wizards 0.2.42 → 0.2.43

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.
Files changed (165) hide show
  1. package/apps/runtime/dist/app.js +37 -3
  2. package/apps/runtime/dist/authoring/guide.js +5 -2
  3. package/apps/runtime/dist/browser/fast/action-space.js +162 -0
  4. package/apps/runtime/dist/browser/fast/classifier.js +91 -0
  5. package/apps/runtime/dist/browser/fast/decide.js +171 -0
  6. package/apps/runtime/dist/browser/fast/driver.js +141 -0
  7. package/apps/runtime/dist/browser/fast/instructions.js +33 -0
  8. package/apps/runtime/dist/browser/fast/run.js +249 -0
  9. package/apps/runtime/dist/browser/fast/span-picker.js +153 -0
  10. package/apps/runtime/dist/browser/fast/text-helper.js +178 -0
  11. package/apps/runtime/dist/browser/snapshot.js +335 -0
  12. package/apps/runtime/dist/db/migrations/tenant/0011_runners.sql +2 -0
  13. package/apps/runtime/dist/db/migrations/tenant/meta/0011_snapshot.json +2956 -0
  14. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
  15. package/apps/runtime/dist/db/schema.js +4 -0
  16. package/apps/runtime/dist/engine/resources.js +109 -0
  17. package/apps/runtime/dist/engine/runner.js +7 -3
  18. package/apps/runtime/dist/engine/steps.js +89 -10
  19. package/apps/runtime/dist/env.js +9 -0
  20. package/apps/runtime/dist/harness/claude.js +9 -1
  21. package/apps/runtime/dist/link-preview.js +4 -3
  22. package/apps/runtime/dist/mcp/tools.js +1 -1
  23. package/apps/runtime/dist/media/conversation.js +177 -0
  24. package/apps/runtime/dist/models.js +17 -0
  25. package/apps/runtime/dist/plugins/loader.js +48 -2
  26. package/apps/runtime/dist/plugins/registry.js +1 -0
  27. package/apps/runtime/dist/plugins/runs.js +205 -0
  28. package/apps/runtime/dist/routes/runs.js +206 -22
  29. package/apps/runtime/dist/routes/studio.js +12 -1
  30. package/apps/runtime/dist/services/cloud.js +1 -0
  31. package/apps/runtime/dist/services/runners.js +138 -0
  32. package/apps/runtime/dist/services/runs.js +83 -45
  33. package/apps/runtime/dist/services/wizard-icon.js +12 -0
  34. package/apps/runtime/dist/services/wizards.js +5 -1
  35. package/apps/runtime/dist/tools/browser.js +426 -97
  36. package/apps/runtime/dist/tools/index.js +50 -3
  37. package/apps/web/dist/assets/ChangelogDialog-8qS5utcR.js +1 -0
  38. package/apps/web/dist/assets/ChatView-Bx1KVCEf.js +10 -0
  39. package/apps/web/dist/assets/{CreditsDialog-DPglouDr.js → CreditsDialog-BCuDsatt.js} +1 -1
  40. package/apps/web/dist/assets/EditorPage-_Sbj-mSD.js +3 -0
  41. package/apps/web/dist/assets/{FlowPreview-CQN5acxA.js → FlowPreview-COgjib4H.js} +1 -1
  42. package/apps/web/dist/assets/{Harness-BFxUFB7B.js → Harness-BaxjV1Ng.js} +2 -2
  43. package/apps/web/dist/assets/HomePage-BlD0wZB0.js +1 -0
  44. package/apps/web/dist/assets/ImportWizard-BZDtNJg1.js +1 -0
  45. package/apps/web/dist/assets/NewWizardPage-Ci_x__p9.js +2 -0
  46. package/apps/web/dist/assets/ProjectPage-NwFut2Z-.js +2 -0
  47. package/apps/web/dist/assets/PublicRunner-rHdvK18v.js +1 -0
  48. package/apps/web/dist/assets/RunDrawer-Dp-JowDX.js +4 -0
  49. package/apps/web/dist/assets/RunnerView-DSlReODC.js +2 -0
  50. package/apps/web/dist/assets/SettingsPage-2Bw-D3hC.js +1 -0
  51. package/apps/web/dist/assets/SetupPage-DHESCsTb.js +1 -0
  52. package/apps/web/dist/assets/SharePage-DdJ-qD-B.js +1 -0
  53. package/apps/web/dist/assets/ThemeSwitch-BkodFy16.js +1 -0
  54. package/apps/web/dist/assets/arrow-right-pf8p4FIz.js +1 -0
  55. package/apps/web/dist/assets/changelog-cmQb-lZW.js +1 -0
  56. package/apps/web/dist/assets/{circle-alert-B0rwkpC7.js → circle-alert-Gn4D6etf.js} +1 -1
  57. package/apps/web/dist/assets/{copy-DgbMaHoj.js → copy-C3D7PBYL.js} +1 -1
  58. package/apps/web/dist/assets/{definition-FVgbAXOo.js → definition-AlI4g-wR.js} +2 -2
  59. package/apps/web/dist/assets/{external-link-pP6YfR9-.js → external-link-M3mEgZA-.js} +1 -1
  60. package/apps/web/dist/assets/globe-BnaeE83w.js +1 -0
  61. package/apps/web/dist/assets/{image-D2X6TWdq.js → image-BuasG4Jr.js} +1 -1
  62. package/apps/web/dist/assets/index-BdrX1tJ4.js +78 -0
  63. package/apps/web/dist/assets/index-D6vcOCCh.css +1 -0
  64. package/apps/web/dist/assets/{lock-BG4mi_lJ.js → lock-CrB_z7n3.js} +1 -1
  65. package/apps/web/dist/assets/{meta-BD9yulXs.js → meta-CT4LmQ7g.js} +1 -1
  66. package/apps/web/dist/assets/mouse-pointer-click-BurvPVO8.js +1 -0
  67. package/apps/web/dist/assets/{pen-line-D54vxrGl.js → pen-line-BA6l84zC.js} +1 -1
  68. package/apps/web/dist/assets/{refresh-cw-DvTgdpdf.js → refresh-cw-DEKCEuIO.js} +1 -1
  69. package/apps/web/dist/assets/{session-CT1AZIlE.js → session-DCcgTTmG.js} +1 -1
  70. package/apps/web/dist/assets/{settings-menu-DJATAPGg.js → settings-menu-C9fE9M0f.js} +1 -1
  71. package/apps/web/dist/assets/star-BwhVXiJM.js +1 -0
  72. package/apps/web/dist/assets/{trash-DAcf34LR.js → trash-WwlTeE_V.js} +1 -1
  73. package/apps/web/dist/assets/{type-BU0mWqf3.js → type-kpWj7Zf1.js} +1 -1
  74. package/apps/web/dist/assets/ui-Wxaw_APn.js +9 -0
  75. package/apps/web/dist/assets/{video-C6qoFAAs.js → video-U-idAC66.js} +1 -1
  76. package/apps/web/dist/assets/volume-2-BwidpioC.js +1 -0
  77. package/apps/web/dist/assets/{wand-sparkles-Bw4tu2An.js → wand-sparkles-DaINku4r.js} +1 -1
  78. package/apps/web/dist/embed.js +119 -4
  79. package/apps/web/dist/index.html +12 -11
  80. package/apps/web/dist/mcp/flow.html +45 -45
  81. package/modules/calls/dist/client.css +3 -0
  82. package/modules/calls/dist/client.js +1 -0
  83. package/modules/calls/engenty.plugin.json +8 -0
  84. package/modules/calls/migrations/0001_init.sql +26 -0
  85. package/modules/calls/package.json +25 -0
  86. package/modules/calls/src/openai.ts +155 -0
  87. package/modules/calls/src/plugin.ts +407 -0
  88. package/modules/calls/src/rules.ts +226 -0
  89. package/modules/calls/src/schema.ts +39 -0
  90. package/modules/calls/src/session.ts +353 -0
  91. package/modules/calls/src/store.ts +124 -0
  92. package/modules/calls/src/twilio.ts +90 -0
  93. package/modules/calls/tsconfig.json +10 -0
  94. package/modules/calls/ui/Settings.tsx +137 -0
  95. package/modules/calls/ui/app.ts +50 -0
  96. package/modules/calls/ui/messages.ts +81 -0
  97. package/modules/calls/ui/parts.tsx +36 -0
  98. package/modules/calls/ui/plugin.tsx +15 -0
  99. package/modules/sms/dist/client.css +3 -0
  100. package/modules/sms/dist/client.js +1 -0
  101. package/modules/sms/engenty.plugin.json +8 -0
  102. package/modules/sms/migrations/0001_init.sql +26 -0
  103. package/modules/sms/package.json +25 -0
  104. package/modules/sms/src/plugin.ts +324 -0
  105. package/modules/sms/src/schema.ts +26 -0
  106. package/modules/sms/src/store.ts +140 -0
  107. package/modules/sms/src/surface.ts +70 -0
  108. package/modules/sms/src/twilio.ts +130 -0
  109. package/modules/sms/tsconfig.json +10 -0
  110. package/modules/sms/ui/Settings.tsx +113 -0
  111. package/modules/sms/ui/Share.tsx +78 -0
  112. package/modules/sms/ui/app.ts +51 -0
  113. package/modules/sms/ui/messages.ts +72 -0
  114. package/modules/sms/ui/parts.tsx +36 -0
  115. package/modules/sms/ui/plugin.tsx +20 -0
  116. package/modules/whatsapp/dist/client.css +3 -0
  117. package/modules/whatsapp/dist/client.js +1 -0
  118. package/modules/whatsapp/engenty.plugin.json +8 -0
  119. package/modules/whatsapp/migrations/0001_init.sql +30 -0
  120. package/modules/whatsapp/package.json +25 -0
  121. package/modules/whatsapp/src/graph.ts +271 -0
  122. package/modules/whatsapp/src/inbound.ts +143 -0
  123. package/modules/whatsapp/src/plugin.ts +369 -0
  124. package/modules/whatsapp/src/schema.ts +32 -0
  125. package/modules/whatsapp/src/store.ts +156 -0
  126. package/modules/whatsapp/src/surface.ts +127 -0
  127. package/modules/whatsapp/tsconfig.json +10 -0
  128. package/modules/whatsapp/ui/Settings.tsx +141 -0
  129. package/modules/whatsapp/ui/Share.tsx +78 -0
  130. package/modules/whatsapp/ui/app.ts +54 -0
  131. package/modules/whatsapp/ui/messages.ts +82 -0
  132. package/modules/whatsapp/ui/parts.tsx +36 -0
  133. package/modules/whatsapp/ui/plugin.tsx +20 -0
  134. package/node_modules/@engenty-wizards/plugin-sdk/dist/index.d.ts +259 -0
  135. package/node_modules/@engenty-wizards/plugin-sdk/dist/studio.d.ts +17 -0
  136. package/node_modules/@engenty-wizards/plugin-sdk/dist/thread.d.ts +174 -0
  137. package/node_modules/@engenty-wizards/plugin-sdk/dist/thread.js +816 -0
  138. package/node_modules/@engenty-wizards/plugin-sdk/package.json +2 -1
  139. package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +8 -0
  140. package/node_modules/@engenty-wizards/shared/dist/definition.js +21 -0
  141. package/node_modules/@engenty-wizards/shared/dist/run.d.ts +61 -3
  142. package/node_modules/@engenty-wizards/shared/dist/run.js +16 -0
  143. package/node_modules/@engenty-wizards/shared/dist/runners.d.ts +81 -0
  144. package/node_modules/@engenty-wizards/shared/dist/runners.js +146 -0
  145. package/package.json +1 -1
  146. package/apps/web/dist/assets/ChangelogDialog-BxRBTR8P.js +0 -1
  147. package/apps/web/dist/assets/EditorPage-BKAFzzWk.js +0 -3
  148. package/apps/web/dist/assets/HomePage-BZuwrr-b.js +0 -1
  149. package/apps/web/dist/assets/ImportWizard-JGMemER4.js +0 -1
  150. package/apps/web/dist/assets/NewWizardPage-BwHAsJwj.js +0 -2
  151. package/apps/web/dist/assets/ProjectPage--ijr1jPE.js +0 -2
  152. package/apps/web/dist/assets/PublicRunner-D9Oe-_vs.js +0 -1
  153. package/apps/web/dist/assets/RunDrawer-BfociUm2.js +0 -4
  154. package/apps/web/dist/assets/RunnerView-D2b84UTY.js +0 -2
  155. package/apps/web/dist/assets/SettingsPage-9rk9IRdr.js +0 -1
  156. package/apps/web/dist/assets/SetupPage-BUJh_v9q.js +0 -1
  157. package/apps/web/dist/assets/SharePage-sNJ_s1RE.js +0 -1
  158. package/apps/web/dist/assets/ThemeSwitch-NDTEeh0R.js +0 -1
  159. package/apps/web/dist/assets/arrow-right-C1xLSnNa.js +0 -1
  160. package/apps/web/dist/assets/changelog-BSVi9hHS.js +0 -1
  161. package/apps/web/dist/assets/index-CBjgitjd.js +0 -78
  162. package/apps/web/dist/assets/index-gTcC8eX6.css +0 -1
  163. package/apps/web/dist/assets/star-CaOg5c-D.js +0 -1
  164. package/apps/web/dist/assets/ui-Bxf6zX5k.js +0 -9
  165. package/apps/web/dist/assets/volume-2-Dw4p9Ln4.js +0 -1
@@ -5,6 +5,7 @@
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./dist/index.js",
8
- "./studio": "./dist/studio.js"
8
+ "./studio": "./dist/studio.js",
9
+ "./thread": "./dist/thread.js"
9
10
  }
10
11
  }
@@ -5,6 +5,14 @@ export declare const ENGENTY_KINDS: readonly ["round", "drop", "dome", "flame",
5
5
  export type EngentyKind = (typeof ENGENTY_KINDS)[number];
6
6
  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
7
  export type FieldKind = (typeof FIELD_KINDS)[number];
8
+ /**
9
+ * How a field is answered without the page's form: `typed` as text, `tapped` from its choices,
10
+ * `value` as a plain value (a colour, line items, a place), `device` only with the person's
11
+ * device or account (a file, a recording, a signature, a connection, a kept list). The chat
12
+ * types and taps; an AI client over MCP gives every way but `device`.
13
+ */
14
+ export type FieldWay = "typed" | "tapped" | "value" | "device";
15
+ export declare const FIELD_WAYS: Record<FieldKind, FieldWay>;
8
16
  /**
9
17
  * What a `location` field holds: where the person stands (from the device), a place they typed,
10
18
  * or both — the label is then the address of the position.
@@ -36,6 +36,27 @@ export const FIELD_KINDS = [
36
36
  "signature",
37
37
  "slot",
38
38
  ];
39
+ export const FIELD_WAYS = {
40
+ text: "typed",
41
+ textarea: "typed",
42
+ number: "typed",
43
+ date: "typed",
44
+ email: "typed",
45
+ url: "typed",
46
+ select: "tapped",
47
+ multiselect: "tapped",
48
+ slot: "tapped",
49
+ toggle: "tapped",
50
+ color: "value",
51
+ items: "value",
52
+ location: "value",
53
+ image: "device",
54
+ file: "device",
55
+ audio: "device",
56
+ signature: "device",
57
+ connection: "device",
58
+ list: "device",
59
+ };
39
60
  export function isLocationValue(v) {
40
61
  if (!v || typeof v !== "object" || Array.isArray(v)) {
41
62
  return false;
@@ -129,10 +129,12 @@ export type AskAnswer = {
129
129
  type: "skip";
130
130
  };
131
131
  /** One thing the person does in the wizard's browser while it waits for them. */
132
- export type BrowserAct = {
132
+ export type BrowserAct =
133
+ /** Where on the picture, as a share of its width and height (0–1). */
134
+ {
133
135
  type: "click";
134
- x: number;
135
- y: number;
136
+ fx: number;
137
+ fy: number;
136
138
  } | {
137
139
  type: "type";
138
140
  text: string;
@@ -239,10 +241,50 @@ export declare const RUN_NOTES: {
239
241
  readonly de: "Klickt im Browser";
240
242
  readonly en: "Clicking in the browser";
241
243
  };
244
+ readonly clicksOn: {
245
+ readonly de: "Klickt auf „{name}“";
246
+ readonly en: "Clicking “{name}”";
247
+ };
242
248
  readonly types: {
243
249
  readonly de: "Tippt im Browser";
244
250
  readonly en: "Typing in the browser";
245
251
  };
252
+ readonly typesText: {
253
+ readonly de: "Tippt „{text}“";
254
+ readonly en: "Typing “{text}”";
255
+ };
256
+ readonly selects: {
257
+ readonly de: "Wählt „{option}“";
258
+ readonly en: "Choosing “{option}”";
259
+ };
260
+ readonly scrolls: {
261
+ readonly de: "Scrollt";
262
+ readonly en: "Scrolling";
263
+ };
264
+ readonly presses: {
265
+ readonly de: "Drückt {key}";
266
+ readonly en: "Pressing {key}";
267
+ };
268
+ readonly goesBack: {
269
+ readonly de: "Geht eine Seite zurück";
270
+ readonly en: "Going back a page";
271
+ };
272
+ readonly waitsForPage: {
273
+ readonly de: "Wartet auf die Seite";
274
+ readonly en: "Waiting for the page";
275
+ };
276
+ readonly fastLoop: {
277
+ readonly de: "Erledigt im Browser: {goal}";
278
+ readonly en: "Doing in the browser: {goal}";
279
+ };
280
+ readonly personDrives: {
281
+ readonly de: "Du steuerst den Browser – der Wizard wartet";
282
+ readonly en: "You are driving the browser – the wizard waits";
283
+ };
284
+ readonly agentDrives: {
285
+ readonly de: "Der Wizard macht im Browser weiter";
286
+ readonly en: "The wizard carries on in the browser";
287
+ };
246
288
  readonly looksAtPage: {
247
289
  readonly de: "Sieht sich die Seite an";
248
290
  readonly en: "Looking at the page";
@@ -349,8 +391,14 @@ export interface RunView {
349
391
  status: RunStatus;
350
392
  mode: "test" | "live";
351
393
  wizard: Pick<WizardDefinition, "title" | "description" | "avatar" | "intro">;
394
+ /** The language the wizard speaks: what is read aloud, and in which voice. */
395
+ lang: "de" | "en";
396
+ /** A live conversation can be started on this run: the runtime has a model for it. */
397
+ talk: boolean;
352
398
  /** The step the person is on (interactive) or the one running. */
353
399
  step: Step | null;
400
+ /** Pages and reviews answered before it, oldest first: what a chat shows above the current step. */
401
+ answered: Step[];
354
402
  values: Record<string, unknown>;
355
403
  /** What fields of the current page start with, from earlier steps (`prefill`). */
356
404
  prefill: Record<string, unknown>;
@@ -424,6 +472,16 @@ export interface PublicWizard {
424
472
  turnstileSiteKey: string | null;
425
473
  available: boolean;
426
474
  unavailableReason: string | null;
475
+ /**
476
+ * The runners switched on for this wizard, the one its link opens first: what the page offers
477
+ * beside "Let's go". A page runner has an address; a channel (a number, a bot) has none.
478
+ */
479
+ runners: {
480
+ id: string;
481
+ label: string;
482
+ kind: "page" | "channel";
483
+ url: string | null;
484
+ }[];
427
485
  }
428
486
  /** What a step is expected to cost, in credits. `high` is the 90th percentile once measured. */
429
487
  export interface StepEstimate {
@@ -42,7 +42,23 @@ export const RUN_NOTES = {
42
42
  readsMany: { de: "Liest {count} Dokumente", en: "Reading {count} documents" },
43
43
  opens: { de: "Öffnet {name}", en: "Opening {name}" },
44
44
  clicks: { de: "Klickt im Browser", en: "Clicking in the browser" },
45
+ clicksOn: { de: "Klickt auf „{name}“", en: "Clicking “{name}”" },
45
46
  types: { de: "Tippt im Browser", en: "Typing in the browser" },
47
+ typesText: { de: "Tippt „{text}“", en: "Typing “{text}”" },
48
+ selects: { de: "Wählt „{option}“", en: "Choosing “{option}”" },
49
+ scrolls: { de: "Scrollt", en: "Scrolling" },
50
+ presses: { de: "Drückt {key}", en: "Pressing {key}" },
51
+ goesBack: { de: "Geht eine Seite zurück", en: "Going back a page" },
52
+ waitsForPage: { de: "Wartet auf die Seite", en: "Waiting for the page" },
53
+ fastLoop: { de: "Erledigt im Browser: {goal}", en: "Doing in the browser: {goal}" },
54
+ personDrives: {
55
+ de: "Du steuerst den Browser – der Wizard wartet",
56
+ en: "You are driving the browser – the wizard waits",
57
+ },
58
+ agentDrives: {
59
+ de: "Der Wizard macht im Browser weiter",
60
+ en: "The wizard carries on in the browser",
61
+ },
46
62
  looksAtPage: { de: "Sieht sich die Seite an", en: "Looking at the page" },
47
63
  waitsForSignIn: {
48
64
  de: "Wartet auf deine Anmeldung bei {name}",
@@ -0,0 +1,81 @@
1
+ import { type AssetKind, type FieldKind, type Step, type WizardDefinition } from "./definition.js";
2
+ /**
3
+ * A runner is a door a wizard runs through: the stepped page, the chat, and the ones plugins
4
+ * add (a call, a messenger). Each declares what it can take in and show; the runtime works out
5
+ * per wizard which runners run it fully, which hand off at some step, and which cannot.
6
+ */
7
+ /** What a step hands on, by the shape a runner has to carry: a text, a picture, a file, a view. */
8
+ export type OutputKind = AssetKind | "text" | "data" | "widget" | "film" | "surface";
9
+ export declare const OUTPUT_KINDS: OutputKind[];
10
+ export interface RunnerCapabilities {
11
+ /** The field kinds the runner asks itself; the rest need another runner. */
12
+ input: FieldKind[];
13
+ output: {
14
+ /** What it shows as it is: text in a thread, a picture on a screen. */
15
+ shows: OutputKind[];
16
+ /** What it shows as a picture with a link to the real thing. Anything else is a link. */
17
+ pictures: OutputKind[];
18
+ };
19
+ /** A sign-in is typed on a page the model never sees: only a browser can take it. */
20
+ asks: ("confirm" | "login")[];
21
+ review: ("accept" | "regenerate" | "edit")[];
22
+ /** Stays through a step that takes minutes, with a note now and then. */
23
+ waits: boolean;
24
+ /** How a link to the run page reaches the person for what the runner cannot do itself. */
25
+ handoff: ("screen" | "thread" | "sms" | "push")[];
26
+ }
27
+ export interface RunnerInfo {
28
+ /** Lower case, digits and "-": the sub-path of the wizard's address, `/w/<token>/<id>`. */
29
+ id: string;
30
+ label: {
31
+ de: string;
32
+ en: string;
33
+ };
34
+ /** A page the person opens, or a channel with an address of its own (a number, a bot). */
35
+ kind: "page" | "channel";
36
+ capabilities: RunnerCapabilities;
37
+ /** Ships with the runtime: steps and chat. */
38
+ builtIn?: boolean;
39
+ /** The plugin that registered it. */
40
+ plugin?: string;
41
+ /** Why the runner cannot be used here right now (a model not set up); null when it can. */
42
+ problem?: string | null;
43
+ }
44
+ export declare const RUNNER_ID: RegExp;
45
+ /** Sub-paths of a wizard's address that are not runners. */
46
+ export declare const RESERVED_PATHS: string[];
47
+ /** The runners every runtime has: the page draws every field kind, so both run every wizard. */
48
+ export declare const BUILT_IN_RUNNERS: RunnerInfo[];
49
+ /** The built-in runners that hold a live conversation: offered only where a speech model is set up. */
50
+ export declare const CONVERSATION_RUNNERS: string[];
51
+ /** The runners every wizard offers until the owner says otherwise. */
52
+ export declare const DEFAULT_ENABLED: string[];
53
+ export declare const DEFAULT_RUNNER = "steps";
54
+ /** How a wizard is offered: the runner its link opens, and the ones switched on beside it. */
55
+ export interface RunnerSettings {
56
+ default: string;
57
+ enabled: string[];
58
+ }
59
+ export declare const DEFAULT_RUNNER_SETTINGS: RunnerSettings;
60
+ /** A step a runner cannot take itself, and why. */
61
+ export interface RunnerGap {
62
+ stepId: string;
63
+ title: string;
64
+ /** What the step needs, as the owner reads it: a field's label, "a sign-in", "to be looked at". */
65
+ why: string;
66
+ }
67
+ export interface RunnerFit {
68
+ runner: string;
69
+ /** `full`: every step native. `handoff`: some steps on the run page. `no`: a step nobody can take. */
70
+ outcome: "full" | "handoff" | "no";
71
+ steps: RunnerGap[];
72
+ }
73
+ /** What a step hands on, or null when it hands on nothing (a page, a review, the result). */
74
+ export declare function outputKindOf(step: Step): OutputKind | null;
75
+ /**
76
+ * Whether a runner runs a wizard, and where it hands off. Every step counts: since the AI can
77
+ * decide which branch a run takes and which fields a page shows, each step may be reached.
78
+ */
79
+ export declare function runnerFit(def: WizardDefinition, runner: RunnerInfo): RunnerFit;
80
+ /** The fit of every runner given, in the order given. */
81
+ export declare function runnersFor(def: WizardDefinition, runners: RunnerInfo[]): RunnerFit[];
@@ -0,0 +1,146 @@
1
+ import { FIELD_KINDS, } from "./definition.js";
2
+ export const OUTPUT_KINDS = [
3
+ "text",
4
+ "data",
5
+ "image",
6
+ "video",
7
+ "voice",
8
+ "document",
9
+ "dashboard",
10
+ "widget",
11
+ "film",
12
+ "surface",
13
+ ];
14
+ export const RUNNER_ID = /^[a-z][a-z0-9-]{0,23}$/;
15
+ /** Sub-paths of a wizard's address that are not runners. */
16
+ export const RESERVED_PATHS = ["runs", "icons", "manifest.webmanifest", "avatar.svg"];
17
+ const EVERYTHING = {
18
+ input: [...FIELD_KINDS],
19
+ output: { shows: [...OUTPUT_KINDS], pictures: [] },
20
+ asks: ["confirm", "login"],
21
+ review: ["accept", "regenerate", "edit"],
22
+ waits: true,
23
+ handoff: ["screen", "push"],
24
+ };
25
+ /** The runners every runtime has: the page draws every field kind, so both run every wizard. */
26
+ export const BUILT_IN_RUNNERS = [
27
+ {
28
+ id: "steps",
29
+ label: { de: "Schritte", en: "Steps" },
30
+ kind: "page",
31
+ capabilities: EVERYTHING,
32
+ builtIn: true,
33
+ },
34
+ {
35
+ id: "chat",
36
+ label: { de: "Chat", en: "Chat" },
37
+ kind: "page",
38
+ capabilities: EVERYTHING,
39
+ builtIn: true,
40
+ },
41
+ // The chat with a live conversation on top: the screen beside it takes what a voice cannot.
42
+ {
43
+ id: "talk",
44
+ label: { de: "Sprachgespräch", en: "Live voice" },
45
+ kind: "page",
46
+ capabilities: EVERYTHING,
47
+ builtIn: true,
48
+ },
49
+ // The call screen: the camera and the conversation on a stage, the chat as the screen beside it.
50
+ {
51
+ id: "video",
52
+ label: { de: "Videoanruf", en: "Video call" },
53
+ kind: "page",
54
+ capabilities: EVERYTHING,
55
+ builtIn: true,
56
+ },
57
+ ];
58
+ /** The built-in runners that hold a live conversation: offered only where a speech model is set up. */
59
+ export const CONVERSATION_RUNNERS = ["talk", "video"];
60
+ /** The runners every wizard offers until the owner says otherwise. */
61
+ export const DEFAULT_ENABLED = ["steps", "chat"];
62
+ export const DEFAULT_RUNNER = "steps";
63
+ export const DEFAULT_RUNNER_SETTINGS = {
64
+ default: DEFAULT_RUNNER,
65
+ enabled: DEFAULT_ENABLED,
66
+ };
67
+ /** What a step hands on, or null when it hands on nothing (a page, a review, the result). */
68
+ export function outputKindOf(step) {
69
+ switch (step.type) {
70
+ case "agent":
71
+ return step.output?.fields?.length ? "data" : "text";
72
+ case "generate":
73
+ return step.asset;
74
+ case "widget":
75
+ return step.video ? "film" : "widget";
76
+ case "film":
77
+ return "film";
78
+ case "surface":
79
+ return "surface";
80
+ default:
81
+ return null;
82
+ }
83
+ }
84
+ /** Steps that take minutes: a door that cannot wait must come back for them. */
85
+ function takesMinutes(step) {
86
+ return step.type === "agent" || step.type === "generate" || step.type === "film";
87
+ }
88
+ /**
89
+ * Whether a runner runs a wizard, and where it hands off. Every step counts: since the AI can
90
+ * decide which branch a run takes and which fields a page shows, each step may be reached.
91
+ */
92
+ export function runnerFit(def, runner) {
93
+ const caps = runner.capabilities;
94
+ const gaps = [];
95
+ let blocked = false;
96
+ const canHandOff = caps.handoff.length > 0;
97
+ const byId = new Map(def.steps.map((s) => [s.id, s]));
98
+ const carries = (kind) => kind === null || caps.output.shows.includes(kind) || caps.output.pictures.includes(kind);
99
+ for (const step of def.steps) {
100
+ if (step.type === "page") {
101
+ // A decided field may or may not be shown: it counts as if it were.
102
+ const missing = step.fields.filter((f) => !caps.input.includes(f.kind));
103
+ const login = step.fields.some((f) => f.kind === "connection") && !caps.asks.includes("login");
104
+ if (missing.length || login) {
105
+ const why = missing.map((f) => f.label).join(", ") || "a sign-in";
106
+ gaps.push({ stepId: step.id, title: step.title, why });
107
+ if (!canHandOff) {
108
+ blocked = true;
109
+ }
110
+ }
111
+ }
112
+ else if (step.type === "review") {
113
+ if (!caps.review.includes("accept")) {
114
+ gaps.push({ stepId: step.id, title: step.title, why: "to be looked at" });
115
+ blocked = true;
116
+ continue;
117
+ }
118
+ const unseen = step.show.filter((id) => !carries(outputKindOf(byId.get(id) ?? step)));
119
+ if (unseen.length) {
120
+ gaps.push({
121
+ stepId: step.id,
122
+ title: step.title,
123
+ why: unseen.map((id) => byId.get(id)?.title ?? id).join(", "),
124
+ });
125
+ if (!canHandOff) {
126
+ blocked = true;
127
+ }
128
+ }
129
+ }
130
+ else if (takesMinutes(step) && !caps.waits) {
131
+ gaps.push({ stepId: step.id, title: step.title, why: "takes minutes" });
132
+ blocked = true;
133
+ }
134
+ // A sign-in a running step meets (an ask of kind login) can only be typed in a browser; it
135
+ // is not known in advance, so it hands off when it happens.
136
+ }
137
+ return {
138
+ runner: runner.id,
139
+ outcome: blocked ? "no" : gaps.length ? "handoff" : "full",
140
+ steps: gaps,
141
+ };
142
+ }
143
+ /** The fit of every runner given, in the order given. */
144
+ export function runnersFor(def, runners) {
145
+ return runners.map((r) => runnerFit(def, r));
146
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wizards",
3
- "version": "0.2.42",
3
+ "version": "0.2.43",
4
4
  "description": "Make a wish. Get your wizard. It guides you step by step. Let AI do the work. Runs on your machine, on the AI subscription you already have.",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "homepage": "https://engenty.ai",
@@ -1 +0,0 @@
1
- import{a as e,n as t,t as n}from"./jsx-runtime-D3jfb0Ew.js";import{t as r}from"./preload-helper-CNEI7N0N.js";import{a as i,f as a,g as o,i as s,j as c,s as l}from"./ui-Bxf6zX5k.js";var u=e(t(),1),d=e(n(),1);function f(e){switch(e.group){case`Added`:return{label:`NEW`,dot:`bg-moss`};case`Fixed`:return{label:`FIXED`,dot:`bg-amber`};case`Changed`:return{label:`CHANGED`,dot:`bg-cobalt`};case`Performance`:return{label:`PERFORMANCE`,dot:`bg-ember`};case`Deploy`:return{label:`DEPLOY`,dot:`bg-ink-4`};case`Docs`:return{label:`DOCS`,dot:`bg-ink-4`};default:return{label:`OTHER`,dot:`bg-ink-4`}}}var p=e=>e.version?e.version.replace(/^v/,``):c(`about.unreleased`),m=e=>e.timestamp?new Date(e.timestamp*1e3).toISOString().slice(0,10):``,h=e=>e.charAt(0).toUpperCase()+e.slice(1);function g(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=[];for(let t of e){if(`${p(t)} ${m(t)}`.toLowerCase().includes(n)){r.push(t);continue}let e=t.commits.filter(e=>`${f(e).label} ${e.scope??``} ${e.message}`.toLowerCase().includes(n));e.length>0&&r.push({...t,commits:e})}return r}async function _(e){if(e)try{let t=await fetch(`https://raw.githubusercontent.com/engenty/engenty-wizards/v${e}/apps/web/src/about/changelog.json`,{signal:AbortSignal.timeout(5e3)});if(t.ok)return await t.json()}catch{}return(await r(async()=>{let{default:e}=await import(`./changelog-BSVi9hHS.js`);return{default:e}},[])).default}function v({open:e,onClose:t,version:n}){let[r,v]=(0,u.useState)(null),[y,b]=(0,u.useState)(``);(0,u.useEffect)(()=>{if(!e||r)return;let t=!1;return _(n).then(e=>{t||v(e)}),()=>{t=!0}},[e,r,n]),(0,u.useEffect)(()=>{e||b(``)},[e]);let x=r?g(r,y):[];return(0,d.jsxs)(s,{open:e,onClose:t,title:c(`about.changelog`),wide:!0,children:[(0,d.jsx)(`p`,{className:`-mt-3 mb-4 text-[0.875rem] text-ink-3`,children:c(`about.changelogHint`)}),r===null?(0,d.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,d.jsx)(a,{})}):r.length===0?(0,d.jsx)(i,{children:c(`about.changelogEmpty`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l,{type:`search`,value:y,placeholder:c(`about.search`),onChange:e=>b(e.target.value)}),x.length===0?(0,d.jsx)(i,{children:c(`about.noMatches`)}):null,x.map(e=>(0,d.jsxs)(`section`,{className:`mt-6`,children:[(0,d.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[p(e),(0,d.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:m(e)})]}),(0,d.jsx)(`ul`,{className:`mt-3 flex flex-col gap-2`,children:e.commits.map(e=>{let t=f(e);return(0,d.jsxs)(`li`,{className:`flex items-start gap-2.5 text-[0.875rem]`,children:[(0,d.jsx)(`span`,{className:o(`mt-[7px] size-1.5 shrink-0 rounded-full`,t.dot)}),(0,d.jsxs)(`span`,{className:`min-w-0 text-ink-2`,children:[(0,d.jsxs)(`span`,{className:`font-semibold text-[0.75rem] text-ink tracking-wide`,children:[t.label,e.scope?` [${e.scope}]`:``]}),` `,h(e.message),e.breaking?(0,d.jsx)(`span`,{className:`ml-1.5 rounded-full bg-rose-tint px-1.5 py-0.5 font-medium text-[0.75rem] text-rose`,children:c(`about.breaking`)}):null]})]},e.id)})})]},e.version??`unreleased`))]})]})}export{v as ChangelogDialog};