@engenty/wizards-runtime 0.11.1 → 0.11.3

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 (147) hide show
  1. package/README.md +25 -6
  2. package/apps/runtime/dist/agents/studio-assistant.js +2 -2
  3. package/apps/runtime/dist/app.js +9 -0
  4. package/apps/runtime/dist/assistant/primer.js +2 -2
  5. package/apps/runtime/dist/auth/index.js +32 -7
  6. package/apps/runtime/dist/authoring/guide.js +19 -19
  7. package/apps/runtime/dist/docs/dev/index.md +1 -0
  8. package/apps/runtime/dist/docs/dev/licensing.md +85 -0
  9. package/apps/runtime/dist/docs/dev/meta.json +2 -1
  10. package/apps/runtime/dist/docs/dev/plugins/events.md +1 -1
  11. package/apps/runtime/dist/docs/dev/plugins/index.md +1 -1
  12. package/apps/runtime/dist/docs/dev/plugins/runners.md +2 -2
  13. package/apps/runtime/dist/docs/dev/plugins/space.md +1 -1
  14. package/apps/runtime/dist/docs/dev/plugins/studio.md +5 -4
  15. package/apps/runtime/dist/docs/dev/wizard-format/index.md +5 -5
  16. package/apps/runtime/dist/docs/dev/wizard-format/meta.json +1 -1
  17. package/apps/runtime/dist/docs/dev/wizard-format/motion-graphics-steps.md +55 -0
  18. package/apps/runtime/dist/docs/dev/wizard-format/review-and-result.md +2 -2
  19. package/apps/runtime/dist/docs/dev/wizard-format/themes.md +1 -1
  20. package/apps/runtime/dist/docs/dev/wizard-format/views-and-widgets.md +2 -2
  21. package/apps/runtime/dist/docs/dev/wizard-format/wizard-file.md +4 -4
  22. package/apps/runtime/dist/docs/user-guide/create-account.md +11 -4
  23. package/apps/runtime/dist/docs/user-guide/first-start.md +10 -2
  24. package/apps/runtime/dist/docs/user-guide/plugins.md +1 -1
  25. package/apps/runtime/dist/docs/user-guide/space.md +15 -7
  26. package/apps/runtime/dist/docs/user-guide/steps.md +17 -16
  27. package/apps/runtime/dist/docs/user-guide/troubleshooting.md +3 -3
  28. package/apps/runtime/dist/engine/requirements.js +7 -7
  29. package/apps/runtime/dist/engine/runner.js +8 -1
  30. package/apps/runtime/dist/engine/steps.js +3 -3
  31. package/apps/runtime/dist/files/storage.js +3 -3
  32. package/apps/runtime/dist/index.js +3 -0
  33. package/apps/runtime/dist/limits.js +16 -0
  34. package/apps/runtime/dist/manage.js +79 -2
  35. package/apps/runtime/dist/models.js +8 -8
  36. package/apps/runtime/dist/{film → motion-graphics}/project.js +54 -54
  37. package/apps/runtime/dist/{film → motion-graphics}/sounds.js +3 -3
  38. package/apps/runtime/dist/{film → motion-graphics}/step.js +37 -37
  39. package/apps/runtime/dist/{film → motion-graphics}/tools.js +1 -1
  40. package/apps/runtime/dist/render/downloads.js +2 -2
  41. package/apps/runtime/dist/render/guard.js +1 -1
  42. package/apps/runtime/dist/routes/delivery.js +1 -1
  43. package/apps/runtime/dist/routes/internal.js +1 -1
  44. package/apps/runtime/dist/routes/marketplace.js +29 -4
  45. package/apps/runtime/dist/routes/organization.js +114 -0
  46. package/apps/runtime/dist/routes/person.js +45 -0
  47. package/apps/runtime/dist/routes/reports.js +80 -0
  48. package/apps/runtime/dist/routes/runs.js +25 -1
  49. package/apps/runtime/dist/routes/studio.js +63 -7
  50. package/apps/runtime/dist/services/brand.js +1 -1
  51. package/apps/runtime/dist/services/manage-reports.js +190 -0
  52. package/apps/runtime/dist/services/marketplace.js +33 -1
  53. package/apps/runtime/dist/services/onboarding-find.js +123 -0
  54. package/apps/runtime/dist/services/onboarding.js +77 -16
  55. package/apps/runtime/dist/services/organization-context.js +40 -0
  56. package/apps/runtime/dist/services/pages.js +1 -1
  57. package/apps/runtime/dist/services/shipped-fonts.js +2 -1
  58. package/apps/runtime/dist/services/wizards.js +7 -0
  59. package/apps/runtime/dist/texts.js +12 -1
  60. package/apps/runtime/dist/widgets/render.js +9 -9
  61. package/apps/runtime/dist/widgets/runtime.js +3 -3
  62. package/apps/runtime/dist/widgets/step.js +20 -20
  63. package/apps/web/dist/assets/{AboutDialog-D2r8kBfV.js → AboutDialog-DlbfynVv.js} +1 -1
  64. package/apps/web/dist/assets/{ChangelogDialog-j7Z1YhNv.js → ChangelogDialog-DciD55wO.js} +1 -1
  65. package/apps/web/dist/assets/{CodeEditor-BTCMfVFJ.js → CodeEditor-9kXX-juf.js} +1 -1
  66. package/apps/web/dist/assets/EditorPage-ovstPrvJ.js +3 -0
  67. package/apps/web/dist/assets/{FlowPreview-BtVgtW7P.js → FlowPreview-BY3kJO9l.js} +1 -1
  68. package/apps/web/dist/assets/{Harness-H4Ue1HOd.js → Harness-BqcSaPmJ.js} +2 -2
  69. package/apps/web/dist/assets/Marketplace-DxcNtFdJ.js +2 -0
  70. package/apps/web/dist/assets/{NewWizardChannels-K1HOzkXf.js → NewWizardChannels-CmeAOy0q.js} +1 -1
  71. package/apps/web/dist/assets/NewWizardPage-C2Ne-QFZ.js +7 -0
  72. package/apps/web/dist/assets/OnboardingPage-CGEgLpx0.js +1 -0
  73. package/apps/web/dist/assets/PreviewPane-VnxYvrbF.js +10 -0
  74. package/apps/web/dist/assets/ProjectPage-CGpsFPJ4.js +1 -0
  75. package/apps/web/dist/assets/PublicRunner-b4vSNmVB.js +1 -0
  76. package/apps/web/dist/assets/{ReadOnly-Duk1YpNM.js → ReadOnly-C7Kk-1Vg.js} +1 -1
  77. package/apps/web/dist/assets/SettingsPage-Cgt3zVu5.js +2 -0
  78. package/apps/web/dist/assets/SetupPage-DmYnhiMq.js +1 -0
  79. package/apps/web/dist/assets/{SharePage-DvAUwrOl.js → SharePage-DMgm31Y_.js} +1 -1
  80. package/apps/web/dist/assets/changelog-CJYpF3Mx.js +1 -0
  81. package/apps/web/dist/assets/{coins-DSvwvqtQ.js → coins-Dd9IUAaR.js} +1 -1
  82. package/apps/web/dist/assets/i18n-QZC6TtrB.js +55 -0
  83. package/apps/web/dist/assets/index-Cfn8Jnfl.js +34 -0
  84. package/apps/web/dist/assets/index-DQc1EITf.css +1 -0
  85. package/apps/web/dist/assets/{oss-credits-BLVLXRzs.js → oss-credits-C6bPkfSE.js} +1 -1
  86. package/apps/web/dist/assets/{phone-xIUU1ZFn.js → phone-DKeaGjd9.js} +1 -1
  87. package/apps/web/dist/assets/runners-D2_oJdgS.js +1 -0
  88. package/apps/web/dist/assets/session-DBNhp6sF.js +2 -0
  89. package/apps/web/dist/assets/settings-menu-B09fSEin.js +1 -0
  90. package/apps/web/dist/assets/theme-CdWeSjNs.js +11 -0
  91. package/apps/web/dist/assets/{ui-6AgUKJhQ.js → ui-BPfapiMz.js} +6 -6
  92. package/apps/web/dist/assets/{upload-C8WgcG1g.js → upload-DCYRRi4d.js} +1 -1
  93. package/apps/web/dist/assets/{useMutation-BdCg6qrc.js → useMutation-BGqWiJkl.js} +1 -1
  94. package/apps/web/dist/assets/{volume-2-jlgQapiz.js → volume-2-D_FTVDPk.js} +1 -1
  95. package/apps/web/dist/assets/{wrench-Ca_TrBQk.js → wrench-BYwez0dN.js} +1 -1
  96. package/apps/web/dist/index.html +9 -9
  97. package/apps/web/dist/mcp/flow.html +32 -32
  98. package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +2 -2
  99. package/node_modules/@engenty/wizards/dist/plugin/studio.d.ts +5 -5
  100. package/node_modules/@engenty/wizards-shared/dist/addresses.d.ts +17 -0
  101. package/node_modules/@engenty/wizards-shared/dist/addresses.js +97 -0
  102. package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +11 -11
  103. package/node_modules/@engenty/wizards-shared/dist/definition.js +24 -23
  104. package/node_modules/@engenty/wizards-shared/dist/engenty/data-tables/columns-value.js +1 -0
  105. package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +9 -3
  106. package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +9 -3
  107. package/node_modules/@engenty/wizards-shared/dist/fit.d.ts +7 -2
  108. package/node_modules/@engenty/wizards-shared/dist/fit.js +23 -6
  109. package/node_modules/@engenty/wizards-shared/dist/marketplace-entry.d.ts +1 -1
  110. package/node_modules/@engenty/wizards-shared/dist/marketplace-entry.js +1 -1
  111. package/node_modules/@engenty/wizards-shared/dist/marketplace.d.ts +16 -7
  112. package/node_modules/@engenty/wizards-shared/dist/marketplace.js +7 -23
  113. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +15 -14
  114. package/node_modules/@engenty/wizards-shared/dist/run.js +30 -28
  115. package/node_modules/@engenty/wizards-shared/dist/runners.d.ts +1 -1
  116. package/node_modules/@engenty/wizards-shared/dist/runners.js +5 -5
  117. package/node_modules/@engenty/wizards-shared/dist/sectors.d.ts +24 -0
  118. package/node_modules/@engenty/wizards-shared/dist/sectors.js +319 -0
  119. package/node_modules/@engenty/wizards-shared/dist/store.d.ts +1 -1
  120. package/node_modules/@engenty/wizards-shared/dist/store.js +1 -2
  121. package/node_modules/@engenty/wizards-shared/dist/theme-look.d.ts +39 -0
  122. package/node_modules/@engenty/wizards-shared/dist/theme-look.js +112 -0
  123. package/node_modules/@engenty/wizards-shared/dist/theme.d.ts +0 -38
  124. package/node_modules/@engenty/wizards-shared/dist/theme.js +1 -108
  125. package/node_modules/@engenty/wizards-shared/dist/wizard-package.js +1 -0
  126. package/package.json +1 -1
  127. package/plugin/.claude-plugin/plugin.json +1 -1
  128. package/plugin/plugin.json +1 -1
  129. package/apps/runtime/dist/docs/dev/wizard-format/film-steps.md +0 -47
  130. package/apps/web/dist/assets/EditorPage-mx6XuEIw.js +0 -3
  131. package/apps/web/dist/assets/Marketplace-YEZDpGm9.js +0 -2
  132. package/apps/web/dist/assets/NewWizardPage-DSHVwwnU.js +0 -7
  133. package/apps/web/dist/assets/OnboardingPage-CoBNtV_1.js +0 -1
  134. package/apps/web/dist/assets/PreviewPane-z0-Glj7p.js +0 -10
  135. package/apps/web/dist/assets/ProjectPage-DFaPSeda.js +0 -1
  136. package/apps/web/dist/assets/PublicRunner-DgT4CApp.js +0 -1
  137. package/apps/web/dist/assets/SettingsPage-FimvOhQq.js +0 -2
  138. package/apps/web/dist/assets/SetupPage-BxEMrMtA.js +0 -1
  139. package/apps/web/dist/assets/changelog-CS9GmnXd.js +0 -1
  140. package/apps/web/dist/assets/i18n-UTsgNY5M.js +0 -55
  141. package/apps/web/dist/assets/index-DHIXX69l.js +0 -20
  142. package/apps/web/dist/assets/index-Mt1sNdPx.css +0 -1
  143. package/apps/web/dist/assets/runners-CrSLA6HI.js +0 -1
  144. package/apps/web/dist/assets/session-CbWzkHl0.js +0 -2
  145. package/apps/web/dist/assets/settings-menu-DoRItnPf.js +0 -1
  146. package/apps/web/dist/assets/theme-znovbShL.js +0 -11
  147. /package/apps/runtime/dist/{film → motion-graphics}/skills.js +0 -0
@@ -1,4 +1,4 @@
1
- import { type TableColumn } from "./engenty/data-tables/index.js";
1
+ import type { TableColumn } from "./engenty/data-tables/columns.js";
2
2
  /**
3
3
  * What a wizard keeps between runs for one person: lists (tabular data), files and connected
4
4
  * accounts. The wizard definition says which lists and connections exist; the content belongs
@@ -1,5 +1,4 @@
1
- // SPDX-License-Identifier: FSL-1.1-MIT OR MIT
2
- import { coerceRowValues, mergeRowValues } from "./engenty/data-tables/index.js";
1
+ import { coerceRowValues, mergeRowValues } from "./engenty/data-tables/columns-value.js";
3
2
  import { readNumber } from "./numbers.js";
4
3
  export const STORE_LIMITS = {
5
4
  fileBytes: 15_000_000,
@@ -0,0 +1,39 @@
1
+ import type { RunFontFace, RunTheme } from "./run.js";
2
+ import { type BuiltInTheme, type ShippedFont, type Theme } from "./theme.js";
3
+ /**
4
+ * The theme a wizard's pages show: what the place showing it asks for (`asked`, an embed's
5
+ * `data-theme`), where the wizard offers it and the space has it; else the first of its chain
6
+ * the space has (a built-in name counts). Undefined: none of them, so the brand.
7
+ */
8
+ export declare function chosenTheme(chain: readonly string[] | undefined, themes: readonly Theme[], asked?: string | null): Theme | BuiltInTheme | undefined;
9
+ /**
10
+ * The look of a wizard's pages: the space's brand (`runTheme`), or the theme the wizard chose
11
+ * built on its base. `host` is drawn as the brand on pages of our own; a host that passes a
12
+ * look of its own puts it over this. The base's colours stay in `accent` and `background`; the
13
+ * theme's colours for light and dark pages go into `modes`, and the page takes those of what it
14
+ * shows.
15
+ */
16
+ export declare function themedLook(brand: RunTheme, theme: Theme | BuiltInTheme | undefined): RunTheme;
17
+ /** A family looks like a serif by its name: what takes its place is a serif too. */
18
+ export declare const serifFamily: (family: string) => boolean;
19
+ /** The shipped font that shows where a brand font does not load: one of its kind. */
20
+ export declare const shippedLike: (family: string) => ShippedFont;
21
+ /** A shipped font's name in its package and its files: "Bricolage Grotesque" → bricolage-grotesque. */
22
+ export declare const shippedFontSlug: (family: ShippedFont) => string;
23
+ /**
24
+ * Where the runtime serves a shipped font's stylesheet, for pages that are not its own (a host's
25
+ * OpenUI chat); null for a family that is not one of ours. Its files sit next to it.
26
+ */
27
+ export declare function shippedFontStylesheet(family: string): string | null;
28
+ /**
29
+ * A family as CSS takes it, with a fallback of its kind while it loads or where it is missing. A
30
+ * brand font with a source (`faces`) names the shipped font of its kind next: it shows if the
31
+ * brand font does not load.
32
+ */
33
+ export declare function fontStack(family: string, faces?: readonly RunFontFace[]): string;
34
+ /** The colours a page shows in light or dark: the theme's for that mode, else the base's. */
35
+ export declare function lookColours(look: Pick<RunTheme, "accent" | "background" | "modes">, mode: "light" | "dark"): {
36
+ accent: string | null;
37
+ background: string | null;
38
+ text: string | null;
39
+ };
@@ -0,0 +1,112 @@
1
+ import { luminance } from "./projects.js";
2
+ import { BUILT_IN_THEMES, SHIPPED_FONTS, themeColors, themeOffered, } from "./theme.js";
3
+ // --- the look of a run ---------------------------------------------------------------------
4
+ // Which theme a wizard's pages show and how they look with it: the theme over the space's
5
+ // brand, font stacks, and the colours of light and dark pages. The theme's values: theme.ts.
6
+ /**
7
+ * The theme a wizard's pages show: what the place showing it asks for (`asked`, an embed's
8
+ * `data-theme`), where the wizard offers it and the space has it; else the first of its chain
9
+ * the space has (a built-in name counts). Undefined: none of them, so the brand.
10
+ */
11
+ export function chosenTheme(chain, themes, asked) {
12
+ const ask = asked && themeOffered(asked, chain) ? [asked] : [];
13
+ for (const id of [...ask, ...(chain ?? [])]) {
14
+ if (BUILT_IN_THEMES.includes(id)) {
15
+ return id;
16
+ }
17
+ const found = themes.find((t) => t.id === id);
18
+ if (found) {
19
+ return found;
20
+ }
21
+ }
22
+ return undefined;
23
+ }
24
+ /** The engenty wizards look without a brand: what `default` shows and builds on. */
25
+ const NEUTRAL = {
26
+ accent: null,
27
+ second: null,
28
+ background: null,
29
+ display: null,
30
+ body: null,
31
+ faces: [],
32
+ dark: false,
33
+ pinned: false,
34
+ modes: null,
35
+ prefer: null,
36
+ shape: null,
37
+ effects: [],
38
+ };
39
+ /**
40
+ * The look of a wizard's pages: the space's brand (`runTheme`), or the theme the wizard chose
41
+ * built on its base. `host` is drawn as the brand on pages of our own; a host that passes a
42
+ * look of its own puts it over this. The base's colours stay in `accent` and `background`; the
43
+ * theme's colours for light and dark pages go into `modes`, and the page takes those of what it
44
+ * shows.
45
+ */
46
+ export function themedLook(brand, theme) {
47
+ if (theme === undefined || theme === "brand" || theme === "host") {
48
+ return brand;
49
+ }
50
+ if (theme === "default") {
51
+ return NEUTRAL;
52
+ }
53
+ const base = theme.base === "default" ? NEUTRAL : brand;
54
+ // `brand` is the brand's font for the role, whatever the theme builds on.
55
+ const font = (name, role) => name === "brand" ? brand[role] : (name ?? base[role]);
56
+ const display = font(theme.fonts?.heading, "display");
57
+ const body = font(theme.fonts?.text, "body");
58
+ const schemes = (theme.colors ?? []).map((c) => c.scheme);
59
+ const only = schemes.length === 1 ? schemes[0] : null;
60
+ const shown = schemes[0] ?? (base.dark ? "dark" : "light");
61
+ const background = themeColors(theme, shown)?.background;
62
+ return {
63
+ ...base,
64
+ display,
65
+ body,
66
+ faces: brand.faces.filter((f) => f.family === display || f.family === body),
67
+ dark: background ? luminance(background) < 0.18 : shown === "dark",
68
+ pinned: only !== null,
69
+ modes: schemes.length
70
+ ? { light: themeColors(theme, "light") ?? null, dark: themeColors(theme, "dark") ?? null }
71
+ : null,
72
+ prefer: schemes.length === 2 ? shown : null,
73
+ shape: theme.shape ?? null,
74
+ effects: theme.effects ?? [],
75
+ };
76
+ }
77
+ const SANS = "ui-sans-serif, system-ui, sans-serif";
78
+ const SERIF = "ui-serif, Georgia, serif";
79
+ const SERIFS = /serif|fraunces|playfair|lora|garamond|antiqua|baskerville|caslon|bodoni|didot|times|georgia|merriweather|tiempos/i;
80
+ /** A family looks like a serif by its name: what takes its place is a serif too. */
81
+ export const serifFamily = (family) => SERIFS.test(family) && !/sans/i.test(family);
82
+ /** The shipped font that shows where a brand font does not load: one of its kind. */
83
+ export const shippedLike = (family) => serifFamily(family) ? "Lora" : "Inter";
84
+ /** A shipped font's name in its package and its files: "Bricolage Grotesque" → bricolage-grotesque. */
85
+ export const shippedFontSlug = (family) => family.toLowerCase().replace(/ /g, "-");
86
+ /**
87
+ * Where the runtime serves a shipped font's stylesheet, for pages that are not its own (a host's
88
+ * OpenUI chat); null for a family that is not one of ours. Its files sit next to it.
89
+ */
90
+ export function shippedFontStylesheet(family) {
91
+ return SHIPPED_FONTS.includes(family)
92
+ ? `/api/public/fonts/shipped/${shippedFontSlug(family)}.css`
93
+ : null;
94
+ }
95
+ /**
96
+ * A family as CSS takes it, with a fallback of its kind while it loads or where it is missing. A
97
+ * brand font with a source (`faces`) names the shipped font of its kind next: it shows if the
98
+ * brand font does not load.
99
+ */
100
+ export function fontStack(family, faces = []) {
101
+ const next = faces.some((f) => f.family === family) ? `"${shippedLike(family)}", ` : "";
102
+ return `"${family.replace(/"/g, "")}", ${next}${serifFamily(family) ? SERIF : SANS}`;
103
+ }
104
+ /** The colours a page shows in light or dark: the theme's for that mode, else the base's. */
105
+ export function lookColours(look, mode) {
106
+ const own = look.modes?.[mode];
107
+ return {
108
+ accent: own?.accent ?? look.accent,
109
+ background: own?.background ?? look.background,
110
+ text: own?.text ?? null,
111
+ };
112
+ }
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import { THEME_ID } from "./definition.js";
3
- import type { RunFontFace, RunTheme } from "./run.js";
4
3
  /** The themes every space has. Nobody defines or publishes them. */
5
4
  export declare const BUILT_IN_THEMES: readonly ["brand", "host", "default"];
6
5
  export type BuiltInTheme = (typeof BUILT_IN_THEMES)[number];
@@ -135,42 +134,5 @@ export declare function themeIdFrom(title: string): string;
135
134
  * wizard's own chain. The host always wins, but only among what the wizard offers.
136
135
  */
137
136
  export declare function themeOffered(asked: string, chain: readonly string[] | undefined): boolean;
138
- /**
139
- * The theme a wizard's pages show: what the place showing it asks for (`asked`, an embed's
140
- * `data-theme`), where the wizard offers it and the space has it; else the first of its chain
141
- * the space has (a built-in name counts). Undefined: none of them, so the brand.
142
- */
143
- export declare function chosenTheme(chain: readonly string[] | undefined, themes: readonly Theme[], asked?: string | null): Theme | BuiltInTheme | undefined;
144
- /**
145
- * The look of a wizard's pages: the space's brand (`runTheme`), or the theme the wizard chose
146
- * built on its base. `host` is drawn as the brand on pages of our own; a host that passes a
147
- * look of its own puts it over this. The base's colours stay in `accent` and `background`; the
148
- * theme's colours for light and dark pages go into `modes`, and the page takes those of what it
149
- * shows.
150
- */
151
- export declare function themedLook(brand: RunTheme, theme: Theme | BuiltInTheme | undefined): RunTheme;
152
- /** A family looks like a serif by its name: what takes its place is a serif too. */
153
- export declare const serifFamily: (family: string) => boolean;
154
- /** The shipped font that shows where a brand font does not load: one of its kind. */
155
- export declare const shippedLike: (family: string) => ShippedFont;
156
- /** A shipped font's name in its package and its files: "Bricolage Grotesque" → bricolage-grotesque. */
157
- export declare const shippedFontSlug: (family: ShippedFont) => string;
158
- /**
159
- * Where the runtime serves a shipped font's stylesheet, for pages that are not its own (a host's
160
- * OpenUI chat); null for a family that is not one of ours. Its files sit next to it.
161
- */
162
- export declare function shippedFontStylesheet(family: string): string | null;
163
- /**
164
- * A family as CSS takes it, with a fallback of its kind while it loads or where it is missing. A
165
- * brand font with a source (`faces`) names the shipped font of its kind next: it shows if the
166
- * brand font does not load.
167
- */
168
- export declare function fontStack(family: string, faces?: readonly RunFontFace[]): string;
169
137
  /** A theme's colours for light or dark pages, without the scheme's name; undefined: it has none. */
170
138
  export declare function themeColors(theme: Pick<Theme, "colors"> | undefined, scheme: ColorScheme): ThemeColours | undefined;
171
- /** The colours a page shows in light or dark: the theme's for that mode, else the base's. */
172
- export declare function lookColours(look: Pick<RunTheme, "accent" | "background" | "modes">, mode: "light" | "dark"): {
173
- accent: string | null;
174
- background: string | null;
175
- text: string | null;
176
- };
@@ -1,6 +1,6 @@
1
+ // SPDX-License-Identifier: FSL-1.1-MIT OR MIT
1
2
  import { z } from "zod";
2
3
  import { ENGENTY_COSTUMES, THEME_ID } from "./definition.js";
3
- import { luminance } from "./projects.js";
4
4
  // --- themes ------------------------------------------------------------------------
5
5
  // How a wizard's pages look, as a document of its own: values only (colours for light and dark,
6
6
  // fonts, shape, effects from the runner's library), kept in the space and shipped in a wizard
@@ -164,104 +164,6 @@ export function themeIdFrom(title) {
164
164
  export function themeOffered(asked, chain) {
165
165
  return BUILT_IN_THEMES.includes(asked) || Boolean(chain?.includes(asked));
166
166
  }
167
- /**
168
- * The theme a wizard's pages show: what the place showing it asks for (`asked`, an embed's
169
- * `data-theme`), where the wizard offers it and the space has it; else the first of its chain
170
- * the space has (a built-in name counts). Undefined: none of them, so the brand.
171
- */
172
- export function chosenTheme(chain, themes, asked) {
173
- const ask = asked && themeOffered(asked, chain) ? [asked] : [];
174
- for (const id of [...ask, ...(chain ?? [])]) {
175
- if (BUILT_IN_THEMES.includes(id)) {
176
- return id;
177
- }
178
- const found = themes.find((t) => t.id === id);
179
- if (found) {
180
- return found;
181
- }
182
- }
183
- return undefined;
184
- }
185
- /** The engenty wizards look without a brand: what `default` shows and builds on. */
186
- const NEUTRAL = {
187
- accent: null,
188
- second: null,
189
- background: null,
190
- display: null,
191
- body: null,
192
- faces: [],
193
- dark: false,
194
- pinned: false,
195
- modes: null,
196
- prefer: null,
197
- shape: null,
198
- effects: [],
199
- };
200
- /**
201
- * The look of a wizard's pages: the space's brand (`runTheme`), or the theme the wizard chose
202
- * built on its base. `host` is drawn as the brand on pages of our own; a host that passes a
203
- * look of its own puts it over this. The base's colours stay in `accent` and `background`; the
204
- * theme's colours for light and dark pages go into `modes`, and the page takes those of what it
205
- * shows.
206
- */
207
- export function themedLook(brand, theme) {
208
- if (theme === undefined || theme === "brand" || theme === "host") {
209
- return brand;
210
- }
211
- if (theme === "default") {
212
- return NEUTRAL;
213
- }
214
- const base = theme.base === "default" ? NEUTRAL : brand;
215
- // `brand` is the brand's font for the role, whatever the theme builds on.
216
- const font = (name, role) => name === "brand" ? brand[role] : (name ?? base[role]);
217
- const display = font(theme.fonts?.heading, "display");
218
- const body = font(theme.fonts?.text, "body");
219
- const schemes = (theme.colors ?? []).map((c) => c.scheme);
220
- const only = schemes.length === 1 ? schemes[0] : null;
221
- const shown = schemes[0] ?? (base.dark ? "dark" : "light");
222
- const background = themeColors(theme, shown)?.background;
223
- return {
224
- ...base,
225
- display,
226
- body,
227
- faces: brand.faces.filter((f) => f.family === display || f.family === body),
228
- dark: background ? luminance(background) < 0.18 : shown === "dark",
229
- pinned: only !== null,
230
- modes: schemes.length
231
- ? { light: themeColors(theme, "light") ?? null, dark: themeColors(theme, "dark") ?? null }
232
- : null,
233
- prefer: schemes.length === 2 ? shown : null,
234
- shape: theme.shape ?? null,
235
- effects: theme.effects ?? [],
236
- };
237
- }
238
- const SANS = "ui-sans-serif, system-ui, sans-serif";
239
- const SERIF = "ui-serif, Georgia, serif";
240
- const SERIFS = /serif|fraunces|playfair|lora|garamond|antiqua|baskerville|caslon|bodoni|didot|times|georgia|merriweather|tiempos/i;
241
- /** A family looks like a serif by its name: what takes its place is a serif too. */
242
- export const serifFamily = (family) => SERIFS.test(family) && !/sans/i.test(family);
243
- /** The shipped font that shows where a brand font does not load: one of its kind. */
244
- export const shippedLike = (family) => serifFamily(family) ? "Lora" : "Inter";
245
- /** A shipped font's name in its package and its files: "Bricolage Grotesque" → bricolage-grotesque. */
246
- export const shippedFontSlug = (family) => family.toLowerCase().replace(/ /g, "-");
247
- /**
248
- * Where the runtime serves a shipped font's stylesheet, for pages that are not its own (a host's
249
- * OpenUI chat); null for a family that is not one of ours. Its files sit next to it.
250
- */
251
- export function shippedFontStylesheet(family) {
252
- return SHIPPED_FONTS.includes(family)
253
- ? `/api/public/fonts/shipped/${shippedFontSlug(family)}.css`
254
- : null;
255
- }
256
- /**
257
- * A family as CSS takes it, with a fallback of its kind while it loads or where it is missing. A
258
- * brand font with a source (`faces`) names the shipped font of its kind next: it shows if the
259
- * brand font does not load.
260
- */
261
- export function fontStack(family, faces = []) {
262
- const next = faces.some((f) => f.family === family) ? `"${shippedLike(family)}", ` : "";
263
- return `"${family.replace(/"/g, "")}", ${next}${serifFamily(family) ? SERIF : SANS}`;
264
- }
265
167
  /** A theme's colours for light or dark pages, without the scheme's name; undefined: it has none. */
266
168
  export function themeColors(theme, scheme) {
267
169
  const found = theme?.colors?.find((c) => c.scheme === scheme);
@@ -271,12 +173,3 @@ export function themeColors(theme, scheme) {
271
173
  const { scheme: _, ...colours } = found;
272
174
  return colours;
273
175
  }
274
- /** The colours a page shows in light or dark: the theme's for that mode, else the base's. */
275
- export function lookColours(look, mode) {
276
- const own = look.modes?.[mode];
277
- return {
278
- accent: own?.accent ?? look.accent,
279
- background: own?.background ?? look.background,
280
- text: own?.text ?? null,
281
- };
282
- }
@@ -1,3 +1,4 @@
1
+ // SPDX-License-Identifier: FSL-1.1-MIT OR MIT
1
2
  import { z } from "zod";
2
3
  import { DEFINITION_VERSION } from "./definition.js";
3
4
  import { MAX_WIZARD_THEMES, themeSchema } from "./theme.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engenty/wizards-runtime",
3
- "version": "0.11.1",
3
+ "version": "0.11.3",
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. The runtime, which `npx wizards` installs.",
5
5
  "license": "FSL-1.1-MIT AND CC-BY-4.0",
6
6
  "homepage": "https://engenty.ai",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wizards",
3
3
  "displayName": "engenty wizards",
4
- "version": "0.11.1",
4
+ "version": "0.11.3",
5
5
  "description": "Build page-by-page AI wizards that people open on a shared link — designed, tested and published from Claude Code — run your published ones in the chat, and keep them in a pane beside it.",
6
6
  "author": {
7
7
  "name": "engenty"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "engenty-wizards",
4
- "version": "0.11.1",
4
+ "version": "0.11.3",
5
5
  "description": "Build page-by-page AI wizards that people open on a shared link, test and publish them from the chat, and run your published ones here.",
6
6
  "author": {
7
7
  "name": "engenty",
@@ -1,47 +0,0 @@
1
- ---
2
- title: Films
3
- description: A film step has the AI client on your computer write a film as code, and the runtime renders it.
4
- version: 0.9.6
5
- ---
6
-
7
- A `film` step makes a motion-graphics film. The AI client on your computer (Claude Code) writes
8
- the film as HTML, CSS and JavaScript in a folder of its own. It looks at its frames and fixes
9
- them, and engenty wizards renders the MP4.
10
-
11
- A film step runs only where Claude Code is set up as your AI subscription. It never runs on
12
- credits or in the cloud, and it takes 5 to 40 minutes.
13
-
14
- ```json
15
- {
16
- "id": "film", "type": "film", "title": "Make the film",
17
- "brief": "A 30-second explainer of {{product}}, calm and bright. Use the voice-over.",
18
- "kit": "kits/explainer.zip",
19
- "inputs": { "voice": "steps.voice", "script": "steps.script" },
20
- "format": "16:9", "seconds": 30
21
- }
22
- ```
23
-
24
- | Key | What it does |
25
- |---|---|
26
- | `brief` | What the film is: story, look, what to use. A template |
27
- | `skills` | Skill packages the client reads. The default is `["hyperframes"]`. A workspace package is `skills/<name>`, a folder with a `SKILL.md` |
28
- | `kit` | A style kit in the workspace, as a `.zip`: a showreel made once with its rules, helpers and stills. Every film of the wizard is made to it |
29
- | `inputs` | What the film is made from: a name (lowercase letters, digits, `-`) → a field id or `steps.<id>` |
30
- | `format` | `16:9` (the default), `9:16` or `1:1` |
31
- | `from` | `steps.<id>` of an earlier film step. This film starts from that one’s code and lays it out for its own format |
32
- | `seconds` | About how long the film runs, 3 to 600 |
33
- | `model`, `effort` | The model class, `low` by default. The kit carries the craft |
34
-
35
- Files among the inputs (uploads, voice lines, pictures) are copied into `input/<name>/`. Text is
36
- written to `input/<name>.md`, JSON to `input/<name>.json`.
37
-
38
- ## A film in steps
39
-
40
- A film that convinces is made in stages, each with its own review:
41
-
42
- 1. An agent step writes the research and the script.
43
- 2. A `generate` step with `asset` `voice` reads the whole script.
44
- 3. The film step makes the film from the voice, the pictures and the script.
45
-
46
- The film step finds the word timings in the voice-over itself. Sounds come from a fixed catalog.
47
- A film leaves the page as a video file, so it shows the EU’s “AI” label in the picture.