wizards 0.2.46 → 0.2.48
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/{project-assistant.js → studio-assistant.js} +199 -69
- package/apps/runtime/dist/agents/website.js +25 -2
- package/apps/runtime/dist/app.js +5 -1
- package/apps/runtime/dist/assistant/browser.js +26 -0
- package/apps/runtime/dist/assistant/docs.js +158 -0
- package/apps/runtime/dist/assistant/knows.js +325 -0
- package/apps/runtime/dist/assistant/primer.js +26 -0
- package/apps/runtime/dist/authoring/guide.js +5 -0
- package/apps/runtime/dist/cli/features.js +50 -0
- package/apps/runtime/dist/cli/main.js +4 -1
- package/apps/runtime/dist/connectors/plugin-connections.js +123 -29
- package/apps/runtime/dist/db/migrations/tenant/0012_assistant_chat.sql +40 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0012_snapshot.json +3132 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
- package/apps/runtime/dist/db/schema.js +30 -0
- package/apps/runtime/dist/docs/dev/index.md +34 -0
- package/apps/runtime/dist/docs/dev/meta.json +7 -0
- package/apps/runtime/dist/docs/dev/plugins/connections.md +70 -0
- package/apps/runtime/dist/docs/dev/plugins/events.md +86 -0
- package/apps/runtime/dist/docs/dev/plugins/examples.md +99 -0
- package/apps/runtime/dist/docs/dev/plugins/index.md +72 -0
- package/apps/runtime/dist/docs/dev/plugins/layout.md +88 -0
- package/apps/runtime/dist/docs/dev/plugins/meta.json +29 -0
- package/apps/runtime/dist/docs/dev/plugins/pro-modules.md +59 -0
- package/apps/runtime/dist/docs/dev/plugins/quick-start.md +92 -0
- package/apps/runtime/dist/docs/dev/plugins/reference.md +298 -0
- package/apps/runtime/dist/docs/dev/plugins/reloading.md +75 -0
- package/apps/runtime/dist/docs/dev/plugins/routes.md +123 -0
- package/apps/runtime/dist/docs/dev/plugins/runners.md +184 -0
- package/apps/runtime/dist/docs/dev/plugins/server.md +191 -0
- package/apps/runtime/dist/docs/dev/plugins/shipping.md +98 -0
- package/apps/runtime/dist/docs/dev/plugins/space.md +260 -0
- package/apps/runtime/dist/docs/dev/plugins/starters.md +62 -0
- package/apps/runtime/dist/docs/dev/plugins/studio.md +261 -0
- package/apps/runtime/dist/docs/dev/plugins/styling.md +109 -0
- package/apps/runtime/dist/docs/dev/plugins/tables.md +102 -0
- package/apps/runtime/dist/docs/dev/plugins/tools.md +128 -0
- package/apps/runtime/dist/docs/meta.json +3 -0
- package/apps/runtime/dist/docs/user/ai-apps.md +99 -0
- package/apps/runtime/dist/docs/user/assistant.md +52 -0
- package/apps/runtime/dist/docs/user/build-a-wizard.md +79 -0
- package/apps/runtime/dist/docs/user/command-line.md +76 -0
- package/apps/runtime/dist/docs/user/connectors.md +80 -0
- package/apps/runtime/dist/docs/user/data.md +61 -0
- package/apps/runtime/dist/docs/user/first-start.md +42 -0
- package/apps/runtime/dist/docs/user/index.md +45 -0
- package/apps/runtime/dist/docs/user/install.md +76 -0
- package/apps/runtime/dist/docs/user/meta.json +29 -0
- package/apps/runtime/dist/docs/user/models.md +100 -0
- package/apps/runtime/dist/docs/user/plugins.md +61 -0
- package/apps/runtime/dist/docs/user/run.md +92 -0
- package/apps/runtime/dist/docs/user/server.md +50 -0
- package/apps/runtime/dist/docs/user/space.md +97 -0
- package/apps/runtime/dist/docs/user/steps.md +196 -0
- package/apps/runtime/dist/docs/user/test-and-share.md +210 -0
- package/apps/runtime/dist/docs/user/troubleshooting.md +57 -0
- package/apps/runtime/dist/engine/runner.js +12 -5
- package/apps/runtime/dist/features.js +123 -0
- package/apps/runtime/dist/manage.js +24 -0
- package/apps/runtime/dist/plugins/discovery.js +11 -0
- package/apps/runtime/dist/plugins/loader.js +12 -0
- package/apps/runtime/dist/routes/internal.js +3 -0
- package/apps/runtime/dist/routes/studio.js +126 -73
- package/apps/runtime/dist/services/assistant-chats.js +267 -0
- package/apps/runtime/dist/services/project-index.js +1 -1
- package/apps/runtime/dist/services/space-origin.js +45 -2
- package/apps/web/dist/assets/{AboutDialog-DkY1j7k6.js → AboutDialog-CuiVGknS.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-820LI5Jt.js → ChangelogDialog-DCEQD3Jd.js} +1 -1
- package/apps/web/dist/assets/ChatView-DFxrG2PD.js +10 -0
- package/apps/web/dist/assets/EditorPage-B5rzKNMy.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-ChXfiMn_.js → FlowPreview-CYoR5DRY.js} +1 -1
- package/apps/web/dist/assets/{Harness-CfUfchNw.js → Harness-DAR1u4Dk.js} +1 -1
- package/apps/web/dist/assets/HomePage-BnYdh_Nx.js +1 -0
- package/apps/web/dist/assets/Marketplace-BDQNwMDB.js +2 -0
- package/apps/web/dist/assets/{NewWizardPage-C3NqEGmg.js → NewWizardPage-DztTEUlG.js} +1 -1
- package/apps/web/dist/assets/ProjectPage-B7-Lqx9a.js +2 -0
- package/apps/web/dist/assets/PublicRunner-CaH3bHHd.js +1 -0
- package/apps/web/dist/assets/{ReadOnly-C9P9aiU6.js → ReadOnly-DnB47DQC.js} +1 -1
- package/apps/web/dist/assets/RunDrawer-Dv0KRqGA.js +4 -0
- package/apps/web/dist/assets/RunnerView-Bzwv1u4j.js +2 -0
- package/apps/web/dist/assets/SettingsPage-oVO7CKvc.js +1 -0
- package/apps/web/dist/assets/SetupPage-D--8cWA0.js +1 -0
- package/apps/web/dist/assets/{SharePage-D5AvnhlY.js → SharePage-DjU08q7T.js} +1 -1
- package/apps/web/dist/assets/ThemeSwitch-C3EJRN06.js +1 -0
- package/apps/web/dist/assets/arrow-right-F7X_SjK9.js +1 -0
- package/apps/web/dist/assets/changelog-BRoVI_JJ.js +1 -0
- package/apps/web/dist/assets/{circle-alert-CPo3Naay.js → circle-alert-DdpaAYgd.js} +1 -1
- package/apps/web/dist/assets/{definition-CQGiBQ4X.js → definition-CHacJYmI.js} +2 -2
- package/apps/web/dist/assets/{external-link-CpU8aJY2.js → external-link-Dfc1VFvS.js} +1 -1
- package/apps/web/dist/assets/index-CX_yxZVQ.js +79 -0
- package/apps/web/dist/assets/index-Dr0bv52Q.css +1 -0
- package/apps/web/dist/assets/{lock-C_WlXIQ0.js → lock-Bu1wDFs8.js} +1 -1
- package/apps/web/dist/assets/{refresh-cw-Cli5WGnW.js → refresh-cw-BUDPOT39.js} +1 -1
- package/apps/web/dist/assets/{session-miDEdw2c.js → session-Blj2os_v.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-ROT8Lbbj.js → settings-menu-BvxRnNtf.js} +1 -1
- package/apps/web/dist/assets/{sparkles-CP5H-O1E.js → sparkles-DWGJluyV.js} +1 -1
- package/apps/web/dist/assets/{trash-DU-hZpV0.js → trash-D9UB6TtS.js} +1 -1
- package/apps/web/dist/assets/ui-GsuU9WTj.js +9 -0
- package/apps/web/dist/assets/{upload-DMq5N6Fw.js → upload-BngimDBR.js} +1 -1
- package/apps/web/dist/assets/{volume-2-0SfkvOho.js → volume-2-BZju_bOP.js} +1 -1
- package/apps/web/dist/index.html +11 -11
- package/apps/web/dist/mcp/flow.html +51 -51
- package/node_modules/@engenty-wizards/plugin-sdk/dist/index.d.ts +103 -7
- package/node_modules/@engenty-wizards/plugin-sdk/dist/studio.d.ts +58 -4
- package/node_modules/@engenty-wizards/shared/dist/assistant.d.ts +113 -0
- package/node_modules/@engenty-wizards/shared/dist/assistant.js +55 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +56 -1
- package/node_modules/@engenty-wizards/shared/dist/definition.js +94 -4
- package/node_modules/@engenty-wizards/shared/dist/feature-flags.d.ts +54 -0
- package/node_modules/@engenty-wizards/shared/dist/feature-flags.js +46 -0
- package/node_modules/@engenty-wizards/shared/dist/features.d.ts +36 -0
- package/node_modules/@engenty-wizards/shared/dist/features.js +78 -0
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +3 -1
- package/package.json +1 -1
- package/apps/web/dist/assets/ChatView-DBl0iRMg.js +0 -10
- package/apps/web/dist/assets/EditorPage-BwJ-hqPg.js +0 -3
- package/apps/web/dist/assets/HomePage-BG5OZJkv.js +0 -1
- package/apps/web/dist/assets/Marketplace-BWhUJ4UX.js +0 -2
- package/apps/web/dist/assets/ProjectPage-Btf0TeP_.js +0 -2
- package/apps/web/dist/assets/PublicRunner-BxYinn04.js +0 -1
- package/apps/web/dist/assets/RunDrawer-DfnEMPTq.js +0 -4
- package/apps/web/dist/assets/RunnerView-CLrGb-oq.js +0 -2
- package/apps/web/dist/assets/SettingsPage-FWH84btd.js +0 -1
- package/apps/web/dist/assets/SetupPage-BI0kUNVW.js +0 -1
- package/apps/web/dist/assets/ThemeSwitch-C1qYFoYP.js +0 -1
- package/apps/web/dist/assets/arrow-right-Dpp_mpHe.js +0 -1
- package/apps/web/dist/assets/changelog-B6QMrVxX.js +0 -1
- package/apps/web/dist/assets/index-CIO9W4pe.js +0 -78
- package/apps/web/dist/assets/index-DKHClEy3.css +0 -1
- package/apps/web/dist/assets/ui-D92EkdEB.js +0 -9
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Space
|
|
3
|
+
description: What your wizards share and produce — who you are, what they look things up in, and the results of their runs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The folder in the top bar opens your space: what all your wizards share, and what they produce.
|
|
7
|
+
Every AI step knows it, so a wizard never has to ask for your company's name or address.
|
|
8
|
+
|
|
9
|
+
The menu on the left shows the space's four parts; a part opens its own sections, the arrow at
|
|
10
|
+
the top leads back. On a phone the parts, a part's sections and the page take turns.
|
|
11
|
+
|
|
12
|
+
| Part | Sections | Used for |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| Info & brand | Basics, Logos, Colours, Assets, Facts | Who you are and how you look |
|
|
15
|
+
| Knowledge | All, then each Kategorie, then a plugin's sections (Sources) | What every AI step looks things up in |
|
|
16
|
+
| Data | All data, then each wizard | Tables and pages the wizards keep |
|
|
17
|
+
| Results | All results, then each wizard | The runs that reached their result |
|
|
18
|
+
|
|
19
|
+
## Info & brand
|
|
20
|
+
|
|
21
|
+
| Section | Holds | Used for |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| Basics | Title and "About": what you do, for whom, and the tone you write in | Texts sound like you. People who run a wizard see the title too |
|
|
24
|
+
| Logos | One or several, each with a description of what it is for | People see the main logo. The description tells a step what a variant is for |
|
|
25
|
+
| Colours | Named colours, each with a note on its use | The first colour is the accent of documents, dashboards and public pages |
|
|
26
|
+
| Assets | Images, graphics, videos, each with a description | AI steps place them in documents and choose by the description |
|
|
27
|
+
| Facts | Labelled values: address, VAT id, opening hours | Steps use them as written |
|
|
28
|
+
|
|
29
|
+
## Knowledge
|
|
30
|
+
|
|
31
|
+
The ground truth your wizards' steps look things up in: pages, tables and files. You see here
|
|
32
|
+
exactly what a step can find.
|
|
33
|
+
|
|
34
|
+
- **Documents become pages and tables when they arrive.** A PDF, a Word file or a scan becomes a
|
|
35
|
+
page; the original stays behind it ("Original"), and the page marks where each page of it
|
|
36
|
+
begins, so a step can quote "p. 2". A long document with headings of its own — a law, a
|
|
37
|
+
manual — becomes a page with sub-pages, one per section; "§ 281" in the text links to that
|
|
38
|
+
sub-page. A workbook becomes a table per sheet, a CSV one table. What cannot be read stays a
|
|
39
|
+
file and is found by its name and description. A scan that read badly is marked "Check".
|
|
40
|
+
- **Kategorien keep things apart.** A Kategorie is a property with a type: a choice
|
|
41
|
+
(Baustelle, Art der Förderung), a date, a number with its unit, a short text, yes / no. Set
|
|
42
|
+
them on a page, a table or a file with the chips under its title; when a document arrives, a
|
|
43
|
+
model fills them from what it reads. A table's column can be one. A step filters by them
|
|
44
|
+
before it searches: "reports of Graz Süd in March" is a filter first.
|
|
45
|
+
- **Each value of a choice** has its contents — everything that has it — and an overview a model
|
|
46
|
+
writes on request ("Write the overview"). The search finds the overview like a page.
|
|
47
|
+
- **Two spellings of one value** ("Graz-Süd", "Graz Süd") are offered for merging on the
|
|
48
|
+
Kategorie's page. A Kategorie a source proposes stands as "Proposed" until you take it.
|
|
49
|
+
- **"Try a search …"** searches the way a step does: the filters first, then words and meaning,
|
|
50
|
+
then a classifier asks of each hit whether it answers the question and keeps those that do,
|
|
51
|
+
with how sure it is. Without a classifier the hits stay unchecked; it needs a Vercel AI Gateway
|
|
52
|
+
or TypeSafe key, or an account. See [Models and account](./models.md).
|
|
53
|
+
|
|
54
|
+
A plugin such as Sources fills Knowledge from outside: a website, a sitemap, a folder of this
|
|
55
|
+
computer. What it wrote shows where it came from; once you change it, it stays yours and the
|
|
56
|
+
source no longer writes it.
|
|
57
|
+
|
|
58
|
+
## Data
|
|
59
|
+
|
|
60
|
+
Tables and pages the space's wizards keep, under the wizard they belong to. A wizard fills its
|
|
61
|
+
own: a shared list becomes one of its tables, and a step with the "Pages" tool writes its pages.
|
|
62
|
+
The columns of a shared list come from the wizard.
|
|
63
|
+
|
|
64
|
+
- **Table**: columns of a type (text, number, date, duration, choice, yes / no) and a row per
|
|
65
|
+
line. Type into a cell; it is saved when you leave it. A value that does not fit the column is
|
|
66
|
+
marked and not saved. The heading of a column changes its name and type, the plus beside the
|
|
67
|
+
headings adds one.
|
|
68
|
+
- **Page**: a title and text in Markdown. "Write" edits it, "Preview" shows it; it is saved as
|
|
69
|
+
you type.
|
|
70
|
+
|
|
71
|
+
### On a local install and in the cloud
|
|
72
|
+
|
|
73
|
+
Data stays where it was written. A wizard's tables and pages are filled where it runs: on this
|
|
74
|
+
computer by its runs here, in the cloud by the runs over its link. The pages and tables of
|
|
75
|
+
Knowledge, with their Kategorien, go to the cloud with every wizard you publish there, and are
|
|
76
|
+
shown there without being changed. Files stay on this computer.
|
|
77
|
+
|
|
78
|
+
## Results
|
|
79
|
+
|
|
80
|
+
Every run that reached its result, newest first: of all wizards, or of the one picked in the
|
|
81
|
+
menu, where the wizard with the latest result stands first. Search finds words in the wizard's
|
|
82
|
+
name, in what was answered and in what the run produced; the filters keep live or test runs and
|
|
83
|
+
the last 24 hours, 7 or 30 days. A run opens beside the list as the person saw it, with its
|
|
84
|
+
files.
|
|
85
|
+
|
|
86
|
+
## Have it filled in
|
|
87
|
+
|
|
88
|
+
The [assistant](./assistant.md) at the bottom of the page fills the space for you. Tell it about
|
|
89
|
+
yourselves, name your website or give it files:
|
|
90
|
+
|
|
91
|
+
> Read our website example.com
|
|
92
|
+
|
|
93
|
+
It enters what it finds: title, description, logo, colours and facts. You correct the rest.
|
|
94
|
+
|
|
95
|
+
## One space
|
|
96
|
+
|
|
97
|
+
An install has one space. Its wizards, settings and files belong together.
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Steps
|
|
3
|
+
description: What a wizard is made of — pages, AI steps, generated media, widgets, reviews and the result.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
A wizard runs its steps from top to bottom. The last step is always the result.
|
|
7
|
+
|
|
8
|
+
| Step | What it does |
|
|
9
|
+
|---|---|
|
|
10
|
+
| Page | Asks the person: one to five fields |
|
|
11
|
+
| AI step | Does a task with tools: research, read documents, call an API, work in a connected service |
|
|
12
|
+
| Generate | Makes one thing: an image, a video, a voice-over, a document or a dashboard |
|
|
13
|
+
| Widget | Shows an interactive view built once for this wizard: a map, a timeline, a calculator, a film |
|
|
14
|
+
| View | Shows the results in the wizard's own look: key figures, facts, a list, a chart |
|
|
15
|
+
| Review | Shows what earlier steps made. The person accepts it, edits it or asks for a new version |
|
|
16
|
+
| Result | The last page: what the person can download or share |
|
|
17
|
+
|
|
18
|
+
## Pages
|
|
19
|
+
|
|
20
|
+
A page has a title, up to five fields and a button. Each field has a kind:
|
|
21
|
+
|
|
22
|
+
| Kind | The person |
|
|
23
|
+
|---|---|
|
|
24
|
+
| Text, long text, number, date, e-mail, link | types a value |
|
|
25
|
+
| Select, multi-select, toggle, colour | picks |
|
|
26
|
+
| Image | takes or uploads photos, one or several, in an order they can change |
|
|
27
|
+
| File | uploads documents; the camera can scan papers and record a short clip |
|
|
28
|
+
| Line items | fills rows with amounts. The wizard computes net, VAT and total |
|
|
29
|
+
| Location | taps "Use my location" or types an address |
|
|
30
|
+
| Voice note | records up to 5 minutes. The wizard writes down what was said before the next step reads it |
|
|
31
|
+
| Signature | signs with a finger |
|
|
32
|
+
| Appointment | picks one of the free times offered, shown by day |
|
|
33
|
+
| Connection | connects their own account of a service, for example their mailbox |
|
|
34
|
+
| List | checks, corrects and extends a list the wizard keeps for them |
|
|
35
|
+
|
|
36
|
+
A text field can have a "Scan" button that fills it from a QR code or barcode.
|
|
37
|
+
|
|
38
|
+
A field can start with a value an earlier step proposed. A line-items field, for example, shows
|
|
39
|
+
the positions an AI step looked up, for the person to correct.
|
|
40
|
+
|
|
41
|
+
A field can be shown only under a condition: "Street and town" only when the person chose
|
|
42
|
+
delivery, "Which allergy?" only when they ticked "Allergies". The condition can read another
|
|
43
|
+
field of the same page, and the field then appears as the person answers, or anything known
|
|
44
|
+
before the page. A hidden field is not required and is not kept.
|
|
45
|
+
|
|
46
|
+
The choices of a select can come from earlier data instead of a fixed list: the suppliers a
|
|
47
|
+
research step found, one column of a table it made, or a column of a list the wizard keeps. The
|
|
48
|
+
fixed choices stand in while that data is empty.
|
|
49
|
+
|
|
50
|
+
An appointment field takes its times the same way, usually from an AI step that looked up the
|
|
51
|
+
free times in a calendar. The times show in the calendar's own time zone, grouped by day.
|
|
52
|
+
|
|
53
|
+
A field can also be left to the AI: it is shown when the AI, reading what was answered and found
|
|
54
|
+
so far, finds a statement true ("The complaint is about a damaged article"). Fields that are
|
|
55
|
+
alternatives of each other form a group, and the AI shows the one that fits ("How should we reach
|
|
56
|
+
the person?"). The AI decides once, when the run reaches the page.
|
|
57
|
+
|
|
58
|
+
## AI steps
|
|
59
|
+
|
|
60
|
+
An AI step has instructions and the tools you allow it:
|
|
61
|
+
|
|
62
|
+
| Tool | Lets the step |
|
|
63
|
+
|---|---|
|
|
64
|
+
| Web search | search the web |
|
|
65
|
+
| Read web pages | open and read a page |
|
|
66
|
+
| Browser | click and type on websites, take screenshots, download files. A login is typed by the person; the model never sees it |
|
|
67
|
+
| Code & shell | run code in a sandbox, where the install has one |
|
|
68
|
+
| Images | make images while it works |
|
|
69
|
+
| API | call an HTTP API |
|
|
70
|
+
| Pages | write pages of the wizard in Markdown, kept for every later run, and read them and the space's own pages |
|
|
71
|
+
|
|
72
|
+
Every AI step can also read and write the wizard's lists, list its files and read documents:
|
|
73
|
+
PDFs, scans and photos, Word, Excel, CSV and saved mails.
|
|
74
|
+
|
|
75
|
+
Further tools come from three places:
|
|
76
|
+
|
|
77
|
+
- **Connections** the wizard declares: the step gets the service's actions as tools. See
|
|
78
|
+
[Connectors](./connectors.md).
|
|
79
|
+
- **Connected systems (MCP)** of the space, where you allow them on the step.
|
|
80
|
+
- **Plugins** installed in this app. See [Plugins](./plugins.md).
|
|
81
|
+
|
|
82
|
+
### Model class
|
|
83
|
+
|
|
84
|
+
A step names the kind of model it needs, never a model:
|
|
85
|
+
|
|
86
|
+
| Class | For |
|
|
87
|
+
|---|---|
|
|
88
|
+
| Classifier | Routing, yes/no, picking from options, pulling a few values out of text. Cheapest |
|
|
89
|
+
| Standard | Short copy, calling an API, reformatting |
|
|
90
|
+
| High | Research with tools, long documents, weighing many sources. The default |
|
|
91
|
+
| Highest | Hard reasoning or code. Several times the cost of High |
|
|
92
|
+
|
|
93
|
+
Images, video, voice notes and voice-overs have classes of their own. Which model serves a class
|
|
94
|
+
is set under [Models & account](./models.md). "Thinking effort" tells the model how hard to
|
|
95
|
+
think; leave it on "Automatic" unless a step is clearly trivial or clearly hard.
|
|
96
|
+
|
|
97
|
+
### What a step hands on
|
|
98
|
+
|
|
99
|
+
A step's output is text, Markdown or structured data with named fields: a text, a number, a
|
|
100
|
+
list, a table, a yes/no answer, a choice or a score on a scale ("low, medium, high"). Later steps use these, and branches decide on them.
|
|
101
|
+
|
|
102
|
+
## Generate
|
|
103
|
+
|
|
104
|
+
| Makes | Options |
|
|
105
|
+
|---|---|
|
|
106
|
+
| Image | Aspect ratio, style, a reference image to start from |
|
|
107
|
+
| Video | Aspect ratio, 4 to 10 seconds, 720p or 480p, a reference image |
|
|
108
|
+
| Voice | The exact text read aloud, and how to speak it |
|
|
109
|
+
| Document | A template: invoice, offer, briefing, letter, report or free |
|
|
110
|
+
| Dashboard | An HTML page with the figures of earlier steps |
|
|
111
|
+
|
|
112
|
+
An image or video step can make one result per entry, at most eight: per uploaded photo, per
|
|
113
|
+
image of an earlier step, or per row of a table. In a review the person can have single results
|
|
114
|
+
made again.
|
|
115
|
+
|
|
116
|
+
## Views
|
|
117
|
+
|
|
118
|
+
A view shows what the run found in the wizard's own look, on any screen: key figures, a list of
|
|
119
|
+
facts, a list of results with pictures, a table or a simple chart (bars, a line, a ring). It is
|
|
120
|
+
built from a fixed set of parts, written once by the assistant, and every run brings new data;
|
|
121
|
+
it costs nothing to show.
|
|
122
|
+
|
|
123
|
+
A view can also leave some of its parts to the AI, for example a chart only when there is
|
|
124
|
+
something to compare. And an AI step can lay out a view of its own result, which reviews and the
|
|
125
|
+
result page then show instead of a plain table.
|
|
126
|
+
|
|
127
|
+
For anything the parts cannot show, such as a map or an animation, use a widget.
|
|
128
|
+
|
|
129
|
+
## Widgets
|
|
130
|
+
|
|
131
|
+
A widget is an interactive HTML view written once into the wizard's files. Every run only brings
|
|
132
|
+
new data, so it costs nothing to show and looks the same every time. With "video" switched on it
|
|
133
|
+
is a film: its timeline is rendered to an MP4 with sound.
|
|
134
|
+
|
|
135
|
+
## Reviews
|
|
136
|
+
|
|
137
|
+
A review shows earlier outputs. Depending on its settings the person can edit text, or ask for a
|
|
138
|
+
new version with a note on what should change. A list shown in a review is edited in place; a
|
|
139
|
+
list with files is checked row by row, each row beside its document.
|
|
140
|
+
|
|
141
|
+
## The result
|
|
142
|
+
|
|
143
|
+
Each entry of the result page names a step and the formats the person can download:
|
|
144
|
+
|
|
145
|
+
| From | Formats |
|
|
146
|
+
|---|---|
|
|
147
|
+
| Image | PNG |
|
|
148
|
+
| Video | MP4 (several: a ZIP) |
|
|
149
|
+
| Voice | MP3 |
|
|
150
|
+
| Document | PDF, Word, HTML, Markdown, PNG |
|
|
151
|
+
| Dashboard | HTML, PDF, PNG |
|
|
152
|
+
| Widget | HTML, PNG, PDF, JSON; MP4 when it animates |
|
|
153
|
+
| View | JSON |
|
|
154
|
+
| AI step, text | Markdown, text, Word, PDF, HTML |
|
|
155
|
+
| AI step, data | JSON, CSV, Excel, Markdown |
|
|
156
|
+
| AI step, collected files | ZIP |
|
|
157
|
+
| List | Excel, CSV, JSON, Markdown; ZIP with the files its rows name |
|
|
158
|
+
|
|
159
|
+
## Branches
|
|
160
|
+
|
|
161
|
+
A step can send the run somewhere else when a condition holds: a field equals a value, is one of
|
|
162
|
+
several, is filled in or empty, is greater or less than a number, or contains a value. A
|
|
163
|
+
condition can also read what an AI step found, or how many rows a list the wizard keeps has.
|
|
164
|
+
Several conditions on one branch must all hold. The first branch that matches wins; otherwise
|
|
165
|
+
the next step follows. The diagram draws the branches with their conditions.
|
|
166
|
+
|
|
167
|
+
A branch can also be decided by the AI: instead of a condition it has a statement ("The person
|
|
168
|
+
wants a refund, not an exchange"). When no condition matched, the AI reads what was answered and
|
|
169
|
+
found so far and takes the branch whose statement is true; if none clearly is, the next step
|
|
170
|
+
follows. All such branches of a step cost one small decision together.
|
|
171
|
+
|
|
172
|
+
A branch back to an earlier step makes a loop, for example "write, check, write again until the
|
|
173
|
+
check passes". A loop stops after the number of times you allow, at most ten if you set nothing.
|
|
174
|
+
The step that runs again sees what it made the last time.
|
|
175
|
+
|
|
176
|
+
An AI step can also work through a list: once per row of a table an earlier step made, or per
|
|
177
|
+
row of a list the wizard keeps. Its results come together in one table.
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
## What a wizard keeps
|
|
181
|
+
|
|
182
|
+
- **Lists** hold rows between runs, separately for each person who runs the wizard: the
|
|
183
|
+
receipts already booked, the customers already written to.
|
|
184
|
+
- **Shared lists** hold one set of rows for every run: requests, sign-ups, a log. The person
|
|
185
|
+
running the wizard never sees them; you find them under Space → Data, below the wizard.
|
|
186
|
+
- **Connected accounts and sign-ins** are kept for the person's next run.
|
|
187
|
+
|
|
188
|
+
The person sees and deletes all of it under "What this wizard remembers". See
|
|
189
|
+
[Run a wizard](./run.md).
|
|
190
|
+
|
|
191
|
+
## AI media
|
|
192
|
+
|
|
193
|
+
Images, clips, voice-overs and films a model made or changed carry a marking in their file, and
|
|
194
|
+
every page lays an "AI generated" or "AI modified" label over them (EU AI Act, Art. 50). Nothing
|
|
195
|
+
is drawn into an image. A film shows the label in the picture, since it leaves the page as a
|
|
196
|
+
video file.
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Test and share
|
|
3
|
+
description: Try the wizard, publish it, and hand out its link or put it on a website.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Test
|
|
7
|
+
|
|
8
|
+
"Test" in the editor starts a run of the draft, as a person would see it. Test runs are listed
|
|
9
|
+
under "Runs". A test spends what a real run spends: your model's usage, or credits.
|
|
10
|
+
|
|
11
|
+
Where runs spend credits, each AI step shows an estimate. It is a formula at first and is
|
|
12
|
+
measured from the latest runs after five of them.
|
|
13
|
+
|
|
14
|
+
## Publish
|
|
15
|
+
|
|
16
|
+
"Publish" makes the draft the live version. The editor's top bar and the wizard's card on the
|
|
17
|
+
start page say where it runs:
|
|
18
|
+
|
|
19
|
+
| It says | Means |
|
|
20
|
+
|---|---|
|
|
21
|
+
| Not published yet · Draft | Only you can run it, as a test |
|
|
22
|
+
| Live · version 3 | The link runs this version. With a cloud icon: on engenty.ai, for everyone with the link |
|
|
23
|
+
| Live · 1 note | It runs in the cloud, one step there with less (see "Share") |
|
|
24
|
+
| Local | Published on an install without an account: the link answers only on this computer |
|
|
25
|
+
| Being sent | The version did not reach engenty.ai yet; the studio tries again by itself |
|
|
26
|
+
| Not in the cloud | engenty.ai does not run this version. "Share" says why and what helps |
|
|
27
|
+
| Unpublished changes | You changed the draft since. The link still runs the published version |
|
|
28
|
+
|
|
29
|
+
On a card, "Link" copies the address others can open, and the arrow opens it. A wizard that
|
|
30
|
+
runs only on this computer has no address for others: its "Link" says so and how an account
|
|
31
|
+
gives it one, and the arrow opens it here.
|
|
32
|
+
|
|
33
|
+
## Share
|
|
34
|
+
|
|
35
|
+
"Share" says on top where the wizard runs, then gives its link:
|
|
36
|
+
|
|
37
|
+
| Part | Does |
|
|
38
|
+
|---|---|
|
|
39
|
+
| Link | The address people open. "Copy" puts it on the clipboard, "Open" opens it |
|
|
40
|
+
| Website | The tag for a website (see below) |
|
|
41
|
+
| QR code | The link as a QR code, and the wizard's ID for the mobile app |
|
|
42
|
+
| Channels | The ways the wizard runs: the page, the chat, and what plugins add (see below) |
|
|
43
|
+
| Settings | One line, "on · 50 a day", that folds out: |
|
|
44
|
+
| · Link is active | Switch it off and the link stops answering |
|
|
45
|
+
| · Runs per day | How many runs the link allows a day. 50 unless you change it |
|
|
46
|
+
| · Create a new link | Replaces the address. The old link stops working, in the cloud too |
|
|
47
|
+
|
|
48
|
+
Where the draft is not published as it is, the dialog says so first and publishes from there.
|
|
49
|
+
|
|
50
|
+
One visitor can start 6 runs an hour.
|
|
51
|
+
|
|
52
|
+
### Channels
|
|
53
|
+
|
|
54
|
+
A wizard runs page by page, as a chat, as a live conversation on top of the chat, or as a video
|
|
55
|
+
call on a stage with the chat beside it (the person talks, the wizard talks back and sees the
|
|
56
|
+
camera; both need an OpenAI API key under Models for now); a plugin can add further ways, a
|
|
57
|
+
kiosk page or a messenger. Each channel in the list says how far it gets with this wizard:
|
|
58
|
+
|
|
59
|
+
| It says | Meaning |
|
|
60
|
+
|---|---|
|
|
61
|
+
| Everything in the channel | Every field, review and result works there |
|
|
62
|
+
| Hands off to the page at: … | At those steps the person gets a link to the wizard's page, for a photo, a signature or a sign-in, and comes back after |
|
|
63
|
+
| Not possible: … | A step nobody can hand off, for example one that takes minutes on a channel that cannot wait |
|
|
64
|
+
|
|
65
|
+
The home's cards show the channels that are on as small icons, the link's door first, and a row
|
|
66
|
+
of pills above the cards narrows them to one channel once channels beyond steps and chat are in
|
|
67
|
+
play.
|
|
68
|
+
|
|
69
|
+
The link opens the **default**; "Make default" moves it. What else is switched on answers under
|
|
70
|
+
its own address, `/chat` for the chat, and is offered on the wizard's first page: "Or: Chat". A
|
|
71
|
+
switched-off address sends people to the link instead.
|
|
72
|
+
|
|
73
|
+
### WhatsApp
|
|
74
|
+
|
|
75
|
+
With the WhatsApp module a wizard runs in a WhatsApp thread on your own business number. Set
|
|
76
|
+
the number up once under Settings → WhatsApp: the phone number ID and a permanent access token
|
|
77
|
+
from your Meta app, then the webhook address and the verify token the page shows go into the
|
|
78
|
+
Meta app's WhatsApp configuration. Until a number is connected, the channel shows "not set up"
|
|
79
|
+
in the list.
|
|
80
|
+
|
|
81
|
+
Switch WhatsApp on for a wizard and its row folds out a **keyword**, the link that writes it
|
|
82
|
+
(`wa.me/<number>?text=<keyword>`) and the link as a QR code. Whoever sends the keyword to the
|
|
83
|
+
number starts the wizard; without a keyword, the number offers the wizards that are on.
|
|
84
|
+
|
|
85
|
+
In the thread the wizard asks one field per message: buttons for up to three choices, a list
|
|
86
|
+
for more, yes/no as buttons, a photo or a file sent in the chat, "send location" for a place, a
|
|
87
|
+
voice message for a text field where a listener is set up under Models. A page with a field only
|
|
88
|
+
the screen can take (a signature, a sign-in) arrives as a link to the wizard's page; the thread
|
|
89
|
+
goes on by itself once it was filled there. A review is the text with "Looks good" and "New
|
|
90
|
+
version"; the result arrives as text, pictures and documents, a widget or dashboard as a picture,
|
|
91
|
+
and a link to everything. "stop" ends a run, the keyword starts a new one.
|
|
92
|
+
|
|
93
|
+
What WhatsApp allows: a free message within 24 hours of the person's last one. A wizard that
|
|
94
|
+
finishes later can only reach back with an approved utility template with one placeholder; its
|
|
95
|
+
name goes into the settings, the link into the placeholder. Without one, the result waits for
|
|
96
|
+
the person's next message.
|
|
97
|
+
|
|
98
|
+
### SMS
|
|
99
|
+
|
|
100
|
+
With the SMS module a wizard runs by text message, through a Twilio account and number of your
|
|
101
|
+
own. Settings → SMS takes the Account SID, the auth token and the number; the webhook address
|
|
102
|
+
the page shows goes into the number's "A message comes in" field in Twilio. Switch SMS on for a
|
|
103
|
+
wizard and its row folds out the keyword, an `sms:` link that types it and the QR code.
|
|
104
|
+
|
|
105
|
+
Text only: one field per text, choices as numbered lines answered with the number (several
|
|
106
|
+
numbers with commas for a multiple choice), yes or no, a place as a typed address. A page with
|
|
107
|
+
a photo, a file or a signature arrives as a link to the wizard's page and the texts go on once it
|
|
108
|
+
was filled there. Long texts come as their gist; every picture, document and the whole result
|
|
109
|
+
are links. Each text costs what Twilio charges; there is no window, a wizard that finishes
|
|
110
|
+
later still texts.
|
|
111
|
+
|
|
112
|
+
### Calls
|
|
113
|
+
|
|
114
|
+
With the calls module a wizard runs as a conversation on the phone: a WhatsApp call to your
|
|
115
|
+
business number, or a phone call to a Twilio number. Twilio carries the call and the speech
|
|
116
|
+
model of your OpenAI account (Settings → Models) speaks, as the chat's live voice does, so the
|
|
117
|
+
same rules apply: one field at a time, choices read out, e-mail addresses and numbers read back.
|
|
118
|
+
|
|
119
|
+
Settings → Calls takes the Twilio account, a Twilio number that can text, the OpenAI project ID
|
|
120
|
+
and the webhook secret of a webhook you add in the OpenAI dashboard for incoming calls, and
|
|
121
|
+
shows what to enter where: the voice webhook for Twilio's SIP domain and phone number, the
|
|
122
|
+
OpenAI webhook, and for WhatsApp the SIP server to set on the number in Meta's calling settings
|
|
123
|
+
(the Twilio SIP domain, port 5061). Switch "Call" on for a wizard; with several on, the wizard
|
|
124
|
+
asks which one at the start of the call. A WhatsApp call button or deep link whose payload is a
|
|
125
|
+
wizard's link token picks that wizard.
|
|
126
|
+
|
|
127
|
+
What a voice cannot take (a photo, a file, a signature) is texted as a link to the wizard's page,
|
|
128
|
+
and the call goes on once it was filled there. At the end the result is texted as a link too.
|
|
129
|
+
Each minute costs what OpenAI and Twilio charge.
|
|
130
|
+
|
|
131
|
+
### Who can open the link
|
|
132
|
+
|
|
133
|
+
An install on your computer only answers on `localhost`: the link works on that computer, not
|
|
134
|
+
for anyone else. To let others run the wizard:
|
|
135
|
+
|
|
136
|
+
| Way | How |
|
|
137
|
+
|---|---|
|
|
138
|
+
| The cloud | With an [account](./models.md#account) signed in, "Publish" also sends the version to engenty.ai. Its link there runs on the account's credits, also while your computer is off |
|
|
139
|
+
| Your own server | [Run engenty wizards on a server](./server.md) with a public https address |
|
|
140
|
+
|
|
141
|
+
### In the cloud
|
|
142
|
+
|
|
143
|
+
Once an account is signed in under Settings → Account, every "Publish" sends the published
|
|
144
|
+
version to engenty.ai. The avatar then carries a small cloud, and its menu says "Connected to
|
|
145
|
+
engenty.ai" with the credits. The share dialog gives the wizard's address at engenty.ai, which
|
|
146
|
+
stays the same when you publish again; "Test on this computer" at its foot opens the copy on
|
|
147
|
+
your computer. On top it says:
|
|
148
|
+
|
|
149
|
+
| It shows | Means |
|
|
150
|
+
|---|---|
|
|
151
|
+
| "Live on engenty.ai · version 3" | The cloud runs this version |
|
|
152
|
+
| "Version 3 does not run in the cloud" | Something the wizard needs is missing there. The list says what; the version before keeps running |
|
|
153
|
+
| "What runs differently in the cloud" | A step works there with less, for example without a machine for code |
|
|
154
|
+
| "Send again" | The last sending did not arrive, or the space changed. When engenty.ai was the trouble, the studio tries again by itself and says when |
|
|
155
|
+
|
|
156
|
+
Without an account the dialog says that the wizard runs only on this computer, and offers to
|
|
157
|
+
sign in or create an account. "Website" and "QR code" are there too, marked with a cloud: they
|
|
158
|
+
need an address everyone reaches, and say so.
|
|
159
|
+
|
|
160
|
+
What goes and what stays:
|
|
161
|
+
|
|
162
|
+
| Goes to the cloud | Stays on your computer |
|
|
163
|
+
|---|---|
|
|
164
|
+
| The published version and its files | Drafts and the chat with the assistant |
|
|
165
|
+
| The space's name, what it says about itself, its logo | Runs and results of your computer |
|
|
166
|
+
| How the link is shared: on or off, runs a day | Connected accounts, keys, the space's documents and MCP servers |
|
|
167
|
+
|
|
168
|
+
At engenty.ai/studio you see the space and its runs there. It is changed on your computer:
|
|
169
|
+
the studio there edits nothing. An account holds one space of one computer. On a new computer
|
|
170
|
+
the share dialog offers to replace the space of the old one, which removes its wizards and
|
|
171
|
+
their links from the cloud.
|
|
172
|
+
|
|
173
|
+
Deleting a wizard here removes its copy; switching its link off here switches it off there.
|
|
174
|
+
|
|
175
|
+
### Embed in a website
|
|
176
|
+
|
|
177
|
+
The share dialog gives a tag to paste into a page's HTML:
|
|
178
|
+
|
|
179
|
+
| Looks | Shows |
|
|
180
|
+
|---|---|
|
|
181
|
+
| Steps | The wizard page by page |
|
|
182
|
+
| Chat | The wizard as a chat, 640 px high (`data-height` changes that) |
|
|
183
|
+
|
|
184
|
+
| Place | Shows |
|
|
185
|
+
|---|---|
|
|
186
|
+
| Inline | The wizard in that place of the page, as tall as its content |
|
|
187
|
+
| Button + modal | A button in that place that opens the wizard in a window over the page |
|
|
188
|
+
| Chat button | The wizard's engenty in the lower right corner; the chat opens above it |
|
|
189
|
+
|
|
190
|
+
```html
|
|
191
|
+
<script async src="https://example.com/embed.js" data-wizard="TOKEN"></script>
|
|
192
|
+
<script async src="https://example.com/embed.js" data-wizard="TOKEN" data-mode="modal" data-label="Start"></script>
|
|
193
|
+
<script async src="https://example.com/embed.js" data-wizard="TOKEN" data-runner="chat"></script>
|
|
194
|
+
<script async src="https://example.com/embed.js" data-wizard="TOKEN" data-mode="popout"></script>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
A chat that is switched off for the wizard shows the page instead.
|
|
198
|
+
|
|
199
|
+
The button takes your website's own styles through the class `engenty-wizard-button`.
|
|
200
|
+
|
|
201
|
+
## Results people share
|
|
202
|
+
|
|
203
|
+
On the result page a person can share what they got as a link. The result of a run over the
|
|
204
|
+
wizard's link, and the link to it, are deleted after 7 days. The person can withdraw the link
|
|
205
|
+
earlier.
|
|
206
|
+
|
|
207
|
+
## Move a wizard
|
|
208
|
+
|
|
209
|
+
Export it as a package (`.wizard`) from the editor and import it in another studio. See
|
|
210
|
+
[Build a wizard](./build-a-wizard.md#take-it-with-you).
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Troubleshooting
|
|
3
|
+
description: What to do when a link is no longer valid, a client shows as not signed in, or an export fails.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`wizards doctor` checks the install and says what is wrong. Start there.
|
|
7
|
+
|
|
8
|
+
## Starting and signing in
|
|
9
|
+
|
|
10
|
+
| What you see | Do |
|
|
11
|
+
|---|---|
|
|
12
|
+
| "This link is no longer valid" | The link works once. `wizards open` gives this browser a new one |
|
|
13
|
+
| `wizards`: command not found | Open a new terminal, or run `~/.local/bin/wizards` |
|
|
14
|
+
| The sign-in page instead of the studio | This browser is not signed in to the install. Run `wizards open` |
|
|
15
|
+
| You open it under another address | Set `APP_URL` in `~/.engenty/wizards/.env` to the address you open |
|
|
16
|
+
| Port 24368 is taken | The next free port is used. To fix one, set `API_PORT` in `~/.engenty/wizards/.env` |
|
|
17
|
+
|
|
18
|
+
## Models
|
|
19
|
+
|
|
20
|
+
| What you see | Do |
|
|
21
|
+
|---|---|
|
|
22
|
+
| An AI client shows as not signed in | Sign it in on the setup page or under Settings → Models, or in your own terminal (`claude`, `codex login`). Then "Check again" |
|
|
23
|
+
| "Signed in with an API key from your shell" | The client runs on that key, not on your subscription. "Sign in here" switches it |
|
|
24
|
+
| The test does not work | The message names the reason. Check the key, or sign the client in again |
|
|
25
|
+
| "Models are missing" in the editor | A step needs a model this install has no way to, often video or audio. Add a key under Settings → Models |
|
|
26
|
+
| A template says "Not set up here" | The same: it needs a model that is not set up |
|
|
27
|
+
|
|
28
|
+
## Running wizards
|
|
29
|
+
|
|
30
|
+
| What you see | Do |
|
|
31
|
+
|---|---|
|
|
32
|
+
| PDF or PNG export fails | Install Google Chrome, or set `CHROME_PATH` to Chrome or Chromium |
|
|
33
|
+
| A widget offers no video | Install ffmpeg, or set `FFMPEG_PATH` |
|
|
34
|
+
| "This wizard is not available right now" | The link is switched off, or the account the wizard runs on has no credits left. See [Test and share](./test-and-share.md) |
|
|
35
|
+
| The wizard says its limit is reached for today | The link's runs for the day are used up. Raise "Runs per day" in the share dialog |
|
|
36
|
+
| "This wizard does not exist (anymore)" | It is not published, or its link was replaced by a new one |
|
|
37
|
+
| Others cannot open the link | An install on your computer answers on `localhost` only. See [who can open the link](./test-and-share.md#who-can-open-the-link) |
|
|
38
|
+
| The camera, microphone or location does not work | Allow it in the browser's site settings (the lock icon in the address bar) |
|
|
39
|
+
| A connector says "not set up" | The install needs an OAuth client for it. See [Connectors](./connectors.md) |
|
|
40
|
+
| A step stops at a plugin's tool | That plugin is not installed here. See [Plugins](./plugins.md) |
|
|
41
|
+
|
|
42
|
+
## Updating
|
|
43
|
+
|
|
44
|
+
| What you see | Do |
|
|
45
|
+
|---|---|
|
|
46
|
+
| "The update failed" | The reason is in `~/.engenty/wizards/logs/update.log`. Run `wizards update` in a terminal to see it live |
|
|
47
|
+
| A template "Needs a newer app" | Update: `wizards update` |
|
|
48
|
+
|
|
49
|
+
## Still stuck
|
|
50
|
+
|
|
51
|
+
`wizards logs` shows the last lines the install printed; keys and tokens are taken out. Open an
|
|
52
|
+
issue at [github.com/engenty/engenty-wizards](https://github.com/engenty/engenty-wizards/issues)
|
|
53
|
+
with what `wizards doctor` prints and the lines that matter.
|
|
54
|
+
|
|
55
|
+
With a [linked account](./models.md), `wizards report` sends the status, the model settings
|
|
56
|
+
(never a key) and the last 500 log lines to engenty, and names the report's id: give that id when
|
|
57
|
+
you ask for help. Nothing is sent unless you run the command.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { marginOf, } from "@engenty-wizards/shared/decision";
|
|
2
|
-
import { branchValues, conditionsOf, dataRef, followRules, formatsFor, isDecidedField, LIST_FORMATS, listRef, loopKey, MAX_SHOWN_FIELDS, optionsFromData, otherwiseOf, pageNeeds, whenHolds, wizardLang, } from "@engenty-wizards/shared/definition";
|
|
2
|
+
import { branchValues, cardsFromData, conditionsOf, dataRef, followRules, formatsFor, isDecidedField, LIST_FORMATS, listRef, loopKey, MAX_SHOWN_FIELDS, optionsFromData, otherwiseOf, pageNeeds, whenHolds, wizardLang, } from "@engenty-wizards/shared/definition";
|
|
3
3
|
import { eq } from "drizzle-orm";
|
|
4
4
|
import { nanoid } from "nanoid";
|
|
5
5
|
import { connectionViews } from "../connectors/index.js";
|
|
@@ -249,7 +249,7 @@ export async function pageContext(run, step) {
|
|
|
249
249
|
const sourced = step.fields.filter((f) => f.optionsFrom);
|
|
250
250
|
const decided = step.fields.some(isDecidedField) ? (run.state.pages?.[step.id]?.shown ?? []) : [];
|
|
251
251
|
if (!needs.length && !sourced.length) {
|
|
252
|
-
return { known: {}, options: {}, decided };
|
|
252
|
+
return { known: {}, options: {}, cards: {}, decided };
|
|
253
253
|
}
|
|
254
254
|
const all = await flowValues(run, run.state);
|
|
255
255
|
const known = Object.fromEntries(needs.map((ref) => [ref, all[ref]]));
|
|
@@ -257,16 +257,23 @@ export async function pageContext(run, step) {
|
|
|
257
257
|
? await storedLists(run)
|
|
258
258
|
: {};
|
|
259
259
|
const options = {};
|
|
260
|
+
const cards = {};
|
|
260
261
|
for (const field of sourced) {
|
|
261
|
-
const found = optionsFromData(field.optionsFrom ?? "", run.state.outputs, lists);
|
|
262
|
+
const found = optionsFromData(field.optionsFrom ?? "", run.state.outputs, lists, field.cards);
|
|
262
263
|
if (found.length) {
|
|
263
264
|
options[field.id] = found;
|
|
264
265
|
}
|
|
266
|
+
if (field.cards) {
|
|
267
|
+
const drawn = cardsFromData(field.optionsFrom ?? "", run.state.outputs, field.cards);
|
|
268
|
+
if (drawn.length) {
|
|
269
|
+
cards[field.id] = drawn;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
265
272
|
}
|
|
266
|
-
return { known, options, decided };
|
|
273
|
+
return { known, options, cards, decided };
|
|
267
274
|
}
|
|
268
275
|
function viewContext(ctx) {
|
|
269
|
-
return { known: ctx.known, options: ctx.options, decidedFields: ctx.decided };
|
|
276
|
+
return { known: ctx.known, options: ctx.options, cards: ctx.cards, decidedFields: ctx.decided };
|
|
270
277
|
}
|
|
271
278
|
/** The wizard's lists with the person's rows, by list id. */
|
|
272
279
|
async function storedLists(run) {
|