@engenty/wizards-runtime 0.17.0 → 0.17.1
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/app.js +2 -0
- package/apps/runtime/dist/broker/account.js +20 -1
- package/apps/runtime/dist/broker/call.js +116 -20
- package/apps/runtime/dist/broker/host.js +8 -2
- package/apps/runtime/dist/broker/index.js +3 -2
- package/apps/runtime/dist/broker/log.js +149 -14
- package/apps/runtime/dist/broker/over.js +38 -0
- package/apps/runtime/dist/broker/rights.js +192 -0
- package/apps/runtime/dist/broker/rwx.js +295 -51
- package/apps/runtime/dist/broker/send.js +25 -12
- package/apps/runtime/dist/bundles/fetch.js +119 -0
- package/apps/runtime/dist/bundles/index.js +621 -0
- package/apps/runtime/dist/bundles/read.js +607 -0
- package/apps/runtime/dist/connectors/external.js +532 -61
- package/apps/runtime/dist/connectors/person-sign-ins.js +1 -0
- package/apps/runtime/dist/connectors/reload.js +73 -0
- package/apps/runtime/dist/connectors/space-connections.js +73 -6
- package/apps/runtime/dist/db/migrations/tenant/0058_mcp_state_across_roles.sql +26 -0
- package/apps/runtime/dist/db/migrations/tenant/0059_space_connection_paused.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/0060_space_bundle.sql +21 -0
- package/apps/runtime/dist/db/migrations/tenant/0061_space_connection_limits.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0058_snapshot.json +6696 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0059_snapshot.json +6710 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0060_snapshot.json +6857 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0061_snapshot.json +6871 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +28 -0
- package/apps/runtime/dist/db/schema.js +81 -3
- package/apps/runtime/dist/docs/dev/broker.md +251 -31
- package/apps/runtime/dist/docs/user-guide/capabilities.md +123 -5
- package/apps/runtime/dist/docs/user-guide/connectors.md +52 -5
- package/apps/runtime/dist/docs/user-guide/protocol.md +15 -4
- package/apps/runtime/dist/docs/user-guide/test-and-share.md +1 -1
- package/apps/runtime/dist/elements/caller.js +2 -2
- package/apps/runtime/dist/engenty/connections-external/build-connector.js +23 -8
- package/apps/runtime/dist/engenty/connections-external/import-service.js +18 -9
- package/apps/runtime/dist/engenty/connections-external/importer/classify.js +12 -0
- package/apps/runtime/dist/engenty/connections-external/invoke/http-invoker.js +1 -0
- package/apps/runtime/dist/engenty/connections-external/net/guarded-fetch.js +6 -3
- package/apps/runtime/dist/engenty/connections-sdk/oauth2.js +2 -2
- package/apps/runtime/dist/engenty/shims/web-ingest.js +64 -0
- package/apps/runtime/dist/engine/resources.js +15 -6
- package/apps/runtime/dist/engine/runner.js +2 -1
- package/apps/runtime/dist/env.js +2 -0
- package/apps/runtime/dist/index.js +11 -2
- package/apps/runtime/dist/mcp/handler.js +2 -2
- package/apps/runtime/dist/mcp/seen.js +71 -51
- package/apps/runtime/dist/mcp/tools.js +5 -1
- package/apps/runtime/dist/prompts/mcp.md +1 -1
- package/apps/runtime/dist/prompts/tools.md +16 -0
- package/apps/runtime/dist/routes/broker.js +1 -1
- package/apps/runtime/dist/routes/bundles.js +91 -0
- package/apps/runtime/dist/routes/connections.js +14 -3
- package/apps/runtime/dist/routes/rules.js +53 -9
- package/apps/runtime/dist/routes/studio.js +23 -18
- package/apps/runtime/dist/services/cloud.js +2 -0
- package/apps/runtime/dist/services/draft-events.js +79 -6
- package/apps/runtime/dist/services/files.js +2 -2
- package/apps/runtime/dist/services/skills.js +61 -5
- package/apps/runtime/dist/services/space-index.js +102 -10
- package/apps/runtime/dist/services/synced-spaces.js +5 -1
- package/apps/runtime/dist/services/wizards.js +48 -2
- package/apps/runtime/dist/sharing/jobs.js +6 -2
- package/apps/runtime/dist/sync/records.js +6 -1
- package/apps/runtime/dist/texts.js +36 -1
- package/apps/runtime/dist/tools/connections.js +8 -0
- package/apps/runtime/dist/tools/connector.js +13 -1
- package/apps/runtime/dist/tools/index.js +8 -3
- package/apps/runtime/dist/tools/skills.js +11 -1
- package/apps/web/dist/assets/{AboutDialog-B2Xmxyj4.js → AboutDialog-mZCBU7KF.js} +1 -1
- package/apps/web/dist/assets/{BlockEditor-D0HoUSih.js → BlockEditor-Dk0QwLSU.js} +1 -1
- package/apps/web/dist/assets/CapabilitiesPage-GkpgF-wZ.js +2 -0
- package/apps/web/dist/assets/{ChangelogDialog-BIrJbAKi.js → ChangelogDialog-BhyilZWA.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-DUVcXI5P.js → CodeEditor-DULYZbuE.js} +1 -1
- package/apps/web/dist/assets/EditorPage-D_mCdYdZ.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-BIag8_Be.js → FlowPreview-ykxZxWnk.js} +1 -1
- package/apps/web/dist/assets/{LangSwitch-CJ00IgaO.js → LangSwitch-iO54w9AP.js} +1 -1
- package/apps/web/dist/assets/{Marketplace-D7-ot9Dz.js → Marketplace-C97fH7UC.js} +2 -2
- package/apps/web/dist/assets/{NewWizardChannels-DI3SQ4iS.js → NewWizardChannels-CsSV7sm2.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-CytheHxX.js → NewWizardPage-Ebgw-Vf_.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-_91Pa8Ad.js → OnboardingPage-BZlloT7v.js} +1 -1
- package/apps/web/dist/assets/PreviewPane-CJuqY5uA.js +7 -0
- package/apps/web/dist/assets/ProtocolSection-CPaDKVpZ.js +1 -0
- package/apps/web/dist/assets/{PublicRunner-CEgXSk3r.js → PublicRunner-4Lf4SnwB.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-CWf5x74a.js → ReadOnly-CXQ41R9Q.js} +1 -1
- package/apps/web/dist/assets/{SettingsPage-Dr8SDk-L.js → SettingsPage-C-8BgK9O.js} +2 -2
- package/apps/web/dist/assets/{SetupPage-B68n0l4I.js → SetupPage-4_K083Wl.js} +1 -1
- package/apps/web/dist/assets/{SharePage-DfznN7ar.js → SharePage-CQjgMcDI.js} +1 -1
- package/apps/web/dist/assets/{SkillEditor-BIcIczRc.js → SkillEditor-DT5hQwbg.js} +1 -1
- package/apps/web/dist/assets/{Skills-CN4QE7Kx.js → Skills-D7V_9_xo.js} +1 -1
- package/apps/web/dist/assets/SpacePage-D3rYS1bA.js +2 -0
- package/apps/web/dist/assets/{UpdateCheck-QhBI3rlQ.js → UpdateCheck-DVgAJmy8.js} +2 -2
- package/apps/web/dist/assets/changelog-DzQCUSsx.js +1 -0
- package/apps/web/dist/assets/{code-editor-DkPo1C-L.js → code-editor-5T7ilBjd.js} +2 -2
- package/apps/web/dist/assets/{host-D6H6Z9Jp.js → host-CCijW1hj.js} +6 -6
- package/apps/web/dist/assets/i18n-DCPDesT-.js +55 -0
- package/apps/web/dist/assets/{index-De0Wb42y.js → index-C_iWl8iS.js} +3 -3
- package/apps/web/dist/assets/index-zcPlodHx.css +1 -0
- package/apps/web/dist/assets/minus-BpYkOkYw.js +1 -0
- package/apps/web/dist/assets/{read-aloud-CnFwDSGD.js → read-aloud-Qb719not.js} +1 -1
- package/apps/web/dist/assets/{runners-0sTPbWzr.js → runners-BeZ84YH_.js} +1 -1
- package/apps/web/dist/assets/{session-BMiUrqHg.js → session-CEJRkSP5.js} +1 -1
- package/apps/web/dist/assets/{theme-CkNTe-_Z.js → theme-y_owNosi.js} +1 -1
- package/apps/web/dist/assets/{ui-DAk_vjrL.js → ui-BacfkQ7Q.js} +1 -1
- package/apps/web/dist/assets/{useMutation-isHfB33W.js → useMutation-CgzFr4qH.js} +1 -1
- package/apps/web/dist/assets/{viewers-ijNZHJFG.js → viewers-CkyHAjnk.js} +2 -2
- package/apps/web/dist/index.html +12 -12
- package/apps/web/dist/mcp/flow.html +2 -2
- package/node_modules/@engenty/wizards-shared/dist/bundles.d.ts +219 -0
- package/node_modules/@engenty/wizards-shared/dist/bundles.js +19 -0
- package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +105 -4
- package/node_modules/@engenty/wizards-shared/dist/connectors.js +6 -0
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +8 -0
- package/node_modules/@engenty/wizards-shared/dist/run.js +16 -0
- package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +84 -1
- package/node_modules/@engenty/wizards-shared/dist/rwx.js +69 -1
- package/node_modules/@engenty/wizards-shared/dist/skills.d.ts +20 -3
- package/node_modules/@engenty/wizards-shared/dist/skills.js +5 -2
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/web/dist/assets/CapabilitiesPage-C1th2cZE.js +0 -2
- package/apps/web/dist/assets/EditorPage-56sIqEfF.js +0 -3
- package/apps/web/dist/assets/PreviewPane-BDsYm-_K.js +0 -7
- package/apps/web/dist/assets/ProtocolSection-D_zaxHEL.js +0 -1
- package/apps/web/dist/assets/SpacePage-DiVTwhnJ.js +0 -2
- package/apps/web/dist/assets/changelog-a_CuplMX.js +0 -1
- package/apps/web/dist/assets/i18n-BaPKbQ1s.js +0 -55
- package/apps/web/dist/assets/index-CCUG6Vnh.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AboutDialog-
|
|
2
|
-
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,Dn as i,Gn as a,Q as o,Vr as s,Xn as c,Yn as l,Zn as u,gr as d,hn as f,in as p,or as m,rr as h,un as g}from"./ui-DAk_vjrL.js";import{t as _}from"./useMutation-isHfB33W.js";import{t as v}from"./react-dom-hf6EcyAr.js";import{t as y}from"./preload-helper-DpV6A1kQ.js";import{n as b,s as x}from"./i18n-BaPKbQ1s.js";import{t as S}from"./media-Cej-H610.js";var C=e(v(),1),w=e(t(),1),T=e(n(),1),E=(0,w.lazy)(()=>y(()=>import(`./AboutDialog-B2Xmxyj4.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),D=`0.17.0`;function O({me:e}){let[t,n]=(0,w.useState)(!1);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`button`,{type:`button`,className:`tabular-nums transition hover:text-ink-2`,onClick:()=>n(!0),children:x(`about.version`,{v:D})}),t?(0,T.jsx)(w.Suspense,{fallback:null,children:(0,T.jsx)(E,{open:!0,me:e,onClose:()=>n(!1)})}):null]})}var k=[`update`],A=36e5;function j(e=!0){let t=s(),[n,r]=(0,w.useState)(null),i=d({queryKey:k,queryFn:()=>o.get(`/api/studio/update`),staleTime:A,refetchInterval:A,retry:!1,enabled:e}),a=_({mutationFn:()=>o.get(`/api/studio/update?fresh=1`),onSuccess:e=>t.setQueryData(k,e)}),c=_({mutationFn:()=>o.post(`/api/studio/update`),onSuccess:e=>t.setQueryData(k,e)}),l=i.data,u=l?.latest??null,f=l?.restarts&&(l.applying===`running`||l.applying===`done`),p=l?.current;return(0,w.useEffect)(()=>{if(!(f||l?.applying===`running`)||!u)return;let e=setInterval(async()=>{try{let e=await o.get(`/api/studio/update`);if(e.current!==p){window.location.reload();return}t.setQueryData(k,e),e.applying===`done`&&e.restarts&&r(u)}catch{r(u)}},2e3);return()=>clearInterval(e)},[f,l?.applying,u,p,t]),{status:i,data:l,latest:u,check:a,apply:c,busy:l?.applying===`running`||n!==null,progress:!l||!u?null:n===null?l.applying===`running`?x(`about.update.installing`,{v:u}):l.applying===`done`?x(`about.update.done`,{v:u}):l.applying===`failed`?x(`about.update.failed`):null:x(`about.update.restarting`,{v:u})}}var M=(0,w.createContext)({slot:null,narrow:!1,setDetail:()=>void 0});function N(){return(0,w.useContext)(M)}function P({children:e}){let{slot:t}=N();return t?(0,C.createPortal)(e,t):null}function F(e){let{setDetail:t}=N();(0,w.useEffect)(()=>(t(e),()=>t(null)),[e,t])}function I(){return S(`(max-width: 767px)`)}function L(e){return e===`deeper`?`animate-step-deeper`:e===`back`&&`animate-step-back`}function R({title:e,open:t,onBack:n,root:r}){let i=t??r??null,a=t?n:void 0;return(0,T.jsxs)(`div`,{className:`mb-2 flex h-9 min-w-0 items-center px-1`,children:[(0,T.jsx)(`div`,{className:f(`shrink-0 overflow-hidden transition-[width,margin,opacity] duration-200 ease-out`,i&&a?`-ml-1.5 mr-0.5 w-8 opacity-100`:`w-0 opacity-0`),children:(0,T.jsx)(`button`,{type:`button`,onClick:a,"aria-hidden":!(i&&a),tabIndex:i&&a?void 0:-1,"aria-label":e,className:`grid size-8 place-items-center rounded-lg text-ink-3 transition hover:bg-accent hover:text-ink`,children:(0,T.jsx)(h,{className:`size-4`})})}),!t&&r?.onOpen?(0,T.jsxs)(`button`,{type:`button`,onClick:r.onOpen,"aria-current":r.current?`page`:void 0,className:f(`-mx-1 flex min-w-0 flex-1 items-center gap-2 rounded-lg px-2 py-1 text-left font-medium text-[0.875rem] transition`,r.current?`bg-paper-2 text-ink`:`hover:bg-accent`),children:[(0,T.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,T.jsx)(r.icon,{className:`size-4 text-ember-strong`})}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:r.label})]}):i?(0,T.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-medium text-[0.875rem]`,children:[(0,T.jsx)(i.icon,{className:`size-4 shrink-0 text-ember-strong`}),(0,T.jsx)(`span`,{className:`truncate`,children:i.label})]}):(0,T.jsx)(`span`,{className:`truncate font-medium text-[0.875rem]`,children:e})]})}function z({entries:e,current:t,hide:n,onPick:r}){let[i,a]=(0,w.useState)(!1);return(0,T.jsx)(`ul`,{className:`flex flex-col gap-0.5`,onPointerMove:()=>i&&a(!1),children:e.map((o,s)=>(0,T.jsx)(`li`,{"aria-hidden":o.id===n||void 0,className:f(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none`,o.id===n?`grid-rows-[0fr] opacity-0`:`grid-rows-[1fr]`),children:(0,T.jsxs)(`div`,{className:`min-h-0 overflow-hidden`,children:[o.group===e[s-1]?.group?null:o.group?(0,T.jsx)(`div`,{className:`px-2 pt-4 pb-1 font-medium text-[0.75rem] text-ink-3 first:pt-1`,children:o.group}):(0,T.jsx)(`div`,{className:`h-3`,"aria-hidden":!0}),(0,T.jsxs)(m,{to:o.to,onClick:e=>{a(!0),o.id===t?.id&&(e.preventDefault(),r(o))},"aria-current":o.id===t?.id?`page`:void 0,className:f(`group flex items-center gap-2 rounded-lg px-2 py-1 text-[0.875rem] transition max-md:py-2`,o.id===t?.id?`bg-paper-2 font-medium text-ink`:i?`text-ink-2`:`text-ink-2 hover:bg-accent hover:text-ink`),children:[(0,T.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,T.jsx)(o.icon,{className:`size-4 transition-transform duration-200 ease-out group-hover:scale-110`})}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o.label}),o.count===void 0?null:(0,T.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:o.count}),(0,T.jsx)(l,{className:`size-4 text-ink-4 md:hidden`})]})]})},o.id))})}function B({label:e,onBack:t}){return(0,T.jsxs)(`button`,{type:`button`,onClick:t,className:`-ml-1 flex items-center gap-1 rounded-lg py-1.5 pr-3 pl-1 text-[0.8125rem] text-ink-3 transition hover:text-ink`,children:[(0,T.jsx)(c,{className:`size-4`}),e]})}function V(e){let t=(0,w.useRef)({level:e,direction:null});return e!==t.current.level&&(t.current={level:e,direction:e>t.current.level?`deeper`:`back`}),t.current.direction}function H({label:e,collapsible:t,open:n=!0,count:r,children:i}){let[a,o]=(0,w.useState)(n),s=`font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.12em]`;return(0,T.jsxs)(`div`,{className:`mt-5 first:mt-0 [&:not(:has(li))]:hidden`,children:[t?(0,T.jsxs)(`button`,{type:`button`,onClick:()=>o(!a),"aria-expanded":a,className:f(`mb-1 flex w-full items-center gap-1 px-2 text-left hover:text-ink-2`,s),children:[(0,T.jsx)(`span`,{className:`flex-1`,children:e}),a?null:(0,T.jsx)(`span`,{className:`tabular-nums tracking-normal`,children:r}),(0,T.jsx)(u,{className:f(`size-3.5 transition-transform`,a?null:`-rotate-90`)})]}):(0,T.jsx)(`p`,{className:f(`mb-1 px-2`,s),children:e}),a?(0,T.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:i}):null]})}function U({icon:e,label:t,badge:n,tone:r,toneLabel:i,selected:a,disabled:o,onPick:s}){let{filter:c}=N();return c&&!t.toLowerCase().includes(c)?null:(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,onClick:s,disabled:o,"aria-current":a?`page`:void 0,className:f(`group flex w-full items-center gap-2 rounded-lg px-2 py-1 text-left text-[0.875rem] transition max-md:py-2`,a?`bg-paper-2 font-medium text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`,o&&`cursor-default opacity-50 hover:bg-transparent hover:text-ink-2`),children:[(0,T.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,T.jsx)(e,{className:f(`size-4 transition-transform duration-200 ease-out`,!o&&`group-hover:scale-110`,a?`text-ember-strong`:`text-ink-3`)})}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n,r?(0,T.jsx)(`span`,{role:`img`,title:i,"aria-label":i,className:f(`size-2 shrink-0 rounded-full`,r===`done`&&`bg-moss`,r===`credits`&&`bg-amber`,r===`on`&&`bg-ember`,r===`miss`&&`bg-amber`,r===`off`&&`ring-1 ring-ink-4 ring-inset`)}):null,o?null:(0,T.jsx)(l,{className:`size-4 shrink-0 text-ink-4 md:hidden`})]})})}function W({enabled:e=!0,align:t=`center`}){let{status:n,data:o,latest:s,check:c,apply:l,busy:u,progress:d}=j(e),p=o?.checkedAt?new Date(o.checkedAt).toLocaleTimeString(b,{hour:`2-digit`,minute:`2-digit`}):null,m=t===`center`;return(0,T.jsxs)(`div`,{className:f(`flex flex-col gap-3 text-[0.875rem] text-ink-2`,m?`items-center text-center`:`items-start`),children:[n.isPending||c.isPending?(0,T.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,T.jsx)(g,{className:`size-4 text-ember-strong`}),x(`about.update.checking`)]}):d?(0,T.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[u?(0,T.jsx)(g,{className:`size-4 text-ember-strong`}):null,d]}):o?.newer&&s?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2.5 font-medium text-ink`,children:[(0,T.jsx)(a,{className:`size-4 shrink-0 text-ember-strong`}),x(`about.update.available`,{v:s})]}),o.canApply?null:(0,T.jsx)(`p`,{className:`text-ink-3`,children:x(`about.update.manual`)})]}):o?.enabled?o.latest===null?(0,T.jsx)(`p`,{children:x(`about.update.unknown`)}):(0,T.jsxs)(`p`,{children:[x(`about.update.upToDate`),p?(0,T.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,x(`about.update.checkedAt`,{when:p})]}):null]}):(0,T.jsx)(`p`,{children:x(`about.update.off`)}),u||n.isPending?null:(0,T.jsxs)(`div`,{className:f(`flex flex-wrap gap-2`,m&&`justify-center`),children:[o?.newer&&o.canApply&&o.applying!==`running`?(0,T.jsxs)(r,{size:`sm`,disabled:l.isPending,onClick:()=>l.mutate(),children:[(0,T.jsx)(a,{className:`size-4`}),` `,x(`about.update.install`)]}):null,o?.enabled===!1?null:(0,T.jsxs)(r,{size:`sm`,variant:`secondary`,disabled:c.isPending,onClick:()=>c.mutate(),children:[(0,T.jsx)(i,{className:f(`size-4`,c.isPending&&`animate-spin`)}),` `,x(`about.update.check`)]})]})]})}function G({me:e}){let t=e.mode===`local`,{status:n,data:o,latest:s,check:c,apply:l,busy:u,progress:d}=j(t),f=n.isPending||c.isPending;return(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-2 text-[0.8125rem] text-ink-3`,children:[(0,T.jsx)(O,{me:e}),(0,T.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t?f?(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,T.jsx)(g,{className:`size-3.5 text-ember-strong`}),` `,x(`about.update.checking`)]}):d?(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[u?(0,T.jsx)(g,{className:`size-3.5 text-ember-strong`}):null,d]}):o?.newer&&s?(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-ink`,children:[(0,T.jsx)(a,{className:`size-3.5 shrink-0 text-ember-strong`}),x(`about.update.available`,{v:s})]}):o?.enabled?o.latest===null?(0,T.jsx)(`span`,{children:x(`about.update.unknown`)}):(0,T.jsx)(`span`,{children:x(`about.update.upToDate`)}):(0,T.jsx)(`span`,{children:x(`about.update.off`)}):(0,T.jsx)(`span`,{children:x(`about.kind.cloud`)}),!t||f||u?null:o?.newer&&o.canApply?(0,T.jsxs)(r,{size:`sm`,disabled:l.isPending,onClick:()=>l.mutate(),children:[(0,T.jsx)(a,{className:`size-4`}),` `,x(`about.update.install`)]}):o?.enabled?(0,T.jsx)(p,{label:x(`about.update.check`),className:`size-7 coarse:size-9`,onClick:()=>c.mutate(),children:(0,T.jsx)(i,{className:`size-3.5`})}):null]})}export{z as a,M as c,F as d,I as f,D as g,j as h,R as i,P as l,V as m,G as n,H as o,N as p,B as r,U as s,W as t,L as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AboutDialog-mZCBU7KF.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/ui-BacfkQ7Q.js","assets/preload-helper-DpV6A1kQ.js","assets/marked.esm-DQ7XA7AC.js","assets/i18n-DCPDesT-.js","assets/logo-BpnjXTRy.js","assets/engenty-CNjaZCVM.js","assets/ChangelogDialog-BhyilZWA.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
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,Dn as i,Gn as a,Q as o,Vr as s,Xn as c,Yn as l,Zn as u,gr as d,hn as f,in as p,or as m,rr as h,un as g}from"./ui-BacfkQ7Q.js";import{t as _}from"./useMutation-CgzFr4qH.js";import{t as v}from"./react-dom-hf6EcyAr.js";import{t as y}from"./preload-helper-DpV6A1kQ.js";import{n as b,s as x}from"./i18n-DCPDesT-.js";import{t as S}from"./media-Cej-H610.js";var C=e(v(),1),w=e(t(),1),T=e(n(),1),E=(0,w.lazy)(()=>y(()=>import(`./AboutDialog-mZCBU7KF.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),D=`0.17.1`;function O({me:e}){let[t,n]=(0,w.useState)(!1);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`button`,{type:`button`,className:`tabular-nums transition hover:text-ink-2`,onClick:()=>n(!0),children:x(`about.version`,{v:D})}),t?(0,T.jsx)(w.Suspense,{fallback:null,children:(0,T.jsx)(E,{open:!0,me:e,onClose:()=>n(!1)})}):null]})}var k=[`update`],A=36e5;function j(e=!0){let t=s(),[n,r]=(0,w.useState)(null),i=d({queryKey:k,queryFn:()=>o.get(`/api/studio/update`),staleTime:A,refetchInterval:A,retry:!1,enabled:e}),a=_({mutationFn:()=>o.get(`/api/studio/update?fresh=1`),onSuccess:e=>t.setQueryData(k,e)}),c=_({mutationFn:()=>o.post(`/api/studio/update`),onSuccess:e=>t.setQueryData(k,e)}),l=i.data,u=l?.latest??null,f=l?.restarts&&(l.applying===`running`||l.applying===`done`),p=l?.current;return(0,w.useEffect)(()=>{if(!(f||l?.applying===`running`)||!u)return;let e=setInterval(async()=>{try{let e=await o.get(`/api/studio/update`);if(e.current!==p){window.location.reload();return}t.setQueryData(k,e),e.applying===`done`&&e.restarts&&r(u)}catch{r(u)}},2e3);return()=>clearInterval(e)},[f,l?.applying,u,p,t]),{status:i,data:l,latest:u,check:a,apply:c,busy:l?.applying===`running`||n!==null,progress:!l||!u?null:n===null?l.applying===`running`?x(`about.update.installing`,{v:u}):l.applying===`done`?x(`about.update.done`,{v:u}):l.applying===`failed`?x(`about.update.failed`):null:x(`about.update.restarting`,{v:u})}}var M=(0,w.createContext)({slot:null,narrow:!1,setDetail:()=>void 0});function N(){return(0,w.useContext)(M)}function P({children:e}){let{slot:t}=N();return t?(0,C.createPortal)(e,t):null}function F(e){let{setDetail:t}=N();(0,w.useEffect)(()=>(t(e),()=>t(null)),[e,t])}function I(){return S(`(max-width: 767px)`)}function L(e){return e===`deeper`?`animate-step-deeper`:e===`back`&&`animate-step-back`}function R({title:e,open:t,onBack:n,root:r}){let i=t??r??null,a=t?n:void 0;return(0,T.jsxs)(`div`,{className:`mb-2 flex h-9 min-w-0 items-center px-1`,children:[(0,T.jsx)(`div`,{className:f(`shrink-0 overflow-hidden transition-[width,margin,opacity] duration-200 ease-out`,i&&a?`-ml-1.5 mr-0.5 w-8 opacity-100`:`w-0 opacity-0`),children:(0,T.jsx)(`button`,{type:`button`,onClick:a,"aria-hidden":!(i&&a),tabIndex:i&&a?void 0:-1,"aria-label":e,className:`grid size-8 place-items-center rounded-lg text-ink-3 transition hover:bg-accent hover:text-ink`,children:(0,T.jsx)(h,{className:`size-4`})})}),!t&&r?.onOpen?(0,T.jsxs)(`button`,{type:`button`,onClick:r.onOpen,"aria-current":r.current?`page`:void 0,className:f(`-mx-1 flex min-w-0 flex-1 items-center gap-2 rounded-lg px-2 py-1 text-left font-medium text-[0.875rem] transition`,r.current?`bg-paper-2 text-ink`:`hover:bg-accent`),children:[(0,T.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,T.jsx)(r.icon,{className:`size-4 text-ember-strong`})}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:r.label})]}):i?(0,T.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-medium text-[0.875rem]`,children:[(0,T.jsx)(i.icon,{className:`size-4 shrink-0 text-ember-strong`}),(0,T.jsx)(`span`,{className:`truncate`,children:i.label})]}):(0,T.jsx)(`span`,{className:`truncate font-medium text-[0.875rem]`,children:e})]})}function z({entries:e,current:t,hide:n,onPick:r}){let[i,a]=(0,w.useState)(!1);return(0,T.jsx)(`ul`,{className:`flex flex-col gap-0.5`,onPointerMove:()=>i&&a(!1),children:e.map((o,s)=>(0,T.jsx)(`li`,{"aria-hidden":o.id===n||void 0,className:f(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none`,o.id===n?`grid-rows-[0fr] opacity-0`:`grid-rows-[1fr]`),children:(0,T.jsxs)(`div`,{className:`min-h-0 overflow-hidden`,children:[o.group===e[s-1]?.group?null:o.group?(0,T.jsx)(`div`,{className:`px-2 pt-4 pb-1 font-medium text-[0.75rem] text-ink-3 first:pt-1`,children:o.group}):(0,T.jsx)(`div`,{className:`h-3`,"aria-hidden":!0}),(0,T.jsxs)(m,{to:o.to,onClick:e=>{a(!0),o.id===t?.id&&(e.preventDefault(),r(o))},"aria-current":o.id===t?.id?`page`:void 0,className:f(`group flex items-center gap-2 rounded-lg px-2 py-1 text-[0.875rem] transition max-md:py-2`,o.id===t?.id?`bg-paper-2 font-medium text-ink`:i?`text-ink-2`:`text-ink-2 hover:bg-accent hover:text-ink`),children:[(0,T.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,T.jsx)(o.icon,{className:`size-4 transition-transform duration-200 ease-out group-hover:scale-110`})}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o.label}),o.count===void 0?null:(0,T.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:o.count}),(0,T.jsx)(l,{className:`size-4 text-ink-4 md:hidden`})]})]})},o.id))})}function B({label:e,onBack:t}){return(0,T.jsxs)(`button`,{type:`button`,onClick:t,className:`-ml-1 flex items-center gap-1 rounded-lg py-1.5 pr-3 pl-1 text-[0.8125rem] text-ink-3 transition hover:text-ink`,children:[(0,T.jsx)(c,{className:`size-4`}),e]})}function V(e){let t=(0,w.useRef)({level:e,direction:null});return e!==t.current.level&&(t.current={level:e,direction:e>t.current.level?`deeper`:`back`}),t.current.direction}function H({label:e,collapsible:t,open:n=!0,count:r,children:i}){let[a,o]=(0,w.useState)(n),s=`font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.12em]`;return(0,T.jsxs)(`div`,{className:`mt-5 first:mt-0 [&:not(:has(li))]:hidden`,children:[t?(0,T.jsxs)(`button`,{type:`button`,onClick:()=>o(!a),"aria-expanded":a,className:f(`mb-1 flex w-full items-center gap-1 px-2 text-left hover:text-ink-2`,s),children:[(0,T.jsx)(`span`,{className:`flex-1`,children:e}),a?null:(0,T.jsx)(`span`,{className:`tabular-nums tracking-normal`,children:r}),(0,T.jsx)(u,{className:f(`size-3.5 transition-transform`,a?null:`-rotate-90`)})]}):(0,T.jsx)(`p`,{className:f(`mb-1 px-2`,s),children:e}),a?(0,T.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:i}):null]})}function U({icon:e,label:t,badge:n,tone:r,toneLabel:i,selected:a,disabled:o,onPick:s}){let{filter:c}=N();return c&&!t.toLowerCase().includes(c)?null:(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,onClick:s,disabled:o,"aria-current":a?`page`:void 0,className:f(`group flex w-full items-center gap-2 rounded-lg px-2 py-1 text-left text-[0.875rem] transition max-md:py-2`,a?`bg-paper-2 font-medium text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`,o&&`cursor-default opacity-50 hover:bg-transparent hover:text-ink-2`),children:[(0,T.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,T.jsx)(e,{className:f(`size-4 transition-transform duration-200 ease-out`,!o&&`group-hover:scale-110`,a?`text-ember-strong`:`text-ink-3`)})}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n,r?(0,T.jsx)(`span`,{role:`img`,title:i,"aria-label":i,className:f(`size-2 shrink-0 rounded-full`,r===`done`&&`bg-moss`,r===`credits`&&`bg-amber`,r===`on`&&`bg-ember`,r===`miss`&&`bg-amber`,r===`off`&&`ring-1 ring-ink-4 ring-inset`)}):null,o?null:(0,T.jsx)(l,{className:`size-4 shrink-0 text-ink-4 md:hidden`})]})})}function W({enabled:e=!0,align:t=`center`}){let{status:n,data:o,latest:s,check:c,apply:l,busy:u,progress:d}=j(e),p=o?.checkedAt?new Date(o.checkedAt).toLocaleTimeString(b,{hour:`2-digit`,minute:`2-digit`}):null,m=t===`center`;return(0,T.jsxs)(`div`,{className:f(`flex flex-col gap-3 text-[0.875rem] text-ink-2`,m?`items-center text-center`:`items-start`),children:[n.isPending||c.isPending?(0,T.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,T.jsx)(g,{className:`size-4 text-ember-strong`}),x(`about.update.checking`)]}):d?(0,T.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[u?(0,T.jsx)(g,{className:`size-4 text-ember-strong`}):null,d]}):o?.newer&&s?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2.5 font-medium text-ink`,children:[(0,T.jsx)(a,{className:`size-4 shrink-0 text-ember-strong`}),x(`about.update.available`,{v:s})]}),o.canApply?null:(0,T.jsx)(`p`,{className:`text-ink-3`,children:x(`about.update.manual`)})]}):o?.enabled?o.latest===null?(0,T.jsx)(`p`,{children:x(`about.update.unknown`)}):(0,T.jsxs)(`p`,{children:[x(`about.update.upToDate`),p?(0,T.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,x(`about.update.checkedAt`,{when:p})]}):null]}):(0,T.jsx)(`p`,{children:x(`about.update.off`)}),u||n.isPending?null:(0,T.jsxs)(`div`,{className:f(`flex flex-wrap gap-2`,m&&`justify-center`),children:[o?.newer&&o.canApply&&o.applying!==`running`?(0,T.jsxs)(r,{size:`sm`,disabled:l.isPending,onClick:()=>l.mutate(),children:[(0,T.jsx)(a,{className:`size-4`}),` `,x(`about.update.install`)]}):null,o?.enabled===!1?null:(0,T.jsxs)(r,{size:`sm`,variant:`secondary`,disabled:c.isPending,onClick:()=>c.mutate(),children:[(0,T.jsx)(i,{className:f(`size-4`,c.isPending&&`animate-spin`)}),` `,x(`about.update.check`)]})]})]})}function G({me:e}){let t=e.mode===`local`,{status:n,data:o,latest:s,check:c,apply:l,busy:u,progress:d}=j(t),f=n.isPending||c.isPending;return(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-2 text-[0.8125rem] text-ink-3`,children:[(0,T.jsx)(O,{me:e}),(0,T.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t?f?(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,T.jsx)(g,{className:`size-3.5 text-ember-strong`}),` `,x(`about.update.checking`)]}):d?(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[u?(0,T.jsx)(g,{className:`size-3.5 text-ember-strong`}):null,d]}):o?.newer&&s?(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-ink`,children:[(0,T.jsx)(a,{className:`size-3.5 shrink-0 text-ember-strong`}),x(`about.update.available`,{v:s})]}):o?.enabled?o.latest===null?(0,T.jsx)(`span`,{children:x(`about.update.unknown`)}):(0,T.jsx)(`span`,{children:x(`about.update.upToDate`)}):(0,T.jsx)(`span`,{children:x(`about.update.off`)}):(0,T.jsx)(`span`,{children:x(`about.kind.cloud`)}),!t||f||u?null:o?.newer&&o.canApply?(0,T.jsxs)(r,{size:`sm`,disabled:l.isPending,onClick:()=>l.mutate(),children:[(0,T.jsx)(a,{className:`size-4`}),` `,x(`about.update.install`)]}):o?.enabled?(0,T.jsx)(p,{label:x(`about.update.check`),className:`size-7 coarse:size-9`,onClick:()=>c.mutate(),children:(0,T.jsx)(i,{className:`size-3.5`})}):null]})}export{z as a,M as c,F as d,I as f,D as g,j as h,R as i,P as l,V as m,G as n,H as o,N as p,B as r,U as s,W as t,L as u};
|