wizards 0.5.7 → 0.5.9
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 +13 -26
- package/apps/runtime/dist/agents/studio-assistant.js +19 -22
- package/apps/runtime/dist/agents/subscription.js +10 -9
- package/apps/runtime/dist/app.js +6 -6
- package/apps/runtime/dist/assistant/knows.js +10 -9
- package/apps/runtime/dist/connectors/external.js +3 -3
- package/apps/runtime/dist/connectors/index.js +23 -23
- package/apps/runtime/dist/connectors/via-account.js +6 -6
- package/apps/runtime/dist/documents/parse.js +3 -3
- package/apps/runtime/dist/engine/input.js +11 -11
- package/apps/runtime/dist/engine/requirements.js +7 -8
- package/apps/runtime/dist/engine/runner.js +10 -14
- package/apps/runtime/dist/engine/steps.js +6 -6
- package/apps/runtime/dist/engine/surface.js +2 -2
- package/apps/runtime/dist/film/step.js +5 -5
- package/apps/runtime/dist/harness/apple.js +2 -1
- package/apps/runtime/dist/harness/claude.js +2 -2
- package/apps/runtime/dist/harness/codex.js +2 -2
- package/apps/runtime/dist/harness/model.js +4 -5
- package/apps/runtime/dist/harness/terminal.js +4 -4
- package/apps/runtime/dist/media/conversation.js +18 -35
- package/apps/runtime/dist/media/transcribe.js +2 -1
- package/apps/runtime/dist/model-errors.js +1 -1
- package/apps/runtime/dist/models.js +32 -40
- package/apps/runtime/dist/plugins/runs.js +3 -5
- package/apps/runtime/dist/routes/api.js +9 -9
- package/apps/runtime/dist/routes/lang.js +14 -9
- package/apps/runtime/dist/routes/runs.js +5 -5
- package/apps/runtime/dist/routes/studio.js +38 -37
- package/apps/runtime/dist/services/access.js +4 -4
- package/apps/runtime/dist/services/architect.js +3 -12
- package/apps/runtime/dist/services/assistant-chats.js +2 -2
- package/apps/runtime/dist/services/brand.js +3 -3
- package/apps/runtime/dist/services/cloud.js +5 -5
- package/apps/runtime/dist/services/errors.js +2 -2
- package/apps/runtime/dist/services/knowledge-model.js +3 -3
- package/apps/runtime/dist/services/marketplace.js +3 -3
- package/apps/runtime/dist/services/package-file.js +9 -11
- package/apps/runtime/dist/services/package.js +8 -9
- package/apps/runtime/dist/services/profile.js +2 -1
- package/apps/runtime/dist/services/project-files.js +13 -13
- package/apps/runtime/dist/services/projects.js +7 -11
- package/apps/runtime/dist/services/runners.js +4 -4
- package/apps/runtime/dist/services/runs.js +7 -10
- package/apps/runtime/dist/services/shares.js +2 -2
- package/apps/runtime/dist/services/site.js +8 -11
- package/apps/runtime/dist/services/space-categories.js +7 -7
- package/apps/runtime/dist/services/space-data.js +20 -20
- package/apps/runtime/dist/services/spaces.js +7 -9
- package/apps/runtime/dist/services/wizards.js +11 -13
- package/apps/runtime/dist/store/index.js +2 -2
- package/apps/runtime/dist/texts.js +195 -0
- package/apps/runtime/dist/tools/plugin.js +7 -3
- package/apps/runtime/dist/widgets/step.js +2 -2
- package/apps/web/dist/assets/AboutDialog-CpI-cGpz.js +1 -0
- package/apps/web/dist/assets/{ChangelogDialog-rAtYZjxz.js → ChangelogDialog-BW56Y5UR.js} +1 -1
- package/apps/web/dist/assets/ChatView-CH8U-tRy.js +10 -0
- package/apps/web/dist/assets/EditorPage-Be5J_y4F.js +3 -0
- package/apps/web/dist/assets/{FlowPreview--3-yI51e.js → FlowPreview-CzmH4JUQ.js} +1 -1
- package/apps/web/dist/assets/{Harness-B9tvFe0U.js → Harness-CJKWO3AK.js} +2 -2
- package/apps/web/dist/assets/{NewWizardChannels-BxrBhC9U.js → NewWizardChannels-Ca2niMTY.js} +1 -1
- package/apps/web/dist/assets/NewWizardPage-D5gi4TYE.js +7 -0
- package/apps/web/dist/assets/{OnboardingPage-DPdH9sSj.js → OnboardingPage-Bm-c-D21.js} +1 -1
- package/apps/web/dist/assets/ProjectPage-C8nJCBZP.js +1 -0
- package/apps/web/dist/assets/{PublicRunner-Bv3TMKw4.js → PublicRunner-anxg3Rxz.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-CmqIrOAR.js → ReadOnly-i-6WBMSE.js} +1 -1
- package/apps/web/dist/assets/RunDrawer-4yvfW_2c.js +4 -0
- package/apps/web/dist/assets/{RunnerView-Cd1VAlIA.js → RunnerView-BkWQBa_M.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-NL8r9S6R.js +1 -0
- package/apps/web/dist/assets/SetupPage-Crcfx4-p.js +1 -0
- package/apps/web/dist/assets/{SharePage-BT80wI1I.js → SharePage-CDEAtmBC.js} +1 -1
- package/apps/web/dist/assets/changelog-BGBuldNF.js +1 -0
- package/apps/web/dist/assets/{esm-BTVd6EFo.js → esm-BF1nonbH.js} +1 -1
- package/apps/web/dist/assets/index-C74LSJ-W.js +14 -0
- package/apps/web/dist/assets/{lock-ByHFI96G.js → lock-DVvM6IsA.js} +1 -1
- package/apps/web/dist/assets/{phone-KPwxAM1R.js → phone-3fG1okFs.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-K5bg3QE3.js → settings-menu-D9fbi1Z0.js} +1 -1
- package/apps/web/dist/assets/ui-EuR3jezP.js +134 -0
- package/apps/web/dist/assets/{upload-BsIL8tNR.js → upload-BsMUhEfX.js} +1 -1
- package/apps/web/dist/index.html +2 -2
- package/apps/web/dist/mcp/flow.html +77 -77
- package/bin/wizards.mjs +15 -2
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +26 -9
- package/node_modules/@engenty-wizards/shared/dist/definition.js +125 -3
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.d.ts +1 -1
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.js +9 -8
- package/node_modules/@engenty-wizards/shared/dist/marketplace-search.js +6 -6
- package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +78 -205
- package/node_modules/@engenty-wizards/shared/dist/marketplace.js +167 -68
- package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +3 -6
- package/node_modules/@engenty-wizards/shared/dist/projects.js +9 -9
- package/node_modules/@engenty-wizards/shared/dist/providers.d.ts +33 -7
- package/node_modules/@engenty-wizards/shared/dist/providers.js +88 -37
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +298 -365
- package/node_modules/@engenty-wizards/shared/dist/run.js +582 -240
- package/node_modules/@engenty-wizards/shared/dist/texts.d.ts +36 -0
- package/node_modules/@engenty-wizards/shared/dist/texts.js +46 -0
- package/package.json +5 -1
- package/apps/web/dist/assets/AboutDialog-t9bayaIs.js +0 -1
- package/apps/web/dist/assets/ChatView-C3VqLT98.js +0 -10
- package/apps/web/dist/assets/EditorPage-D3Ef24b9.js +0 -3
- package/apps/web/dist/assets/NewWizardPage-C1_hsQPr.js +0 -7
- package/apps/web/dist/assets/ProjectPage-P40R1cPE.js +0 -1
- package/apps/web/dist/assets/RunDrawer-9qG1G-OY.js +0 -4
- package/apps/web/dist/assets/SettingsPage-DFz4UMfo.js +0 -1
- package/apps/web/dist/assets/SetupPage-B0UBNMB9.js +0 -1
- package/apps/web/dist/assets/changelog-BpSBMjpm.js +0 -1
- package/apps/web/dist/assets/index-D8vwgldH.js +0 -14
- package/apps/web/dist/assets/ui-4bQx9I1f.js +0 -134
package/bin/wizards.mjs
CHANGED
|
@@ -149,8 +149,21 @@ if (command === "version") {
|
|
|
149
149
|
console.log(versionOf(root));
|
|
150
150
|
process.exit(0);
|
|
151
151
|
}
|
|
152
|
-
const
|
|
153
|
-
|
|
152
|
+
const checkout = existsSync(join(root, "pnpm-workspace.yaml"));
|
|
153
|
+
// Windows has no installer yet, and the setup, the service and the AI clients are written for
|
|
154
|
+
// macOS and Linux: it says so instead of half working. What needs no install still runs.
|
|
155
|
+
if (process.platform === "win32" && !checkout && !RUN_HERE.includes(command)) {
|
|
156
|
+
console.error(
|
|
157
|
+
"engenty wizards for Windows is coming soon.\n\n" +
|
|
158
|
+
"Until then it runs in WSL (Windows Subsystem for Linux). In PowerShell:\n\n" +
|
|
159
|
+
" wsl --install\n\n" +
|
|
160
|
+
"then, in the Ubuntu terminal that opens:\n\n" +
|
|
161
|
+
" curl -fsSL https://engenty.ai/install.sh | bash\n\n" +
|
|
162
|
+
"https://engenty.ai/docs/user/install\n",
|
|
163
|
+
);
|
|
164
|
+
process.exit(1);
|
|
165
|
+
}
|
|
166
|
+
const fromNpm = process.platform !== "win32" && !checkout && !isInstall();
|
|
154
167
|
if (fromNpm && (!currentNode || !RUN_HERE.includes(command))) {
|
|
155
168
|
const own = versionOf(root) || "0.0.0";
|
|
156
169
|
const installed = existsSync(wrapper)
|
|
@@ -3,6 +3,28 @@ import { type SurfaceComponent } from "./surface.js";
|
|
|
3
3
|
/** The engenty avatars a wizard can wear. Same cast as engenty's ui-core. */
|
|
4
4
|
export declare const ENGENTY_KINDS: readonly ["round", "drop", "dome", "flame", "oval", "bean", "pebble", "sprout", "tower", "wedge"];
|
|
5
5
|
export type EngentyKind = (typeof ENGENTY_KINDS)[number];
|
|
6
|
+
/**
|
|
7
|
+
* The languages engenty speaks: the studio, the runner, the mails, a wizard's own words. A
|
|
8
|
+
* language joins once its strings are written; English is the one every string has, and what a
|
|
9
|
+
* language still lacks is said in English.
|
|
10
|
+
*/
|
|
11
|
+
export declare const LANGS: readonly ["en", "de"];
|
|
12
|
+
export type Lang = (typeof LANGS)[number];
|
|
13
|
+
/** Each language's name, in that language: what a switch or a menu shows. */
|
|
14
|
+
export declare const LANG_NAMES: Record<Lang, string>;
|
|
15
|
+
/** The locale amounts and dates are written in for a language. */
|
|
16
|
+
export declare const LOCALES: Record<Lang, string>;
|
|
17
|
+
/** The locale speech is heard and spoken in for a language (recognition, voices). */
|
|
18
|
+
export declare const SPEECH_LOCALES: Record<Lang, string>;
|
|
19
|
+
export declare function isLang(value: unknown): value is Lang;
|
|
20
|
+
/** The language of a tag such as "de-AT", "fr" or "pt_BR", where engenty speaks it. */
|
|
21
|
+
export declare function langOf(tag: string | null | undefined): Lang | null;
|
|
22
|
+
/**
|
|
23
|
+
* The person's own language beside English: the first of their languages (the browser's, in
|
|
24
|
+
* its order) that engenty speaks, else the main language of the country their time zone lies
|
|
25
|
+
* in; null where neither names one.
|
|
26
|
+
*/
|
|
27
|
+
export declare function localLang(languages: readonly string[], timeZone?: string | null): Lang | null;
|
|
6
28
|
export declare const FIELD_KINDS: readonly ["text", "textarea", "number", "select", "multiselect", "date", "email", "url", "toggle", "color", "image", "file", "items", "connection", "list", "location", "audio", "signature", "slot"];
|
|
7
29
|
export type FieldKind = (typeof FIELD_KINDS)[number];
|
|
8
30
|
/**
|
|
@@ -31,7 +53,7 @@ export interface AudioValue {
|
|
|
31
53
|
seconds?: number;
|
|
32
54
|
transcript?: string;
|
|
33
55
|
/** The language the runner was in when the note was taken: what it is most likely spoken in. */
|
|
34
|
-
lang?:
|
|
56
|
+
lang?: Lang;
|
|
35
57
|
}
|
|
36
58
|
export declare function isLocationValue(v: unknown): v is LocationValue;
|
|
37
59
|
export declare function isAudioValue(v: unknown): v is AudioValue;
|
|
@@ -2665,9 +2687,9 @@ export interface SlotTime {
|
|
|
2665
2687
|
*/
|
|
2666
2688
|
export declare function slotTime(iso: string): SlotTime | null;
|
|
2667
2689
|
/** The weekday and date of a slot's day: "Montag, 12. Oktober" / "Monday, 12 October". */
|
|
2668
|
-
export declare function slotDayText(iso: string, lang?:
|
|
2690
|
+
export declare function slotDayText(iso: string, lang?: Lang): string;
|
|
2669
2691
|
/** A chosen slot as a person reads it back: "Di 13.10.2026, 10:30" / "Tue 13/10/2026, 10:30". */
|
|
2670
|
-
export declare function slotText(iso: string, lang?:
|
|
2692
|
+
export declare function slotText(iso: string, lang?: Lang): string;
|
|
2671
2693
|
/**
|
|
2672
2694
|
* The slot among `options` that is the same moment as `value`, written as offered — so an answer
|
|
2673
2695
|
* in another offset ("…T07:00:00Z" for "…T09:00:00+02:00") picks the offered time.
|
|
@@ -2687,11 +2709,6 @@ export declare function allFields(def: WizardDefinition): Field[];
|
|
|
2687
2709
|
* The language a wizard speaks to people: the one it names, else read from its own words
|
|
2688
2710
|
* (titles, labels, intro) — English where they are not clearly German.
|
|
2689
2711
|
*/
|
|
2690
|
-
export declare function wizardLang(def: WizardDefinition):
|
|
2691
|
-
/** The locale amounts and dates are written in for a wizard's language. */
|
|
2692
|
-
export declare const LOCALES: {
|
|
2693
|
-
readonly de: "de-DE";
|
|
2694
|
-
readonly en: "en-GB";
|
|
2695
|
-
};
|
|
2712
|
+
export declare function wizardLang(def: WizardDefinition): Lang;
|
|
2696
2713
|
/** True when this app's schema reads the definition without losing anything of it. */
|
|
2697
2714
|
export declare function readable(definition: unknown): boolean;
|
|
@@ -16,6 +16,130 @@ export const ENGENTY_KINDS = [
|
|
|
16
16
|
"tower",
|
|
17
17
|
"wedge",
|
|
18
18
|
];
|
|
19
|
+
// --- languages -------------------------------------------------------------------------------
|
|
20
|
+
/**
|
|
21
|
+
* The languages engenty speaks: the studio, the runner, the mails, a wizard's own words. A
|
|
22
|
+
* language joins once its strings are written; English is the one every string has, and what a
|
|
23
|
+
* language still lacks is said in English.
|
|
24
|
+
*/
|
|
25
|
+
export const LANGS = ["en", "de"];
|
|
26
|
+
/** Each language's name, in that language: what a switch or a menu shows. */
|
|
27
|
+
export const LANG_NAMES = { en: "English", de: "Deutsch" };
|
|
28
|
+
/** The locale amounts and dates are written in for a language. */
|
|
29
|
+
export const LOCALES = { en: "en-GB", de: "de-DE" };
|
|
30
|
+
/** The locale speech is heard and spoken in for a language (recognition, voices). */
|
|
31
|
+
export const SPEECH_LOCALES = { en: "en-US", de: "de-DE" };
|
|
32
|
+
export function isLang(value) {
|
|
33
|
+
return typeof value === "string" && LANGS.includes(value);
|
|
34
|
+
}
|
|
35
|
+
/** The language of a tag such as "de-AT", "fr" or "pt_BR", where engenty speaks it. */
|
|
36
|
+
export function langOf(tag) {
|
|
37
|
+
const code = tag?.trim().toLowerCase().split(/[-_]/)[0];
|
|
38
|
+
return isLang(code) ? code : null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The main language of each European country. It holds languages engenty does not speak yet:
|
|
42
|
+
* `langOf` passes over them until they join `LANGS`.
|
|
43
|
+
*/
|
|
44
|
+
const COUNTRY_LANGUAGE = {
|
|
45
|
+
AT: "de",
|
|
46
|
+
BE: "nl",
|
|
47
|
+
BG: "bg",
|
|
48
|
+
CH: "de",
|
|
49
|
+
CY: "el",
|
|
50
|
+
CZ: "cs",
|
|
51
|
+
DE: "de",
|
|
52
|
+
DK: "da",
|
|
53
|
+
EE: "et",
|
|
54
|
+
ES: "es",
|
|
55
|
+
FI: "fi",
|
|
56
|
+
FR: "fr",
|
|
57
|
+
GB: "en",
|
|
58
|
+
GR: "el",
|
|
59
|
+
HR: "hr",
|
|
60
|
+
HU: "hu",
|
|
61
|
+
IE: "en",
|
|
62
|
+
IS: "is",
|
|
63
|
+
IT: "it",
|
|
64
|
+
LI: "de",
|
|
65
|
+
LT: "lt",
|
|
66
|
+
LU: "fr",
|
|
67
|
+
LV: "lv",
|
|
68
|
+
MC: "fr",
|
|
69
|
+
MT: "en",
|
|
70
|
+
NL: "nl",
|
|
71
|
+
NO: "nb",
|
|
72
|
+
PL: "pl",
|
|
73
|
+
PT: "pt",
|
|
74
|
+
RO: "ro",
|
|
75
|
+
RS: "sr",
|
|
76
|
+
SE: "sv",
|
|
77
|
+
SI: "sl",
|
|
78
|
+
SK: "sk",
|
|
79
|
+
SM: "it",
|
|
80
|
+
UA: "uk",
|
|
81
|
+
VA: "it",
|
|
82
|
+
};
|
|
83
|
+
/** The country of each European time zone (IANA names, as `Intl` gives them). */
|
|
84
|
+
const ZONE_COUNTRY = {
|
|
85
|
+
"Europe/Amsterdam": "NL",
|
|
86
|
+
"Europe/Athens": "GR",
|
|
87
|
+
"Europe/Belgrade": "RS",
|
|
88
|
+
"Europe/Berlin": "DE",
|
|
89
|
+
"Europe/Bratislava": "SK",
|
|
90
|
+
"Europe/Brussels": "BE",
|
|
91
|
+
"Europe/Bucharest": "RO",
|
|
92
|
+
"Europe/Budapest": "HU",
|
|
93
|
+
"Europe/Busingen": "DE",
|
|
94
|
+
"Europe/Copenhagen": "DK",
|
|
95
|
+
"Europe/Dublin": "IE",
|
|
96
|
+
"Europe/Helsinki": "FI",
|
|
97
|
+
"Europe/Kiev": "UA",
|
|
98
|
+
"Europe/Kyiv": "UA",
|
|
99
|
+
"Europe/Lisbon": "PT",
|
|
100
|
+
"Europe/Ljubljana": "SI",
|
|
101
|
+
"Europe/London": "GB",
|
|
102
|
+
"Europe/Luxembourg": "LU",
|
|
103
|
+
"Europe/Madrid": "ES",
|
|
104
|
+
"Europe/Malta": "MT",
|
|
105
|
+
"Europe/Monaco": "MC",
|
|
106
|
+
"Europe/Oslo": "NO",
|
|
107
|
+
"Europe/Paris": "FR",
|
|
108
|
+
"Europe/Prague": "CZ",
|
|
109
|
+
"Europe/Riga": "LV",
|
|
110
|
+
"Europe/Rome": "IT",
|
|
111
|
+
"Europe/San_Marino": "SM",
|
|
112
|
+
"Europe/Sofia": "BG",
|
|
113
|
+
"Europe/Stockholm": "SE",
|
|
114
|
+
"Europe/Tallinn": "EE",
|
|
115
|
+
"Europe/Vaduz": "LI",
|
|
116
|
+
"Europe/Vatican": "VA",
|
|
117
|
+
"Europe/Vienna": "AT",
|
|
118
|
+
"Europe/Vilnius": "LT",
|
|
119
|
+
"Europe/Warsaw": "PL",
|
|
120
|
+
"Europe/Zagreb": "HR",
|
|
121
|
+
"Europe/Zurich": "CH",
|
|
122
|
+
"Atlantic/Canary": "ES",
|
|
123
|
+
"Atlantic/Madeira": "PT",
|
|
124
|
+
"Atlantic/Reykjavik": "IS",
|
|
125
|
+
"Asia/Nicosia": "CY",
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* The person's own language beside English: the first of their languages (the browser's, in
|
|
129
|
+
* its order) that engenty speaks, else the main language of the country their time zone lies
|
|
130
|
+
* in; null where neither names one.
|
|
131
|
+
*/
|
|
132
|
+
export function localLang(languages, timeZone) {
|
|
133
|
+
for (const tag of languages) {
|
|
134
|
+
const found = langOf(tag);
|
|
135
|
+
if (found && found !== "en") {
|
|
136
|
+
return found;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const country = timeZone ? ZONE_COUNTRY[timeZone] : undefined;
|
|
140
|
+
const found = country ? langOf(COUNTRY_LANGUAGE[country]) : null;
|
|
141
|
+
return found === "en" ? null : found;
|
|
142
|
+
}
|
|
19
143
|
export const FIELD_KINDS = [
|
|
20
144
|
"text",
|
|
21
145
|
"textarea",
|
|
@@ -584,7 +708,7 @@ export const wizardSchema = z.object({
|
|
|
584
708
|
* The language the wizard speaks to people: its texts, the runner's words, its numbers and
|
|
585
709
|
* dates. Without one it is read from the wizard's own words (`wizardLang`).
|
|
586
710
|
*/
|
|
587
|
-
lang: z.enum(
|
|
711
|
+
lang: z.enum(LANGS).optional(),
|
|
588
712
|
/** Tabular data the wizard keeps between runs, per person — or for all runs (`shared`). */
|
|
589
713
|
lists: z.array(listSchema).max(12).optional(),
|
|
590
714
|
/** Accounts the person connects; kept between runs, per person. */
|
|
@@ -1634,8 +1758,6 @@ export function wizardLang(def) {
|
|
|
1634
1758
|
const en = text.match(ENGLISH)?.length ?? 0;
|
|
1635
1759
|
return de > en ? "de" : "en";
|
|
1636
1760
|
}
|
|
1637
|
-
/** The locale amounts and dates are written in for a wizard's language. */
|
|
1638
|
-
export const LOCALES = { de: "de-DE", en: "en-GB" };
|
|
1639
1761
|
// --- can this app read a definition? ---------------------------------------------------------
|
|
1640
1762
|
// The schema drops what it does not know. A definition written for a newer app would be read
|
|
1641
1763
|
// without complaint and run wrongly, so it counts only when nothing of it is lost.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type WizardDefinition } from "./definition.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type ItemFormat, type MarketplaceLang } from "./marketplace.js";
|
|
3
3
|
/** A step as the flow shows it: what happens there, not how — and where the flow branches. */
|
|
4
4
|
export interface OutlineStep {
|
|
5
5
|
id: string;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { allFields, conditionsOf, listRef, } from "./definition.js";
|
|
2
|
+
import { marketLabel } from "./marketplace.js";
|
|
2
3
|
/** When a branch is taken, in words: the field's label stands for its id. */
|
|
3
4
|
function condition(definition, rule, lang) {
|
|
4
5
|
if (rule.ask) {
|
|
5
6
|
return rule.ask;
|
|
6
7
|
}
|
|
7
8
|
if (rule.when === undefined) {
|
|
8
|
-
return
|
|
9
|
+
return marketLabel("outline", "otherwise", lang);
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.
|
|
11
|
+
const parts = conditionsOf(rule.when).map((c) => conditionText(definition, c, lang));
|
|
12
|
+
return parts.length
|
|
13
|
+
? parts.reduce((first, second) => marketLabel("outline", "and", lang, { first, second }))
|
|
14
|
+
: "";
|
|
13
15
|
}
|
|
14
16
|
function conditionText(definition, c, lang) {
|
|
15
17
|
const { field, op, value } = c;
|
|
16
18
|
const name = allFields(definition).find((f) => f.id === field)?.label ?? field.split(".").pop() ?? field;
|
|
17
|
-
const de = lang === "de";
|
|
18
19
|
// A toggle is often labelled "Mit …" already.
|
|
19
20
|
const bare = name.replace(/^(mit|with)\s+/i, "");
|
|
20
|
-
const without =
|
|
21
|
-
const withIt =
|
|
21
|
+
const without = marketLabel("outline", "without", lang, { name: bare });
|
|
22
|
+
const withIt = marketLabel("outline", "with", lang, { name: bare });
|
|
22
23
|
// A toggle reads better as with / without than as "= true".
|
|
23
24
|
if (typeof value === "boolean" && (op === "equals" || op === "notEquals")) {
|
|
24
25
|
return (op === "equals") === value ? withIt : without;
|
|
@@ -40,7 +41,7 @@ function conditionText(definition, c, lang) {
|
|
|
40
41
|
case "lt":
|
|
41
42
|
return `${name} < ${shown}`;
|
|
42
43
|
case "contains":
|
|
43
|
-
return
|
|
44
|
+
return marketLabel("outline", "contains", lang, { name, value: shown });
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
export const outlineOf = (definition, lang) => definition.steps.map((s) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { scoreCatalogEntry, tokenizeCatalogText, } from "./engenty/search-index/catalog-lexical.js";
|
|
2
|
-
import {
|
|
2
|
+
import { marketLabels, } from "./marketplace.js";
|
|
3
3
|
/**
|
|
4
4
|
* Searching the marketplace by words: BM25 with prefixes and inflections, the scoring engenty's
|
|
5
5
|
* catalogs use. The marketplace answers every search with it; an app that cannot reach the
|
|
@@ -36,7 +36,7 @@ export const SENTENCE_WORDS = 3;
|
|
|
36
36
|
/** Of a sentence's finds by words, those with at least this share of the best score are kept. */
|
|
37
37
|
const SENTENCE_SHARE = 0.4;
|
|
38
38
|
export const isSentence = (query) => query.trim().split(/\s+/).filter(Boolean).length >= SENTENCE_WORDS;
|
|
39
|
-
const labels = (
|
|
39
|
+
const labels = (group, ids) => ids.flatMap((id) => marketLabels(group, id));
|
|
40
40
|
/** How well an entry answers the query by its words; 0 when it does not at all. */
|
|
41
41
|
export function scoreEntry(entry, query) {
|
|
42
42
|
const terms = searchTerms(query);
|
|
@@ -46,11 +46,11 @@ export function scoreEntry(entry, query) {
|
|
|
46
46
|
const record = {
|
|
47
47
|
title: fold(entry.title),
|
|
48
48
|
summary: fold(entry.pitch),
|
|
49
|
-
category: labels(
|
|
49
|
+
category: labels("useCase", entry.useCases),
|
|
50
50
|
tags: [
|
|
51
|
-
...labels(
|
|
52
|
-
...labels(
|
|
53
|
-
...labels(
|
|
51
|
+
...labels("industry", entry.industries),
|
|
52
|
+
...labels("format", entry.formats),
|
|
53
|
+
...labels("capability", entry.capabilities),
|
|
54
54
|
].map(fold),
|
|
55
55
|
};
|
|
56
56
|
let score = scoreCatalogEntry(record, terms.join(" "), WEIGHTS);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type WizardDefinition } from "./definition.js";
|
|
1
|
+
import { type Lang, type WizardDefinition } from "./definition.js";
|
|
2
|
+
import { type Gap, type Texts } from "./texts.js";
|
|
2
3
|
/**
|
|
3
4
|
* The marketplace: wizards anyone can start from. What an entry is sorted by — formats, industry,
|
|
4
5
|
* use case — and what follows from its definition: the AI capabilities it needs, how much a
|
|
@@ -7,215 +8,86 @@ import { type WizardDefinition } from "./definition.js";
|
|
|
7
8
|
export declare const MARKETPLACE_LANGS: readonly ["de", "en"];
|
|
8
9
|
export type MarketplaceLang = (typeof MARKETPLACE_LANGS)[number];
|
|
9
10
|
/** What comes out of a run. */
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
de: string;
|
|
25
|
-
en: string;
|
|
26
|
-
};
|
|
27
|
-
video: {
|
|
28
|
-
de: string;
|
|
29
|
-
en: string;
|
|
30
|
-
};
|
|
31
|
-
audio: {
|
|
32
|
-
de: string;
|
|
33
|
-
en: string;
|
|
34
|
-
};
|
|
35
|
-
dashboard: {
|
|
36
|
-
de: string;
|
|
37
|
-
en: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export type ItemFormat = keyof typeof ITEM_FORMATS;
|
|
41
|
-
export declare const INDUSTRIES: {
|
|
42
|
-
any: {
|
|
43
|
-
de: string;
|
|
44
|
-
en: string;
|
|
45
|
-
};
|
|
46
|
-
trades: {
|
|
47
|
-
de: string;
|
|
48
|
-
en: string;
|
|
49
|
-
};
|
|
50
|
-
gastronomy: {
|
|
51
|
-
de: string;
|
|
52
|
-
en: string;
|
|
53
|
-
};
|
|
54
|
-
hospitality: {
|
|
55
|
-
de: string;
|
|
56
|
-
en: string;
|
|
57
|
-
};
|
|
58
|
-
realEstate: {
|
|
59
|
-
de: string;
|
|
60
|
-
en: string;
|
|
61
|
-
};
|
|
62
|
-
retail: {
|
|
63
|
-
de: string;
|
|
64
|
-
en: string;
|
|
65
|
-
};
|
|
66
|
-
health: {
|
|
67
|
-
de: string;
|
|
68
|
-
en: string;
|
|
69
|
-
};
|
|
70
|
-
professional: {
|
|
71
|
-
de: string;
|
|
72
|
-
en: string;
|
|
73
|
-
};
|
|
74
|
-
agency: {
|
|
75
|
-
de: string;
|
|
76
|
-
en: string;
|
|
77
|
-
};
|
|
78
|
-
events: {
|
|
79
|
-
de: string;
|
|
80
|
-
en: string;
|
|
81
|
-
};
|
|
82
|
-
publicSector: {
|
|
83
|
-
de: string;
|
|
84
|
-
en: string;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
export type Industry = keyof typeof INDUSTRIES;
|
|
88
|
-
export declare const USE_CASES: {
|
|
89
|
-
marketing: {
|
|
90
|
-
de: string;
|
|
91
|
-
en: string;
|
|
92
|
-
};
|
|
93
|
-
sales: {
|
|
94
|
-
de: string;
|
|
95
|
-
en: string;
|
|
96
|
-
};
|
|
97
|
-
accounting: {
|
|
98
|
-
de: string;
|
|
99
|
-
en: string;
|
|
100
|
-
};
|
|
101
|
-
service: {
|
|
102
|
-
de: string;
|
|
103
|
-
en: string;
|
|
104
|
-
};
|
|
105
|
-
research: {
|
|
106
|
-
de: string;
|
|
107
|
-
en: string;
|
|
108
|
-
};
|
|
109
|
-
hr: {
|
|
110
|
-
de: string;
|
|
111
|
-
en: string;
|
|
112
|
-
};
|
|
113
|
-
operations: {
|
|
114
|
-
de: string;
|
|
115
|
-
en: string;
|
|
116
|
-
};
|
|
117
|
-
website: {
|
|
118
|
-
de: string;
|
|
119
|
-
en: string;
|
|
120
|
-
};
|
|
121
|
-
visuals: {
|
|
122
|
-
de: string;
|
|
123
|
-
en: string;
|
|
124
|
-
};
|
|
125
|
-
inquiries: {
|
|
126
|
-
de: string;
|
|
127
|
-
en: string;
|
|
128
|
-
};
|
|
129
|
-
advice: {
|
|
130
|
-
de: string;
|
|
131
|
-
en: string;
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
export type UseCase = keyof typeof USE_CASES;
|
|
135
|
-
/** What the models and tools behind a wizard must be able to do. */
|
|
136
|
-
export declare const CAPABILITIES: {
|
|
137
|
-
text: {
|
|
138
|
-
de: string;
|
|
139
|
-
en: string;
|
|
140
|
-
};
|
|
141
|
-
web: {
|
|
142
|
-
de: string;
|
|
143
|
-
en: string;
|
|
144
|
-
};
|
|
145
|
-
browser: {
|
|
146
|
-
de: string;
|
|
147
|
-
en: string;
|
|
148
|
-
};
|
|
149
|
-
documents: {
|
|
150
|
-
de: string;
|
|
151
|
-
en: string;
|
|
152
|
-
};
|
|
153
|
-
image: {
|
|
154
|
-
de: string;
|
|
155
|
-
en: string;
|
|
156
|
-
};
|
|
157
|
-
video: {
|
|
158
|
-
de: string;
|
|
159
|
-
en: string;
|
|
160
|
-
};
|
|
161
|
-
speech: {
|
|
162
|
-
de: string;
|
|
163
|
-
en: string;
|
|
164
|
-
};
|
|
165
|
-
listening: {
|
|
166
|
-
de: string;
|
|
167
|
-
en: string;
|
|
168
|
-
};
|
|
169
|
-
code: {
|
|
170
|
-
de: string;
|
|
171
|
-
en: string;
|
|
172
|
-
};
|
|
173
|
-
connectors: {
|
|
174
|
-
de: string;
|
|
175
|
-
en: string;
|
|
176
|
-
};
|
|
177
|
-
/** A film the installed client makes: only on a computer with Claude Code, on its subscription. */
|
|
178
|
-
film: {
|
|
179
|
-
de: string;
|
|
180
|
-
en: string;
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
export type Capability = keyof typeof CAPABILITIES;
|
|
184
|
-
export declare const COST_TIERS: {
|
|
185
|
-
low: {
|
|
186
|
-
de: string;
|
|
187
|
-
en: string;
|
|
188
|
-
};
|
|
189
|
-
medium: {
|
|
190
|
-
de: string;
|
|
191
|
-
en: string;
|
|
192
|
-
};
|
|
193
|
-
high: {
|
|
194
|
-
de: string;
|
|
195
|
-
en: string;
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
export type CostTier = keyof typeof COST_TIERS;
|
|
11
|
+
export declare const ITEM_FORMAT_IDS: readonly ["text", "document", "table", "image", "video", "audio", "dashboard"];
|
|
12
|
+
export type ItemFormat = (typeof ITEM_FORMAT_IDS)[number];
|
|
13
|
+
export declare const INDUSTRY_IDS: readonly ["any", "trades", "gastronomy", "hospitality", "realEstate", "retail", "health", "professional", "agency", "events", "publicSector"];
|
|
14
|
+
export type Industry = (typeof INDUSTRY_IDS)[number];
|
|
15
|
+
export declare const USE_CASE_IDS: readonly ["marketing", "sales", "accounting", "service", "research", "hr", "operations", "website", "visuals", "inquiries", "advice"];
|
|
16
|
+
export type UseCase = (typeof USE_CASE_IDS)[number];
|
|
17
|
+
/**
|
|
18
|
+
* What the models and tools behind a wizard must be able to do. `film`: a film the installed
|
|
19
|
+
* client makes, only on a computer with Claude Code, on its subscription.
|
|
20
|
+
*/
|
|
21
|
+
export declare const CAPABILITY_IDS: readonly ["text", "web", "browser", "documents", "image", "video", "speech", "listening", "code", "connectors", "film"];
|
|
22
|
+
export type Capability = (typeof CAPABILITY_IDS)[number];
|
|
23
|
+
export declare const COST_TIER_IDS: readonly ["low", "medium", "high"];
|
|
24
|
+
export type CostTier = (typeof COST_TIER_IDS)[number];
|
|
199
25
|
/**
|
|
200
26
|
* The plan a wizard needs. Free runs on what every runtime has; Pro needs plugins, which come
|
|
201
27
|
* with the Pro and Team plans of engenty.ai.
|
|
202
28
|
*/
|
|
203
|
-
export declare const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
29
|
+
export declare const MARKETPLACE_PLAN_IDS: readonly ["free", "pro"];
|
|
30
|
+
export type MarketplacePlan = (typeof MARKETPLACE_PLAN_IDS)[number];
|
|
31
|
+
/** What a marketplace label belongs to: a facet, a cost tier, a plan. */
|
|
32
|
+
export type MarketGroup = "format" | "industry" | "useCase" | "capability" | "cost" | "plan" | "outline";
|
|
33
|
+
declare const MARKET_EN: {
|
|
34
|
+
readonly "format.text": "Text";
|
|
35
|
+
readonly "format.document": "Document (PDF, Word)";
|
|
36
|
+
readonly "format.table": "Table";
|
|
37
|
+
readonly "format.image": "Image";
|
|
38
|
+
readonly "format.video": "Video";
|
|
39
|
+
readonly "format.audio": "Audio";
|
|
40
|
+
readonly "format.dashboard": "Dashboard";
|
|
41
|
+
readonly "industry.any": "Any industry";
|
|
42
|
+
readonly "industry.trades": "Trades";
|
|
43
|
+
readonly "industry.gastronomy": "Food service";
|
|
44
|
+
readonly "industry.hospitality": "Hotels & tourism";
|
|
45
|
+
readonly "industry.realEstate": "Real estate";
|
|
46
|
+
readonly "industry.retail": "Retail";
|
|
47
|
+
readonly "industry.health": "Health";
|
|
48
|
+
readonly "industry.professional": "Professional services";
|
|
49
|
+
readonly "industry.agency": "Agency & marketing";
|
|
50
|
+
readonly "industry.events": "Events";
|
|
51
|
+
readonly "industry.publicSector": "Associations & public sector";
|
|
52
|
+
readonly "useCase.marketing": "Marketing & social media";
|
|
53
|
+
readonly "useCase.sales": "Offers & sales";
|
|
54
|
+
readonly "useCase.accounting": "Accounting & receipts";
|
|
55
|
+
readonly "useCase.service": "Customer service";
|
|
56
|
+
readonly "useCase.research": "Research & analysis";
|
|
57
|
+
readonly "useCase.hr": "HR & applications";
|
|
58
|
+
readonly "useCase.operations": "Planning & operations";
|
|
59
|
+
readonly "useCase.website": "Website helpers";
|
|
60
|
+
readonly "useCase.visuals": "Images & video";
|
|
61
|
+
readonly "useCase.inquiries": "Inquiries & bookings";
|
|
62
|
+
readonly "useCase.advice": "Advice & pricing";
|
|
63
|
+
readonly "capability.text": "Writes text";
|
|
64
|
+
readonly "capability.web": "Web search";
|
|
65
|
+
readonly "capability.browser": "Drives a browser";
|
|
66
|
+
readonly "capability.documents": "Reads documents & photos";
|
|
67
|
+
readonly "capability.image": "Makes images";
|
|
68
|
+
readonly "capability.video": "Makes video";
|
|
69
|
+
readonly "capability.speech": "Speech output";
|
|
70
|
+
readonly "capability.listening": "Understands voice notes";
|
|
71
|
+
readonly "capability.code": "Runs code";
|
|
72
|
+
readonly "capability.connectors": "Connected accounts & systems";
|
|
73
|
+
readonly "capability.film": "Films with Claude Code (on your subscription)";
|
|
74
|
+
readonly "cost.low": "low cost";
|
|
75
|
+
readonly "cost.medium": "medium cost";
|
|
76
|
+
readonly "cost.high": "high cost";
|
|
77
|
+
readonly "plan.free": "Free";
|
|
78
|
+
readonly "plan.pro": "Pro";
|
|
79
|
+
readonly "outline.otherwise": "otherwise";
|
|
80
|
+
readonly "outline.and": "{first} and {second}";
|
|
81
|
+
readonly "outline.with": "with {name}";
|
|
82
|
+
readonly "outline.without": "without {name}";
|
|
83
|
+
readonly "outline.contains": "{name} contains {value}";
|
|
212
84
|
};
|
|
213
|
-
|
|
214
|
-
export declare const
|
|
215
|
-
|
|
216
|
-
export declare
|
|
217
|
-
|
|
218
|
-
export declare const
|
|
85
|
+
type MarketKey = keyof typeof MARKET_EN;
|
|
86
|
+
export declare const MARKET_TEXTS: Texts<MarketKey>;
|
|
87
|
+
/** The label of a facet value, a cost tier or a plan in a language; its id where it has none. */
|
|
88
|
+
export declare function marketLabel(group: MarketGroup, id: string, lang: Lang, params?: Record<string, Gap | undefined>): string;
|
|
89
|
+
/** A label in every language, for search: a person may type either. */
|
|
90
|
+
export declare const marketLabels: (group: MarketGroup, id: string) => string[];
|
|
219
91
|
/** The formats a run hands over, read from what the result step offers. */
|
|
220
92
|
export declare function formatsOf(def: WizardDefinition): ItemFormat[];
|
|
221
93
|
/** The capabilities a definition needs, read from its steps. */
|
|
@@ -357,3 +229,4 @@ export interface MarketplaceEntry extends MarketplaceSummary {
|
|
|
357
229
|
/** The plugins it needs that this app does not have: a wizard made from it would not run. */
|
|
358
230
|
needs?: string[];
|
|
359
231
|
}
|
|
232
|
+
export {};
|