@engenty/wizards-runtime 0.11.5 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/runtime/dist/agents/architect.js +40 -55
- package/apps/runtime/dist/agents/chat-clients.js +3 -0
- package/apps/runtime/dist/agents/company.js +4 -12
- package/apps/runtime/dist/agents/studio-assistant.js +82 -74
- package/apps/runtime/dist/agents/subscription.js +27 -17
- package/apps/runtime/dist/assistant/knows.js +19 -19
- package/apps/runtime/dist/auth/account.js +51 -12
- package/apps/runtime/dist/auth/index.js +15 -2
- package/apps/runtime/dist/authoring/guide.js +20 -447
- package/apps/runtime/dist/browser/fast/run.js +18 -12
- package/apps/runtime/dist/cli/account.js +127 -10
- package/apps/runtime/dist/cli/main.js +4 -2
- package/apps/runtime/dist/connectors/mail.js +4 -3
- package/apps/runtime/dist/data/chat-models.json +116 -0
- package/apps/runtime/dist/docs/user-guide/models.md +15 -5
- package/apps/runtime/dist/documents/parse.js +5 -14
- package/apps/runtime/dist/engine/decide.js +2 -1
- package/apps/runtime/dist/engine/runner.js +4 -3
- package/apps/runtime/dist/engine/steps.js +82 -91
- package/apps/runtime/dist/engine/template.js +2 -3
- package/apps/runtime/dist/env.js +5 -0
- package/apps/runtime/dist/harness/antigravity.js +2 -2
- package/apps/runtime/dist/harness/apple.js +4 -6
- package/apps/runtime/dist/harness/codex.js +5 -6
- package/apps/runtime/dist/harness/prompt.js +8 -8
- package/apps/runtime/dist/mcp/handler.js +5 -7
- package/apps/runtime/dist/mcp/tools.js +33 -54
- package/apps/runtime/dist/media/conversation.js +18 -23
- package/apps/runtime/dist/media/generate.js +18 -3
- package/apps/runtime/dist/media/transcribe.js +5 -4
- package/apps/runtime/dist/models.js +8 -9
- package/apps/runtime/dist/motion-graphics/project.js +19 -53
- package/apps/runtime/dist/motion-graphics/sounds.js +2 -1
- package/apps/runtime/dist/motion-graphics/step.js +31 -16
- package/apps/runtime/dist/prompts/README.md +48 -0
- package/apps/runtime/dist/prompts/architect.md +89 -0
- package/apps/runtime/dist/prompts/authoring.md +503 -0
- package/apps/runtime/dist/prompts/goose.md +229 -0
- package/apps/runtime/dist/prompts/mcp.md +156 -0
- package/apps/runtime/dist/prompts/safety.md +23 -0
- package/apps/runtime/dist/prompts/services.md +151 -0
- package/apps/runtime/dist/prompts/step.md +334 -0
- package/apps/runtime/dist/prompts/tools.md +330 -0
- package/apps/runtime/dist/prompts/voice.md +53 -0
- package/apps/runtime/dist/prompts.js +50 -0
- package/apps/runtime/dist/routes/studio.js +58 -7
- package/apps/runtime/dist/safety.js +45 -0
- package/apps/runtime/dist/sandbox/index.js +8 -3
- package/apps/runtime/dist/services/architect.js +5 -4
- package/apps/runtime/dist/services/assistant-chats.js +5 -8
- package/apps/runtime/dist/services/brand.js +2 -7
- package/apps/runtime/dist/services/chat-models.js +58 -0
- package/apps/runtime/dist/services/cloud.js +8 -4
- package/apps/runtime/dist/services/knowledge-model.js +17 -8
- package/apps/runtime/dist/services/knowledge.js +5 -9
- package/apps/runtime/dist/services/project-files.js +3 -8
- package/apps/runtime/dist/services/relevance.js +4 -3
- package/apps/runtime/dist/services/runs.js +6 -7
- package/apps/runtime/dist/services/site.js +2 -2
- package/apps/runtime/dist/services/translations.js +17 -10
- package/apps/runtime/dist/services/wizards.js +8 -0
- package/apps/runtime/dist/sync/client.js +116 -1
- package/apps/runtime/dist/tools/browser.js +36 -33
- package/apps/runtime/dist/tools/code.js +20 -6
- package/apps/runtime/dist/tools/connector.js +23 -9
- package/apps/runtime/dist/tools/index.js +14 -11
- package/apps/runtime/dist/tools/mail.js +5 -5
- package/apps/runtime/dist/tools/net-guard.js +4 -4
- package/apps/runtime/dist/tools/pages.js +3 -2
- package/apps/runtime/dist/tools/project.js +7 -8
- package/apps/runtime/dist/tools/store.js +14 -10
- package/apps/web/dist/assets/{AboutDialog-B525L37O.js → AboutDialog-J9rRhJTJ.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-gInSm1Xe.js → ChangelogDialog-D9bBSuLQ.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-C0TmdCrb.js → CodeEditor-CiRJjYpm.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-7t3vhZi6.js → EditorPage-ChLV09jO.js} +1 -1
- package/apps/web/dist/assets/{FlowPreview-BBN-APkG.js → FlowPreview-QRnLE4JM.js} +1 -1
- package/apps/web/dist/assets/{Harness-fAoC908y.js → Harness-dM1CDgnx.js} +1 -1
- package/apps/web/dist/assets/Marketplace-8rU-MhWj.js +2 -0
- package/apps/web/dist/assets/{NewWizardChannels-X32lBGMf.js → NewWizardChannels--JqgVT-t.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-DMoqDhsh.js → NewWizardPage-CNv5UuBn.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-BjZy-bhI.js → OnboardingPage-CDuhfBEI.js} +1 -1
- package/apps/web/dist/assets/{PreviewPane-Bt-ForJG.js → PreviewPane-BsMrHW8b.js} +2 -2
- package/apps/web/dist/assets/{ProjectPage-B5a-nod-.js → ProjectPage-CoVMEoB1.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-Cq_XzX54.js → PublicRunner-Ckte5NnM.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-DX3beZJz.js → ReadOnly-Ch-ss9Mh.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-CGp6G_fp.js +2 -0
- package/apps/web/dist/assets/{SetupPage-BI9bgEkI.js → SetupPage-DgFT_646.js} +1 -1
- package/apps/web/dist/assets/{SharePage-Ch-1oLBs.js → SharePage-CEcFKE3b.js} +1 -1
- package/apps/web/dist/assets/changelog-DMhLfQmS.js +1 -0
- package/apps/web/dist/assets/i18n-AXoEWXfv.js +55 -0
- package/apps/web/dist/assets/index-BYZBN0xx.css +1 -0
- package/apps/web/dist/assets/index-Dx7qMiM3.js +34 -0
- package/apps/web/dist/assets/{oss-credits-CZT1KRIp.js → oss-credits-Da4KrYmP.js} +1 -1
- package/apps/web/dist/assets/{phone-DxC6eM6O.js → phone-De-HF0g7.js} +1 -1
- package/apps/web/dist/assets/{runners-SQHfvvNQ.js → runners-UIPj9xyX.js} +1 -1
- package/apps/web/dist/assets/{session-4CTNIlai.js → session-DUxZmhqy.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-B0af5EBE.js → settings-menu-Bo1yXMGF.js} +1 -1
- package/apps/web/dist/assets/{theme-mtamawa_.js → theme-CSuPPxre.js} +1 -1
- package/apps/web/dist/assets/ui-CBDsXUoA.js +83 -0
- package/apps/web/dist/assets/{upload-DXJQU2lL.js → upload-CZgdEF60.js} +1 -1
- package/apps/web/dist/assets/{useMutation-DwRYrG3V.js → useMutation-ZHWqRSPd.js} +1 -1
- package/apps/web/dist/assets/{volume-2-CYbbBiXP.js → volume-2-c641MxaU.js} +1 -1
- package/apps/web/dist/assets/{wrench-D8lG2BH7.js → wrench-DCEAyYuR.js} +1 -1
- package/apps/web/dist/index.html +8 -9
- package/apps/web/dist/mcp/flow.html +87 -87
- package/node_modules/@engenty/wizards-shared/dist/assistant.d.ts +1 -0
- package/node_modules/@engenty/wizards-shared/dist/assistant.js +2 -0
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +6 -0
- package/node_modules/@engenty/wizards-shared/dist/run.js +12 -0
- package/node_modules/@engenty/wizards-shared/dist/surface.d.ts +0 -2
- package/node_modules/@engenty/wizards-shared/dist/surface.js +0 -29
- package/node_modules/@engenty/wizards-shared/dist/sync.d.ts +5 -0
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/runtime/dist/assistant/primer.js +0 -26
- package/apps/web/dist/assets/Marketplace-CotMMcJ-.js +0 -2
- package/apps/web/dist/assets/SettingsPage-DPuwA3QL.js +0 -2
- package/apps/web/dist/assets/changelog-BlJc9UFS.js +0 -1
- package/apps/web/dist/assets/coins-D_yN56kT.js +0 -1
- package/apps/web/dist/assets/i18n-Dy3fTQM3.js +0 -55
- package/apps/web/dist/assets/index-Dt1Ps3ge.js +0 -34
- package/apps/web/dist/assets/index-rX7eCvWh.css +0 -1
- package/apps/web/dist/assets/ui-CL8v8Goa.js +0 -83
|
@@ -64,6 +64,7 @@ export declare const assistantTurnSchema: z.ZodObject<{
|
|
|
64
64
|
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
65
65
|
}, z.core.$strip>>>;
|
|
66
66
|
debug: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
extra: z.ZodOptional<z.ZodBoolean>;
|
|
67
68
|
}, z.core.$strip>;
|
|
68
69
|
export type AssistantTurn = z.input<typeof assistantTurnSchema>;
|
|
69
70
|
/**
|
|
@@ -52,6 +52,8 @@ export const assistantTurnSchema = z.object({
|
|
|
52
52
|
tools: z.array(browserToolSchema).max(40).default([]),
|
|
53
53
|
/** Developer mode: the turn also sends its prompt and each step (`prompt`, `step`). */
|
|
54
54
|
debug: z.boolean().optional(),
|
|
55
|
+
/** Extra effort: the chat works with its more capable model. Off where the field is left out. */
|
|
56
|
+
extra: z.boolean().optional(),
|
|
55
57
|
});
|
|
56
58
|
/**
|
|
57
59
|
* A message the person writes while a turn runs (POST /api/studio/assistant/run/:runId/signal):
|
|
@@ -426,6 +426,9 @@ declare const NOTES_EN: {
|
|
|
426
426
|
readonly other: "A space can have at most {count} documents.";
|
|
427
427
|
};
|
|
428
428
|
readonly accountSignedOut: "The account is signed out. Sign in again.";
|
|
429
|
+
readonly spaceOfOtherOrganization: "This space belongs to {organization}. Switch to {organization} to keep it the same as in the cloud again.";
|
|
430
|
+
readonly syncChangesWaiting: "Changes made here haven’t arrived in the cloud yet.";
|
|
431
|
+
readonly switchChangesWaiting: "Changes in {spaces} haven’t arrived in the cloud yet. If you switch now, they stay on this computer and arrive when you switch back.";
|
|
429
432
|
readonly cloudNotReachedRight: "The cloud can’t be reached right now.";
|
|
430
433
|
readonly syncUpdateHere: "The cloud runs a newer version than this computer. Update engenty wizards, then your changes arrive in the cloud again.";
|
|
431
434
|
readonly syncUpdateCloud: "This computer runs a newer version than the cloud. Your changes arrive there once the cloud is updated.";
|
|
@@ -458,6 +461,9 @@ declare const NOTES_EN: {
|
|
|
458
461
|
readonly commandNotStarted: "The command couldn’t start: {detail}";
|
|
459
462
|
readonly providerKeyMissing: "{provider} is chosen for {makes}, but no API key is set.";
|
|
460
463
|
readonly noModelFor: "No model is set up for {makes}.";
|
|
464
|
+
readonly contentBlocked: "This wasn’t made: the request goes against the content rules.";
|
|
465
|
+
readonly contentCheckFailed: "Nothing was made, because the content check couldn’t run: {detail}";
|
|
466
|
+
readonly chatNoWay: "The chat has nothing to run on yet. Pick a subscription, a key or the credits under Settings › Models › Agent chat.";
|
|
461
467
|
readonly noApiKeyFor: "No API key is set for {provider}.";
|
|
462
468
|
readonly freeTier: "Your AI Gateway key is on Vercel’s free tier, which doesn’t include {model}. Top up at Vercel ({url}) or choose another model under Settings → Models.";
|
|
463
469
|
readonly thisModel: "this model";
|
|
@@ -255,6 +255,9 @@ const NOTES_EN = {
|
|
|
255
255
|
other: "A space can have at most {count} documents.",
|
|
256
256
|
},
|
|
257
257
|
accountSignedOut: "The account is signed out. Sign in again.",
|
|
258
|
+
spaceOfOtherOrganization: "This space belongs to {organization}. Switch to {organization} to keep it the same as in the cloud again.",
|
|
259
|
+
syncChangesWaiting: "Changes made here haven’t arrived in the cloud yet.",
|
|
260
|
+
switchChangesWaiting: "Changes in {spaces} haven’t arrived in the cloud yet. If you switch now, they stay on this computer and arrive when you switch back.",
|
|
258
261
|
cloudNotReachedRight: "The cloud can’t be reached right now.",
|
|
259
262
|
syncUpdateHere: "The cloud runs a newer version than this computer. Update engenty wizards, then your changes arrive in the cloud again.",
|
|
260
263
|
syncUpdateCloud: "This computer runs a newer version than the cloud. Your changes arrive there once the cloud is updated.",
|
|
@@ -287,6 +290,9 @@ const NOTES_EN = {
|
|
|
287
290
|
commandNotStarted: "The command couldn’t start: {detail}",
|
|
288
291
|
providerKeyMissing: "{provider} is chosen for {makes}, but no API key is set.",
|
|
289
292
|
noModelFor: "No model is set up for {makes}.",
|
|
293
|
+
contentBlocked: "This wasn’t made: the request goes against the content rules.",
|
|
294
|
+
contentCheckFailed: "Nothing was made, because the content check couldn’t run: {detail}",
|
|
295
|
+
chatNoWay: "The chat has nothing to run on yet. Pick a subscription, a key or the credits under Settings › Models › Agent chat.",
|
|
290
296
|
noApiKeyFor: "No API key is set for {provider}.",
|
|
291
297
|
freeTier: "Your AI Gateway key is on Vercel’s free tier, which doesn’t include {model}. Top up at Vercel ({url}) or choose another model under Settings → Models.",
|
|
292
298
|
thisModel: "this model",
|
|
@@ -564,6 +570,9 @@ const NOTES_DE = {
|
|
|
564
570
|
other: "Ein Space hat höchstens {count} Dokumente.",
|
|
565
571
|
},
|
|
566
572
|
accountSignedOut: "Das Konto ist abgemeldet. Melde dich neu an.",
|
|
573
|
+
spaceOfOtherOrganization: "Dieser Space gehört zu {organization}. Wechsle zu {organization}, damit er wieder gleich ist wie in der Cloud.",
|
|
574
|
+
syncChangesWaiting: "Änderungen von hier sind noch nicht in der Cloud angekommen.",
|
|
575
|
+
switchChangesWaiting: "Änderungen in {spaces} sind noch nicht in der Cloud angekommen. Wechselst du jetzt, bleiben sie auf diesem Computer und kommen an, wenn du zurückwechselst.",
|
|
567
576
|
cloudNotReachedRight: "Die Cloud ist gerade nicht erreichbar.",
|
|
568
577
|
syncUpdateHere: "Die Cloud hat eine neuere Version als dieser Computer. Aktualisiere engenty wizards, dann kommen deine Änderungen wieder in der Cloud an.",
|
|
569
578
|
syncUpdateCloud: "Dieser Computer hat eine neuere Version als die Cloud. Deine Änderungen kommen dort an, sobald die Cloud aktualisiert ist.",
|
|
@@ -596,6 +605,9 @@ const NOTES_DE = {
|
|
|
596
605
|
commandNotStarted: "Der Befehl konnte nicht starten: {detail}",
|
|
597
606
|
providerKeyMissing: "Für {makes} ist {provider} gewählt, aber kein API-Key hinterlegt.",
|
|
598
607
|
noModelFor: "Für {makes} ist kein Modell eingerichtet.",
|
|
608
|
+
contentBlocked: "Das wurde nicht erstellt: Die Anfrage verstößt gegen die Inhaltsregeln.",
|
|
609
|
+
contentCheckFailed: "Es wurde nichts erstellt, weil die Inhaltsprüfung nicht laufen konnte: {detail}",
|
|
610
|
+
chatNoWay: "Der Chat hat noch nichts, womit er arbeiten kann. Wähle unter Einstellungen › Modelle › Agent-Chat ein Abo, einen Key oder das Guthaben.",
|
|
599
611
|
noApiKeyFor: "Für {provider} ist kein API-Key hinterlegt.",
|
|
600
612
|
freeTier: "Dein AI-Gateway-Key nutzt bei Vercel die kostenlose Stufe, und die schließt {model} aus. Lade bei Vercel Guthaben auf ({url}) oder wähle unter Einstellungen → Modelle ein anderes Modell.",
|
|
601
613
|
thisModel: "dieses Modell",
|
|
@@ -111,5 +111,3 @@ export declare function worded(raw: unknown, spec: {
|
|
|
111
111
|
map?: unknown;
|
|
112
112
|
format?: unknown;
|
|
113
113
|
}): unknown;
|
|
114
|
-
/** What a model needs to compose a surface: the catalog, briefly. */
|
|
115
|
-
export declare const SURFACE_GUIDE = "A surface is a flat JSON array of components; the one with id \"root\" is drawn. Containers list their children by id.\nComponents and props (a prop may be a literal or {\"path\": \"/key/...\"} into the data):\n- Column { children: [ids] } \u2014 vertical stack (use for root); Column and Grid may also repeat one component per entry: children {\"path\", \"componentId\"}\n- Text { text, variant?: \"h3\"|\"h4\"|\"lead\"|\"body\"|\"muted\" } \u2014 \"lead\": the one opening line in the wizard's voice\n- List { children: {\"path\": \"/rows\", \"componentId\": \"<a Row id>\"} } \u2014 one Row per array entry; inside, paths without \"/\" read the entry (\"name\")\n- Row { title, subtitle?, meta?, badge?, image? }\n- DetailGrid { rows: [{ label, value }] } \u2014 label/value facts\n- Badge { label, tone?: \"default\"|\"success\"|\"warning\"|\"accent\" }\n- Grid { children: [ids], columns?: 2|3|4, min?: rem } \u2014 tiles side by side; min: the narrowest a tile gets (14 for cards, so a phone shows one)\n- Metric { label, value, caption? } \u2014 a key figure\n- Table { rows: {\"path\": \"/rows\"}, columns?: [{ key, label }] }\n- Image { src: an asset id or {\"path\": ...}, alt? }\n- BarChart / LineChart { title?, points: [{ label, value }] or {\"path\": ...}, labelKey?, valueKey? }\n- DonutChart { title?, slices: [{ label, value }] or {\"path\": ...}, labelKey?, valueKey? }\n (labelKey / valueKey: the columns of bound rows that hold the label and the number, e.g. \"name\", \"price\")\n- Actions { children: [Button ids] } / Button { label, action: \"regenerate\"|\"open\" }\n- Tabs { tabs: [{ label, count?, child: id }] } \u2014 two to four views of one result; count may bind a list (shows its length)\n- Card { title, eyebrow?, subtitle?, meta?: [values], image?, children?: [ids] } \u2014 one thing: a day, a recipe, an offer\n- Fold { title, open?, children: [ids] } \u2014 details that open on a tap\n- Group { children: {\"path\", \"componentId\"}, by: \"<key>\", order?: [values] } \u2014 entries under a heading per value of a key\n- Chips { items, labelKey?, flagKey?, flag? } \u2014 short things at a glance; flagKey marks some (\"bald\")\n- Checklist { items, labelKey?, detailKey?, noteKey?, noteFormat?, noteMap?, groupKey?, groupOrder?, share? } \u2014 things to get or do; ticks are kept; a yes/no note needs noteMap: {\"true\": \"da\", \"false\": \"einkaufen\"}\n- Steps { items, textKey?, minutesKey? } \u2014 ordered work, numbered, with times\n- Link { title, subtitle?, eyebrow?, meta?, look?: \"row\"|\"card\", items: {\"path\": \"/recipes\"}, key?: \"id\", value: {\"path\": \"recipe_id\"}, view: id } \u2014 opens the entry of items whose key is value in a sheet, drawn by view; title, subtitle and meta read that entry, eyebrow the row the Link sits in\n- Callout { text, title?, tone?: \"tip\"|\"note\"|\"warning\" }\nA path may put its value into words: {\"path\": \"in_fridge\", \"map\": {\"true\": \"da\", \"false\": \"einkaufen\"}}, {\"path\": \"minutes\", \"format\": \"{} Min\"}.\nDesign it like an app, not a report: lead with a headline, the key figure or the chips; one Card per thing, never a Table of things; ordered work is Steps, things to get are a Checklist, sets are grouped by their key. A Table only for figures people compare across columns.\nKeep it small: what the person needs to see first, then the details. Never invent numbers: bind them by path.";
|
|
@@ -411,32 +411,3 @@ export function worded(raw, spec) {
|
|
|
411
411
|
}
|
|
412
412
|
return v;
|
|
413
413
|
}
|
|
414
|
-
/** What a model needs to compose a surface: the catalog, briefly. */
|
|
415
|
-
export const SURFACE_GUIDE = `A surface is a flat JSON array of components; the one with id "root" is drawn. Containers list their children by id.
|
|
416
|
-
Components and props (a prop may be a literal or {"path": "/key/..."} into the data):
|
|
417
|
-
- Column { children: [ids] } — vertical stack (use for root); Column and Grid may also repeat one component per entry: children {"path", "componentId"}
|
|
418
|
-
- Text { text, variant?: "h3"|"h4"|"lead"|"body"|"muted" } — "lead": the one opening line in the wizard's voice
|
|
419
|
-
- List { children: {"path": "/rows", "componentId": "<a Row id>"} } — one Row per array entry; inside, paths without "/" read the entry ("name")
|
|
420
|
-
- Row { title, subtitle?, meta?, badge?, image? }
|
|
421
|
-
- DetailGrid { rows: [{ label, value }] } — label/value facts
|
|
422
|
-
- Badge { label, tone?: "default"|"success"|"warning"|"accent" }
|
|
423
|
-
- Grid { children: [ids], columns?: 2|3|4, min?: rem } — tiles side by side; min: the narrowest a tile gets (14 for cards, so a phone shows one)
|
|
424
|
-
- Metric { label, value, caption? } — a key figure
|
|
425
|
-
- Table { rows: {"path": "/rows"}, columns?: [{ key, label }] }
|
|
426
|
-
- Image { src: an asset id or {"path": ...}, alt? }
|
|
427
|
-
- BarChart / LineChart { title?, points: [{ label, value }] or {"path": ...}, labelKey?, valueKey? }
|
|
428
|
-
- DonutChart { title?, slices: [{ label, value }] or {"path": ...}, labelKey?, valueKey? }
|
|
429
|
-
(labelKey / valueKey: the columns of bound rows that hold the label and the number, e.g. "name", "price")
|
|
430
|
-
- Actions { children: [Button ids] } / Button { label, action: "regenerate"|"open" }
|
|
431
|
-
- Tabs { tabs: [{ label, count?, child: id }] } — two to four views of one result; count may bind a list (shows its length)
|
|
432
|
-
- Card { title, eyebrow?, subtitle?, meta?: [values], image?, children?: [ids] } — one thing: a day, a recipe, an offer
|
|
433
|
-
- Fold { title, open?, children: [ids] } — details that open on a tap
|
|
434
|
-
- Group { children: {"path", "componentId"}, by: "<key>", order?: [values] } — entries under a heading per value of a key
|
|
435
|
-
- Chips { items, labelKey?, flagKey?, flag? } — short things at a glance; flagKey marks some ("bald")
|
|
436
|
-
- Checklist { items, labelKey?, detailKey?, noteKey?, noteFormat?, noteMap?, groupKey?, groupOrder?, share? } — things to get or do; ticks are kept; a yes/no note needs noteMap: {"true": "da", "false": "einkaufen"}
|
|
437
|
-
- Steps { items, textKey?, minutesKey? } — ordered work, numbered, with times
|
|
438
|
-
- Link { title, subtitle?, eyebrow?, meta?, look?: "row"|"card", items: {"path": "/recipes"}, key?: "id", value: {"path": "recipe_id"}, view: id } — opens the entry of items whose key is value in a sheet, drawn by view; title, subtitle and meta read that entry, eyebrow the row the Link sits in
|
|
439
|
-
- Callout { text, title?, tone?: "tip"|"note"|"warning" }
|
|
440
|
-
A path may put its value into words: {"path": "in_fridge", "map": {"true": "da", "false": "einkaufen"}}, {"path": "minutes", "format": "{} Min"}.
|
|
441
|
-
Design it like an app, not a report: lead with a headline, the key figure or the chips; one Card per thing, never a Table of things; ordered work is Steps, things to get are a Checklist, sets are grouped by their key. A Table only for figures people compare across columns.
|
|
442
|
-
Keep it small: what the person needs to see first, then the details. Never invent numbers: bind them by path.`;
|
|
@@ -134,6 +134,11 @@ export interface SpaceSyncState {
|
|
|
134
134
|
reason?: string;
|
|
135
135
|
at: string;
|
|
136
136
|
} | null;
|
|
137
|
+
/**
|
|
138
|
+
* The organization the space syncs with, when the account is signed in to another one now:
|
|
139
|
+
* the space stays here and syncs again after a switch back.
|
|
140
|
+
*/
|
|
141
|
+
organization?: string | null;
|
|
137
142
|
}
|
|
138
143
|
/** An item where both sides changed the same thing: what each has, and where they differ. */
|
|
139
144
|
export interface SyncConflictView {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@engenty/wizards-runtime",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
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",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"mammoth": "1.13.0",
|
|
75
75
|
"marked": "18.0.14",
|
|
76
76
|
"nanoid": "5.1.16",
|
|
77
|
-
"nodemailer": "10.0.
|
|
77
|
+
"nodemailer": "10.0.10",
|
|
78
78
|
"pdf-parse": "2.4.5",
|
|
79
79
|
"playwright-core": "1.63.0",
|
|
80
80
|
"postal-mime": "4.0.2",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wizards",
|
|
3
3
|
"displayName": "engenty wizards",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.7",
|
|
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"
|
package/plugin/plugin.json
CHANGED
|
@@ -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.
|
|
4
|
+
"version": "0.11.7",
|
|
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,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What engenty wizards is, on one page, in every turn of the studio assistant. Written from the
|
|
3
|
-
* user guide (docs/content/user-guide/index.md and the pages it links); the details are a docs_search
|
|
4
|
-
* away.
|
|
5
|
-
*/
|
|
6
|
-
export const PRIMER = `ENGENTY WIZARDS IN ONE PAGE
|
|
7
|
-
engenty wizards turns something done again and again into a wizard: pages that ask what it needs, AI steps that do the work, and a link to share. It runs on the person's own computer (a "local install" at ~/.engenty/wizards, studio at /studio) or in the cloud at engenty.ai with an account.
|
|
8
|
-
|
|
9
|
-
Words
|
|
10
|
-
- Studio: where wizards are built. Home lists the space's wizards; the editor (/edit/<id>) has its own chat (the architect) that builds and changes the wizard, a preview of each step as people see it with the steps in a row above it, and beside it the flow as a diagram and the editor of the step chosen.
|
|
11
|
-
- Wizard: a flow of steps a person walks through on a link. Step kinds: a page (fields to fill in), an AI step (an agent with tools: web search, reading files, writing documents, images, video, pages, other services), a review, and the result.
|
|
12
|
-
- Run: one person going through a wizard once. Results lists every run that reached its result.
|
|
13
|
-
- Space: what all wizards of an organization know. Its sources page (Quellen in German, the app bar's second place: where the wizards get what they know) has five parts: Info (title, about, facts, with the main logo to see), Brand (logos, colours, type, assets), Knowledge (pages, tables and files the AI steps look things up in, kept apart by typed categories), Data (tables and pages the wizards keep) and Results (finished runs).
|
|
14
|
-
- Model class: the kind of model a step needs (Classifier, Low, Standard, High for text; Image, Video, Speech, Audio). Which model serves a class is a setting (Settings › Models), not part of the wizard.
|
|
15
|
-
|
|
16
|
-
Thinking: an installed AI client on the person's subscription (Claude Code, Codex, Antigravity, Cursor Agent), own API keys (OpenAI, Anthropic, Google, fal.ai, ElevenLabs, Replicate, Vercel AI Gateway), a local model (Ollama), or engenty credits from an account. Settings › Models shows which way serves each class and what is missing.
|
|
17
|
-
|
|
18
|
-
Sharing: Test runs a draft. Publish makes a version live behind a link. Share holds the link, the tag for a website, a QR code, channels (the page, the chat, and what plugins add: WhatsApp, SMS, calls) and the link's settings (on/off, runs per day, a new address). With an account, what is published on a local install also runs in the cloud, on the account's credits, while the computer is off.
|
|
19
|
-
|
|
20
|
-
AI apps: the install is an MCP server; Claude Desktop, Cursor, Codex and others build and run wizards through it (Settings › AI apps).
|
|
21
|
-
|
|
22
|
-
Plugins add pages to the studio (a Shop, a Termin-Planer), settings sections, sections of the space page, tools for AI steps and for this assistant, and channels. Settings › Plugins lists what is installed.
|
|
23
|
-
|
|
24
|
-
Account and plans: an account is optional on a local install; it brings credits, cloud publishing, sync and Pro modules. In the cloud, organizations are on a plan (Free, Pro, Team) with monthly credits; credits can be topped up on the account's billing page. Plans, prices and the balance come from the account (tools: plans, account, usage), never from memory.
|
|
25
|
-
|
|
26
|
-
Studio addresses: / (home), /new (a new wizard), /edit/<id> (the editor), /space/info, /space/brand, /space/knowledge, /space/data, /space/results, /settings/account, /settings/organization (cloud), /settings/connectors, /settings/models, /settings/integrate (AI apps), /settings/plugins, and the pages plugins add.`;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FlowPreview-BBN-APkG.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/ui-CL8v8Goa.js","assets/preload-helper-DpV6A1kQ.js","assets/i18n-Dy3fTQM3.js","assets/esm-BdxDT9Km.js","assets/react-dom-hf6EcyAr.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{n,t as r}from"./jsx-runtime-BNakU3Ej.js";import{G as i,Gn as a,Gt as o,Hn as s,Kt as c,Mn as l,Mr as u,Sn as d,Sr as f,Tn as p,Un as m,W as h,Wt as g,Xn as _,cn as v,cr as y,dr as b,fr as x,hn as ee,ir as S,lr as C,on as w,qt as te,sn as T,sr as E,tn as D,wn as ne,zn as O}from"./ui-CL8v8Goa.js";import{t as k}from"./useMutation-DwRYrG3V.js";import{t as A}from"./preload-helper-DpV6A1kQ.js";import{i as j,n as re,r as ie,t as ae}from"./volume-2-CYbbBiXP.js";import{n as oe,t as se}from"./coins-D_yN56kT.js";import{d as ce,h as le,k as ue,x as de}from"./session-4CTNIlai.js";import{c as fe,s as pe}from"./engenty-CNjaZCVM.js";import{F as M,P as me,U as he,X as ge,Y as _e,g as ve,n as N,nt as ye,q as P,s as F}from"./i18n-Dy3fTQM3.js";var be=class extends C{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,n.data),hasPreviousPage:x(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function xe(e,t){return y(e,be,t)}var Se={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};Se.node;var I=_(Se),Ce={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};Ce.node;var L=_(Ce),we={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};we.node;var Te=_(we),Ee={name:`circle-euro`,size:24,node:[[`path`,{d:`M15 9.4a4 4 0 1 0 0 5.2`,key:`1makmb`}],[`path`,{d:`M7 12h5`,key:`gblrwe`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Ee.node;var De=_(Ee),Oe={name:`clapperboard`,size:24,node:[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]};Oe.node;var R=_(Oe),ke={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};ke.node;var z=_(ke),Ae={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Ae.node;var B=_(Ae),je={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};je.node;var V=_(je),Me={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Me.node;var Ne=_(Me),Pe={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};Pe.node;var Fe=_(Pe),Ie={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Ie.node;var H=_(Ie),Le={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};Le.node;var Re=_(Le),ze={name:`scan-text`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}]]};ze.node;var Be=_(ze),Ve={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};Ve.node;var U=_(Ve),He={name:`table-2`,size:24,node:[[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]};He.node;var Ue=_(He),We={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};We.node;var Ge=_(We),Ke={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Ke.node;var qe=_(Ke),Je={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Je.node;var W=_(Je),Ye=[`text`,`web`,`browser`,`documents`,`image`,`video`,`speech`,`listening`,`code`,`connectors`,`motion-graphics`],Xe=new Set([`html`,`md`,`txt`,`csv`,`json`]),Ze=new Set([`code`]),Qe=new Set([`web_search`,`browser`,`sandbox`,`image`]),$e=new Set([`web_fetch`,`http`]),et=/\{\{\s*memory\b/;function tt(e){switch(e.type){case`agent`:return[e.instructions,e.call?JSON.stringify(e.call.input):``];case`generate`:return[e.prompt,e.options?.style??``];case`motion-graphics`:return[e.brief];case`widget`:case`surface`:return Object.values(e.data).map(e=>`{{${M(e)}}}`);default:return[]}}function nt(e,t){return e.steps.slice(t+1).some(e=>e.type===`agent`&&!e.call||e.type===`generate`||e.type===`motion-graphics`)}function rt(e,t){let n=[],r=(t,r)=>{let i=n.find(e=>e.need===t);i?i.hard||=r:n.push({stepId:e.id,need:t,hard:r})},i=t.steps.indexOf(e);for(let t of tt(e))et.test(t)&&r(`memory`,!0),ye(t).some(e=>e.startsWith(`lists.`))&&r(`lists`,!0);switch(e.type){case`page`:for(let n of e.fields){switch(n.kind){case`audio`:r(`field:audio`,!!n.required);break;case`connection`:r(`field:connection`,!0);break;case`slot`:r(`field:slot`,!0);break;case`list`:r(`lists`,!0);break;case`location`:r(`field:location`,!1);break;case`image`:r(`field:image`,!1);break;case`file`:nt(t,i)?r(`field:file-read`,!0):r(`field:file`,!1)}n.optionsFrom&&P(M(n.optionsFrom).split(`.`).slice(0,2).join(`.`))&&r(`lists`,!0)}break;case`agent`:{let t=e.call?[...e.tools,e.call.tool]:e.tools;for(let e of t){let t=_e(e);t?r(`plugin:${t.plugin}`,!0):$e.has(e)||Ze.has(e)||(Qe.has(e)?r(`tool:${e}`,!0):r(`tool:${e}`,!1))}e.connections?.length&&r(`connections`,!0),e.each&&(P(M(e.each))?r(`lists`,!0):r(`each`,!1));break}case`generate`:e.asset!==`document`&&e.asset!==`dashboard`&&r(`asset:${e.asset}`,!0);break;case`motion-graphics`:r(`motion-graphics`,!0);break;case`widget`:r(e.video?`widget:video`:`widget`,!0);break;case`surface`:Object.values(e.data).some(e=>P(M(e)))&&r(`lists`,!0);break;case`review`:e.show.some(e=>P(e))&&r(`lists`,!0);break;case`result`:for(let n of e.deliverables){if(P(n.from)){r(`lists`,!0);continue}let e=t.steps.find(e=>e.id===n.from);if(e?.type!==`agent`&&(e?.type!==`generate`||e.asset!==`document`&&e.asset!==`dashboard`))continue;let i=n.formats.some(e=>Xe.has(e));for(let t of n.formats)Xe.has(t)||(t!==`pdf`||e?.type!==`agent`)&&r(`format:${t}`,t!==`pdf`&&!i)}}return n}function it(e){let t=e.steps.flatMap(t=>rt(t,e));e.lists?.length&&!t.some(e=>e.need===`lists`)&&t.push({stepId:e.steps[0]?.id??``,need:`lists`,hard:!0}),e.connections?.length&&!t.some(e=>e.need===`connections`)&&t.push({stepId:e.steps[0]?.id??``,need:`connections`,hard:!0});let n=st(e);return{fit:t.some(e=>e.hard&&n.has(e.stepId))?`no`:t.length?`less`:`full`,notes:t}}function at(e){switch(e){case`tool:web_search`:case`tool:web_fetch`:return`web`;case`tool:browser`:return`browser`;case`tool:sandbox`:return`code`;case`tool:image`:case`asset:image`:return`image`;case`asset:video`:case`motion-graphics`:case`widget:video`:return`video`;case`asset:voice`:return`speech`;case`field:audio`:return`listening`;case`tool:http`:case`connections`:case`field:connection`:return`connectors`;case`field:image`:case`field:file`:case`field:file-read`:return`documents`;default:return null}}function ot(e){let t=it(e),n=st(e),r=new Set,i=new Set,a=new Set,o=new Set;for(let e of t.notes){if(e.need.startsWith(`plugin:`)){a.add(e.need.slice(7));continue}if(e.need.startsWith(`format:`)){o.add(e.need.slice(7));continue}let t=at(e.need);t&&(e.hard&&n.has(e.stepId)?r.add(t):i.add(t))}for(let e of r)i.delete(e);return{...t,missing:[...r],optional:[...i],needs:[...a].sort(),without:[...o]}}function st(e){return e.steps.length?ct(e,e.steps[0].id,{}):new Set}function ct(e,t,n){let r=new Map(e.steps.map((e,t)=>[e.id,t])),i=r.get(t)??0,a=t=>{let i=[];for(let a of e.steps[t].next??[]){if(he(a))continue;let t=a.goto===`end`?e.steps.length:r.get(a.goto)??-1;if(a.ask||!me(a.when).every(e=>e.field in n)){t>=0&&i.push(t);continue}if(ge(a,n))return t>=0?[...i,t]:i}return i.push(lt(e,t,r)),i},o=t=>{if(t===i)return!1;let n=new Set([i]),r=[i];for(;r.length;){let i=r.shift();if(i>=e.steps.length)return!0;for(let e of a(i))e!==t&&!n.has(e)&&(n.add(e),r.push(e))}return!1};return new Set(e.steps.filter((e,t)=>!o(t)).map(e=>e.id))}function lt(e,t,n){let r=e.steps[t].next?.find(he)?.goto;return r===void 0?t+1:r===`end`?e.steps.length:n.get(r)??t+1}var ut=[`text`,`document`,`table`,`image`,`video`,`audio`,`dashboard`],dt=[`any`,`trades`,`gastronomy`,`hospitality`,`realEstate`,`retail`,`health`,`professional`,`agency`,`events`,`publicSector`],ft=[`marketing`,`sales`,`accounting`,`service`,`research`,`hr`,`operations`,`website`,`visuals`,`inquiries`,`advice`],pt=[`free`,`pro`],mt={"format.text":`Text`,"format.document":`Document (PDF, Word)`,"format.table":`Table`,"format.image":`Image`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Any industry`,"industry.trades":`Trades`,"industry.gastronomy":`Food service`,"industry.hospitality":`Hotels & tourism`,"industry.realEstate":`Real estate`,"industry.retail":`Retail`,"industry.health":`Health`,"industry.professional":`Professional services`,"industry.agency":`Agency & marketing`,"industry.events":`Events`,"industry.publicSector":`Associations & public sector`,"useCase.marketing":`Marketing & social media`,"useCase.sales":`Offers & sales`,"useCase.accounting":`Accounting & receipts`,"useCase.service":`Customer service`,"useCase.research":`Research & analysis`,"useCase.hr":`HR & applications`,"useCase.operations":`Planning & operations`,"useCase.website":`Website helpers`,"useCase.visuals":`Images & video`,"useCase.inquiries":`Inquiries & bookings`,"useCase.advice":`Advice & pricing`,"capability.text":`Writes text`,"capability.web":`Web search`,"capability.browser":`Drives a browser`,"capability.documents":`Reads documents & photos`,"capability.image":`Makes images`,"capability.video":`Makes video`,"capability.speech":`Speech output`,"capability.listening":`Understands voice notes`,"capability.code":`Runs code`,"capability.connectors":`Connected accounts & systems`,"capability.motion-graphics":`Motion graphics with Claude Code (on your subscription)`,"cost.low":`low cost`,"cost.medium":`medium cost`,"cost.high":`high cost`,"plan.free":`Free`,"plan.pro":`Pro`,"outline.otherwise":`otherwise`,"outline.and":`{first} and {second}`,"outline.with":`with {name}`,"outline.without":`without {name}`,"outline.contains":`{name} contains {value}`},ht={en:mt,de:{"format.text":`Text`,"format.document":`Dokument (PDF, Word)`,"format.table":`Tabelle`,"format.image":`Bild`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Jede Branche`,"industry.trades":`Handwerk`,"industry.gastronomy":`Gastronomie`,"industry.hospitality":`Hotel & Tourismus`,"industry.realEstate":`Immobilien`,"industry.retail":`Handel`,"industry.health":`Gesundheit`,"industry.professional":`Kanzlei & Beratung`,"industry.agency":`Agentur & Marketing`,"industry.events":`Veranstaltungen`,"industry.publicSector":`Vereine & Öffentliches`,"useCase.marketing":`Marketing & Social Media`,"useCase.sales":`Angebote & Verkauf`,"useCase.accounting":`Buchhaltung & Belege`,"useCase.service":`Kundenservice`,"useCase.research":`Recherche & Analyse`,"useCase.hr":`Personal & Bewerbungen`,"useCase.operations":`Planung & Abläufe`,"useCase.website":`Helfer für die Website`,"useCase.visuals":`Bilder & Video`,"useCase.inquiries":`Anfragen & Termine`,"useCase.advice":`Beratung & Preise`,"capability.text":`Text schreiben`,"capability.web":`Websuche`,"capability.browser":`Browser bedienen`,"capability.documents":`Dokumente & Fotos lesen`,"capability.image":`Bilder erzeugen`,"capability.video":`Videos erzeugen`,"capability.speech":`Sprachausgabe`,"capability.listening":`Sprachnotizen verstehen`,"capability.code":`Code ausführen`,"capability.connectors":`Verbundene Konten & Systeme`,"capability.motion-graphics":`Motion-Grafik mit Claude Code (auf deinem Abo)`,"cost.low":`günstig`,"cost.medium":`mittel`,"cost.high":`teuer`,"plan.free":`Kostenlos`,"plan.pro":`Pro`,"outline.otherwise":`sonst`,"outline.and":`{first} und {second}`,"outline.with":`mit {name}`,"outline.without":`ohne {name}`,"outline.contains":`{name} enthält {value}`}};function gt(e,t,n,r){let i=`${e}.${t}`;return i in mt?ve(ht,i,n,r):t}var G=t(n(),1);function _t(e){switch(e.type){case`page`:return H;case`agent`:return j;case`generate`:return e.asset===`image`?V:e.asset===`video`?v:e.asset===`dashboard`?Ne:l;case`widget`:return I;case`surface`:return Fe;case`motion-graphics`:return R;case`review`:return z;case`result`:return B}return W}var vt={page:`bg-cobalt-tint text-cobalt`,agent:`bg-ember-tint text-ember-strong`,generate:`bg-amber-tint text-ink-2`,widget:`bg-ember-veil text-ember-strong`,surface:`bg-ember-veil text-ember-strong`,"motion-graphics":`bg-amber-tint text-ink-2`,review:`bg-moss-tint text-moss`,result:`bg-paper-2 text-ink-2`};function yt(e){return F(`type.${e.type}`)}var bt=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`,`code`];function xt(e){return bt.includes(e)?F(`tool.${e}`):e}function St(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:return e.tools.map(xt).join(` · `)||e.instructions.slice(0,90);case`generate`:{let t=[e.asset];return e.options?.aspectRatio&&t.push(e.options.aspectRatio),e.options?.duration&&t.push(`${e.options.duration}s`),e.options?.resolution&&t.push(e.options.resolution),e.options?.template&&t.push(e.options.template),t.join(` · `)}case`widget`:return[e.entry,Object.keys(e.data).join(`, `)].filter(Boolean).join(` · `);case`surface`:return e.candidates?e.candidates.map(e=>e.id).join(` · `):Object.keys(e.data).join(`, `);case`motion-graphics`:return[e.format,e.seconds?`${e.seconds}s`:null,e.skills.join(`, `)].filter(Boolean).join(` · `);case`review`:return[e.edit?F(`editor.reviewEditable`):null,e.regenerate?F(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var Ct=e({EntryDialog:()=>Q,MarketplaceBrowser:()=>Jt,MarketplaceCards:()=>qt,MarketplaceFit:()=>Kt,MarketplaceHits:()=>Wt,ProChip:()=>Nt,useFit:()=>Gt,useSettled:()=>$}),K=t(r(),1),wt=(0,G.lazy)(()=>A(()=>import(`./FlowPreview-BBN-APkG.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])));function Tt({level:e}){let t=e.next,n=t?Math.max(0,t.runs-e.progress.runs):0,r=t?Math.max(0,t.published-e.progress.published):0,i=t?Math.min(1,(Math.min(e.progress.runs/Math.max(1,t.runs),1)+Math.min(e.progress.published/Math.max(1,t.published||1),1))/2):1;return(0,K.jsxs)(`div`,{className:`mx-auto mt-3 flex max-w-md items-center gap-3 text-[0.78125rem] text-ink-3`,children:[(0,K.jsx)(`span`,{className:`shrink-0 font-medium text-ink-2`,children:F(`market.level`,{level:e.level,name:e.name})}),(0,K.jsx)(`span`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-paper-3`,children:(0,K.jsx)(`span`,{className:`block h-full rounded-full bg-primary`,style:{width:`${i*100}%`}})}),(0,K.jsx)(`span`,{className:`shrink-0`,children:t?F(r?`market.levelNextPublish`:`market.levelNext`,{runs:n,published:r,name:t.name}):F(`market.levelTop`)})]})}var Et={useCase:``,industry:``,format:``,capability:``,plan:``},q=(e,t)=>gt(e,t,N),Dt={en:Te,de:De};function Ot(e){if(e<1)return 1;let t=10**Math.floor(Math.log10(e));return Math.round(e/t)*t}function kt(e){return e.credits?F(`market.credits`,{n:Ot(e.credits.credits)}):q(`cost`,e.costTier)}var At={text:qe,document:l,table:Ue,image:V,video:v,audio:a,dashboard:L};function J({format:e,className:t}){let n=At[e],r=q(`format`,e);return(0,K.jsx)(`span`,{title:r,className:`inline-flex`,children:(0,K.jsx)(n,{className:t,"aria-label":r,role:`img`})})}var jt=[`low`,`medium`,`high`];function Mt({entry:e}){let t=jt.indexOf(e.costTier)+1,n=Dt[N];return(0,K.jsxs)(`span`,{title:kt(e),className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex shrink-0`,children:jt.slice(0,t).map((e,t)=>(0,K.jsx)(`span`,{className:w(`rounded-full bg-(--coin-bg,var(--color-card))`,t>0&&`-ml-1.5`),children:(0,K.jsx)(n,{className:`size-4`})},e))}),q(`cost`,e.costTier)]})}function Nt(){return(0,K.jsx)(c,{tone:`ember`,title:F(`market.proHint`),children:F(`market.pro`)})}function Pt({plugin:e}){return(0,K.jsx)(c,{icon:(0,K.jsx)(Re,{className:`size-3.5`}),title:F(`market.fromPlugin`,{name:e.name}),children:e.name})}function Y({entry:e,onOpen:t,why:n}){return(0,K.jsxs)(o,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:w(`relative flex min-h-[124px] cursor-pointer flex-col gap-5 p-4 text-left transition sm:min-h-[136px] sm:p-5 hover:shadow-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,(!e.usable||e.missing.length>0||!!e.needs?.length)&&`opacity-60`),children:[(0,K.jsx)(`span`,{className:`-top-4 pointer-events-none absolute right-4`,children:(0,K.jsx)(de,{kind:e.avatar,costume:e.costume,size:68})}),(0,K.jsxs)(`div`,{className:`min-w-0 pr-20`,children:[(0,K.jsxs)(`div`,{className:`font-display font-semibold text-[0.9375rem]`,children:[e.title,e.plan===`pro`?(0,K.jsx)(`span`,{className:`ml-1.5 inline-flex align-middle`,children:(0,K.jsx)(Nt,{})}):null,e.starred?(0,K.jsx)(U,{className:`ml-1.5 inline size-3.5 fill-amber align-[-2px] text-amber`,"aria-label":F(`market.starred`)}):null]}),e.featured?(0,K.jsx)(`div`,{className:`mt-1`,children:(0,K.jsx)(c,{tone:`ember`,children:F(`market.recommended`)})}):null,(0,K.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3 leading-snug`,children:e.pitch})]}),(0,K.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-x-3 gap-y-1.5 text-[0.75rem] text-ink-3`,children:[n?(0,K.jsx)(c,{children:n}):null,e.plugin?(0,K.jsx)(Pt,{plugin:e.plugin}):null,e.needs?.length?(0,K.jsx)(c,{tone:`warn`,children:F(`market.needsPro`,{list:e.needs.join(`, `)})}):e.usable&&e.missing.length?(0,K.jsx)(c,{tone:`warn`,children:F(`market.missing`,{list:Z(e.missing)})}):e.usable?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(O,{className:`size-3.5`}),` `,F(`market.minutes`,{n:e.effort.minutes})]}),(0,K.jsx)(Mt,{entry:e}),e.optional?.length?(0,K.jsx)(c,{title:F(`market.optionalHint`,{list:Z(e.optional)}),children:F(`market.without`,{list:Z(e.optional)})}):null,(0,K.jsx)(`span`,{className:`ml-auto inline-flex items-center gap-1.5`,children:e.formats.map(e=>(0,K.jsx)(J,{format:e,className:`size-4`},e))})]}):(0,K.jsx)(c,{tone:`warn`,children:F(`market.needsUpdate`)})]})]})}function X({title:e,children:t}){return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:e}),t]})}var Z=e=>e.map(e=>q(`capability`,e)).join(`, `),Ft={text:d,web:ie,browser:ne,documents:Be,image:V,video:v,speech:ae,listening:p,code:Ge,connectors:re,"motion-graphics":R};function It(e){switch(e.type){case`page`:return H;case`agent`:return j;case`generate`:return e.asset===`image`?V:e.asset===`video`?v:e.asset===`voice`?ae:e.asset===`dashboard`?L:l;case`widget`:return e.video?R:I;case`surface`:return I;case`motion-graphics`:return R;case`review`:return z;case`result`:return B}return W}function Lt(e){let t=new Set;for(let[n,r]of e.entries())for(let i of r.branches??[]){let r=i.to===`end`?e.length:e.findIndex(e=>e.id===i.to);for(let i=n+1;i<r;i++)t.add(e[i].id)}return t}function Rt(e){let t=Lt(e);return e.map(e=>({id:e.id,title:e.title,icon:It(e),tone:vt[e.type]??`bg-paper-2 text-ink-2`,optional:t.has(e.id),branches:e.branches}))}function zt({title:e,children:t}){return(0,K.jsx)(`span`,{title:e,className:`inline-flex items-center gap-2 border-border border-l px-4 first:border-l-0 first:pl-0`,children:t})}function Bt({icon:e,children:t,more:n}){return(0,K.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,K.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`text-[0.875rem] text-ink leading-snug`,children:t}),n?(0,K.jsx)(`div`,{className:`text-[0.75rem] text-ink-3 leading-snug`,children:n}):null]})]})}function Vt({className:e,children:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)({above:!1,below:!1});(0,G.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{let t=e.scrollTop>1,n=e.scrollTop+e.clientHeight<e.scrollHeight-1;i(e=>e.above===t&&e.below===n?e:{above:t,below:n})};t(),e.addEventListener(`scroll`,t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild),()=>{e.removeEventListener(`scroll`,t),r.disconnect()}},[]);let a=`linear-gradient(to bottom, ${r.above?`transparent`:`black`} 0, black 28px, black calc(100% - 44px), ${r.below?`transparent`:`black`} 100%)`;return(0,K.jsx)(`div`,{ref:n,className:e,style:{maskImage:a,WebkitMaskImage:a},children:(0,K.jsx)(`div`,{children:t})})}function Q({id:e,fallback:t,onClose:n,onUse:r,busy:a}){let o=u(),s=S(),c=E({queryKey:[`marketplace-entry`,e,N],queryFn:()=>i.get(`/api/studio/marketplace/${encodeURIComponent(e)}?lang=${N}`),enabled:!!e,retry:!1}),l=c.data??t,d=k({mutationFn:t=>{let n=`/api/studio/marketplace/${encodeURIComponent(e)}/star`;return t?i.put(n):i.del(n)},onSuccess:()=>Promise.all([o.invalidateQueries({queryKey:[`marketplace`]}),o.invalidateQueries({queryKey:[`marketplace-entry`,e]})])}),f=ue()===`dark`,p=pe[fe[l?.avatar||`round`]],m=f?`var(--card)`:`color-mix(in oklch, ${p??`var(--ink-4)`} 14%, var(--paper-2))`;return(0,K.jsx)(te,{open:!!e,onClose:n,wide:!0,bare:!0,children:l?(0,K.jsxs)(`div`,{className:`relative flex max-h-[calc(100dvh-48px)] flex-col rounded-2xl bg-card shadow-overlay max-sm:h-dvh max-sm:max-h-none max-sm:rounded-none`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":F(`common.close`),onClick:n,className:`sm:-top-3.5 sm:-right-3.5 absolute top-3 right-3 z-20 flex size-9 items-center justify-center rounded-full bg-card text-ink-2 shadow-elevated ring-1 ring-border-soft transition hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,children:(0,K.jsx)(T,{className:`size-4`})}),(0,K.jsxs)(`header`,{className:`relative shrink-0 border-border-soft border-b px-5 pt-5 pb-4 text-ink sm:rounded-t-2xl sm:px-7`,style:{background:m,"--coin-bg":m},children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 overflow-hidden sm:rounded-t-2xl`,children:(0,K.jsx)(`span`,{className:w(`-top-28 -right-10 absolute size-80 rounded-full bg-white blur-3xl`,f?`opacity-[0.14]`:`opacity-80`)})}),(0,K.jsx)(`div`,{className:`-bottom-5 absolute right-9 z-10 max-sm:hidden`,children:(0,K.jsx)(de,{kind:l.avatar,costume:l.costume,size:104})}),(0,K.jsxs)(`div`,{className:`relative sm:pr-36`,children:[(0,K.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight max-sm:pr-10`,children:l.title}),(0,K.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-2 leading-snug`,children:c.data?.description||l.pitch})]}),l.usable?(0,K.jsxs)(`div`,{className:`-mx-5 sm:-mx-7 relative mt-3.5 flex flex-wrap items-center gap-y-2 border-border-soft border-t px-5 pt-3 font-medium text-[0.875rem] sm:px-7 sm:pr-40`,children:[(0,K.jsxs)(zt,{title:F(`market.duration`),children:[(0,K.jsx)(O,{className:`size-4 text-ink-3`}),F(`market.minutes`,{n:l.effort.minutes})]}),(0,K.jsx)(zt,{title:F(`market.cost`),children:(0,K.jsx)(Mt,{entry:l})}),(0,K.jsx)(zt,{title:F(`market.result`),children:l.formats.map(e=>(0,K.jsx)(J,{format:e,className:`size-4`},e))})]}):null]}),l.usable?(0,K.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-x-7 gap-y-6 px-5 pt-6 max-sm:overflow-y-auto max-sm:pb-4 sm:grid-cols-[230px_minmax(0,1fr)] sm:grid-rows-[minmax(0,1fr)] sm:px-7`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-5 sm:min-h-0 sm:overflow-y-auto`,children:[(0,K.jsx)(X,{title:F(`market.duration`),children:(0,K.jsx)(Bt,{icon:(0,K.jsx)(O,{className:`size-4 text-moss`}),more:F(`market.durationHint`,{n:l.effort.fields}),children:F(`market.minutes`,{n:l.effort.minutes})})}),(0,K.jsx)(X,{title:F(`market.cost`),children:(0,K.jsx)(Bt,{icon:(0,K.jsx)(se,{className:`size-4 text-amber`}),more:l.credits?F(`market.creditsHint`):void 0,children:(0,K.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2`,children:[(0,K.jsx)(Mt,{entry:l}),l.credits?(0,K.jsx)(`span`,{className:`text-ink-2`,children:F(`market.creditsRange`,{n:Ot(l.credits.credits)})}):null]})})}),(0,K.jsx)(X,{title:F(`market.result`),children:(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:(c.data?.results??[]).map(e=>(0,K.jsx)(Bt,{icon:(0,K.jsx)(J,{format:e.kind,className:`size-4 text-ember-strong`}),more:e.formats.map(e=>e.toUpperCase()).join(` · `),children:e.title},e.title))})}),(0,K.jsx)(X,{title:F(`market.needs`),children:(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.capabilities.map(e=>{let t=Ft[e],n=l.missing.includes(e),r=l.optional?.includes(e);return(0,K.jsxs)(`li`,{className:w(`flex items-center gap-2.5 text-[0.875rem]`,n?`text-ink-3`:`text-ink-2`),children:[(0,K.jsx)(t,{className:w(`size-4 shrink-0`,n?`text-rose`:r?`text-amber`:`text-cobalt`)}),q(`capability`,e),n?(0,K.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:F(`market.unavailable`)}):r?(0,K.jsx)(`span`,{className:`text-[0.75rem] text-amber`,children:F(`market.optional`)}):null]},e)})})})]}),(0,K.jsxs)(`div`,{className:`flex flex-col sm:min-h-0`,children:[(0,K.jsx)(`div`,{className:`mb-1.5 shrink-0 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:F(`market.steps`)}),(0,K.jsx)(Vt,{className:`-mr-2 overscroll-contain pt-1 pr-2 pl-1 sm:min-h-0 sm:flex-1 sm:overflow-y-auto`,children:c.isLoading?(0,K.jsx)(D,{className:`size-5 text-ink-3`}):(0,K.jsx)(G.Suspense,{fallback:(0,K.jsx)(D,{className:`size-5 text-ink-3`}),children:(0,K.jsx)(wt,{steps:Rt(c.data?.outline??[])})})})]})]}):(0,K.jsx)(`div`,{className:`flex-1 px-5 pt-6 sm:px-7`,children:(0,K.jsx)(`p`,{className:`rounded-lg bg-amber-tint p-3 text-[0.875rem] text-ink-2`,children:F(`market.needsUpdateHint`)})}),(0,K.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 px-5 pt-4 pb-5 max-sm:border-border-soft max-sm:border-t sm:px-7 sm:pb-6`,children:[l.plugin?(0,K.jsx)(`span`,{className:`mr-auto flex items-center`,children:(0,K.jsx)(Pt,{plugin:l.plugin})}):(0,K.jsxs)(g,{variant:`ghost`,className:`mr-auto`,title:F(`market.starHint`),"aria-pressed":l.starred,busy:d.isPending,onClick:()=>d.mutate(!l.starred),children:[(0,K.jsx)(U,{className:w(`size-4`,l.starred&&`fill-amber text-amber`)}),(0,K.jsx)(`span`,{className:`max-sm:sr-only`,children:F(l.starred?`market.starred`:`market.star`)})]}),(0,K.jsx)(g,{variant:`secondary`,onClick:n,children:F(`common.close`)}),l.usable&&l.missing.length?(0,K.jsx)(g,{variant:`secondary`,onClick:()=>s(`/settings/models`),children:F(`editor.models.settings`)}):null,r?(0,K.jsx)(g,{disabled:!l.usable||l.missing.length>0||!!l.needs?.length,title:l.needs?.length?F(`market.needsProHint`,{list:l.needs.join(`, `)}):l.missing.length?F(`market.missingHint`,{list:Z(l.missing)}):l.optional?.length?F(`market.optionalHint`,{list:Z(l.optional)}):void 0,busy:a,onClick:()=>r(l),children:F(`market.use`)}):null]})]}):(0,K.jsx)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-3 rounded-2xl bg-card p-8 text-[0.875rem] text-ink-2 shadow-overlay`,children:c.isLoading?(0,K.jsx)(D,{className:`size-6 text-ink-3`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{children:F(`market.notFound`)}),(0,K.jsx)(g,{variant:`secondary`,onClick:n,children:F(`common.close`)})]})})})}function Ht({name:e,value:t,options:n,onChange:r}){let[i,a]=(0,G.useState)(!1),o=(0,G.useRef)(null);(0,G.useEffect)(()=>{if(!i)return;let e=e=>{o.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let c=n.find(e=>e.value===t);return(0,K.jsxs)(`div`,{ref:o,className:`relative`,children:[(0,K.jsxs)(`div`,{className:w(`flex h-8 items-center rounded-full text-[0.8125rem] transition`,c?`bg-ember-tint text-ink`:`text-ink-2 hover:bg-paper-2 hover:text-ink`,i&&!c&&`bg-paper-2 text-ink`),children:[(0,K.jsx)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":i,onClick:()=>a(!i),className:w(`flex h-full items-center gap-1.5 rounded-full pl-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,c?`pr-1`:`pr-2.5`),children:c?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,K.jsx)(`span`,{className:`font-medium`,children:c.label})]}):(0,K.jsxs)(K.Fragment,{children:[e,(0,K.jsx)(s,{className:w(`size-3.5 transition`,i&&`rotate-180`)})]})}),c?(0,K.jsx)(`button`,{type:`button`,"aria-label":`${e}: ${F(`market.reset`)}`,onClick:()=>r(``),className:`mr-1 flex size-6 items-center justify-center rounded-full text-ink-3 hover:bg-card hover:text-ink`,children:(0,K.jsx)(T,{className:`size-3.5`})}):null]}),i?(0,K.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`absolute top-full left-0 z-30 mt-1.5 max-h-80 min-w-60 overflow-y-auto rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:n.map(e=>(0,K.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.value===t,disabled:!e.count||e.unavailable,onClick:()=>{r(e.value===t?``:e.value),a(!1)},className:w(`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[0.875rem] transition coarse:py-2.5`,e.count&&!e.unavailable?`text-ink-2 hover:bg-paper-2 hover:text-ink`:`text-ink-4`,e.value===t&&`font-medium text-ink`),children:[e.icon,(0,K.jsx)(`span`,{className:`flex-1 whitespace-nowrap`,children:e.label}),e.value===t?(0,K.jsx)(m,{className:`size-4 text-ember`}):e.unavailable?(0,K.jsx)(`span`,{className:`whitespace-nowrap text-[0.75rem] text-ink-4`,children:F(`market.unavailable`)}):(0,K.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:e.count})]},e.value))}):null]})}function $(e,t){let[n,r]=(0,G.useState)(e);return(0,G.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var Ut=60;function Wt({query:e,onUse:t,busy:n,limit:r=6}){let[a,o]=(0,G.useState)(null),s=$(e.trim(),250),c=E({queryKey:[`marketplace`,N,s,`hits`,r],queryFn:()=>i.get(`/api/studio/marketplace?${new URLSearchParams({lang:N,limit:String(r),offset:`0`,q:s})}`),enabled:!!s,placeholderData:f}),l=s?c.data?.entries??[]:[];return l.length?(0,K.jsxs)(`section`,{className:`mt-10`,children:[(0,K.jsxs)(`h2`,{className:`mb-5 flex items-center gap-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:[F(`market.hits`),c.isFetching?(0,K.jsx)(D,{className:`size-3.5`}):null]}),(0,K.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:l.map(e=>(0,K.jsx)(Y,{entry:e,onOpen:()=>o(e.id)},e.id))}),(0,K.jsx)(Q,{id:a,fallback:l.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:t,busy:n})]}):null}function Gt(){let e=E({queryKey:[`marketplace`,N,`fit`],queryFn:()=>i.get(`/api/studio/marketplace?${new URLSearchParams({lang:N,limit:`12`,offset:`0`,fit:`1`})}`)});return e.data?.context&&e.data.entries.some(e=>e.fit)?e.data:null}function Kt({page:e,organization:t,onUse:n,busy:r,onAll:i}){let[a,o]=(0,G.useState)(null),s=e.context??{sector:null,sectorName:null},c=e.entries,l=e=>e.fit===`sector`||e.fit===`industry`?s.sectorName:e.fit===`wish`?F(`market.fitWish`):null;return(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h2`,{className:`mt-16 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:F(`market.fitTitle`,{organization:t})}),(0,K.jsx)(`p`,{className:`mt-2 mb-5 text-center text-[0.875rem] text-ink-3`,children:s.sectorName?F(`market.fitLine`,{sector:s.sectorName}):F(`market.fitLinePlain`)}),(0,K.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:c.map((e,t)=>(0,K.jsx)(`div`,{className:w(`contents`,t>=4&&`max-sm:hidden`,t>=8&&`sm:max-lg:hidden`),children:(0,K.jsx)(Y,{entry:e,why:l(e),onOpen:()=>o(e.id)})},e.id))}),(0,K.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,K.jsx)(g,{variant:`secondary`,onClick:i,children:F(`market.fitAll`,{n:e.all||e.total})})}),(0,K.jsx)(Q,{id:a,fallback:c.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:n,busy:r})]})}function qt({entries:e}){let t=u(),n=S(),{project:r}=ce(),a=le()&&!!r&&!r?.readOnly,[o,s]=(0,G.useState)(null),c=k({mutationFn:e=>i.post(`/api/studio/wizards`,{projectId:r.id,starterId:e,lang:N}),onSuccess:async({id:e})=>{await t.invalidateQueries({queryKey:h.spaces()}),await t.invalidateQueries({queryKey:[`wizards`]}),s(null),n(`/edit/${e}`)}});return(0,K.jsxs)(`div`,{className:`@container mt-3`,children:[(0,K.jsx)(`div`,{className:`flex flex-col gap-4 @xl:grid @xl:grid-cols-2`,children:e.map(e=>(0,K.jsx)(Y,{entry:e,onOpen:()=>s(e.id)},e.id))}),c.error?(0,K.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:c.error.message}):null,(0,K.jsx)(Q,{id:o,fallback:e.find(e=>e.id===o)??null,onClose:()=>s(null),onUse:a?e=>!c.isPending&&c.mutate(e.id):void 0,busy:c.isPending})]})}function Jt({onUse:e,busy:t,open:n,search:r,onGuestOpen:a}){let[o,s]=(0,G.useState)(``);(0,G.useEffect)(()=>{r&&s(r.text)},[r]);let[c,l]=(0,G.useState)(Et),[u,d]=(0,G.useState)(!1),[p,m]=(0,G.useState)(n??null),h=$(o.trim(),250),_=(0,G.useRef)(null);(0,G.useEffect)(()=>{let e=_.current;h&&e&&window.matchMedia(`(max-width: 639px)`).matches&&e.scrollIntoView({behavior:`smooth`,block:`start`})},[h]);let v=xe({queryKey:[`marketplace`,N,h,c,u],queryFn:({pageParam:e})=>{let t=new URLSearchParams({lang:N,limit:String(Ut),offset:String(e)});h&&t.set(`q`,h);for(let[e,n]of Object.entries(c))n&&t.set(e,n);return u&&t.set(`starred`,`1`),i.get(`/api/${a?`guest`:`studio`}/marketplace?${t}`)},initialPageParam:0,getNextPageParam:(e,t)=>{let n=t.reduce((e,t)=>e+t.entries.length,0);return n<e.total?n:void 0},placeholderData:f}),y=v.data?.pages[0],b=v.data?.pages.flatMap(e=>e.entries)??[],x=y?.all??0,S=o.trim()!==h||v.isFetching&&!v.isFetchingNextPage,C=(e,t,n,r)=>n.filter(t=>y?.facets[e]?.[t]!==void 0).map(n=>({value:n,label:q(t,n),icon:r?.(n),count:(y?.facets[e])[n]??0,unavailable:e===`capability`&&te.has(n)})),te=new Set(y?.unavailable??[]),E=C(`useCase`,`useCase`,ft),ne=[{key:`industry`,name:F(`market.industry`),options:C(`industry`,`industry`,dt)},{key:`format`,name:F(`market.format`),options:C(`format`,`format`,ut,e=>(0,K.jsx)(J,{format:e,className:`size-4 text-ink-3`}))},{key:`plan`,name:F(`market.plan`),options:C(`plan`,`plan`,pt)},{key:`capability`,name:F(`market.capability`),options:C(`capability`,`capability`,Ye,e=>{let t=Ft[e];return(0,K.jsx)(t,{className:`size-4 text-ink-3`})})}],O=!!o.trim()||u||Object.values(c).some(Boolean),k=()=>{l(Et),s(``),d(!1)};if(v.isLoading)return(0,K.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,K.jsx)(D,{className:`size-6 text-ink-3`})});let A=y?.offline?(0,K.jsxs)(`p`,{className:`mt-4 flex items-center justify-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,K.jsx)(oe,{className:`size-4 shrink-0`}),F(`market.offline`)]}):null;if(!x&&!O)return A;let j=o?(0,K.jsx)(`button`,{type:`button`,"aria-label":F(`market.reset`),onClick:()=>s(``),className:`-mr-1.5 flex size-7 shrink-0 items-center justify-center rounded-full text-ink-3 hover:bg-paper-2 hover:text-ink`,children:(0,K.jsx)(T,{className:`size-4`})}):null,re=e=>w(`inline-flex h-7 shrink-0 items-center gap-1 whitespace-nowrap rounded-full px-2.5 text-[0.78125rem] transition`,e?`bg-card font-medium text-ink shadow-soft ring-1 ring-border-soft`:`text-ink-3 hover:bg-card/60 hover:text-ink`);return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`label`,{ref:_,className:`relative mx-auto flex h-10 max-w-md scroll-mt-4 items-center gap-2.5 rounded-full bg-card px-4 shadow-soft ring-1 ring-border-soft transition focus-within:ring-2 focus-within:ring-focus sm:h-11`,children:[S?(0,K.jsx)(D,{className:`size-4 shrink-0 text-ink-3`}):(0,K.jsx)(ee,{className:`size-4 shrink-0 text-ink-3`}),(0,K.jsx)(`input`,{type:`search`,value:o,onChange:e=>s(e.target.value),placeholder:F(`market.search`),"aria-label":F(`market.search`),className:`min-w-0 flex-1 bg-transparent text-[0.9375rem] outline-none placeholder:text-ink-4 [&::-webkit-search-cancel-button]:hidden`}),j]}),A,y?.level?(0,K.jsx)(Tt,{level:y.level}):null,(0,K.jsxs)(`div`,{className:`max-sm:-mx-3 mt-4 flex gap-1 max-sm:overflow-x-auto max-sm:px-3 max-sm:[scrollbar-width:none] sm:flex-wrap sm:justify-center max-sm:[&::-webkit-scrollbar]:hidden`,children:[[{value:``,label:F(`market.all`)},...E].map(e=>(0,K.jsx)(`button`,{type:`button`,"aria-pressed":!u&&c.useCase===e.value,onClick:()=>{d(!1),l({...c,useCase:e.value})},className:re(!u&&c.useCase===e.value),children:e.label},e.value)),a?null:(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":u,onClick:()=>d(!u),className:re(u),children:[(0,K.jsx)(U,{className:w(`size-3.5`,u&&`fill-amber text-amber`)}),F(`market.starred`)]})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-1 gap-y-2 sm:mt-6`,children:[u?null:ne.map(e=>(0,K.jsx)(Ht,{name:e.name,value:c[e.key],options:e.options,onChange:t=>l({...c,[e.key]:t})},e.key)),(0,K.jsxs)(`span`,{className:`ml-auto flex items-center gap-3 whitespace-nowrap pl-2 text-[0.8125rem] text-ink-3`,children:[O?(0,K.jsxs)(`button`,{type:`button`,onClick:k,className:`inline-flex items-center gap-1 text-ember-strong underline-offset-2 hover:underline`,children:[(0,K.jsx)(T,{className:`size-3.5 max-sm:size-4`}),(0,K.jsx)(`span`,{className:`max-sm:sr-only`,children:F(`market.resetShort`)})]}):null,O?(0,K.jsx)(`span`,{className:`tabular-nums sm:hidden`,children:F(`market.countOfShort`,{n:y?.total??0,all:x})}):null,(0,K.jsx)(`span`,{className:w(`tabular-nums`,O&&`max-sm:hidden`),children:O?F(`market.countOf`,{n:y?.total??0,all:x}):F(`market.count`,{n:x})})]})]}),b.length?(0,K.jsx)(`div`,{className:`mt-4 flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:b.map(e=>(0,K.jsx)(Y,{entry:e,onOpen:()=>a?a(e):m(e.id)},e.id))}):(0,K.jsxs)(`div`,{className:`py-10 text-center text-[0.875rem] text-ink-3`,children:[(0,K.jsx)(`p`,{children:F(u?`market.noneStarred`:`market.none`)}),(0,K.jsx)(g,{variant:`ghost`,className:`mt-2`,onClick:k,children:F(`market.reset`)})]}),v.hasNextPage?(0,K.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,K.jsx)(g,{variant:`secondary`,busy:v.isFetchingNextPage,onClick:()=>void v.fetchNextPage(),children:F(`market.more`)})}):null,(0,K.jsx)(Q,{id:p,fallback:b.find(e=>e.id===p)??null,onClose:()=>m(null),onUse:e,busy:t})]})}export{xe as A,Fe as C,R as D,z as E,L as O,H as S,B as T,W as _,Ct as a,U as b,$ as c,St as d,xt as f,ot as g,at as h,Wt as i,I as k,vt as l,gt as m,Jt as n,Nt as o,yt as p,Kt as r,Gt as s,Q as t,_t as u,qe as v,V as w,Re as x,Ue as y};
|