@engenty/wizards-runtime 0.12.2 → 0.13.0

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 (96) hide show
  1. package/apps/runtime/dist/agents/studio-assistant.js +25 -4
  2. package/apps/runtime/dist/app.js +11 -2
  3. package/apps/runtime/dist/credits/estimate.js +3 -3
  4. package/apps/runtime/dist/docs/dev/wizard-format/agent-steps.md +20 -2
  5. package/apps/runtime/dist/docs/user-guide/models.md +105 -30
  6. package/apps/runtime/dist/docs/user-guide/together.md +15 -2
  7. package/apps/runtime/dist/engine/decide.js +1 -1
  8. package/apps/runtime/dist/engine/requirements.js +139 -11
  9. package/apps/runtime/dist/engine/runner.js +47 -5
  10. package/apps/runtime/dist/engine/steps.js +13 -5
  11. package/apps/runtime/dist/engine/template.js +17 -0
  12. package/apps/runtime/dist/link-preview.js +9 -0
  13. package/apps/runtime/dist/manage.js +25 -0
  14. package/apps/runtime/dist/mcp/handler.js +55 -1
  15. package/apps/runtime/dist/mcp/seen.js +47 -0
  16. package/apps/runtime/dist/models.js +202 -11
  17. package/apps/runtime/dist/motion-graphics/step.js +2 -2
  18. package/apps/runtime/dist/prompts/goose.md +8 -7
  19. package/apps/runtime/dist/prompts/safety.md +18 -0
  20. package/apps/runtime/dist/prompts/step.md +1 -1
  21. package/apps/runtime/dist/routes/marketplace.js +3 -3
  22. package/apps/runtime/dist/routes/runs.js +5 -0
  23. package/apps/runtime/dist/routes/studio.js +103 -4
  24. package/apps/runtime/dist/safety.js +60 -18
  25. package/apps/runtime/dist/services/manage-reports.js +3 -0
  26. package/apps/runtime/dist/services/marketplace.js +7 -31
  27. package/apps/runtime/dist/services/pages.js +6 -2
  28. package/apps/runtime/dist/services/shares.js +5 -0
  29. package/apps/runtime/dist/services/spaces.js +15 -1
  30. package/apps/runtime/dist/texts.js +6 -0
  31. package/apps/runtime/dist/tools/index.js +3 -2
  32. package/apps/web/dist/assets/AboutDialog-B-JxkELB.js +1 -0
  33. package/apps/web/dist/assets/{ChangelogDialog-CKLgFL6r.js → ChangelogDialog-SwyId00t.js} +1 -1
  34. package/apps/web/dist/assets/{CodeEditor-B3nto_26.js → CodeEditor-BwZsk5Al.js} +1 -1
  35. package/apps/web/dist/assets/EditorPage-DQ_2FOzI.js +3 -0
  36. package/apps/web/dist/assets/{FlowPreview-zJCtixSi.js → FlowPreview-DtSpjVTl.js} +1 -1
  37. package/apps/web/dist/assets/Marketplace-DoH4YO3D.js +2 -0
  38. package/apps/web/dist/assets/{NewWizardChannels-B4N7GIYh.js → NewWizardChannels-Tgoexgj4.js} +1 -1
  39. package/apps/web/dist/assets/NewWizardPage-B24AF482.js +7 -0
  40. package/apps/web/dist/assets/OnboardingPage-BEvq4slJ.js +1 -0
  41. package/apps/web/dist/assets/PreviewPane-B_v7Y8R7.js +10 -0
  42. package/apps/web/dist/assets/ProjectPage-ClRuhFJo.js +10 -0
  43. package/apps/web/dist/assets/PublicRunner-MicrpVsv.js +1 -0
  44. package/apps/web/dist/assets/{ReadOnly-C9oGMkUB.js → ReadOnly-BXjv-MSv.js} +1 -1
  45. package/apps/web/dist/assets/SettingsPage-DY8O1r43.js +2 -0
  46. package/apps/web/dist/assets/SetupPage-BOVkVpMu.js +1 -0
  47. package/apps/web/dist/assets/{SharePage-DdMm1Y8K.js → SharePage-DXGzJSnR.js} +1 -1
  48. package/apps/web/dist/assets/SkillEditor-BzzTDeaU.js +1 -0
  49. package/apps/web/dist/assets/changelog-BLdS-0Bj.js +1 -0
  50. package/apps/web/dist/assets/{code-xml-Hx7YxCg0.js → code-xml-TwKzzMtA.js} +1 -1
  51. package/apps/web/dist/assets/{eye-BkMFLnYu.js → eye-Brd-xPUJ.js} +1 -1
  52. package/apps/web/dist/assets/i18n-8-Sw11tB.js +55 -0
  53. package/apps/web/dist/assets/index-OsdQFHmh.js +49 -0
  54. package/apps/web/dist/assets/index-QPipX5Fi.css +1 -0
  55. package/apps/web/dist/assets/{lock-CGXM95Mi.js → lock-C0uxcOlq.js} +1 -1
  56. package/apps/web/dist/assets/{phone-DMfwuh9V.js → phone-DhkHteoJ.js} +1 -1
  57. package/apps/web/dist/assets/{runners-D5qz6b_s.js → runners-G-XYaDgR.js} +1 -1
  58. package/apps/web/dist/assets/{session-DRy0k0nh.js → session-BWI-KENJ.js} +1 -1
  59. package/apps/web/dist/assets/theme-D7krsx0_.js +11 -0
  60. package/apps/web/dist/assets/ui-DSXG3f49.js +83 -0
  61. package/apps/web/dist/assets/{upload-DQJwLSGj.js → upload-BYZTwJTD.js} +1 -1
  62. package/apps/web/dist/assets/{useMutation-C20c2EH3.js → useMutation-D0QP_k2-.js} +1 -1
  63. package/apps/web/dist/assets/{volume-2-CC5qamYT.js → volume-2-CVHoxdGM.js} +1 -1
  64. package/apps/web/dist/index.html +9 -9
  65. package/apps/web/dist/mcp/flow.html +56 -56
  66. package/node_modules/@engenty/wizards-shared/dist/assistant.d.ts +1 -0
  67. package/node_modules/@engenty/wizards-shared/dist/assistant.js +5 -0
  68. package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +107 -0
  69. package/node_modules/@engenty/wizards-shared/dist/definition.js +67 -4
  70. package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +12 -0
  71. package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +12 -0
  72. package/node_modules/@engenty/wizards-shared/dist/marketplace.d.ts +0 -5
  73. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +61 -0
  74. package/node_modules/@engenty/wizards-shared/dist/run.js +50 -0
  75. package/node_modules/@engenty/wizards-shared/dist/tiers.d.ts +195 -0
  76. package/node_modules/@engenty/wizards-shared/dist/tiers.js +98 -0
  77. package/package.json +1 -1
  78. package/plugin/.claude-plugin/plugin.json +1 -1
  79. package/plugin/plugin.json +1 -1
  80. package/apps/web/dist/assets/AboutDialog-CLgnoYTI.js +0 -1
  81. package/apps/web/dist/assets/EditorPage-D9JDdAAI.js +0 -3
  82. package/apps/web/dist/assets/Marketplace-D4e0Oac9.js +0 -2
  83. package/apps/web/dist/assets/NewWizardPage-Dpt0Mzk8.js +0 -7
  84. package/apps/web/dist/assets/OnboardingPage-CDoYVjRC.js +0 -1
  85. package/apps/web/dist/assets/PreviewPane-DPB5nEd5.js +0 -10
  86. package/apps/web/dist/assets/ProjectPage-408YOoNa.js +0 -10
  87. package/apps/web/dist/assets/PublicRunner-BZ66xdRX.js +0 -1
  88. package/apps/web/dist/assets/SettingsPage-Dq3AZwJS.js +0 -2
  89. package/apps/web/dist/assets/SetupPage-CP3lbyZc.js +0 -1
  90. package/apps/web/dist/assets/SkillEditor-b5NMFB90.js +0 -1
  91. package/apps/web/dist/assets/changelog-82-DHogQ.js +0 -1
  92. package/apps/web/dist/assets/i18n-CKKh3Pn0.js +0 -55
  93. package/apps/web/dist/assets/index-Cy2NHzAx.js +0 -49
  94. package/apps/web/dist/assets/index-wR_-1hfN.css +0 -1
  95. package/apps/web/dist/assets/theme-DNPm6r4e.js +0 -11
  96. package/apps/web/dist/assets/ui-CwFQAfE-.js +0 -83
@@ -0,0 +1,195 @@
1
+ /**
2
+ * Model tiers: the managed model lists of an organization with compliance needs, and how its
3
+ * admins share out the tier's models (its policy). The Manage-App serves both in
4
+ * `GET /v1/tenants/:id` and enforces them in its gateway (docs/manage-contract.md, "Model
5
+ * tiers"); the runtime shows them and names the class a step asks for. Behind `modelTiers`.
6
+ */
7
+ import { z } from "zod";
8
+ import { type Effort, type Maker, type StepClass } from "./definition.js";
9
+ /** What a call is for: a run, the studio outside a run (Goose, the editor), a work chat. */
10
+ export type Purpose = "wizard" | "assistant" | "work";
11
+ /** Why a class is not offered in a tier. */
12
+ type TierReason = "unbound" | "region" | "retention" | "training" | "maker";
13
+ /** What a class (`high`, `anthropic/high`, `image`) runs on in a tier, or why it doesn't. */
14
+ export type TierClass = {
15
+ model: string;
16
+ name: string;
17
+ route: string | null;
18
+ region: string | null;
19
+ } | {
20
+ model: null;
21
+ name: string | null;
22
+ reason: TierReason;
23
+ };
24
+ /** A model the tier offers (`tier.models`): in its list and passing its rules now. */
25
+ export interface TierModel {
26
+ /** The catalog id: "anthropic/claude-sonnet-5.5". */
27
+ id: string;
28
+ name: string;
29
+ maker: string;
30
+ kind: "text" | "image" | "video" | "audio" | "speech";
31
+ /** The offered classes it runs on now: "standard", "anthropic/standard". */
32
+ classes: string[];
33
+ /** The efforts it takes; empty for none. */
34
+ efforts: Effort[];
35
+ /** In the tier's preselection: what the studio's choosers show after Auto. */
36
+ chooser: boolean;
37
+ }
38
+ export interface ModelTier {
39
+ id: string;
40
+ /** Shown in the studio: "EU Private". */
41
+ name: string;
42
+ /** Set by contract: the organization's owner can't pick another. */
43
+ locked: boolean;
44
+ rules: {
45
+ /** Where calls may run ("EU"); null: anywhere. */
46
+ regions: string[] | null;
47
+ zdr: boolean;
48
+ noTraining: boolean;
49
+ search: boolean;
50
+ /** An evaluation model may answer decisions. */
51
+ decisions: boolean;
52
+ };
53
+ /** Every class the gateway knows; one missing is not offered. */
54
+ classes: Record<string, TierClass>;
55
+ /** What the tier offers, the preselection first. */
56
+ models: TierModel[];
57
+ /** Every tier there is, in order, and whether the plan offers it. */
58
+ choices: {
59
+ id: string;
60
+ name: string;
61
+ inPlan: boolean;
62
+ }[];
63
+ }
64
+ export interface PurposePolicy {
65
+ /** Way C: the classes and models people may pick; null: the whole tier. */
66
+ models: string[] | null;
67
+ /** Way B: the class or model a new step or chat starts on. */
68
+ default: string | null;
69
+ /** Way B: the highest effort people may set. */
70
+ effortCap: Effort | null;
71
+ /** Way C: the efforts offered per entry of `models`. */
72
+ efforts: Record<string, Effort[]> | null;
73
+ }
74
+ export interface ModelPolicy {
75
+ /** A: engenty picks · B: admins set defaults · C: approved models only. */
76
+ way: "A" | "B" | "C";
77
+ purposes: Record<Purpose, PurposePolicy>;
78
+ credits: boolean;
79
+ ownKeys: boolean;
80
+ /** A member's AI client on their own subscription, for Goose. */
81
+ subscriptions: boolean;
82
+ /** A model on a member's computer, for Goose. */
83
+ localModels: boolean;
84
+ /** Apps connected to a space over MCP: those with local models, those on subscriptions. */
85
+ apps: {
86
+ local: boolean;
87
+ subscriptions: boolean;
88
+ };
89
+ masking: boolean;
90
+ /** What else to mask, in the admins' words; saved, it turns into `maskLabels`. */
91
+ maskInstructions: string;
92
+ /** What the masking detector looks for besides personal data: `company`, `project name`. */
93
+ maskLabels: string[];
94
+ }
95
+ /** Masking instructions and the labels they turn into, as the Manage-App takes them. */
96
+ export declare const MAX_MASK_INSTRUCTIONS = 1000;
97
+ export declare const MAX_MASK_LABELS = 20;
98
+ export declare const MAX_MASK_LABEL_CHARS = 60;
99
+ /** The makers by company name, as a tier leaves one out: "EU Sovereign leaves out Anthropic". */
100
+ export declare const MAKER_COMPANIES: Record<Maker, string>;
101
+ /** The makers by their models' name, as a maker class reads: "Claude · High". */
102
+ export declare const MAKER_FAMILIES: Record<Maker, string>;
103
+ /** A tier's class id split: `anthropic/high` → maker and class; `video` → no maker. */
104
+ export declare function splitClassId(id: string): {
105
+ maker: Maker | null;
106
+ cls: string;
107
+ };
108
+ /** The class a pick of a model asks for: a maker class first, so it follows the tier's binding. */
109
+ export declare function pickClassOf(classes: string[]): string | null;
110
+ /**
111
+ * A pick of a chooser as the class a step or chat asks for: a class id as it is, a model id of
112
+ * `tier.models` as the class it runs on. Null where it is neither a level people pick (`low`,
113
+ * `standard`, `high`) nor a maker class the maker has.
114
+ */
115
+ export declare function pickedClass(tier: ModelTier, id: string): {
116
+ maker: Maker | null;
117
+ cls: StepClass;
118
+ } | null;
119
+ /**
120
+ * What a call for a tier's class asks the gateway for (docs/manage-contract.md, "Model tiers"):
121
+ * the class, or the model it runs on where the purpose's way-C list approves that model and not
122
+ * the class.
123
+ */
124
+ export declare function policyEntry(tier: ModelTier, policy: ModelPolicy | null, purpose: Purpose, classId: string): string;
125
+ /** Why a call was refused by the gateway for the organization's tier or policy. */
126
+ export type TierRefusalType = "outside_tier" | "not_in_policy";
127
+ /**
128
+ * A policy as the studio's admins save it, checked for its shape only: the Manage-App checks it
129
+ * against the plan and the tier and keeps what the way uses. The masking fields left out stay
130
+ * as saved.
131
+ */
132
+ export declare const modelPolicySchema: z.ZodObject<{
133
+ way: z.ZodEnum<{
134
+ A: "A";
135
+ B: "B";
136
+ C: "C";
137
+ }>;
138
+ purposes: z.ZodObject<{
139
+ wizard: z.ZodObject<{
140
+ models: z.ZodNullable<z.ZodArray<z.ZodString>>;
141
+ default: z.ZodNullable<z.ZodString>;
142
+ effortCap: z.ZodNullable<z.ZodEnum<{
143
+ high: "high";
144
+ low: "low";
145
+ medium: "medium";
146
+ }>>;
147
+ efforts: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
148
+ high: "high";
149
+ low: "low";
150
+ medium: "medium";
151
+ }>>>>;
152
+ }, z.core.$strip>;
153
+ assistant: z.ZodObject<{
154
+ models: z.ZodNullable<z.ZodArray<z.ZodString>>;
155
+ default: z.ZodNullable<z.ZodString>;
156
+ effortCap: z.ZodNullable<z.ZodEnum<{
157
+ high: "high";
158
+ low: "low";
159
+ medium: "medium";
160
+ }>>;
161
+ efforts: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
162
+ high: "high";
163
+ low: "low";
164
+ medium: "medium";
165
+ }>>>>;
166
+ }, z.core.$strip>;
167
+ work: z.ZodObject<{
168
+ models: z.ZodNullable<z.ZodArray<z.ZodString>>;
169
+ default: z.ZodNullable<z.ZodString>;
170
+ effortCap: z.ZodNullable<z.ZodEnum<{
171
+ high: "high";
172
+ low: "low";
173
+ medium: "medium";
174
+ }>>;
175
+ efforts: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
176
+ high: "high";
177
+ low: "low";
178
+ medium: "medium";
179
+ }>>>>;
180
+ }, z.core.$strip>;
181
+ }, z.core.$strip>;
182
+ credits: z.ZodBoolean;
183
+ ownKeys: z.ZodBoolean;
184
+ subscriptions: z.ZodBoolean;
185
+ localModels: z.ZodBoolean;
186
+ apps: z.ZodObject<{
187
+ local: z.ZodBoolean;
188
+ subscriptions: z.ZodBoolean;
189
+ }, z.core.$strip>;
190
+ masking: z.ZodBoolean;
191
+ maskInstructions: z.ZodOptional<z.ZodString>;
192
+ maskLabels: z.ZodOptional<z.ZodArray<z.ZodString>>;
193
+ }, z.core.$strip>;
194
+ export type ModelPolicyInput = z.infer<typeof modelPolicySchema>;
195
+ export {};
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Model tiers: the managed model lists of an organization with compliance needs, and how its
3
+ * admins share out the tier's models (its policy). The Manage-App serves both in
4
+ * `GET /v1/tenants/:id` and enforces them in its gateway (docs/manage-contract.md, "Model
5
+ * tiers"); the runtime shows them and names the class a step asks for. Behind `modelTiers`.
6
+ */
7
+ import { z } from "zod";
8
+ import { EFFORTS, MAKER_CLASSES, MAKERS, } from "./definition.js";
9
+ /** Masking instructions and the labels they turn into, as the Manage-App takes them. */
10
+ export const MAX_MASK_INSTRUCTIONS = 1000;
11
+ export const MAX_MASK_LABELS = 20;
12
+ export const MAX_MASK_LABEL_CHARS = 60;
13
+ /** The makers by company name, as a tier leaves one out: "EU Sovereign leaves out Anthropic". */
14
+ export const MAKER_COMPANIES = {
15
+ anthropic: "Anthropic",
16
+ openai: "OpenAI",
17
+ google: "Google",
18
+ mistral: "Mistral AI",
19
+ };
20
+ /** The makers by their models' name, as a maker class reads: "Claude · High". */
21
+ export const MAKER_FAMILIES = {
22
+ anthropic: "Claude",
23
+ openai: "GPT",
24
+ google: "Gemini",
25
+ mistral: "Mistral",
26
+ };
27
+ /** A tier's class id split: `anthropic/high` → maker and class; `video` → no maker. */
28
+ export function splitClassId(id) {
29
+ const [maker, cls] = id.split("/");
30
+ return cls && MAKERS.includes(maker)
31
+ ? { maker: maker, cls }
32
+ : { maker: null, cls: id };
33
+ }
34
+ const LEVELS = ["low", "standard", "high", "highest"];
35
+ /** The class a pick of a model asks for: a maker class first, so it follows the tier's binding. */
36
+ export function pickClassOf(classes) {
37
+ const picked = classes.filter((id) => LEVELS.includes(splitClassId(id).cls));
38
+ return picked.find((id) => splitClassId(id).maker) ?? picked[0] ?? null;
39
+ }
40
+ /**
41
+ * A pick of a chooser as the class a step or chat asks for: a class id as it is, a model id of
42
+ * `tier.models` as the class it runs on. Null where it is neither a level people pick (`low`,
43
+ * `standard`, `high`) nor a maker class the maker has.
44
+ */
45
+ export function pickedClass(tier, id) {
46
+ const model = tier.models.find((m) => m.id === id);
47
+ const classId = model ? pickClassOf(model.classes) : id;
48
+ if (!classId) {
49
+ return null;
50
+ }
51
+ const { maker, cls } = splitClassId(classId);
52
+ if (!LEVELS.includes(cls)) {
53
+ return null;
54
+ }
55
+ // `highest` exists only as a maker class.
56
+ const fits = maker ? MAKER_CLASSES[maker].includes(cls) : cls !== "highest";
57
+ return fits ? { maker, cls: cls } : null;
58
+ }
59
+ /**
60
+ * What a call for a tier's class asks the gateway for (docs/manage-contract.md, "Model tiers"):
61
+ * the class, or the model it runs on where the purpose's way-C list approves that model and not
62
+ * the class.
63
+ */
64
+ export function policyEntry(tier, policy, purpose, classId) {
65
+ const list = policy?.way === "C" ? policy.purposes[purpose].models : null;
66
+ const model = tier.classes[classId]?.model;
67
+ return list && !list.includes(classId) && model && list.includes(model) ? model : classId;
68
+ }
69
+ const purposePolicySchema = z.object({
70
+ models: z.array(z.string().min(1).max(200)).max(100).nullable(),
71
+ default: z.string().min(1).max(200).nullable(),
72
+ effortCap: z.enum(EFFORTS).nullable(),
73
+ efforts: z.record(z.string(), z.array(z.enum(EFFORTS)).min(1)).nullable(),
74
+ });
75
+ /**
76
+ * A policy as the studio's admins save it, checked for its shape only: the Manage-App checks it
77
+ * against the plan and the tier and keeps what the way uses. The masking fields left out stay
78
+ * as saved.
79
+ */
80
+ export const modelPolicySchema = z.object({
81
+ way: z.enum(["A", "B", "C"]),
82
+ purposes: z.object({
83
+ wizard: purposePolicySchema,
84
+ assistant: purposePolicySchema,
85
+ work: purposePolicySchema,
86
+ }),
87
+ credits: z.boolean(),
88
+ ownKeys: z.boolean(),
89
+ subscriptions: z.boolean(),
90
+ localModels: z.boolean(),
91
+ apps: z.object({ local: z.boolean(), subscriptions: z.boolean() }),
92
+ masking: z.boolean(),
93
+ maskInstructions: z.string().max(MAX_MASK_INSTRUCTIONS).optional(),
94
+ maskLabels: z
95
+ .array(z.string().trim().min(1).max(MAX_MASK_LABEL_CHARS))
96
+ .max(MAX_MASK_LABELS)
97
+ .optional(),
98
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engenty/wizards-runtime",
3
- "version": "0.12.2",
3
+ "version": "0.13.0",
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.12.2",
4
+ "version": "0.13.0",
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.12.2",
4
+ "version": "0.13.0",
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 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Bn as r,Jt as i,Nn as a,Xt as o,Yt as s,in as c,on as l,qt as u,sn as d,tn as f}from"./ui-CwFQAfE-.js";import{t as p}from"./preload-helper-DpV6A1kQ.js";import{t as m}from"./logo-CGNoptDg.js";import{s as h}from"./i18n-CKKh3Pn0.js";import{Mt as g,Nt as _,V as v,et as y,it as b}from"./index-Cy2NHzAx.js";import{ReleaseNotes as x,loadReleases as S,releaseDate as C,releaseLabel as w}from"./ChangelogDialog-CKLgFL6r.js";var T=e(t(),1),E=[{name:`engenty wizards`,description:`credit.engenty-wizards`,homepage:`https://github.com/engenty/wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:`credit.engenty`,homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],D=[{name:`Mastra`,description:`credit.mastra`,homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:`credit.ai-sdk`,homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:`credit.model-context-protocol`,homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:`credit.hono`,homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:`credit.drizzle-orm`,homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:`credit.libsql`,homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:`credit.playwright`,homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`React`,description:`credit.react`,homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:`credit.vite`,homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:`credit.tailwind-css`,homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:`credit.react-flow`,homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:`credit.tanstack-query`,homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:`credit.xterm-js`,homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:`credit.lucide`,homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:`credit.geist-geist-mono`,homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:`credit.space-grotesk`,homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:`credit.git-cliff`,homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],O=e(n(),1),k=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function A({name:e,homepage:t,version:n,license:r,description:i}){return(0,O.jsxs)(`li`,{className:`py-2.5`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,O.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.875rem] text-ink underline-offset-4 hover:underline`,children:[e,(0,O.jsx)(a,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,O.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:r})]}),i?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:i}):null]})}function j({title:e,hint:t,children:n}){return(0,O.jsxs)(`section`,{className:`mt-6`,children:[(0,O.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,O.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function M({credits:e}){return(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,O.jsx)(A,{name:e.name,homepage:e.homepage,license:e.license,description:h(e.description)},e.name))})}function N({label:e,packages:t}){return(0,O.jsxs)(`div`,{className:`mt-4`,children:[(0,O.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,O.jsx)(A,{...e},e.name))})]})}function P({active:e}){let[t,n]=(0,T.useState)(null),[r,a]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return p(()=>import(`./oss-credits-DpRWUPjD.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||a(``)},[e]);let s=r.trim().toLowerCase(),c=e=>s?e.filter(e=>k(s,e.name,e.license,h(e.description))):e,l=e=>s?e.filter(e=>k(s,e.name,e.license,e.version)):e,u=c(E),d=c(D),m=t?[{id:`shared`,label:h(`about.creditsShared`),packages:l(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:l(e.packages)}))].filter(e=>e.packages.length>0):[],g=u.length===0&&d.length===0&&m.length===0;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:h(`about.creditsHint`)}),(0,O.jsx)(o,{type:`search`,value:r,placeholder:h(`about.search`),onChange:e=>a(e.target.value)}),u.length>0?(0,O.jsx)(j,{title:h(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:u})}):null,d.length>0?(0,O.jsx)(j,{title:h(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:d})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(f,{})}):m.length>0?(0,O.jsx)(j,{title:h(`about.creditsDeps`),hint:s?void 0:h(`about.creditsDepsHint`),children:m.map(e=>(0,O.jsx)(N,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,O.jsx)(i,{children:h(`about.noMatches`)}):null]})}var F=[`new`,`earlier`,`credits`],I=e=>h(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),L=e=>e===1?h(`about.change`):h(`about.changes`,{n:e});function R({me:e,active:t,initialTab:n=`new`}){let i=e?.mode===`local`,{data:a,latest:o}=g(i&&t),[s,u]=(0,T.useState)(null),[d,p]=(0,T.useState)(n);(0,T.useEffect)(()=>p(n),[n]);let E=b(F.indexOf(d)),D=a?.newer&&o?o:_;(0,T.useEffect)(()=>{if(!t)return;let e=!1;return u(null),S(D===`0.12.2`?void 0:D).then(t=>{e||u(t)}),()=>{e=!0}},[t,D]);let k=s?.find(e=>e.version===`v${D}`)??s?.[0]??null,A=s?.filter(e=>e!==k)??[],j=i?a?.kind??null:`cloud`;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,O.jsx)(m,{size:96}),(0,O.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,O.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,O.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,O.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[h(`about.version`,{v:_}),j?` · ${h(`about.kind.${j}`)}`:``]})]}),i?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(v,{enabled:t})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(c,{value:d,onChange:p,options:F.map(e=>({id:e,label:I(e)})),label:h(`about.title`)})}),(0,O.jsxs)(`div`,{className:l(`mt-5`,y(E)),children:[d===`new`?s===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(f,{})}):k?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[w(k),(0,O.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:C(k)})]}),(0,O.jsx)(`div`,{className:`mt-3`,children:(0,O.jsx)(x,{release:k})})]}):(0,O.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:h(`about.changelogEmpty`)}):null,d===`earlier`?(0,O.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:A.map(e=>(0,O.jsxs)(`details`,{className:`group/r py-2`,children:[(0,O.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,O.jsx)(r,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,O.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:w(e)}),(0,O.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:C(e)}),(0,O.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:L(e.commits.length)})]}),(0,O.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,O.jsx)(x,{release:e})})]},e.version??`unreleased`))}):null,d===`credits`?(0,O.jsx)(P,{active:!0}):null]},d)]})}function z({open:e,onClose:t,me:n}){return(0,O.jsxs)(u,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,O.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,O.jsx)(s,{label:h(`common.close`),onClick:t,children:(0,O.jsx)(d,{className:`size-4`})})}),(0,O.jsx)(R,{me:n,active:e})]})}export{z as AboutDialog,R as AboutPanel};