wizards 0.2.55 → 0.2.57

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 (123) hide show
  1. package/README.md +2 -2
  2. package/apps/runtime/dist/cli/autostart.js +1 -1
  3. package/apps/runtime/dist/cli/machine.js +5 -48
  4. package/apps/runtime/dist/cli/report.js +1 -1
  5. package/apps/runtime/dist/db/control-schema.js +13 -0
  6. package/apps/runtime/dist/db/migrations/control/0008_runner.sql +8 -0
  7. package/apps/runtime/dist/db/migrations/control/meta/0008_snapshot.json +505 -0
  8. package/apps/runtime/dist/db/migrations/control/meta/_journal.json +7 -0
  9. package/apps/runtime/dist/db/migrations/tenant/0014_run_answer.sql +2 -0
  10. package/apps/runtime/dist/db/migrations/tenant/meta/0014_snapshot.json +3154 -0
  11. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
  12. package/apps/runtime/dist/db/schema.js +4 -0
  13. package/apps/runtime/dist/docs/dev/index.md +4 -4
  14. package/apps/runtime/dist/docs/dev/plugins/connections.md +4 -3
  15. package/apps/runtime/dist/docs/dev/plugins/events.md +1 -0
  16. package/apps/runtime/dist/docs/dev/plugins/examples.md +10 -9
  17. package/apps/runtime/dist/docs/dev/plugins/index.md +4 -3
  18. package/apps/runtime/dist/docs/dev/plugins/layout.md +2 -1
  19. package/apps/runtime/dist/docs/dev/plugins/meta.json +0 -1
  20. package/apps/runtime/dist/docs/dev/plugins/quick-start.md +4 -3
  21. package/apps/runtime/dist/docs/dev/plugins/reference.md +36 -14
  22. package/apps/runtime/dist/docs/dev/plugins/reloading.md +5 -5
  23. package/apps/runtime/dist/docs/dev/plugins/routes.md +30 -6
  24. package/apps/runtime/dist/docs/dev/plugins/runners.md +15 -10
  25. package/apps/runtime/dist/docs/dev/plugins/server.md +16 -7
  26. package/apps/runtime/dist/docs/dev/plugins/shipping.md +4 -26
  27. package/apps/runtime/dist/docs/dev/plugins/space.md +66 -53
  28. package/apps/runtime/dist/docs/dev/plugins/starters.md +10 -7
  29. package/apps/runtime/dist/docs/dev/plugins/studio.md +33 -12
  30. package/apps/runtime/dist/docs/dev/plugins/styling.md +19 -9
  31. package/apps/runtime/dist/docs/dev/plugins/tables.md +6 -4
  32. package/apps/runtime/dist/docs/dev/plugins/tools.md +22 -12
  33. package/apps/runtime/dist/docs/dev/wizard-format.md +3 -2
  34. package/apps/runtime/dist/docs/user/ai-apps.md +3 -1
  35. package/apps/runtime/dist/docs/user/assistant.md +5 -3
  36. package/apps/runtime/dist/docs/user/build-a-wizard.md +14 -2
  37. package/apps/runtime/dist/docs/user/command-line.md +16 -14
  38. package/apps/runtime/dist/docs/user/connectors.md +17 -12
  39. package/apps/runtime/dist/docs/user/data.md +14 -9
  40. package/apps/runtime/dist/docs/user/first-start.md +13 -6
  41. package/apps/runtime/dist/docs/user/index.md +2 -1
  42. package/apps/runtime/dist/docs/user/install.md +19 -11
  43. package/apps/runtime/dist/docs/user/models.md +44 -22
  44. package/apps/runtime/dist/docs/user/plugins.md +9 -4
  45. package/apps/runtime/dist/docs/user/run.md +14 -9
  46. package/apps/runtime/dist/docs/user/server.md +7 -5
  47. package/apps/runtime/dist/docs/user/space.md +15 -8
  48. package/apps/runtime/dist/docs/user/steps.md +33 -13
  49. package/apps/runtime/dist/docs/user/test-and-share.md +41 -25
  50. package/apps/runtime/dist/docs/user/troubleshooting.md +15 -7
  51. package/apps/runtime/dist/docs/user/wordpress.md +59 -49
  52. package/apps/runtime/dist/engine/asks.js +53 -33
  53. package/apps/runtime/dist/engine/events.js +45 -1
  54. package/apps/runtime/dist/engine/owner.js +32 -0
  55. package/apps/runtime/dist/engine/runner.js +131 -97
  56. package/apps/runtime/dist/env.js +25 -3
  57. package/apps/runtime/dist/harness/apple.js +36 -21
  58. package/apps/runtime/dist/harness/claude.js +1 -1
  59. package/apps/runtime/dist/harness/model.js +2 -2
  60. package/apps/runtime/dist/index.js +13 -2
  61. package/apps/runtime/dist/limits.js +7 -4
  62. package/apps/runtime/dist/media/conversation.js +6 -5
  63. package/apps/runtime/dist/model-errors.js +22 -1
  64. package/apps/runtime/dist/models.js +30 -7
  65. package/apps/runtime/dist/plugins/pro-keys.js +1 -1
  66. package/apps/runtime/dist/plugins/pro-state.js +1 -1
  67. package/apps/runtime/dist/plugins/pro.js +1 -1
  68. package/apps/runtime/dist/plugins/runs.js +20 -15
  69. package/apps/runtime/dist/render/browser-path.js +54 -0
  70. package/apps/runtime/dist/routes/runs.js +67 -38
  71. package/apps/runtime/dist/routes/studio.js +7 -3
  72. package/apps/runtime/dist/services/api.js +3 -1
  73. package/apps/runtime/dist/services/package-file.js +8 -8
  74. package/apps/runtime/dist/services/runs.js +7 -8
  75. package/apps/runtime/dist/tenants/control.js +85 -7
  76. package/apps/runtime/dist/update.js +1 -1
  77. package/apps/web/dist/assets/AboutDialog-DEZCEQlN.js +1 -0
  78. package/apps/web/dist/assets/{ChangelogDialog-BLmJABe4.js → ChangelogDialog-CgnnJj4G.js} +1 -1
  79. package/apps/web/dist/assets/{ChatView-YAiOT6mt.js → ChatView-BnnKdwk4.js} +1 -1
  80. package/apps/web/dist/assets/{EditorPage-C0zMXwlF.js → EditorPage-CeDWjq4z.js} +2 -2
  81. package/apps/web/dist/assets/{FlowPreview-B4lbmeha.js → FlowPreview-Du028FI3.js} +1 -1
  82. package/apps/web/dist/assets/{Harness-_riwRD-c.js → Harness-CEPy4MEp.js} +1 -1
  83. package/apps/web/dist/assets/{Marketplace-B0Nki6J6.js → Marketplace-ms58DQJ9.js} +2 -2
  84. package/apps/web/dist/assets/{NewWizardPage-DkvGgROv.js → NewWizardPage-CEQSNXeZ.js} +1 -1
  85. package/apps/web/dist/assets/{ProjectPage-CFRIPset.js → ProjectPage-CXDpKoK2.js} +1 -1
  86. package/apps/web/dist/assets/{PublicRunner-QJuQB7ff.js → PublicRunner-DMmtmzBX.js} +1 -1
  87. package/apps/web/dist/assets/{ReadOnly-DiOfNtVr.js → ReadOnly-zQecD9OB.js} +1 -1
  88. package/apps/web/dist/assets/{RunDrawer-LjUX3yIv.js → RunDrawer-BIojYB0g.js} +1 -1
  89. package/apps/web/dist/assets/{RunnerView-DkJVfUeG.js → RunnerView-D8OGEoMl.js} +1 -1
  90. package/apps/web/dist/assets/SettingsPage-BlMZL4_d.js +1 -0
  91. package/apps/web/dist/assets/SetupPage-Doz9T3kv.js +1 -0
  92. package/apps/web/dist/assets/{SharePage-CCimr8XT.js → SharePage-DOJXdsyi.js} +1 -1
  93. package/apps/web/dist/assets/{brand-CwLcF9JR.js → brand-DIKyySmf.js} +1 -1
  94. package/apps/web/dist/assets/changelog-B1jhC7Fv.js +1 -0
  95. package/apps/web/dist/assets/{circle-alert-BEDKtkJy.js → circle-alert-B9b9Vb9k.js} +1 -1
  96. package/apps/web/dist/assets/{esm-BCwno33N.js → esm-D6fM9MdG.js} +1 -1
  97. package/apps/web/dist/assets/{index-Dq-Wj6Yo.js → index-nfRuCdVt.js} +4 -4
  98. package/apps/web/dist/assets/{lock-Ce2ofIWG.js → lock-BNvsUKTg.js} +1 -1
  99. package/apps/web/dist/assets/session-CSbo-pmx.js +1 -0
  100. package/apps/web/dist/assets/{settings-menu-DX0JnPBR.js → settings-menu-BGfn4LJE.js} +1 -1
  101. package/apps/web/dist/assets/{ui-mkL5nF_f.js → ui-FW7ypPI6.js} +1 -1
  102. package/apps/web/dist/assets/{upload-BfrqabpO.js → upload-MQ_24gSb.js} +1 -1
  103. package/apps/web/dist/assets/{volume-2-C3GeMqc-.js → volume-2-B1mj20eS.js} +1 -1
  104. package/apps/web/dist/index.html +6 -6
  105. package/apps/web/dist/install.sh +2 -2
  106. package/apps/web/dist/mcp/flow.html +1 -1
  107. package/modules/calls/dist/client.css +1 -1
  108. package/modules/sms/dist/client.css +1 -1
  109. package/modules/whatsapp/dist/client.css +1 -1
  110. package/node_modules/@engenty-wizards/shared/dist/definition.js +1 -0
  111. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.js +1 -0
  112. package/node_modules/@engenty-wizards/shared/dist/fit.js +1 -0
  113. package/node_modules/@engenty-wizards/shared/dist/run.d.ts +152 -2
  114. package/node_modules/@engenty-wizards/shared/dist/run.js +135 -1
  115. package/node_modules/@engenty-wizards/shared/dist/store.js +1 -0
  116. package/node_modules/@engenty-wizards/shared/dist/surface.js +1 -0
  117. package/package.json +2 -2
  118. package/apps/runtime/dist/docs/dev/plugins/pro-modules.md +0 -59
  119. package/apps/web/dist/assets/AboutDialog-BelD7JCn.js +0 -1
  120. package/apps/web/dist/assets/SettingsPage-BKZ1KLfP.js +0 -1
  121. package/apps/web/dist/assets/SetupPage-Rqlo16Lk.js +0 -1
  122. package/apps/web/dist/assets/changelog-Bg5ZBu5p.js +0 -1
  123. package/apps/web/dist/assets/session-BuVghS-e.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$ as r,At as i,C as a,Ct as o,D as s,E as c,Et as l,H as u,J as d,Lt as f,N as p,Ot as m,Pt as h,Q as g,Qt as _,S as v,T as y,X as b,Z as x,a as S,b as C,bt as w,ct as T,dt as E,en as D,f as O,g as k,h as A,i as j,in as M,jt as N,kt as P,m as F,mt as I,vt as L,w as ee,xt as R,yt as z,zt as B}from"./ui-mkL5nF_f.js";import{r as te}from"./brand-CwLcF9JR.js";import{n as ne,r as re}from"./RunnerView-DkJVfUeG.js";import{t as ie}from"./volume-2-C3GeMqc-.js";import{J as ae,X as oe,Y as se,at as ce,ft as le,nt as ue,t as de}from"./index-Dq-Wj6Yo.js";var fe={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};fe.node;var pe=M(fe),me={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};me.node;var he=M(me),ge={name:`video-off`,size:24,node:[[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`,key:`w8jjjt`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`1xawa7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};ge.node;var V=M(ge),_e={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};_e.node;var ve=M(_e),ye=le(),H=e(t(),1),U=e(n(),1),be=typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches;function xe({since:e}){let[t,n]=(0,H.useState)(Date.now());if((0,H.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),!e)return null;let r=Math.max(0,Math.floor((t-e)/1e3)),i=String(Math.floor(r/60)).padStart(2,`0`),a=String(r%60).padStart(2,`0`);return(0,U.jsxs)(`span`,{className:`font-mono text-[0.8125rem] text-white/60 tabular-nums`,children:[i,`:`,a]})}function W({label:e,on:t,danger:n,busy:r,onClick:i,children:a}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":t,disabled:r,onClick:i,className:z(`flex size-12 items-center justify-center rounded-full transition disabled:opacity-50`,n?`bg-rose text-white hover:brightness-110`:t===!1?`bg-white text-neutral-900 hover:bg-white/90`:`bg-white/15 text-white hover:bg-white/25`),children:r?(0,U.jsx)(I,{className:`size-5`}):a})}function Se({voice:e}){let t=(0,H.useRef)(null),{captions:n}=e;return(0,H.useEffect)(()=>{n.length&&t.current?.scrollIntoView({block:`end`})},[n]),n.length?(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 sm:px-5`,children:(0,U.jsxs)(`ol`,{className:`mx-auto flex max-w-[720px] flex-col gap-2 py-2`,children:[n.map(e=>(0,U.jsx)(`li`,{className:z(`text-[0.9375rem] leading-snug`,e.who===`bot`?`text-white/95`:`text-right text-white/50`),children:e.text},e.id)),(0,U.jsx)(`div`,{ref:t})]})}):null}function Ce({voice:e,view:t,video:n,className:r}){let i=e.state===`live`,a=e.state===`connecting`,[s,c]=(0,H.useState)(null),[u,d]=(0,H.useState)(!1);(0,H.useEffect)(()=>{c(i?Date.now():null)},[i]);let f=async()=>{d(!1),await e.start(),n&&await e.startCamera()},p=()=>{e.stop(),d(!0)},h=n||e.camera,g=[...e.captions].reverse().find(e=>e.who===`bot`),_=[...e.captions].reverse().find(e=>e.who===`me`),v=e.speaking?o(`talk.speaking`):e.listening?o(`talk.listening`):i?o(`talk.live`):a?o(`talk.connecting`):u?o(`video.ended`):``;return(0,U.jsxs)(`section`,{className:z(`relative flex min-h-0 flex-col bg-neutral-950 text-white`,`safe-top`,r),children:[(0,U.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-3 px-4 sm:px-5`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1 truncate font-display font-semibold text-[1rem] tracking-tight`,children:t?.wizard.title??``}),v?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-white/70`,children:[i?(0,U.jsx)(`span`,{className:z(`size-2 rounded-full`,e.speaking?`animate-pulse-dot bg-emerald-400`:`bg-rose`)}):null,v]}):null,(0,U.jsx)(xe,{since:s})]}),(0,U.jsxs)(`div`,{className:z(`grid min-h-0 gap-2 px-3 pb-2 sm:px-4`,h?`flex-1 grid-cols-1 sm:grid-cols-2`:`shrink-0 grid-cols-1`,!h&&i&&e.captions.length?`h-[38%]`:h?``:`flex-1`),children:[(0,U.jsxs)(`div`,{className:z(`relative min-h-0 overflow-hidden rounded-2xl bg-neutral-900`,!h&&`hidden`),children:[(0,U.jsx)(`video`,{ref:e.video,muted:!0,playsInline:!0,autoPlay:!0,className:z(`absolute inset-0 h-full w-full object-cover`,e.facing===`user`&&`-scale-x-100`,e.camera?`block`:`hidden`)}),e.camera?null:(0,U.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2 text-white/50`,children:[(0,U.jsx)(V,{className:`size-8`}),(0,U.jsx)(`span`,{className:`text-[0.8125rem]`,children:o(`video.cameraOff`)})]}),(0,U.jsxs)(`span`,{className:`absolute bottom-2 left-3 rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:[o(`video.you`),e.muted?(0,U.jsx)(ce,{className:`ml-1.5 inline size-3`}):null]})]}),(0,U.jsxs)(`div`,{className:z(`relative flex min-h-0 items-center justify-center overflow-hidden rounded-2xl transition-shadow`,h?`bg-neutral-900`:`bg-transparent`,h&&e.speaking&&`ring-2 ring-emerald-400/70`),children:[(0,U.jsx)(`div`,{className:z(`rounded-full transition-shadow duration-500`,!h&&e.listening&&`shadow-[0_0_80px_20px_rgba(244,63,94,0.25)]`,!h&&e.speaking&&`shadow-[0_0_80px_20px_rgba(52,211,153,0.3)]`,e.speaking&&`animate-breathe`),children:(0,U.jsx)(te,{kind:t?.wizard.avatar??`round`,size:h?140:200,fluffy:!0,interactive:!1})}),h?(0,U.jsx)(`span`,{className:`absolute bottom-2 left-3 max-w-[85%] truncate rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:t?.wizard.title??``}):null]})]}),i&&!h?(0,U.jsx)(Se,{voice:e}):i&&(g||_)?(0,U.jsx)(`div`,{className:`shrink-0 px-4 pb-2 sm:px-5`,children:(0,U.jsxs)(`div`,{className:`mx-auto max-w-[720px] space-y-1 text-center`,children:[_?(0,U.jsx)(`p`,{className:`line-clamp-1 text-[0.8125rem] text-white/50`,children:_.text}):null,g?(0,U.jsx)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-white/95 leading-snug`,children:g.text}):null]})}):null,e.error?(0,U.jsx)(`p`,{className:`shrink-0 px-5 pb-2 text-center text-[0.8125rem] text-rose`,children:e.error}):null,(0,U.jsx)(`div`,{className:`flex shrink-0 items-center justify-center gap-3 px-4 pt-1 pb-4`,children:i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(W,{label:o(e.muted?`video.unmute`:`video.mute`),on:!e.muted,onClick:e.toggleMute,children:e.muted?(0,U.jsx)(ce,{className:`size-5`}):(0,U.jsx)(B,{className:`size-5`})}),(0,U.jsx)(W,{label:o(e.camera?`talk.cameraOff`:`talk.camera`),on:e.camera,onClick:()=>e.camera?e.stopCamera():void e.startCamera(),children:e.camera?(0,U.jsx)(l,{className:`size-5`}):(0,U.jsx)(V,{className:`size-5`})}),e.camera&&be?(0,U.jsx)(W,{label:o(`video.flip`),onClick:()=>void e.flipCamera(),children:(0,U.jsx)(m,{className:`size-5`})}):null,(0,U.jsx)(W,{label:o(`video.leave`),danger:!0,onClick:p,children:(0,U.jsx)(ue,{className:`size-5`})})]}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,disabled:a||!t?.talk,onClick:()=>void f(),className:`flex h-12 items-center gap-2 rounded-full bg-emerald-500 px-6 font-medium text-[0.9375rem] text-white transition hover:brightness-110 disabled:opacity-50`,children:[a?(0,U.jsx)(I,{className:`size-4`}):n?(0,U.jsx)(l,{className:`size-5`}):(0,U.jsx)(B,{className:`size-5`}),o(u?`video.rejoin`:n?`video.join`:`talk.start`)]}),!u&&!e.error?(0,U.jsx)(`p`,{className:`max-w-sm text-center text-[0.75rem] text-white/50`,children:o(n?`video.hint`:`talk.joinHint`)}):null]})})]})}var we=e=>p[e.kind]!==`device`,Te=1024,Ee=4e3;function De(e,t){return e?e.length>t?`${e.slice(0,t)} …`:e:``}function Oe(e,t,n=!1){let r=[`status: ${e.status}`,`camera: ${n?`on`:`off`}`];if(e.ask)return r.push(e.ask.kind===`confirm`?`question: the step wants to "${e.ask.action.summary}" in ${e.ask.service}; answer_ask allows or skips it`:`question: a sign-in at ${e.ask.site.host}; the person types it on the screen, wait`),r.join(`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$ as r,At as i,C as a,Ct as o,D as s,E as c,Et as l,H as u,J as d,Lt as f,N as p,Ot as m,Pt as h,Q as g,Qt as _,S as v,T as y,X as b,Z as x,a as S,b as C,bt as w,ct as T,dt as E,en as D,f as O,g as k,h as A,i as j,in as M,jt as N,kt as P,m as F,mt as I,vt as L,w as ee,xt as R,yt as z,zt as B}from"./ui-FW7ypPI6.js";import{r as te}from"./brand-DIKyySmf.js";import{n as ne,r as re}from"./RunnerView-D8OGEoMl.js";import{t as ie}from"./volume-2-B1mj20eS.js";import{J as ae,X as oe,Y as se,at as ce,ft as le,nt as ue,t as de}from"./index-nfRuCdVt.js";var fe={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};fe.node;var pe=M(fe),me={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};me.node;var he=M(me),ge={name:`video-off`,size:24,node:[[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`,key:`w8jjjt`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`1xawa7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};ge.node;var V=M(ge),_e={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};_e.node;var ve=M(_e),ye=le(),H=e(t(),1),U=e(n(),1),be=typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches;function xe({since:e}){let[t,n]=(0,H.useState)(Date.now());if((0,H.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),!e)return null;let r=Math.max(0,Math.floor((t-e)/1e3)),i=String(Math.floor(r/60)).padStart(2,`0`),a=String(r%60).padStart(2,`0`);return(0,U.jsxs)(`span`,{className:`font-mono text-[0.8125rem] text-white/60 tabular-nums`,children:[i,`:`,a]})}function W({label:e,on:t,danger:n,busy:r,onClick:i,children:a}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":t,disabled:r,onClick:i,className:z(`flex size-12 items-center justify-center rounded-full transition disabled:opacity-50`,n?`bg-rose text-white hover:brightness-110`:t===!1?`bg-white text-neutral-900 hover:bg-white/90`:`bg-white/15 text-white hover:bg-white/25`),children:r?(0,U.jsx)(I,{className:`size-5`}):a})}function Se({voice:e}){let t=(0,H.useRef)(null),{captions:n}=e;return(0,H.useEffect)(()=>{n.length&&t.current?.scrollIntoView({block:`end`})},[n]),n.length?(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 sm:px-5`,children:(0,U.jsxs)(`ol`,{className:`mx-auto flex max-w-[720px] flex-col gap-2 py-2`,children:[n.map(e=>(0,U.jsx)(`li`,{className:z(`text-[0.9375rem] leading-snug`,e.who===`bot`?`text-white/95`:`text-right text-white/50`),children:e.text},e.id)),(0,U.jsx)(`div`,{ref:t})]})}):null}function Ce({voice:e,view:t,video:n,className:r}){let i=e.state===`live`,a=e.state===`connecting`,[s,c]=(0,H.useState)(null),[u,d]=(0,H.useState)(!1);(0,H.useEffect)(()=>{c(i?Date.now():null)},[i]);let f=async()=>{d(!1),await e.start(),n&&await e.startCamera()},p=()=>{e.stop(),d(!0)},h=n||e.camera,g=[...e.captions].reverse().find(e=>e.who===`bot`),_=[...e.captions].reverse().find(e=>e.who===`me`),v=e.speaking?o(`talk.speaking`):e.listening?o(`talk.listening`):i?o(`talk.live`):a?o(`talk.connecting`):u?o(`video.ended`):``;return(0,U.jsxs)(`section`,{className:z(`relative flex min-h-0 flex-col bg-neutral-950 text-white`,`safe-top`,r),children:[(0,U.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-3 px-4 sm:px-5`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1 truncate font-display font-semibold text-[1rem] tracking-tight`,children:t?.wizard.title??``}),v?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-white/70`,children:[i?(0,U.jsx)(`span`,{className:z(`size-2 rounded-full`,e.speaking?`animate-pulse-dot bg-emerald-400`:`bg-rose`)}):null,v]}):null,(0,U.jsx)(xe,{since:s})]}),(0,U.jsxs)(`div`,{className:z(`grid min-h-0 gap-2 px-3 pb-2 sm:px-4`,h?`flex-1 grid-cols-1 sm:grid-cols-2`:`shrink-0 grid-cols-1`,!h&&i&&e.captions.length?`h-[38%]`:h?``:`flex-1`),children:[(0,U.jsxs)(`div`,{className:z(`relative min-h-0 overflow-hidden rounded-2xl bg-neutral-900`,!h&&`hidden`),children:[(0,U.jsx)(`video`,{ref:e.video,muted:!0,playsInline:!0,autoPlay:!0,className:z(`absolute inset-0 h-full w-full object-cover`,e.facing===`user`&&`-scale-x-100`,e.camera?`block`:`hidden`)}),e.camera?null:(0,U.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2 text-white/50`,children:[(0,U.jsx)(V,{className:`size-8`}),(0,U.jsx)(`span`,{className:`text-[0.8125rem]`,children:o(`video.cameraOff`)})]}),(0,U.jsxs)(`span`,{className:`absolute bottom-2 left-3 rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:[o(`video.you`),e.muted?(0,U.jsx)(ce,{className:`ml-1.5 inline size-3`}):null]})]}),(0,U.jsxs)(`div`,{className:z(`relative flex min-h-0 items-center justify-center overflow-hidden rounded-2xl transition-shadow`,h?`bg-neutral-900`:`bg-transparent`,h&&e.speaking&&`ring-2 ring-emerald-400/70`),children:[(0,U.jsx)(`div`,{className:z(`rounded-full transition-shadow duration-500`,!h&&e.listening&&`shadow-[0_0_80px_20px_rgba(244,63,94,0.25)]`,!h&&e.speaking&&`shadow-[0_0_80px_20px_rgba(52,211,153,0.3)]`,e.speaking&&`animate-breathe`),children:(0,U.jsx)(te,{kind:t?.wizard.avatar??`round`,size:h?140:200,fluffy:!0,interactive:!1})}),h?(0,U.jsx)(`span`,{className:`absolute bottom-2 left-3 max-w-[85%] truncate rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:t?.wizard.title??``}):null]})]}),i&&!h?(0,U.jsx)(Se,{voice:e}):i&&(g||_)?(0,U.jsx)(`div`,{className:`shrink-0 px-4 pb-2 sm:px-5`,children:(0,U.jsxs)(`div`,{className:`mx-auto max-w-[720px] space-y-1 text-center`,children:[_?(0,U.jsx)(`p`,{className:`line-clamp-1 text-[0.8125rem] text-white/50`,children:_.text}):null,g?(0,U.jsx)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-white/95 leading-snug`,children:g.text}):null]})}):null,e.error?(0,U.jsx)(`p`,{className:`shrink-0 px-5 pb-2 text-center text-[0.8125rem] text-rose`,children:e.error}):null,(0,U.jsx)(`div`,{className:`flex shrink-0 items-center justify-center gap-3 px-4 pt-1 pb-4`,children:i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(W,{label:o(e.muted?`video.unmute`:`video.mute`),on:!e.muted,onClick:e.toggleMute,children:e.muted?(0,U.jsx)(ce,{className:`size-5`}):(0,U.jsx)(B,{className:`size-5`})}),(0,U.jsx)(W,{label:o(e.camera?`talk.cameraOff`:`talk.camera`),on:e.camera,onClick:()=>e.camera?e.stopCamera():void e.startCamera(),children:e.camera?(0,U.jsx)(l,{className:`size-5`}):(0,U.jsx)(V,{className:`size-5`})}),e.camera&&be?(0,U.jsx)(W,{label:o(`video.flip`),onClick:()=>void e.flipCamera(),children:(0,U.jsx)(m,{className:`size-5`})}):null,(0,U.jsx)(W,{label:o(`video.leave`),danger:!0,onClick:p,children:(0,U.jsx)(ue,{className:`size-5`})})]}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,disabled:a||!t?.talk,onClick:()=>void f(),className:`flex h-12 items-center gap-2 rounded-full bg-emerald-500 px-6 font-medium text-[0.9375rem] text-white transition hover:brightness-110 disabled:opacity-50`,children:[a?(0,U.jsx)(I,{className:`size-4`}):n?(0,U.jsx)(l,{className:`size-5`}):(0,U.jsx)(B,{className:`size-5`}),o(u?`video.rejoin`:n?`video.join`:`talk.start`)]}),!u&&!e.error?(0,U.jsx)(`p`,{className:`max-w-sm text-center text-[0.75rem] text-white/50`,children:o(n?`video.hint`:`talk.joinHint`)}):null]})})]})}var we=e=>p[e.kind]!==`device`,Te=1024,Ee=4e3;function De(e,t){return e?e.length>t?`${e.slice(0,t)} …`:e:``}function Oe(e,t,n=!1){let r=[`status: ${e.status}`,`camera: ${n?`on`:`off`}`];if(e.ask)return r.push(e.ask.kind===`confirm`?`question: the step wants to "${e.ask.action.summary}" in ${e.ask.service}; answer_ask allows or skips it`:`question: a sign-in at ${e.ask.site.host}; the person types it on the screen, wait`),r.join(`
2
2
  `);if(e.status===`running`){let t=[...e.events].reverse().find(e=>e.type===`tool`||e.type===`info`||e.type===`step_started`);return r.push(`working on: ${e.step?.title??``}`),t&&r.push(`doing: ${w(t)}`),r.join(`
3
3
  `)}if(e.status===`done`){r.push(`done. made:`);for(let{step:t,output:n}of e.shown)r.push(`- ${t.title}: ${De(n?.text,400)||`(a file, on the screen)`}`);return r.join(`
4
4
  `)}if(e.status===`failed`)return r.push(`failed: ${e.error??``}; go_back or the person retries on the screen`),r.join(`