@engenty/wizards-runtime 0.9.4 → 0.9.6

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 (52) hide show
  1. package/apps/runtime/dist/cli/main.js +2 -0
  2. package/apps/runtime/dist/credits/credits.js +9 -3
  3. package/apps/runtime/dist/engine/runner.js +11 -1
  4. package/apps/runtime/dist/manage.js +8 -2
  5. package/apps/runtime/dist/plugins/runs.js +4 -1
  6. package/apps/runtime/dist/routes/runs.js +4 -1
  7. package/apps/web/dist/assets/{AboutDialog-CsqUDxPv.js → AboutDialog-CZr1JFvY.js} +1 -1
  8. package/apps/web/dist/assets/{ChangelogDialog-vV9nXOBV.js → ChangelogDialog-0pKHVdhu.js} +1 -1
  9. package/apps/web/dist/assets/{EditorPage-CfmubDLB.js → EditorPage-_qnWDno2.js} +2 -2
  10. package/apps/web/dist/assets/{FlowPreview-DoBlokAp.js → FlowPreview-BZZvY5U9.js} +1 -1
  11. package/apps/web/dist/assets/{Harness-GnlSI4-P.js → Harness-DPRw6BmX.js} +1 -1
  12. package/apps/web/dist/assets/{Marketplace-CYsq0K7A.js → Marketplace-BwbLRU2n.js} +2 -2
  13. package/apps/web/dist/assets/{NewWizardChannels-DUS3dRCj.js → NewWizardChannels-K5vfNzaC.js} +1 -1
  14. package/apps/web/dist/assets/{NewWizardPage-Cm9ydfUW.js → NewWizardPage-zYwDoQTe.js} +1 -1
  15. package/apps/web/dist/assets/{OnboardingPage-xI83C1V1.js → OnboardingPage-jFgWaWJV.js} +1 -1
  16. package/apps/web/dist/assets/{PreviewPane-B-X0rChi.js → PreviewPane-D5Kn9Ila.js} +2 -2
  17. package/apps/web/dist/assets/{ProjectPage-Bu6uD-Kb.js → ProjectPage-CyeEBVGi.js} +1 -1
  18. package/apps/web/dist/assets/{PublicRunner-BWBE74Kn.js → PublicRunner-_N7DyvWj.js} +1 -1
  19. package/apps/web/dist/assets/{ReadOnly-DKgWZ_1q.js → ReadOnly-CQ8lWsnZ.js} +1 -1
  20. package/apps/web/dist/assets/{SettingsPage-B9euFl71.js → SettingsPage-haivwaZK.js} +2 -2
  21. package/apps/web/dist/assets/{SetupPage-C3XLbBTO.js → SetupPage-Dy8KeG7z.js} +1 -1
  22. package/apps/web/dist/assets/{SharePage-CSj1sAVS.js → SharePage-BXkykFJC.js} +1 -1
  23. package/apps/web/dist/assets/changelog-XRs8voQT.js +1 -0
  24. package/apps/web/dist/assets/{coins-D0MI0EKw.js → coins-Bo9_D-7S.js} +1 -1
  25. package/apps/web/dist/assets/{index-qc7o4bkp.js → index-CXA_do-X.js} +5 -5
  26. package/apps/web/dist/assets/index-DG0i3S-z.css +1 -0
  27. package/apps/web/dist/assets/oss-credits-C2JUsf2d.js +1 -0
  28. package/apps/web/dist/assets/{phone-BZ-sPZr6.js → phone-BPybLMSm.js} +1 -1
  29. package/apps/web/dist/assets/preload-helper-DpV6A1kQ.js +1 -0
  30. package/apps/web/dist/assets/{qr-scanner.min-C_UI0gH-.js → qr-scanner.min-BGqShvxG.js} +1 -1
  31. package/apps/web/dist/assets/{runners-CED2yPuf.js → runners-53tvGeez.js} +1 -1
  32. package/apps/web/dist/assets/{session-DyndueX0.js → session-DvW7auj-.js} +1 -1
  33. package/apps/web/dist/assets/{settings-menu-C960R1kx.js → settings-menu-tSPDYTfT.js} +1 -1
  34. package/apps/web/dist/assets/{theme-Zp5g-teI.js → theme-CWGl7LyL.js} +1 -1
  35. package/apps/web/dist/assets/{ui-DVkIZqDg.js → ui-Bk08zclS.js} +3 -3
  36. package/apps/web/dist/assets/{upload-HFTtsOaE.js → upload-Ct_-rz05.js} +1 -1
  37. package/apps/web/dist/assets/{useMutation-D3zIOVOt.js → useMutation-DM9Anfo-.js} +1 -1
  38. package/apps/web/dist/assets/{volume-2-DazUIp6w.js → volume-2-CHuzf68z.js} +1 -1
  39. package/apps/web/dist/assets/{wrench-BHe19Ol_.js → wrench-BAgonupx.js} +1 -1
  40. package/apps/web/dist/index.html +9 -9
  41. package/apps/web/dist/install.ps1 +1 -1
  42. package/apps/web/dist/install.sh +1 -1
  43. package/apps/web/dist/mcp/flow.html +54 -54
  44. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +1 -0
  45. package/node_modules/@engenty/wizards-shared/dist/run.js +2 -0
  46. package/package.json +3 -3
  47. package/plugin/.claude-plugin/plugin.json +1 -1
  48. package/plugin/plugin.json +1 -1
  49. package/apps/web/dist/assets/changelog-pnMcOVO_.js +0 -1
  50. package/apps/web/dist/assets/index-DtjKnB3s.css +0 -1
  51. package/apps/web/dist/assets/oss-credits-D7izqI_0.js +0 -1
  52. package/apps/web/dist/assets/preload-helper-CNEI7N0N.js +0 -1
@@ -1,3 +1,5 @@
1
+ // First: drops Node's `localStorage` before a dependency reads it (no-webstorage.ts).
2
+ import "../no-webstorage.js";
1
3
  import "./install-env.js";
2
4
  import { accountCommand } from "./account.js";
3
5
  import { apps, connectCommand } from "./connect.js";
@@ -31,19 +31,25 @@ export async function balanceCredits() {
31
31
  }
32
32
  return (await tenantInfo(currentTenant(), true).catch(() => null))?.balanceCredits ?? null;
33
33
  }
34
- /** Holds credits for a run before it starts. False = the free balance does not cover it. */
35
- export async function reserveForRun(runId, credits) {
34
+ /**
35
+ * Holds credits for a run before it starts. False = the free balance does not cover it;
36
+ * "guest_budget" = a visitor's run past what visitors may spend on this tenant's wizards.
37
+ */
38
+ export async function reserveForRun(runId, credits, guest = false) {
36
39
  if (!managed || credits <= 0) {
37
40
  return true;
38
41
  }
39
42
  try {
40
- await reserve(currentTenant(), runId, Math.ceil(credits));
43
+ await reserve(currentTenant(), runId, Math.ceil(credits), guest);
41
44
  return true;
42
45
  }
43
46
  catch (err) {
44
47
  if (err instanceof ManageError && err.status === 402) {
45
48
  return false;
46
49
  }
50
+ if (err instanceof ManageError && err.code === "guest_budget") {
51
+ return "guest_budget";
52
+ }
47
53
  throw err;
48
54
  }
49
55
  }
@@ -51,6 +51,12 @@ export class NoCreditsError extends NotedError {
51
51
  super(note("wizardRunOutCredits"));
52
52
  }
53
53
  }
54
+ /** A visitor's run past the day's or the month's budget for visitors (the Manage-App's guest budget). */
55
+ export class GuestBudgetError extends NotedError {
56
+ constructor() {
57
+ super(note("guestBudget"));
58
+ }
59
+ }
54
60
  /** The runs this process drives right now, with the handle that stops each. */
55
61
  const active = new Map();
56
62
  // --- the line ------------------------------------------------------------------
@@ -158,7 +164,11 @@ export async function createRun(input) {
158
164
  }
159
165
  // The run's expected cost is held before it starts; what it really costs is booked per call.
160
166
  const estimate = await estimateRun(input.wizardId, input.version, input.definition, await stepsWithoutModel(input.definition));
161
- if (!(await reserveForRun(id, estimate.reserve))) {
167
+ const held = await reserveForRun(id, estimate.reserve, input.mode === "live" && !!input.visitorId);
168
+ if (held === "guest_budget") {
169
+ throw new GuestBudgetError();
170
+ }
171
+ if (!held) {
162
172
  throw new NoCreditsError();
163
173
  }
164
174
  await db.insert(schema.run).values({
@@ -171,8 +171,14 @@ export function verifyKey(key) {
171
171
  export function grantActive(userId, clientId, tenantId) {
172
172
  return call("POST", "/v1/grants/check", { userId, clientId, tenantId });
173
173
  }
174
- export function reserve(tenantId, runId, credits) {
175
- return call("POST", "/v1/reservations", { tenantId, runId, credits });
174
+ /** `guest`: a visitor started the run, so it counts against the organization's guest budget. */
175
+ export function reserve(tenantId, runId, credits, guest = false) {
176
+ return call("POST", "/v1/reservations", {
177
+ tenantId,
178
+ runId,
179
+ credits,
180
+ ...(guest ? { guest: true } : {}),
181
+ });
176
182
  }
177
183
  export function release(runId) {
178
184
  return call("POST", "/v1/reservations/release", { runId });
@@ -6,7 +6,7 @@ import { db, schema, withTenant } from "../db/client.js";
6
6
  import { answerAsk } from "../engine/asks.js";
7
7
  import { watchRun } from "../engine/events.js";
8
8
  import { fieldErrorsIn } from "../engine/input.js";
9
- import { cancel, createRun, goBack, NoCreditsError, RunInputError, retry, reviewStep, submitPage, } from "../engine/runner.js";
9
+ import { cancel, createRun, GuestBudgetError, goBack, NoCreditsError, RunInputError, retry, reviewStep, submitPage, } from "../engine/runner.js";
10
10
  import { saveAsset } from "../files/storage.js";
11
11
  import { checkUpload } from "../files/upload-check.js";
12
12
  import { wizardUnavailable } from "../limits.js";
@@ -67,6 +67,9 @@ export function runsApiFor(pluginId) {
67
67
  if (err instanceof ModelUnavailableError) {
68
68
  throw new ServiceError("refused", errorText(err, textLang(wizardLang(version.definition))));
69
69
  }
70
+ if (err instanceof GuestBudgetError) {
71
+ throw new ServiceError("refused", noteText({ code: "guestBudget" }, wizardLang(version.definition)));
72
+ }
70
73
  if (err instanceof NoCreditsError) {
71
74
  throw new ServiceError("no_credits", noteText({ code: "wizardRunOutCredits" }, wizardLang(version.definition)));
72
75
  }
@@ -22,7 +22,7 @@ import { fieldErrorsIn } from "../engine/input.js";
22
22
  import { fromOwner } from "../engine/owner.js";
23
23
  import { pushAvailable, setPushDevice } from "../engine/push.js";
24
24
  import { liveResources } from "../engine/resources.js";
25
- import { cancel, createRun, editOutput, goBack, NoCreditsError, projectIdOf, RunConflict, RunInputError, retry, reviewStep, runView, submitPage, talkAllowed, } from "../engine/runner.js";
25
+ import { cancel, createRun, editOutput, GuestBudgetError, goBack, NoCreditsError, projectIdOf, RunConflict, RunInputError, retry, reviewStep, runView, submitPage, talkAllowed, } from "../engine/runner.js";
26
26
  import { basePath, env } from "../env.js";
27
27
  import { loadAsset, saveAsset } from "../files/storage.js";
28
28
  import { checkUpload } from "../files/upload-check.js";
@@ -409,6 +409,9 @@ export const publicRoutes = new Hono()
409
409
  return c.json({ runId });
410
410
  }
411
411
  catch (err) {
412
+ if (err instanceof GuestBudgetError) {
413
+ return refuse(c, { code: "guestBudget" }, 429);
414
+ }
412
415
  if (err instanceof NoCreditsError || err instanceof ModelUnavailableError) {
413
416
  return refuse(c, { code: "wizardUnavailable" }, 403);
414
417
  }
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$t as r,Ar as i,Bt as a,Ht as o,Ir as s,Jt as c,Ut as l,Vt as u,Zt as d,ar as f,on as p}from"./ui-DVkIZqDg.js";import{t as m}from"./preload-helper-CNEI7N0N.js";import{t as h}from"./logo-CGNoptDg.js";import{G as g,nt as _,tt as v}from"./index-qc7o4bkp.js";import{c as y,f as b}from"./settings-menu-C960R1kx.js";import{ReleaseNotes as x,loadReleases as S,releaseDate as C,releaseLabel as w}from"./ChangelogDialog-vV9nXOBV.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:a}){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)(i,{"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})]}),a?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:a}):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:p(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,i]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return m(()=>import(`./oss-credits-D7izqI_0.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||i(``)},[e]);let a=r.trim().toLowerCase(),o=e=>a?e.filter(e=>k(a,e.name,e.license,p(e.description))):e,s=e=>a?e.filter(e=>k(a,e.name,e.license,e.version)):e,d=o(E),f=o(D),h=t?[{id:`shared`,label:p(`about.creditsShared`),packages:s(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:s(e.packages)}))].filter(e=>e.packages.length>0):[],g=d.length===0&&f.length===0&&h.length===0;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:p(`about.creditsHint`)}),(0,O.jsx)(l,{type:`search`,value:r,placeholder:p(`about.search`),onChange:e=>i(e.target.value)}),d.length>0?(0,O.jsx)(j,{title:p(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:d})}):null,f.length>0?(0,O.jsx)(j,{title:p(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:f})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(c,{})}):h.length>0?(0,O.jsx)(j,{title:p(`about.creditsDeps`),hint:a?void 0:p(`about.creditsDepsHint`),children:h.map(e=>(0,O.jsx)(N,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,O.jsx)(u,{children:p(`about.noMatches`)}):null]})}var F=[`new`,`earlier`,`credits`],I=e=>p(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),L=e=>e===1?p(`about.change`):p(`about.changes`,{n:e});function R({me:e,active:t,initialTab:n=`new`}){let i=e?.mode===`local`,{data:a,latest:o}=v(i&&t),[l,u]=(0,T.useState)(null),[f,m]=(0,T.useState)(n);(0,T.useEffect)(()=>m(n),[n]);let E=b(F.indexOf(f)),D=a?.newer&&o?o:_;(0,T.useEffect)(()=>{if(!t)return;let e=!1;return u(null),S(D===`0.9.4`?void 0:D).then(t=>{e||u(t)}),()=>{e=!0}},[t,D]);let k=l?.find(e=>e.version===`v${D}`)??l?.[0]??null,A=l?.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)(h,{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:[p(`about.version`,{v:_}),j?` · ${p(`about.kind.${j}`)}`:``]})]}),i?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(g,{enabled:t})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(d,{value:f,onChange:m,options:F.map(e=>({id:e,label:I(e)})),label:p(`about.title`)})}),(0,O.jsxs)(`div`,{className:r(`mt-5`,y(E)),children:[f===`new`?l===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(c,{})}):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:p(`about.changelogEmpty`)}):null,f===`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)(s,{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,f===`credits`?(0,O.jsx)(P,{active:!0}):null]},f)]})}function z({open:e,onClose:t,me:n}){return(0,O.jsxs)(a,{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)(o,{label:p(`common.close`),onClick:t,children:(0,O.jsx)(f,{className:`size-4`})})}),(0,O.jsx)(R,{me:n,active:e})]})}export{z as AboutDialog,R as AboutPanel};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$t as r,Ar as i,Bt as a,Ht as o,Ir as s,Jt as c,Ut as l,Vt as u,Zt as d,ar as f,on as p}from"./ui-Bk08zclS.js";import{t as m}from"./preload-helper-DpV6A1kQ.js";import{t as h}from"./logo-CGNoptDg.js";import{G as g,nt as _,tt as v}from"./index-CXA_do-X.js";import{c as y,f as b}from"./settings-menu-tSPDYTfT.js";import{ReleaseNotes as x,loadReleases as S,releaseDate as C,releaseLabel as w}from"./ChangelogDialog-0pKHVdhu.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:a}){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)(i,{"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})]}),a?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:a}):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:p(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,i]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return m(()=>import(`./oss-credits-C2JUsf2d.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||i(``)},[e]);let a=r.trim().toLowerCase(),o=e=>a?e.filter(e=>k(a,e.name,e.license,p(e.description))):e,s=e=>a?e.filter(e=>k(a,e.name,e.license,e.version)):e,d=o(E),f=o(D),h=t?[{id:`shared`,label:p(`about.creditsShared`),packages:s(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:s(e.packages)}))].filter(e=>e.packages.length>0):[],g=d.length===0&&f.length===0&&h.length===0;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:p(`about.creditsHint`)}),(0,O.jsx)(l,{type:`search`,value:r,placeholder:p(`about.search`),onChange:e=>i(e.target.value)}),d.length>0?(0,O.jsx)(j,{title:p(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:d})}):null,f.length>0?(0,O.jsx)(j,{title:p(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:f})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(c,{})}):h.length>0?(0,O.jsx)(j,{title:p(`about.creditsDeps`),hint:a?void 0:p(`about.creditsDepsHint`),children:h.map(e=>(0,O.jsx)(N,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,O.jsx)(u,{children:p(`about.noMatches`)}):null]})}var F=[`new`,`earlier`,`credits`],I=e=>p(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),L=e=>e===1?p(`about.change`):p(`about.changes`,{n:e});function R({me:e,active:t,initialTab:n=`new`}){let i=e?.mode===`local`,{data:a,latest:o}=v(i&&t),[l,u]=(0,T.useState)(null),[f,m]=(0,T.useState)(n);(0,T.useEffect)(()=>m(n),[n]);let E=b(F.indexOf(f)),D=a?.newer&&o?o:_;(0,T.useEffect)(()=>{if(!t)return;let e=!1;return u(null),S(D===`0.9.6`?void 0:D).then(t=>{e||u(t)}),()=>{e=!0}},[t,D]);let k=l?.find(e=>e.version===`v${D}`)??l?.[0]??null,A=l?.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)(h,{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:[p(`about.version`,{v:_}),j?` · ${p(`about.kind.${j}`)}`:``]})]}),i?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(g,{enabled:t})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(d,{value:f,onChange:m,options:F.map(e=>({id:e,label:I(e)})),label:p(`about.title`)})}),(0,O.jsxs)(`div`,{className:r(`mt-5`,y(E)),children:[f===`new`?l===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(c,{})}):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:p(`about.changelogEmpty`)}):null,f===`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)(s,{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,f===`credits`?(0,O.jsx)(P,{active:!0}):null]},f)]})}function z({open:e,onClose:t,me:n}){return(0,O.jsxs)(a,{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)(o,{label:p(`common.close`),onClick:t,children:(0,O.jsx)(f,{className:`size-4`})})}),(0,O.jsx)(R,{me:n,active:e})]})}export{z as AboutDialog,R as AboutPanel};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$t as r,Bt as i,Jt as a,Ut as o,Vt as s,on as c}from"./ui-DVkIZqDg.js";import{t as l}from"./preload-helper-CNEI7N0N.js";var u=e(t(),1),d=e(n(),1);function f(e){switch(e.group){case`Added`:return{label:`NEW`,dot:`bg-moss`};case`Fixed`:return{label:`FIXED`,dot:`bg-amber`};case`Changed`:return{label:`CHANGED`,dot:`bg-cobalt`};case`Performance`:return{label:`PERFORMANCE`,dot:`bg-ember`};case`Deploy`:return{label:`DEPLOY`,dot:`bg-ink-4`};case`Docs`:return{label:`DOCS`,dot:`bg-ink-4`};default:return{label:`OTHER`,dot:`bg-ink-4`}}}var p=e=>e.version?e.version.replace(/^v/,``):c(`about.unreleased`),m=e=>e.timestamp?new Date(e.timestamp*1e3).toISOString().slice(0,10):``,h=e=>e.charAt(0).toUpperCase()+e.slice(1);function g(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=[];for(let t of e){if(`${p(t)} ${m(t)}`.toLowerCase().includes(n)){r.push(t);continue}let e=t.commits.filter(e=>`${f(e).label} ${e.scope??``} ${e.message}`.toLowerCase().includes(n));e.length>0&&r.push({...t,commits:e})}return r}async function _(e){if(e)try{let t=await fetch(`https://raw.githubusercontent.com/engenty/wizards/v${e}/apps/web/src/about/changelog.json`,{signal:AbortSignal.timeout(5e3)});if(t.ok)return await t.json()}catch{}return(await l(async()=>{let{default:e}=await import(`./changelog-pnMcOVO_.js`);return{default:e}},[])).default}function v({release:e}){return(0,d.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.commits.map(e=>{let t=f(e);return(0,d.jsxs)(`li`,{className:`flex items-start gap-2.5 text-[0.875rem]`,children:[(0,d.jsx)(`span`,{className:r(`mt-[7px] size-1.5 shrink-0 rounded-full`,t.dot)}),(0,d.jsxs)(`span`,{className:`min-w-0 text-ink-2`,children:[(0,d.jsxs)(`span`,{className:`font-semibold text-[0.75rem] text-ink tracking-wide`,children:[t.label,e.scope?` [${e.scope}]`:``]}),` `,h(e.message),e.breaking?(0,d.jsx)(`span`,{className:`ml-1.5 rounded-full bg-rose-tint px-1.5 py-0.5 font-medium text-[0.75rem] text-rose`,children:c(`about.breaking`)}):null]})]},e.id)})})}function y({open:e,onClose:t,version:n}){let[r,l]=(0,u.useState)(null),[f,h]=(0,u.useState)(``);(0,u.useEffect)(()=>{if(!e||r)return;let t=!1;return _(n).then(e=>{t||l(e)}),()=>{t=!0}},[e,r,n]),(0,u.useEffect)(()=>{e||h(``)},[e]);let y=r?g(r,f):[];return(0,d.jsxs)(i,{open:e,onClose:t,title:c(`about.changelog`),wide:!0,height:`tall`,children:[(0,d.jsx)(`p`,{className:`-mt-3 mb-4 text-[0.875rem] text-ink-3`,children:c(`about.changelogHint`)}),r===null?(0,d.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,d.jsx)(a,{})}):r.length===0?(0,d.jsx)(s,{children:c(`about.changelogEmpty`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o,{type:`search`,value:f,placeholder:c(`about.search`),onChange:e=>h(e.target.value)}),y.length===0?(0,d.jsx)(s,{children:c(`about.noMatches`)}):null,y.map(e=>(0,d.jsxs)(`section`,{className:`mt-6`,children:[(0,d.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[p(e),(0,d.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:m(e)})]}),(0,d.jsx)(`div`,{className:`mt-3`,children:(0,d.jsx)(v,{release:e})})]},e.version??`unreleased`))]})]})}export{y as ChangelogDialog,v as ReleaseNotes,_ as loadReleases,m as releaseDate,p as releaseLabel};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$t as r,Bt as i,Jt as a,Ut as o,Vt as s,on as c}from"./ui-Bk08zclS.js";import{t as l}from"./preload-helper-DpV6A1kQ.js";var u=e(t(),1),d=e(n(),1);function f(e){switch(e.group){case`Added`:return{label:`NEW`,dot:`bg-moss`};case`Fixed`:return{label:`FIXED`,dot:`bg-amber`};case`Changed`:return{label:`CHANGED`,dot:`bg-cobalt`};case`Performance`:return{label:`PERFORMANCE`,dot:`bg-ember`};case`Deploy`:return{label:`DEPLOY`,dot:`bg-ink-4`};case`Docs`:return{label:`DOCS`,dot:`bg-ink-4`};default:return{label:`OTHER`,dot:`bg-ink-4`}}}var p=e=>e.version?e.version.replace(/^v/,``):c(`about.unreleased`),m=e=>e.timestamp?new Date(e.timestamp*1e3).toISOString().slice(0,10):``,h=e=>e.charAt(0).toUpperCase()+e.slice(1);function g(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=[];for(let t of e){if(`${p(t)} ${m(t)}`.toLowerCase().includes(n)){r.push(t);continue}let e=t.commits.filter(e=>`${f(e).label} ${e.scope??``} ${e.message}`.toLowerCase().includes(n));e.length>0&&r.push({...t,commits:e})}return r}async function _(e){if(e)try{let t=await fetch(`https://raw.githubusercontent.com/engenty/wizards/v${e}/apps/web/src/about/changelog.json`,{signal:AbortSignal.timeout(5e3)});if(t.ok)return await t.json()}catch{}return(await l(async()=>{let{default:e}=await import(`./changelog-XRs8voQT.js`);return{default:e}},[])).default}function v({release:e}){return(0,d.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.commits.map(e=>{let t=f(e);return(0,d.jsxs)(`li`,{className:`flex items-start gap-2.5 text-[0.875rem]`,children:[(0,d.jsx)(`span`,{className:r(`mt-[7px] size-1.5 shrink-0 rounded-full`,t.dot)}),(0,d.jsxs)(`span`,{className:`min-w-0 text-ink-2`,children:[(0,d.jsxs)(`span`,{className:`font-semibold text-[0.75rem] text-ink tracking-wide`,children:[t.label,e.scope?` [${e.scope}]`:``]}),` `,h(e.message),e.breaking?(0,d.jsx)(`span`,{className:`ml-1.5 rounded-full bg-rose-tint px-1.5 py-0.5 font-medium text-[0.75rem] text-rose`,children:c(`about.breaking`)}):null]})]},e.id)})})}function y({open:e,onClose:t,version:n}){let[r,l]=(0,u.useState)(null),[f,h]=(0,u.useState)(``);(0,u.useEffect)(()=>{if(!e||r)return;let t=!1;return _(n).then(e=>{t||l(e)}),()=>{t=!0}},[e,r,n]),(0,u.useEffect)(()=>{e||h(``)},[e]);let y=r?g(r,f):[];return(0,d.jsxs)(i,{open:e,onClose:t,title:c(`about.changelog`),wide:!0,height:`tall`,children:[(0,d.jsx)(`p`,{className:`-mt-3 mb-4 text-[0.875rem] text-ink-3`,children:c(`about.changelogHint`)}),r===null?(0,d.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,d.jsx)(a,{})}):r.length===0?(0,d.jsx)(s,{children:c(`about.changelogEmpty`)}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o,{type:`search`,value:f,placeholder:c(`about.search`),onChange:e=>h(e.target.value)}),y.length===0?(0,d.jsx)(s,{children:c(`about.noMatches`)}):null,y.map(e=>(0,d.jsxs)(`section`,{className:`mt-6`,children:[(0,d.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[p(e),(0,d.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:m(e)})]}),(0,d.jsx)(`div`,{className:`mt-3`,children:(0,d.jsx)(v,{release:e})})]},e.version??`unreleased`))]})]})}export{y as ChangelogDialog,v as ReleaseNotes,_ as loadReleases,m as releaseDate,p as releaseLabel};