@cartanova/qgrid-cli 2.22.0 → 2.22.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.
Files changed (21) hide show
  1. package/bundle/web-dist/client/assets/{index-CKbDrgCl.js → index-BSjyOyOc.js} +3 -3
  2. package/bundle/web-dist/client/assets/{logs-wd-lZx75.js → logs-CFyeyR7u.js} +1 -1
  3. package/bundle/web-dist/client/assets/{monit-BjQUu4NS.js → monit-N3gBNCXy.js} +1 -1
  4. package/bundle/web-dist/client/assets/{routes-D-C4eD90.js → routes-UbYa5WQL.js} +1 -1
  5. package/bundle/web-dist/client/assets/{settings-DeJEEmWL.js → settings-CTZGAJjl.js} +1 -1
  6. package/bundle/web-dist/client/assets/{show-DGcvCaF6.js → show-oNGv2jAJ.js} +1 -1
  7. package/bundle/web-dist/client/assets/{tokens-DZCpfLEe.js → tokens-BrhEjJ3t.js} +1 -1
  8. package/bundle/web-dist/client/assets/{use-oauth-login-flow-Rg_ah3e1.js → use-oauth-login-flow-Ca1Sn84P.js} +1 -1
  9. package/bundle/web-dist/client/assets/{use-update-token-mutation-DHVJywXU.js → use-update-token-mutation-DMy7Pw8U.js} +1 -1
  10. package/bundle/web-dist/client/assets/{voice-CfCzLZf2.js → voice-CVXYbgBN.js} +1 -1
  11. package/bundle/web-dist/client/index.html +1 -1
  12. package/bundle/web-dist/server/entry-server.generated.js +1 -1
  13. package/package.json +1 -1
  14. package/skills/qgrid/SKILL.md +2 -2
  15. package/skills/qgrid/references/cli-env-and-server-boot.md +2 -3
  16. package/skills/qgrid/references/decision-rationale.md +4 -4
  17. package/skills/qgrid/references/provider-runtime-differences.md +2 -2
  18. package/skills/qgrid/references/request-log-run-lifecycle.md +2 -2
  19. package/skills/qgrid/references/sonamu-api-web-flow.md +2 -2
  20. package/skills/qgrid/references/token-auth-quota-lifecycle.md +1 -1
  21. package/skills/qgrid/references/verification-and-debugging.md +3 -3
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{P as r}from"./vendor-tanstack-DMgmqjm4.js";import{t as i}from"./clsx-DB0hHKMi.js";import{d as a,s as o}from"./index-CKbDrgCl.js";var s=e(t(),1),c=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},l=(e,t)=>({classGroupId:e,validator:t}),u=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),d=`-`,f=[],p=`arbitrary..`,m=e=>{let t=_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return g(e);let n=e.split(d);return h(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?c(i,t):t:i||f}return n[e]||f}}},h=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=h(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(d):e.slice(t).join(d),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},g=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?p+r:void 0})(),_=e=>{let{theme:t,classGroups:n}=e;return v(n,t)},v=(e,t)=>{let n=u();for(let r in e){let i=e[r];y(i,n,r,t)}return n},y=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];b(i,t,n,r)}},b=(e,t,n,r)=>{typeof e==`string`?x(e,t,n):typeof e==`function`?S(e,t,n,r):C(e,t,n,r)},x=(e,t,n)=>{let r=e===``?t:w(t,e);r.classGroupId=n},S=(e,t,n,r)=>{T(e)?y(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(l(n,e)))},C=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];y(o,w(t,a),n,r)}},w=(e,t)=>{let n=e,r=t.split(d),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=u(),n.nextPart.set(t,i)),n=i}return n},T=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ee=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},E=`!`,D=`:`,te=[],O=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),k=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===D){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(E)?(c=s.slice(0,-1),l=!0):s.startsWith(E)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return O(t,l,c,u)};if(t){let e=t+D,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):O(te,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},A=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},j=e=>({cache:ee(e.cacheSize),parseClassName:k(e),sortModifiers:A(e),postfixLookupClassGroupIds:ne(e),...m(e)}),ne=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},re=/\s+/,M=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(re),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+E:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},ie=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ae(n))&&(i&&(i+=` `),i+=r);return i},ae=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ae(e[r]))&&(n&&(n+=` `),n+=t);return n},oe=(e,...t)=>{let n,r,i,a,o=o=>(n=j(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=M(e,n);return i(e,a),a};return a=o,(...e)=>a(ie(...e))},N=[],P=e=>{let t=t=>t[e]||N;return t.isThemeGetter=!0,t.themeKey=e,t},F=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,L=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,se=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,R=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ce=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,V=e=>L.test(e),H=e=>!!e&&!Number.isNaN(Number(e)),U=e=>!!e&&Number.isInteger(Number(e)),le=e=>e.endsWith(`%`)&&H(e.slice(0,-1)),W=e=>se.test(e),ue=()=>!0,G=e=>R.test(e)&&!ce.test(e),K=()=>!1,de=e=>z.test(e),fe=e=>B.test(e),pe=e=>!q(e)&&!Y(e),me=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),he=e=>Z(e,Ae,K),q=e=>F.test(e),J=e=>Z(e,je,G),ge=e=>Z(e,Me,H),_e=e=>Z(e,Pe,ue),ve=e=>Z(e,Ne,K),ye=e=>Z(e,Oe,K),be=e=>Z(e,ke,fe),xe=e=>Z(e,Fe,de),Y=e=>I.test(e),X=e=>Q(e,je),Se=e=>Q(e,Ne),Ce=e=>Q(e,Oe),we=e=>Q(e,Ae),Te=e=>Q(e,ke),Ee=e=>Q(e,Fe,!0),De=e=>Q(e,Pe,!0),Z=(e,t,n)=>{let r=F.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=I.exec(e);return r?r[1]?t(r[1]):n:!1},Oe=e=>e===`position`||e===`percentage`,ke=e=>e===`image`||e===`url`,Ae=e=>e===`length`||e===`size`||e===`bg-size`,je=e=>e===`length`,Me=e=>e===`number`,Ne=e=>e===`family-name`,Pe=e=>e===`number`||e===`weight`,Fe=e=>e===`shadow`,Ie=oe(()=>{let e=P(`color`),t=P(`font`),n=P(`text`),r=P(`font-weight`),i=P(`tracking`),a=P(`leading`),o=P(`breakpoint`),s=P(`container`),c=P(`spacing`),l=P(`radius`),u=P(`shadow`),d=P(`inset-shadow`),f=P(`text-shadow`),p=P(`drop-shadow`),m=P(`blur`),h=P(`perspective`),g=P(`aspect`),_=P(`ease`),v=P(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,q,c],T=()=>[V,`full`,`auto`,...w()],ee=()=>[U,`none`,`subgrid`,Y,q],E=()=>[`auto`,{span:[`full`,U,Y,q]},U,Y,q],D=()=>[U,`auto`,Y,q],te=()=>[`auto`,`min`,`max`,`fr`,Y,q],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[V,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[s,V,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[V,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,Y,q],ie=()=>[...b(),Ce,ye,{position:[Y,q]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,we,he,{size:[Y,q]}],N=()=>[le,X,J],F=()=>[``,`none`,`full`,l,Y,q],I=()=>[``,H,X,J],L=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[H,le,Ce,ye],ce=()=>[``,`none`,m,Y,q],z=()=>[`none`,H,Y,q],B=()=>[`none`,H,Y,q],G=()=>[H,Y,q],K=()=>[V,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[W],breakpoint:[W],color:[ue],container:[W],"drop-shadow":[W],ease:[`in`,`out`,`in-out`],font:[pe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[W],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[W],shadow:[W],spacing:[`px`,H],text:[W],"text-shadow":[W],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,V,q,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,q]}],"container-named":[me],columns:[{columns:[H,`auto`,q,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[U,`auto`,Y,q]}],basis:[{basis:[V,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[H,V,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,H,Y,q]}],shrink:[{shrink:[``,H,Y,q]}],order:[{order:[U,`first`,`last`,`none`,Y,q]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...j()]}],"font-size":[{text:[`base`,n,X,J]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,De,_e]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,le,q]}],"font-family":[{font:[Se,ve,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,q]}],"line-clamp":[{"line-clamp":[H,`none`,Y,ge]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Y,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[H,`from-font`,`auto`,Y,J]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[H,`auto`,Y,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[U,Y,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},U,Y,q],radial:[``,Y,q],conic:[``,U,Y,q]},Te,be]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[H,Y,q]}],"outline-w":[{outline:[``,H,X,J]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`inner`,`none`,u,Ee,xe]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ee,xe]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[H,J]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,Ee,xe]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[H,Y,q]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Y,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,q]}],filter:[{filter:[``,`none`,Y,q]}],blur:[{blur:ce()}],brightness:[{brightness:[H,Y,q]}],contrast:[{contrast:[H,Y,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ee,xe]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,H,Y,q]}],"hue-rotate":[{"hue-rotate":[H,Y,q]}],invert:[{invert:[``,H,Y,q]}],saturate:[{saturate:[H,Y,q]}],sepia:[{sepia:[``,H,Y,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,q]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[H,Y,q]}],"backdrop-contrast":[{"backdrop-contrast":[H,Y,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,H,Y,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,Y,q]}],"backdrop-invert":[{"backdrop-invert":[``,H,Y,q]}],"backdrop-opacity":[{"backdrop-opacity":[H,Y,q]}],"backdrop-saturate":[{"backdrop-saturate":[H,Y,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,H,Y,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[H,`initial`,Y,q]}],ease:[{ease:[`linear`,`initial`,_,Y,q]}],delay:[{delay:[H,Y,q]}],animate:[{animate:[`none`,v,Y,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":[`scale-3d`],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[Y,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":[`translate-none`],zoom:[{zoom:[U,Y,q]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,q]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[H,X,J,ge]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Le(...e){return Ie(i(e))}var $=n(),Re=(0,s.forwardRef)(({title:e,titleId:t,...n},r)=>(0,$.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,$.jsx)(`title`,{id:t,children:e}):null,(0,$.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})]}));new Map(Object.entries({Æ:`Ae`,Ð:`D`,Ø:`O`,Þ:`Th`,ß:`ss`,æ:`ae`,ð:`d`,ø:`o`,þ:`th`,Đ:`D`,đ:`d`,Ħ:`H`,ħ:`h`,ı:`i`,IJ:`IJ`,ij:`ij`,ĸ:`k`,Ŀ:`L`,ŀ:`l`,Ł:`L`,ł:`l`,ʼn:`'n`,Ŋ:`N`,ŋ:`n`,Œ:`Oe`,œ:`oe`,Ŧ:`T`,ŧ:`t`,ſ:`s`}));function ze(e){return typeof e==`function`}var Be=s.forwardRef(({className:e,type:t,onValueChange:n,onChange:r,clearable:i=!1,...a},o)=>{let c=s.useRef(null),l=s.useCallback(e=>{c.current=e,ze(o)?o(e):o&&(o.current=e)},[o]),u=a.value!==void 0,[d,f]=s.useState(()=>String(a.defaultValue??``).length>0),p=u?String(a.value??``).length>0:d,m=e=>{u||f(e.target.value.length>0),n?.(e.target.value),r?.(e)},h=()=>{let e=c.current;e&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus()),u||f(!1)},g=i&&p&&!a.disabled&&!a.readOnly,_=(0,$.jsx)(`input`,{type:t,"data-slot":`input`,className:Le(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,i&&`pr-8`,e),ref:l,...a,onChange:m});return i?(0,$.jsxs)(`div`,{className:`relative w-full`,children:[_,g&&(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Clear`,onMouseDown:e=>e.preventDefault(),onClick:h,className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground opacity-60 hover:opacity-100 transition-opacity cursor-pointer`,children:(0,$.jsx)(Re,{className:`h-4 w-4`})})]}):_});Be.displayName=`Input`;var Ve={openai:`새 탭에서 OpenAI 로그인을 완료한 뒤 연결 실패 화면이 나타나면, 주소창의 전체 URL을 아래에 붙여넣으세요.`,anthropic:`새 탭에서 Claude 로그인을 완료하면 코드가 표시됩니다. 코드 전체를 아래에 붙여넣으세요.`,grok:`새 탭에서 xAI(auth.x.ai) 로그인을 완료하면 127.0.0.1 주소로 이동하며 페이지가 열리지 않습니다. 주소창의 전체 URL(또는 그 안의 code 값)을 아래에 붙여넣으세요.`},He={openai:`http://localhost:1455/auth/callback?code=...&state=...`,anthropic:`code#state`,grok:`http://127.0.0.1:.../callback?code=...&state=...`};function Ue({provider:e,isPending:t,isError:n,onSubmit:r,onRestart:i}){let[a,o]=(0,s.useState)(``);return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`p`,{className:`text-[12px] text-sand-600 leading-relaxed`,children:Ve[e]}),(0,$.jsx)(Be,{value:a,onChange:e=>o(e.target.value),placeholder:He[e],className:`w-full border border-sand-200 rounded-md px-3 py-2 text-sm font-mono text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`}),n&&(0,$.jsx)(`p`,{className:`text-[11px] text-red-500`,children:`인증 결과 확인에 실패했습니다 — 전체 값을 다시 붙여넣거나 로그인을 다시 시작하세요.`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!a.trim()||t,onClick:()=>r(a),children:t?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Verifying...`]}):`Complete login`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150`,onClick:()=>{o(``),i()},children:`처음부터 다시 시작`})]})}var We=[`anthropic`,`openai`,`grok`];function Ge(e){return We.some(t=>t===e)}var Ke=3e3,qe=3e5,Je=5,Ye=3,Xe=`Grok login failed`;function Ze(e){if(e)try{return new URL(e).protocol===`https:`?e:void 0}catch{return}}async function Qe(e,t){let{rows:n}=await a.getTokens(`A`,{num:0,queryMode:`list`});return new Set(n.filter(n=>n.provider===e&&n.name===t).map(e=>e.id))}function $e(){let[e,t]=(0,s.useState)(null),[n,i]=(0,s.useState)(null),[a,c]=(0,s.useState)(null),l=r(),u=o.useOauthStartMutation(),d=o.useOauthStartOpenAIMutation(),f=o.useOauthStartGrokMutation(),p=o.useOauthCompleteMutation(),m=(0,s.useRef)({}),h=(0,s.useRef)(0),g=(0,s.useCallback)(()=>{h.current+=1,m.current.interval!==void 0&&clearInterval(m.current.interval),m.current.timeout!==void 0&&clearTimeout(m.current.timeout),m.current={}},[]);(0,s.useEffect)(()=>g,[g]);let _=()=>Promise.all([l.invalidateQueries({queryKey:[`Token`]}),l.invalidateQueries({queryKey:[`Qgrid`]})]);return{loadingProvider:e,codeEntryProvider:n,deviceFlow:a,start:async(e,n)=>{let r=n.trim();if(!r)return;g();let a=h.current;c(null);let o=window.open(`about:blank`,`_blank`);t(e);try{if(e===`grok`){let{authUrl:n}=await f.mutateAsync({name:r});if(a!==h.current){o?.close();return}let s=Ze(n);if(!s)throw Error(`Grok login URL is not https`);o?o.location.href=s:window.open(s,`_blank`),i(e),t(null);return}if(e===`openai`){let n=await Qe(e,r);if(a!==h.current){o?.close();return}let{authUrl:s,mode:c}=await d.mutateAsync({name:r});if(a!==h.current){o?.close();return}if(o?o.location.href=s:window.open(s,`_blank`),c===`code`){i(e),t(null);return}m.current.interval=window.setInterval(()=>{Qe(e,r).then(e=>{a===h.current&&[...e].some(e=>!n.has(e))&&(g(),t(null),_())}).catch(()=>{})},Ke),m.current.timeout=window.setTimeout(()=>{a===h.current&&(g(),t(null))},qe);return}let{authUrl:n,mode:s}=await u.mutateAsync({name:r});if(a!==h.current){o?.close();return}s===`code`?(o?o.location.href=n:window.open(n,`_blank`),i(e),t(null)):(o?.close(),window.location.href=n)}catch(e){if(o?.close(),a!==h.current)return;console.error(`OAuth start failed:`,e),t(null)}},startDevice:async(e,n)=>{let r=e.trim();if(!r)return;g();let a=h.current;i(null),t(null),c({status:`starting`});let s;try{s=await o.oauthStartGrokDevice(r)}catch(e){if(a!==h.current)return;console.error(`Grok device login start failed:`,e),c({status:`error`,message:e instanceof Error&&e.message?e.message:Xe});return}if(a!==h.current)return;let{deviceCode:l}=s,u=Ze(s.verificationUri);if(!u){c({status:`error`,message:`Grok verification URL is not https`});return}let d=Ze(s.verificationUriComplete),f=Date.now()+s.expiresIn*1e3,p=Math.max(s.interval,1),v=0,y={status:`waiting`,userCode:s.userCode,verificationUri:u,expiresAt:f,slowDown:!1};d&&(y.verificationUriComplete=d),c(y);let b=()=>{let e=Math.min(p*1e3,Math.max(f-Date.now(),0));m.current.timeout=window.setTimeout(()=>void x(),e)},x=async()=>{if(a!==h.current)return;if(Date.now()>=f){c({status:`expired`});return}let e;try{e=await o.oauthPollGrokDevice(l)}catch(e){if(a!==h.current)return;if(v+=1,v>=Ye){console.error(`Grok device login poll failed:`,e),c({status:`error`,message:e instanceof Error&&e.message?e.message:Xe});return}b();return}a===h.current&&(v=0,e.status===`added`?(c({status:`added`,name:e.name??r}),await _(),a===h.current&&n?.()):(e.status===`slow_down`?(p=e.intervalSec??p+Je,c(e=>e?.status===`waiting`?{...e,slowDown:!0}:e)):e.intervalSec!==void 0&&(p=e.intervalSec),p=Math.max(p,1),b()))};b()},submitCode:async e=>{let t=e.trim();if(!t)return!1;try{await p.mutateAsync({pastedCode:t})}catch(e){return console.error(`OAuth complete failed:`,e),!1}return await _(),!0},reset:()=>{g(),t(null),i(null),c(null),p.reset()},completeMutation:p}}export{Be as i,$e as n,Ue as r,Ge as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{P as r}from"./vendor-tanstack-DMgmqjm4.js";import{t as i}from"./clsx-DB0hHKMi.js";import{d as a,s as o}from"./index-BSjyOyOc.js";var s=e(t(),1),c=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},l=(e,t)=>({classGroupId:e,validator:t}),u=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),d=`-`,f=[],p=`arbitrary..`,m=e=>{let t=_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return g(e);let n=e.split(d);return h(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?c(i,t):t:i||f}return n[e]||f}}},h=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=h(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(d):e.slice(t).join(d),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},g=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?p+r:void 0})(),_=e=>{let{theme:t,classGroups:n}=e;return v(n,t)},v=(e,t)=>{let n=u();for(let r in e){let i=e[r];y(i,n,r,t)}return n},y=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];b(i,t,n,r)}},b=(e,t,n,r)=>{typeof e==`string`?x(e,t,n):typeof e==`function`?S(e,t,n,r):C(e,t,n,r)},x=(e,t,n)=>{let r=e===``?t:w(t,e);r.classGroupId=n},S=(e,t,n,r)=>{T(e)?y(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(l(n,e)))},C=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];y(o,w(t,a),n,r)}},w=(e,t)=>{let n=e,r=t.split(d),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=u(),n.nextPart.set(t,i)),n=i}return n},T=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ee=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},E=`!`,D=`:`,te=[],O=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),k=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===D){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(E)?(c=s.slice(0,-1),l=!0):s.startsWith(E)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return O(t,l,c,u)};if(t){let e=t+D,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):O(te,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},A=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},j=e=>({cache:ee(e.cacheSize),parseClassName:k(e),sortModifiers:A(e),postfixLookupClassGroupIds:ne(e),...m(e)}),ne=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},re=/\s+/,M=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(re),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+E:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},ie=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ae(n))&&(i&&(i+=` `),i+=r);return i},ae=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ae(e[r]))&&(n&&(n+=` `),n+=t);return n},oe=(e,...t)=>{let n,r,i,a,o=o=>(n=j(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=M(e,n);return i(e,a),a};return a=o,(...e)=>a(ie(...e))},N=[],P=e=>{let t=t=>t[e]||N;return t.isThemeGetter=!0,t.themeKey=e,t},F=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,L=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,se=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,R=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ce=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,V=e=>L.test(e),H=e=>!!e&&!Number.isNaN(Number(e)),U=e=>!!e&&Number.isInteger(Number(e)),le=e=>e.endsWith(`%`)&&H(e.slice(0,-1)),W=e=>se.test(e),ue=()=>!0,G=e=>R.test(e)&&!ce.test(e),K=()=>!1,de=e=>z.test(e),fe=e=>B.test(e),pe=e=>!q(e)&&!Y(e),me=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),he=e=>Z(e,Ae,K),q=e=>F.test(e),J=e=>Z(e,je,G),ge=e=>Z(e,Me,H),_e=e=>Z(e,Pe,ue),ve=e=>Z(e,Ne,K),ye=e=>Z(e,Oe,K),be=e=>Z(e,ke,fe),xe=e=>Z(e,Fe,de),Y=e=>I.test(e),X=e=>Q(e,je),Se=e=>Q(e,Ne),Ce=e=>Q(e,Oe),we=e=>Q(e,Ae),Te=e=>Q(e,ke),Ee=e=>Q(e,Fe,!0),De=e=>Q(e,Pe,!0),Z=(e,t,n)=>{let r=F.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=I.exec(e);return r?r[1]?t(r[1]):n:!1},Oe=e=>e===`position`||e===`percentage`,ke=e=>e===`image`||e===`url`,Ae=e=>e===`length`||e===`size`||e===`bg-size`,je=e=>e===`length`,Me=e=>e===`number`,Ne=e=>e===`family-name`,Pe=e=>e===`number`||e===`weight`,Fe=e=>e===`shadow`,Ie=oe(()=>{let e=P(`color`),t=P(`font`),n=P(`text`),r=P(`font-weight`),i=P(`tracking`),a=P(`leading`),o=P(`breakpoint`),s=P(`container`),c=P(`spacing`),l=P(`radius`),u=P(`shadow`),d=P(`inset-shadow`),f=P(`text-shadow`),p=P(`drop-shadow`),m=P(`blur`),h=P(`perspective`),g=P(`aspect`),_=P(`ease`),v=P(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,q,c],T=()=>[V,`full`,`auto`,...w()],ee=()=>[U,`none`,`subgrid`,Y,q],E=()=>[`auto`,{span:[`full`,U,Y,q]},U,Y,q],D=()=>[U,`auto`,Y,q],te=()=>[`auto`,`min`,`max`,`fr`,Y,q],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[V,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[s,V,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[V,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,Y,q],ie=()=>[...b(),Ce,ye,{position:[Y,q]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,we,he,{size:[Y,q]}],N=()=>[le,X,J],F=()=>[``,`none`,`full`,l,Y,q],I=()=>[``,H,X,J],L=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[H,le,Ce,ye],ce=()=>[``,`none`,m,Y,q],z=()=>[`none`,H,Y,q],B=()=>[`none`,H,Y,q],G=()=>[H,Y,q],K=()=>[V,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[W],breakpoint:[W],color:[ue],container:[W],"drop-shadow":[W],ease:[`in`,`out`,`in-out`],font:[pe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[W],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[W],shadow:[W],spacing:[`px`,H],text:[W],"text-shadow":[W],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,V,q,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,q]}],"container-named":[me],columns:[{columns:[H,`auto`,q,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[U,`auto`,Y,q]}],basis:[{basis:[V,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[H,V,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,H,Y,q]}],shrink:[{shrink:[``,H,Y,q]}],order:[{order:[U,`first`,`last`,`none`,Y,q]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...j()]}],"font-size":[{text:[`base`,n,X,J]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,De,_e]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,le,q]}],"font-family":[{font:[Se,ve,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,q]}],"line-clamp":[{"line-clamp":[H,`none`,Y,ge]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Y,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[H,`from-font`,`auto`,Y,J]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[H,`auto`,Y,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[U,Y,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},U,Y,q],radial:[``,Y,q],conic:[``,U,Y,q]},Te,be]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[H,Y,q]}],"outline-w":[{outline:[``,H,X,J]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`inner`,`none`,u,Ee,xe]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ee,xe]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[H,J]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,Ee,xe]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[H,Y,q]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Y,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,q]}],filter:[{filter:[``,`none`,Y,q]}],blur:[{blur:ce()}],brightness:[{brightness:[H,Y,q]}],contrast:[{contrast:[H,Y,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ee,xe]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,H,Y,q]}],"hue-rotate":[{"hue-rotate":[H,Y,q]}],invert:[{invert:[``,H,Y,q]}],saturate:[{saturate:[H,Y,q]}],sepia:[{sepia:[``,H,Y,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,q]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[H,Y,q]}],"backdrop-contrast":[{"backdrop-contrast":[H,Y,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,H,Y,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,Y,q]}],"backdrop-invert":[{"backdrop-invert":[``,H,Y,q]}],"backdrop-opacity":[{"backdrop-opacity":[H,Y,q]}],"backdrop-saturate":[{"backdrop-saturate":[H,Y,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,H,Y,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[H,`initial`,Y,q]}],ease:[{ease:[`linear`,`initial`,_,Y,q]}],delay:[{delay:[H,Y,q]}],animate:[{animate:[`none`,v,Y,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":[`scale-3d`],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[Y,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":[`translate-none`],zoom:[{zoom:[U,Y,q]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,q]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[H,X,J,ge]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Le(...e){return Ie(i(e))}var $=n(),Re=(0,s.forwardRef)(({title:e,titleId:t,...n},r)=>(0,$.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,$.jsx)(`title`,{id:t,children:e}):null,(0,$.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})]}));new Map(Object.entries({Æ:`Ae`,Ð:`D`,Ø:`O`,Þ:`Th`,ß:`ss`,æ:`ae`,ð:`d`,ø:`o`,þ:`th`,Đ:`D`,đ:`d`,Ħ:`H`,ħ:`h`,ı:`i`,IJ:`IJ`,ij:`ij`,ĸ:`k`,Ŀ:`L`,ŀ:`l`,Ł:`L`,ł:`l`,ʼn:`'n`,Ŋ:`N`,ŋ:`n`,Œ:`Oe`,œ:`oe`,Ŧ:`T`,ŧ:`t`,ſ:`s`}));function ze(e){return typeof e==`function`}var Be=s.forwardRef(({className:e,type:t,onValueChange:n,onChange:r,clearable:i=!1,...a},o)=>{let c=s.useRef(null),l=s.useCallback(e=>{c.current=e,ze(o)?o(e):o&&(o.current=e)},[o]),u=a.value!==void 0,[d,f]=s.useState(()=>String(a.defaultValue??``).length>0),p=u?String(a.value??``).length>0:d,m=e=>{u||f(e.target.value.length>0),n?.(e.target.value),r?.(e)},h=()=>{let e=c.current;e&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus()),u||f(!1)},g=i&&p&&!a.disabled&&!a.readOnly,_=(0,$.jsx)(`input`,{type:t,"data-slot":`input`,className:Le(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,i&&`pr-8`,e),ref:l,...a,onChange:m});return i?(0,$.jsxs)(`div`,{className:`relative w-full`,children:[_,g&&(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Clear`,onMouseDown:e=>e.preventDefault(),onClick:h,className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground opacity-60 hover:opacity-100 transition-opacity cursor-pointer`,children:(0,$.jsx)(Re,{className:`h-4 w-4`})})]}):_});Be.displayName=`Input`;var Ve={openai:`새 탭에서 OpenAI 로그인을 완료한 뒤 연결 실패 화면이 나타나면, 주소창의 전체 URL을 아래에 붙여넣으세요.`,anthropic:`새 탭에서 Claude 로그인을 완료하면 코드가 표시됩니다. 코드 전체를 아래에 붙여넣으세요.`,grok:`새 탭에서 xAI(auth.x.ai) 로그인을 완료하면 127.0.0.1 주소로 이동하며 페이지가 열리지 않습니다. 주소창의 전체 URL(또는 그 안의 code 값)을 아래에 붙여넣으세요.`},He={openai:`http://localhost:1455/auth/callback?code=...&state=...`,anthropic:`code#state`,grok:`http://127.0.0.1:.../callback?code=...&state=...`};function Ue({provider:e,isPending:t,isError:n,onSubmit:r,onRestart:i}){let[a,o]=(0,s.useState)(``);return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`p`,{className:`text-[12px] text-sand-600 leading-relaxed`,children:Ve[e]}),(0,$.jsx)(Be,{value:a,onChange:e=>o(e.target.value),placeholder:He[e],className:`w-full border border-sand-200 rounded-md px-3 py-2 text-sm font-mono text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`}),n&&(0,$.jsx)(`p`,{className:`text-[11px] text-red-500`,children:`인증 결과 확인에 실패했습니다 — 전체 값을 다시 붙여넣거나 로그인을 다시 시작하세요.`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!a.trim()||t,onClick:()=>r(a),children:t?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Verifying...`]}):`Complete login`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150`,onClick:()=>{o(``),i()},children:`처음부터 다시 시작`})]})}var We=[`anthropic`,`openai`,`grok`];function Ge(e){return We.some(t=>t===e)}var Ke=3e3,qe=3e5,Je=5,Ye=3,Xe=`Grok login failed`;function Ze(e){if(e)try{return new URL(e).protocol===`https:`?e:void 0}catch{return}}async function Qe(e,t){let{rows:n}=await a.getTokens(`A`,{num:0,queryMode:`list`});return new Set(n.filter(n=>n.provider===e&&n.name===t).map(e=>e.id))}function $e(){let[e,t]=(0,s.useState)(null),[n,i]=(0,s.useState)(null),[a,c]=(0,s.useState)(null),l=r(),u=o.useOauthStartMutation(),d=o.useOauthStartOpenAIMutation(),f=o.useOauthStartGrokMutation(),p=o.useOauthCompleteMutation(),m=(0,s.useRef)({}),h=(0,s.useRef)(0),g=(0,s.useCallback)(()=>{h.current+=1,m.current.interval!==void 0&&clearInterval(m.current.interval),m.current.timeout!==void 0&&clearTimeout(m.current.timeout),m.current={}},[]);(0,s.useEffect)(()=>g,[g]);let _=()=>Promise.all([l.invalidateQueries({queryKey:[`Token`]}),l.invalidateQueries({queryKey:[`Qgrid`]})]);return{loadingProvider:e,codeEntryProvider:n,deviceFlow:a,start:async(e,n)=>{let r=n.trim();if(!r)return;g();let a=h.current;c(null);let o=window.open(`about:blank`,`_blank`);t(e);try{if(e===`grok`){let{authUrl:n}=await f.mutateAsync({name:r});if(a!==h.current){o?.close();return}let s=Ze(n);if(!s)throw Error(`Grok login URL is not https`);o?o.location.href=s:window.open(s,`_blank`),i(e),t(null);return}if(e===`openai`){let n=await Qe(e,r);if(a!==h.current){o?.close();return}let{authUrl:s,mode:c}=await d.mutateAsync({name:r});if(a!==h.current){o?.close();return}if(o?o.location.href=s:window.open(s,`_blank`),c===`code`){i(e),t(null);return}m.current.interval=window.setInterval(()=>{Qe(e,r).then(e=>{a===h.current&&[...e].some(e=>!n.has(e))&&(g(),t(null),_())}).catch(()=>{})},Ke),m.current.timeout=window.setTimeout(()=>{a===h.current&&(g(),t(null))},qe);return}let{authUrl:n,mode:s}=await u.mutateAsync({name:r});if(a!==h.current){o?.close();return}s===`code`?(o?o.location.href=n:window.open(n,`_blank`),i(e),t(null)):(o?.close(),window.location.href=n)}catch(e){if(o?.close(),a!==h.current)return;console.error(`OAuth start failed:`,e),t(null)}},startDevice:async(e,n)=>{let r=e.trim();if(!r)return;g();let a=h.current;i(null),t(null),c({status:`starting`});let s;try{s=await o.oauthStartGrokDevice(r)}catch(e){if(a!==h.current)return;console.error(`Grok device login start failed:`,e),c({status:`error`,message:e instanceof Error&&e.message?e.message:Xe});return}if(a!==h.current)return;let{deviceCode:l}=s,u=Ze(s.verificationUri);if(!u){c({status:`error`,message:`Grok verification URL is not https`});return}let d=Ze(s.verificationUriComplete),f=Date.now()+s.expiresIn*1e3,p=Math.max(s.interval,1),v=0,y={status:`waiting`,userCode:s.userCode,verificationUri:u,expiresAt:f,slowDown:!1};d&&(y.verificationUriComplete=d),c(y);let b=()=>{let e=Math.min(p*1e3,Math.max(f-Date.now(),0));m.current.timeout=window.setTimeout(()=>void x(),e)},x=async()=>{if(a!==h.current)return;if(Date.now()>=f){c({status:`expired`});return}let e;try{e=await o.oauthPollGrokDevice(l)}catch(e){if(a!==h.current)return;if(v+=1,v>=Ye){console.error(`Grok device login poll failed:`,e),c({status:`error`,message:e instanceof Error&&e.message?e.message:Xe});return}b();return}a===h.current&&(v=0,e.status===`added`?(c({status:`added`,name:e.name??r}),await _(),a===h.current&&n?.()):(e.status===`slow_down`?(p=e.intervalSec??p+Je,c(e=>e?.status===`waiting`?{...e,slowDown:!0}:e)):e.intervalSec!==void 0&&(p=e.intervalSec),p=Math.max(p,1),b()))};b()},submitCode:async e=>{let t=e.trim();if(!t)return!1;try{await p.mutateAsync({pastedCode:t})}catch(e){return console.error(`OAuth complete failed:`,e),!1}return await _(),!0},reset:()=>{g(),t(null),i(null),c(null),p.reset()},completeMutation:p}}export{Be as i,$e as n,Ue as r,Ge as t};
@@ -1 +1 @@
1
- import{m as e}from"./vendor-tanstack-DMgmqjm4.js";import{s as t}from"./index-CKbDrgCl.js";function n(){return e({mutationFn:({id:e,name:n,quotaThreshold:r,weight:i,keepaliveEnabled:a})=>t.updateToken(e,n,r,i,a)})}export{n as t};
1
+ import{m as e}from"./vendor-tanstack-DMgmqjm4.js";import{s as t}from"./index-BSjyOyOc.js";function n(){return e({mutationFn:({id:e,name:n,quotaThreshold:r,weight:i,keepaliveEnabled:a})=>t.updateToken(e,n,r,i,a)})}export{n as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{u as r}from"./vendor-tanstack-DMgmqjm4.js";import{A as i,C as a,E as o,T as s,_ as c,b as l,g as u,h as d,j as f,m as p,n as m,p as h,s as g}from"./index-CKbDrgCl.js";import{n as _,t as v}from"./TimedPlayer-UGSsgTKj.js";var y=e(t()),b=n(),x=(0,y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,b.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,b.jsx)(`title`,{id:t,children:e}):null,(0,b.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]})),S=(0,y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,b.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,b.jsx)(`title`,{id:t,children:e}):null,(0,b.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 12a9 9 0 1 1-6.219-8.56`})]})),C=(0,y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,b.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,b.jsx)(`title`,{id:t,children:e}):null,(0,b.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,b.jsx)(`path`,{d:`M12 19v3m7-12v2a7 7 0 0 1-14 0v-2`}),(0,b.jsx)(`rect`,{width:6,height:13,x:9,y:2,rx:3})]})]})),w=(0,y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,b.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,b.jsx)(`title`,{id:t,children:e}):null,(0,b.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`})]})),T=24e3;function E(e,t=T){let n=new Uint8Array(44+e.length*2),r=new DataView(n.buffer),i=(e,t)=>{for(let n=0;n<t.length;n++)r.setUint8(e+n,t.charCodeAt(n))};return i(0,`RIFF`),r.setUint32(4,36+e.length*2,!0),i(8,`WAVE`),i(12,`fmt `),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,t,!0),r.setUint32(28,t*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),i(36,`data`),r.setUint32(40,e.length*2,!0),e.forEach((e,t)=>{let n=Math.max(-1,Math.min(1,e));r.setInt16(44+t*2,n<0?n*32768:n*32767,!0)}),n}function D(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}async function O(e){let t=new AudioContext({sampleRate:T});try{let n=await t.decodeAudioData(await e.arrayBuffer()),r=new Float32Array(n.length);for(let e=0;e<n.numberOfChannels;e++){let t=n.getChannelData(e);for(let e=0;e<t.length;e++)r[e]+=t[e]/n.numberOfChannels}return D(E(r))}finally{await t.close()}}var k=e=>JSON.stringify(e),A=(...e)=>`import { ${[`qgrid`,...e.map(e=>`type ${e}`)].join(`, `)} } from "@cartanova/qgrid-ai-sdk";`;function j(e){let t=e.model.startsWith(`openai/`),n=t?`QgridOpenAISpeechVoice`:`QgridGrokVoice`,r=[` model: qgrid.speech(${k(e.model)}),`,` text: ${k(e.text)},`,` voice: ${k(e.voice)} satisfies ${n},`];return e.instructions&&r.push(` instructions: ${k(e.instructions)},`),e.speed!==void 0&&r.push(` speed: ${e.speed},`),r.push(` outputFormat: ${k(t?`wav`:`mp3`)},`),e.withTimestamps&&r.push(` providerOptions: { qgrid: { withTimestamps: true } },`),[`import { generateSpeech } from "ai";`,A(n),``,`const speech = await generateSpeech({`,...r,`});`].join(`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{u as r}from"./vendor-tanstack-DMgmqjm4.js";import{A as i,C as a,E as o,T as s,_ as c,b as l,g as u,h as d,j as f,m as p,n as m,p as h,s as g}from"./index-BSjyOyOc.js";import{n as _,t as v}from"./TimedPlayer-UGSsgTKj.js";var y=e(t()),b=n(),x=(0,y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,b.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,b.jsx)(`title`,{id:t,children:e}):null,(0,b.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]})),S=(0,y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,b.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,b.jsx)(`title`,{id:t,children:e}):null,(0,b.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 12a9 9 0 1 1-6.219-8.56`})]})),C=(0,y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,b.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,b.jsx)(`title`,{id:t,children:e}):null,(0,b.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,b.jsx)(`path`,{d:`M12 19v3m7-12v2a7 7 0 0 1-14 0v-2`}),(0,b.jsx)(`rect`,{width:6,height:13,x:9,y:2,rx:3})]})]})),w=(0,y.forwardRef)(({title:e,titleId:t,...n},r)=>(0,b.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,b.jsx)(`title`,{id:t,children:e}):null,(0,b.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`})]})),T=24e3;function E(e,t=T){let n=new Uint8Array(44+e.length*2),r=new DataView(n.buffer),i=(e,t)=>{for(let n=0;n<t.length;n++)r.setUint8(e+n,t.charCodeAt(n))};return i(0,`RIFF`),r.setUint32(4,36+e.length*2,!0),i(8,`WAVE`),i(12,`fmt `),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,t,!0),r.setUint32(28,t*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),i(36,`data`),r.setUint32(40,e.length*2,!0),e.forEach((e,t)=>{let n=Math.max(-1,Math.min(1,e));r.setInt16(44+t*2,n<0?n*32768:n*32767,!0)}),n}function D(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}async function O(e){let t=new AudioContext({sampleRate:T});try{let n=await t.decodeAudioData(await e.arrayBuffer()),r=new Float32Array(n.length);for(let e=0;e<n.numberOfChannels;e++){let t=n.getChannelData(e);for(let e=0;e<t.length;e++)r[e]+=t[e]/n.numberOfChannels}return D(E(r))}finally{await t.close()}}var k=e=>JSON.stringify(e),A=(...e)=>`import { ${[`qgrid`,...e.map(e=>`type ${e}`)].join(`, `)} } from "@cartanova/qgrid-ai-sdk";`;function j(e){let t=e.model.startsWith(`openai/`),n=t?`QgridOpenAISpeechVoice`:`QgridGrokVoice`,r=[` model: qgrid.speech(${k(e.model)}),`,` text: ${k(e.text)},`,` voice: ${k(e.voice)} satisfies ${n},`];return e.instructions&&r.push(` instructions: ${k(e.instructions)},`),e.speed!==void 0&&r.push(` speed: ${e.speed},`),r.push(` outputFormat: ${k(t?`wav`:`mp3`)},`),e.withTimestamps&&r.push(` providerOptions: { qgrid: { withTimestamps: true } },`),[`import { generateSpeech } from "ai";`,A(n),``,`const speech = await generateSpeech({`,...r,`});`].join(`
2
2
  `)}function M(e){let t=e.model.startsWith(`openai/`),n=[` model: qgrid.transcription(${k(e.model)}),`,...t?[` // OpenAI takes PCM16 WAV or raw PCM.`,` audio: await readFile("recording.wav"),`]:[` audio: await readFile("recording.mp3"),`]];return e.prompt&&n.push(` providerOptions: { openai: { prompt: ${k(e.prompt)} } },`),[`import { readFile } from "node:fs/promises";`,`import { transcribe } from "ai";`,A(),``,`const transcript = await transcribe({`,...n,`});`].join(`
3
3
  `)}function N(e){let t=[`voice: ${k(e.voice)} satisfies QgridLiveVoice`];e.instructions&&t.push(`instructions: ${k(e.instructions)}`);let{model:n,effort:r,webSearch:i}=e.delegation,a=[` delegation: {`,` model: ${k(n)},`,` effort: ${k(r)},`,` webSearch: ${i},`,` },`];return e.logged||a.push(` logger: false,`),e.continues&&a.push(` history, // earlier turns, at most 128`),[`// Browser`,`import { createQgridRealtime } from "@cartanova/qgrid-ai-sdk/realtime";`,`import { experimental_useRealtime } from "@ai-sdk/react";`,``,`// Module scope: the hook starts a new session whenever it gets a new model object.`,`const model = createQgridRealtime("openai/gpt-live-1");`,``,`const realtime = experimental_useRealtime({`,` model,`,` api: { session: "/api/live" },`,`});`,``,`// Server: POST /api/live`,A(`QgridLiveVoice`),``,`const answer = await qgrid.realtime("openai/gpt-live-1").doCreateWebRTCSession({`,` sdp,`,` // Voice and instructions are set here, on the server.`,` sessionConfig: {`,...t.map(e=>` ${e},`),` providerOptions: {`,` qgrid: {`,...a,` },`,` },`,` },`,`});`].join(`
4
4
  `)}var P=`qgrid_voice_playground`,F=[`grok/grok-tts`,`openai/gpt-realtime-2.1-mini`,`openai/gpt-realtime-2.1`],I=[`openai/gpt-transcribe`,`grok/grok-voice-transcribe-2.0`],L=[{label:`Female`,voices:p.female},{label:`Male`,voices:p.male}],R=[{label:``,voices:u}],z={provider:`timing from Grok TTS`,aligned:`timing from qgrid aligner`},B=e=>e.startsWith(`openai/`),V=`w-full rounded-lg border border-sand-200/80 bg-white px-2.5 py-1.5 text-[12px] text-sand-800 placeholder:text-sand-400 focus:outline-none focus:border-sienna-300 disabled:opacity-50`,H=`${V} h-8`,U=`px-3.5 py-1.5 text-[12px] font-medium rounded-lg bg-sienna-500 text-white hover:bg-sienna-600 disabled:opacity-50 transition-all duration-150 active:scale-[0.97] inline-flex items-center gap-1.5 shadow-sm`;function W({label:e,children:t}){return(0,b.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,b.jsx)(`span`,{className:`text-[11px] font-medium text-sand-500`,children:e}),t]})}var G=e=>e.slice(e.indexOf(`/`)+1);function K({title:e,meta:t,requestLogId:n,onRemove:i,children:a}){return(0,b.jsxs)(`li`,{className:`flex flex-col gap-1.5 px-4 py-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px]`,children:[(0,b.jsx)(`span`,{className:`font-medium text-sand-800`,children:e}),(0,b.jsx)(`span`,{className:`tabular-nums text-sand-400`,children:t}),(0,b.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[n!==void 0&&(0,b.jsxs)(r,{to:`/requests/show`,search:{id:n},target:`_blank`,className:`inline-flex items-center gap-1 tabular-nums text-sand-500 hover:text-sienna-500`,children:[`request log #`,n,(0,b.jsx)(x,{className:`size-3`})]}),(0,b.jsx)(`button`,{type:`button`,onClick:i,title:`Remove from history`,className:`text-sand-300 hover:text-sand-600`,children:(0,b.jsx)(s,{className:`size-3.5`})})]})]}),a]})}function q({code:e,note:t,children:n}){return(0,b.jsxs)(`div`,{className:`flex flex-col xl:flex-row gap-4 items-stretch xl:items-start`,children:[(0,b.jsx)(`div`,{className:`panel overflow-hidden flex-1 min-w-0`,children:n}),(0,b.jsx)(`div`,{className:`min-w-0 xl:w-[32rem] xl:shrink-0 xl:sticky xl:top-4`,children:(0,b.jsx)(_,{title:`AI SDK`,code:e,scroll:!1,actions:t&&(0,b.jsx)(`span`,{className:`text-[11px] text-sand-400`,children:t})})})]})}function J({empty:e,children:t}){return t.length===0?(0,b.jsx)(`p`,{className:`px-4 py-6 text-center text-[12px] text-sand-400`,children:e}):(0,b.jsx)(`ul`,{className:`divide-y divide-sand-100`,children:t})}function Y(e){if(!e)return;let t=[],n;return e.graphChars.forEach((r,i)=>{let[a,o]=e.graphTimes[i];/\s/.test(r)?n=void 0:n?(n.text+=r,n.end=o):(n={text:r,start:a,end:o},t.push(n))}),t}function X(){let[e,t]=(0,y.useState)(F[0]),[n,r]=(0,y.useState)(p.female[0]),[i,a]=(0,y.useState)(``),[s,c]=(0,y.useState)(`Hi! What did you do this weekend?`),[l,d]=(0,y.useState)([]),[f,m]=(0,y.useState)(!0),[h,_]=(0,y.useState)(1),x=(0,y.useRef)(0),C=g.useSpeakMutation(),T=B(e),E=e=>{B(e)!==T&&r(B(e)?u[0]:p.female[0]),t(e)},D=T&&i.trim()?i.trim():void 0,O=t=>{let n=performance.now(),r={model:e,text:s,voice:t,projectName:P};D&&(r.instructions=D),f&&(r.withTimestamps=!0),!T&&h!==1&&(r.speed=h),C.mutate({params:r},{onSuccess:i=>{let a={key:x.current++,src:`data:${i.mimeType};base64,${i.audio}`,model:e,voice:t,instructions:r.instructions,speed:r.speed,text:s,elapsedMs:performance.now()-n,requestLogId:i.requestLogId,words:Y(i.audioTimestamps),timing:i.timestampsError?`timing failed: ${i.timestampsError}`:i.timestampsSource&&z[i.timestampsSource]};d(e=>[a,...e])}})},k=(0,y.useRef)(null),[A,M]=(0,y.useState)();(0,y.useEffect)(()=>()=>k.current?.pause(),[]);let N=e=>{if(r(e),k.current?.pause(),A===e){M(void 0);return}let t=new Audio(`/voice-samples/${T?`openai`:`grok`}/${e}.mp3`);t.addEventListener(`ended`,()=>M(t=>t===e?void 0:t),{once:!0}),k.current=t,M(e),t.play()},I=j({model:e,text:s,voice:n,instructions:D,speed:!T&&h!==1?h:void 0,withTimestamps:f});return(0,b.jsxs)(q,{code:I,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,b.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,b.jsx)(W,{label:`Model`,children:(0,b.jsx)(`select`,{value:e,onChange:e=>E(e.target.value),className:H,children:F.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})}),T?(0,b.jsx)(W,{label:`Style instructions (OpenAI only)`,children:(0,b.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:`e.g. Speak with a gentle Irish accent.`,className:H})}):(0,b.jsx)(W,{label:`Speed (Grok only) — ${h.toFixed(2)}×`,children:(0,b.jsx)(`input`,{type:`range`,min:.7,max:1.5,step:.05,value:h,onChange:e=>_(Number(e.target.value)),className:`h-8 accent-sienna-500`})})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(`span`,{className:`text-[11px] font-medium text-sand-500`,children:`Voice — ▶ plays a short self-introduction sample, a name selects it`}),(T?R:L).map(e=>(0,b.jsxs)(`div`,{className:`flex items-start gap-2`,children:[e.label&&(0,b.jsx)(`span`,{className:`w-12 shrink-0 pt-1 text-[11px] text-sand-400`,children:e.label}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.voices.map(e=>(0,b.jsxs)(`span`,{className:`inline-flex items-center overflow-hidden rounded-full border text-[12px] ${n===e?`border-sienna-400 bg-sienna-50 text-sienna-700`:`border-sand-200/80 bg-white text-sand-700`}`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:()=>r(e),"aria-pressed":n===e,className:`py-0.5 pl-2.5 pr-1 hover:text-sienna-600`,children:e}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>N(e),title:A===e?`Stop "${e}"`:`Play a "${e}" sample`,className:`py-1 pl-1 pr-2 hover:text-sienna-500 ${A===e?`text-sienna-500`:`text-sand-400`}`,children:A===e?(0,b.jsx)(o,{className:`size-3`}):(0,b.jsx)(w,{className:`size-3`})})]},e))})]},e.label))]}),(0,b.jsx)(W,{label:`Text`,children:(0,b.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),rows:3,className:`${V} resize-y`})}),(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>O(n),disabled:C.isPending||!s.trim(),className:U,children:[C.isPending&&(0,b.jsx)(S,{className:`size-3.5 animate-spin`}),`Generate with `,n]}),(0,b.jsxs)(`label`,{className:`flex items-center gap-1.5 text-[12px] text-sand-600`,children:[(0,b.jsx)(`input`,{type:`checkbox`,checked:f,onChange:e=>m(e.target.checked),className:`accent-sienna-500`}),`Word timing`]}),C.isError&&(0,b.jsx)(`p`,{className:`text-[12px] text-danger-500 break-words`,children:C.error?.message})]})]}),(0,b.jsx)(`div`,{className:`border-t border-sand-100`,children:(0,b.jsx)(J,{empty:`Generated clips stack here, newest first, so voices can be compared side by side.`,children:l.map(e=>(0,b.jsxs)(K,{title:[e.voice,G(e.model),e.speed&&`${e.speed}×`].filter(Boolean).join(` · `),meta:[`${(e.elapsedMs/1e3).toFixed(1)}s`,e.timing].filter(Boolean).join(` · `),requestLogId:e.requestLogId,onRemove:()=>d(t=>t.filter(t=>t.key!==e.key)),children:[(!e.words||e.instructions)&&(0,b.jsxs)(`p`,{className:`truncate text-[12px] text-sand-600`,title:e.text,children:[!e.words&&e.text,e.instructions&&(0,b.jsxs)(`span`,{className:`text-sand-400`,children:[` — `,e.instructions]})]}),(0,b.jsx)(v,{src:e.src,words:e.words,autoPlay:!0})]},e.key))})})]})}function Z(){let[e,t]=(0,y.useState)(I[0]),[n,r]=(0,y.useState)(``),[i,a]=(0,y.useState)(),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(),[d,f]=(0,y.useState)([]),p=(0,y.useRef)(null),m=(0,y.useRef)([]),h=(0,y.useRef)(0),_=g.useTranscribeMutation(),x=B(e);(0,y.useEffect)(()=>()=>{p.current?.stream.getTracks().forEach(e=>e.stop()),m.current.forEach(e=>URL.revokeObjectURL(e))},[]);let w=e=>{let t=URL.createObjectURL(e);m.current.push(t),a({blob:e,url:t,clip:m.current.length})},T=async()=>{if(s)p.current?.stop(),c(!1);else{u(void 0);try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e),n=[];t.ondataavailable=e=>n.push(e.data),t.onstop=()=>{e.getTracks().forEach(e=>e.stop()),w(new Blob(n,{type:t.mimeType}))},t.start(),p.current=t,c(!0)}catch(e){u(e instanceof Error?e.message:String(e))}}},E=async()=>{if(!i)return;u(void 0);let t=i.blob.type.split(`;`)[0],r;try{r=!x&&t.startsWith(`audio/`)?{audio:D(new Uint8Array(await i.blob.arrayBuffer())),mediaType:t}:{audio:await O(i.blob),mediaType:`audio/wav`}}catch(e){u(`could not decode audio: ${e instanceof Error?e.message:String(e)}`);return}let a={model:e,...r,projectName:P};x&&n.trim()&&(a.prompt=n.trim());let o=performance.now();_.mutate({params:a},{onSuccess:t=>{let n={key:h.current++,clip:i.clip,clipUrl:i.url,model:e,prompt:a.prompt,text:t.text,elapsedMs:performance.now()-o,durationSec:t.durationSec,requestLogId:t.requestLogId,words:t.words};f(e=>[n,...e])}})},k=M({model:e,prompt:x&&n.trim()?n.trim():void 0});return(0,b.jsxs)(q,{code:k,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,b.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,b.jsx)(W,{label:`Model`,children:(0,b.jsx)(`select`,{value:e,onChange:e=>t(e.target.value),className:H,children:I.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})}),x&&(0,b.jsx)(W,{label:`Prompt (OpenAI only)`,children:(0,b.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`domain words, e.g. qgrid, Kuma`,className:H})})]}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:T,className:`${U} ${s?`bg-danger-500 hover:bg-danger-500`:``}`,children:[s?(0,b.jsx)(o,{className:`size-3.5`}):(0,b.jsx)(C,{className:`size-3.5`}),s?`Stop`:`Record`]}),(0,b.jsxs)(`label`,{className:`text-[12px] text-sand-600 cursor-pointer hover:text-sienna-500`,children:[`or upload a file`,(0,b.jsx)(`input`,{type:`file`,accept:`audio/*`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&w(t)}})]}),l&&(0,b.jsx)(`p`,{className:`text-[12px] text-danger-500 break-words`,children:l})]}),i&&(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(`span`,{className:`shrink-0 text-[11px] font-medium text-sand-500`,children:[`clip `,i.clip]}),(0,b.jsx)(`audio`,{controls:!0,src:i.url,className:`h-8 w-full`})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:E,disabled:!i||s||_.isPending,className:U,children:[_.isPending&&(0,b.jsx)(S,{className:`size-3.5 animate-spin`}),`Transcribe`]}),_.isError&&(0,b.jsx)(`p`,{className:`text-[12px] text-danger-500 break-words`,children:_.error?.message})]})]}),(0,b.jsx)(`div`,{className:`border-t border-sand-100`,children:(0,b.jsx)(J,{empty:`Transcripts stack here, newest first; run one clip through several models to compare.`,children:d.map(e=>(0,b.jsx)(K,{title:`clip ${e.clip} · ${G(e.model)}`,meta:[`${(e.elapsedMs/1e3).toFixed(1)}s`,e.durationSec===void 0?``:`${e.durationSec.toFixed(1)}s audio`,e.prompt?`prompt: ${e.prompt}`:``].filter(Boolean).join(` · `),requestLogId:e.requestLogId,onRemove:()=>f(t=>t.filter(t=>t.key!==e.key)),children:e.words&&e.words.length>0?(0,b.jsx)(v,{src:e.clipUrl,words:e.words}):(0,b.jsx)(`p`,{className:`rounded-lg bg-sand-50 px-3 py-2 text-[13px] text-sand-800 whitespace-pre-wrap`,children:e.text||`(empty transcript)`})},e.key))})})]})}var Q=`openai/gpt-6-luna`,ee=l({type:a(),turn:l({id:a(),role:a(),transcript:a()}).optional(),turn_id:a().optional(),delta:a().optional()}),te=e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,`0`)}`;function $({pc:e,channel:t,mic:n}){t.readyState===`open`&&t.send(JSON.stringify({type:`session.close`})),n.getTracks().forEach(e=>e.stop()),setTimeout(()=>e.close(),500)}function ne(){let[e,t]=(0,y.useState)(d[0]),[n,i]=(0,y.useState)(``),[a,s]=(0,y.useState)(Q),[l,u]=(0,y.useState)(`low`),[f,p]=(0,y.useState)(!1),[m,_]=(0,y.useState)(!0),[v,w]=(0,y.useState)([]),T=!a.startsWith(`anthropic/`),[E,D]=(0,y.useState)(`idle`),[O,k]=(0,y.useState)(),[A,j]=(0,y.useState)([]),[M,F]=(0,y.useState)(),[I,L]=(0,y.useState)(0),R=(0,y.useRef)(null),z=(0,y.useRef)(null),B=g.useLiveCallMutation();(0,y.useEffect)(()=>()=>{R.current&&$(R.current)},[]),(0,y.useEffect)(()=>{if(E!==`live`)return;let e=Date.now(),t=setInterval(()=>L(Math.floor((Date.now()-e)/1e3)),1e3);return()=>clearInterval(t)},[E]);let V=()=>{R.current&&$(R.current),R.current=null,D(`idle`)},G=e=>{let t;try{t=ee.safeParse(JSON.parse(e)).data}catch{return}if(!t)return;let{type:n,turn:r,turn_id:i,delta:a}=t;if(n===`session.closed`)V();else if(r&&(n===`turn.created`||n===`turn.done`)){let e={id:r.id,role:r.role,text:r.transcript};j(t=>t.some(e=>e.id===r.id)?t.map(t=>t.id===r.id?e:t):[...t,e])}else n===`turn.delta`&&i&&a&&j(e=>e.map(e=>e.id===i?{...e,text:e.text+a}:e))},K=async t=>{let r=t?[...v,...A.flatMap(e=>e.text.trim()?[{role:e.role===`assistant`?`assistant`:`user`,text:e.text.trim()}]:[])].slice(-128):[];w(r),k(void 0),j([]),F(void 0),L(0),D(`connecting`);let i,o;try{i=await navigator.mediaDevices.getUserMedia({audio:!0});let t=new RTCPeerConnection;o=t,i.getTracks().forEach(e=>t.addTrack(e)),t.addEventListener(`track`,e=>{z.current&&(z.current.srcObject=new MediaStream([e.track]))});let s=t.createDataChannel(`oai-events`);s.addEventListener(`message`,e=>G(String(e.data)));let c=await t.createOffer();await t.setLocalDescription(c);let u={sdp:c.sdp??``,voice:e,delegation:{model:a,effort:l,webSearch:T&&f},projectName:P};n.trim()&&(u.instructions=n.trim()),r.length&&(u.history=r),m||(u.logger=!1);let d=await B.mutateAsync({params:u});await t.setRemoteDescription({type:`answer`,sdp:d.sdp}),R.current={pc:t,channel:s,mic:i},F(d.requestLogId),D(`live`)}catch(e){i?.getTracks().forEach(e=>e.stop()),o?.close(),k(e instanceof Error?e.message:String(e)),D(`idle`)}},J=N({voice:e,instructions:n.trim()||void 0,delegation:{model:a,effort:l,webSearch:T&&f},logged:m,continues:v.length>0});return(0,b.jsx)(q,{code:J,note:`SDK 2.20.0+, experimental`,children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,b.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,b.jsx)(W,{label:`Voice`,children:(0,b.jsx)(`select`,{value:e,onChange:e=>t(e.target.value),disabled:E!==`idle`,className:H,children:d.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})}),(0,b.jsx)(W,{label:`Instructions`,children:(0,b.jsx)(`input`,{value:n,onChange:e=>i(e.target.value),disabled:E!==`idle`,placeholder:`e.g. You are a friendly English tutor. Keep answers short.`,className:H})}),(0,b.jsx)(W,{label:`Delegation model (answers lookups and reasoning)`,children:(0,b.jsx)(`select`,{value:a,onChange:e=>s(e.target.value),disabled:E!==`idle`,className:H,children:c.map(e=>(0,b.jsx)(`optgroup`,{label:e.label,children:e.models.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))},e.label))})}),(0,b.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,b.jsx)(W,{label:`Effort`,children:(0,b.jsx)(`select`,{value:l,onChange:e=>u(h.options.find(t=>t===e.target.value)??`low`),disabled:E!==`idle`,className:H,children:h.options.map(e=>(0,b.jsx)(`option`,{value:e,children:e},e))})}),(0,b.jsxs)(`label`,{className:`flex h-8 items-center gap-1.5 text-[12px] text-sand-600`,children:[(0,b.jsx)(`input`,{type:`checkbox`,checked:T&&f,onChange:e=>p(e.target.checked),disabled:E!==`idle`||!T,className:`accent-sienna-500`}),`Web search`]}),(0,b.jsxs)(`label`,{className:`flex h-8 items-center gap-1.5 text-[12px] text-sand-600`,children:[(0,b.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>_(e.target.checked),disabled:E!==`idle`,className:`accent-sienna-500`}),`Request log`]})]})]}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[E===`idle`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>K(!1),className:U,children:[(0,b.jsx)(C,{className:`size-3.5`}),`Start conversation`]}),A.length>0&&(0,b.jsx)(`button`,{type:`button`,onClick:()=>K(!0),className:`text-[12px] font-medium text-sienna-600 hover:text-sienna-700`,children:`Continue this conversation`})]}):(0,b.jsxs)(`button`,{type:`button`,onClick:V,disabled:E===`connecting`,className:`${U} bg-danger-500 hover:bg-danger-500`,children:[E===`connecting`?(0,b.jsx)(S,{className:`size-3.5 animate-spin`}):(0,b.jsx)(o,{className:`size-3.5`}),E===`connecting`?`Connecting`:`End`]}),E===`live`&&(0,b.jsxs)(`span`,{className:`tabular-nums text-[12px] text-sand-500`,children:[te(I),` · openai/gpt-live-1 · speak any time (ends by itself after 2 h)`]}),M!==void 0&&(0,b.jsxs)(r,{to:`/requests/show`,search:{id:M},target:`_blank`,className:`inline-flex items-center gap-1 text-[12px] tabular-nums text-sand-500 hover:text-sienna-500`,children:[`request log #`,M,(0,b.jsx)(x,{className:`size-3`})]}),O&&(0,b.jsx)(`p`,{className:`text-[12px] text-danger-500 break-words`,children:O})]}),(0,b.jsx)(`audio`,{ref:z,autoPlay:!0}),v.length===0&&A.length===0?(0,b.jsx)(`p`,{className:`py-6 text-center text-[12px] text-sand-400`,children:`Start a conversation and talk; both sides of the transcript appear here.`}):(0,b.jsxs)(`ul`,{className:`flex flex-col gap-1.5`,children:[v.map((e,t)=>(0,b.jsxs)(`li`,{className:`rounded-lg bg-sand-50/60 px-3 py-2 text-[13px] text-sand-500`,children:[(0,b.jsx)(`span`,{className:`mr-2 text-[10px] font-medium uppercase tracking-wider text-sand-400`,children:e.role}),e.text]},`earlier-${t}`)),A.map(e=>(0,b.jsxs)(`li`,{className:`rounded-lg px-3 py-2 text-[13px] text-sand-800 ${e.role===`assistant`?`bg-sage-50`:`bg-sand-50`}`,children:[(0,b.jsx)(`span`,{className:`mr-2 text-[10px] font-medium uppercase tracking-wider text-sand-500`,children:e.role}),e.text.trim()]},e.id))]})]})})}function re({tab:e}){return(0,b.jsxs)(`section`,{children:[(0,b.jsx)(`div`,{role:`tablist`,className:`panel mb-4 flex gap-1 px-3 pt-2 md:hidden`,children:i.map(t=>(0,b.jsx)(r,{to:`/voice`,search:{tab:t},role:`tab`,"aria-selected":e===t,className:`-mb-px border-b-2 px-3 py-2 text-[13px] no-underline transition-colors duration-150 ${e===t?`border-sienna-500 font-medium text-sand-800`:`border-transparent text-sand-500 hover:text-sand-700`}`,children:f[t]},t))}),(0,b.jsx)(`div`,{role:`tabpanel`,hidden:e!==`tts`,children:(0,b.jsx)(X,{})}),(0,b.jsx)(`div`,{role:`tabpanel`,hidden:e!==`stt`,children:(0,b.jsx)(Z,{})}),(0,b.jsx)(`div`,{role:`tabpanel`,hidden:e!==`live`,children:(0,b.jsx)(ne,{})})]})}function ie(){let{tab:e=`tts`}=m.useSearch();return(0,b.jsx)(`div`,{className:`max-w-3xl mx-auto xl:max-w-6xl`,children:(0,b.jsx)(re,{tab:e})})}export{ie as component};
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/sonamu.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Qgrid</title>
8
- <script type="module" crossorigin src="/assets/index-CKbDrgCl.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-BSjyOyOc.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-8xo7RSum.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-DMgmqjm4.js">
@@ -53973,7 +53973,7 @@ function ChatWidget() {
53973
53973
  }
53974
53974
  //#endregion
53975
53975
  //#region src/components/Sidebar.tsx
53976
- var qgridVersion = "2.22.0";
53976
+ var qgridVersion = "2.22.1";
53977
53977
  function Sidebar({ className }) {
53978
53978
  const pathname = useRouterState({ select: (s) => s.location.pathname });
53979
53979
  const { tab: currentTab = "tts" } = useSearch({ strict: false });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartanova/qgrid-cli",
3
- "version": "2.22.0",
3
+ "version": "2.22.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cartanova-ai/qgrid"
@@ -45,7 +45,7 @@ Request logging is enabled by default. Use `providerOptions.qgrid.logger: false`
45
45
 
46
46
  ## Non-Negotiable Boundaries
47
47
 
48
- - Use `packages/ai-sdk` as the active public SDK surface. `qgrid()` implements `LanguageModelV3` for text, tools, and structured output; it has no public image-generation options and does not support general vision. `qgrid.image("openai/gpt-image-2")` implements `ImageModelV3` for standard AI SDK `generateImage`, directly calling subscription Images for generation or reference editing without a chat driver. Dashboard chat registers its image tool internally; do not add a public SDK tool factory. See `references/ai-sdk-provider-contract.md` for image options, usage, and metadata.
48
+ - Use `packages/ai-sdk` as the active public SDK surface. `qgrid()` implements `LanguageModelV3` for text, tools, and structured output; it has no public image-generation options. User-message image parts are sent as image input on `openai/` and `grok/` models and dropped on `anthropic/` models. `qgrid.image("openai/gpt-image-2")` implements `ImageModelV3` for standard AI SDK `generateImage`, directly calling subscription Images for generation or reference editing without a chat driver. Dashboard chat registers its image tool internally; do not add a public SDK tool factory. See `references/ai-sdk-provider-contract.md` for image options, usage, and metadata.
49
49
  - Expose thinking only as `providerOptions.qgrid.thinking?: boolean`: omission preserves the model policy, false overrides effort, and unsupported/unverified off requests fail explicitly. See the SDK and provider runtime references for the dated support snapshot. Keep Anthropic thinking controls separate from mandatory configuration and memory isolation. Haiku/Sonnet 5.5 off uses a computed thinking-only native body override with Claude Code >=2.1.295; never inherit or expose arbitrary extra body.
50
50
  - The old v1 SDK package (`packages/sdk`, `@cartanova/qgrid-sdk`) has been removed from the repository. It survives only as a deprecated npm artifact (1.9.0); do not resurrect it or write new code against it.
51
51
  - Let the server infer single-turn versus tool-run request-log lifecycle. Do not recreate caller-selected logging modes in the SDK or API examples.
@@ -59,7 +59,7 @@ Request logging is enabled by default. Use `providerOptions.qgrid.logger: false`
59
59
 
60
60
  ## Request log IDs (2.10.0+)
61
61
 
62
- - Successful raw query responses and stream `done` events expose optional top-level `requestLogId`. AI SDK text calls expose it as `providerMetadata.qgrid.requestLogId`; await stream metadata after consuming the stream. `generateImage` exposes each call's ID under `providerMetadata.qgrid.images[]` alongside generation metadata.
62
+ - Successful raw query responses and stream `done` events expose optional top-level `requestLogId`. AI SDK text calls expose it as `result.finalStep.providerMetadata.qgrid.requestLogId` (AI SDK 7 keeps top-level `providerMetadata` only as a deprecated alias); for streams, await `finalStep` after consuming the stream. `generateImage` exposes each call's ID under `providerMetadata.qgrid.images[]` alongside generation metadata.
63
63
  - The ID identifies the parent request log and stays the same across tool-run steps. It is omitted with `logger: false`. Keep `runContext.requestLogId` for tool continuation only; do not replay the top-level ID as continuation state.
64
64
  - Update both server and AI SDK to 2.10.0 or later to consume the metadata. Older servers may omit the ID. This contract does not add IDs to delta or error events or change `createQgridLogger` for external providers.
65
65
 
@@ -10,10 +10,9 @@ Use this reference for qgrid startup, configuration, and runtime-facing environm
10
10
 
11
11
  When npm reports a newer `@cartanova/qgrid-cli`, including patch releases, the CLI installs that exact resolved version and restarts from the updated binary. Do not use a moving `@latest` install target for this path; exact versions avoid stale pnpm global project ranges. The npm lookup and global install are best-effort: a registry/package-manager outage is logged prominently and boot continues on the current qgrid version. A successful install is still verified against the exact resolved version before restart.
12
12
 
13
- The CLI also ensures runtime CLIs are installed/current enough:
13
+ The CLI checks one runtime CLI at startup and only warns when it is missing (it does not install it):
14
14
 
15
- - `codex` from `@openai/codex`, required for OpenAI tokens.
16
- - `claude` from `@anthropic-ai/claude-code`, required for Anthropic tokens.
15
+ - `claude` (Claude Code), required for Anthropic tokens. OpenAI and Grok tokens need no local CLI: qgrid calls their backends directly.
17
16
 
18
17
  ## CLI database env vars
19
18
 
@@ -94,8 +94,8 @@ Key decisions:
94
94
  - Direct PKCE OAuth, refresh, and `wham/usage` quota lookup replace delegated runtime calls. Generation and quota requests send Codex CLI identity headers.
95
95
  - Requests run uncapped, matching the Anthropic runtime: transport is a single HTTPS/WS request, so no local resource justifies a cap, and upstream limits are the backend's responses. The worker-era permit/queue layer was removed once this became clear.
96
96
  - Every turn sends full Responses-format history. A model-scoped opaque value derived from `sessionKey` is forwarded as `prompt_cache_key`; it is not a provider thread address.
97
- - `AbortSignal` cancellation covers queue wait, retry delay, and active HTTPS transport.
98
- - The transport interface is independent of HTTPS so a future WebSocket implementation can preserve dispatcher behavior.
97
+ - `AbortSignal` cancellation covers token selection (including the quota lookup) and the active transport. There is no queue.
98
+ - The transport interface is independent of HTTPS; the WebSocket transport (`QGRID_OPENAI_TRANSPORT=websocket`, the current default) uses the same dispatcher behavior.
99
99
  - The backend is private and unstable. Mocked protocol tests do not establish live provider compatibility.
100
100
  - OpenAI cached tokens are included in `input_tokens`. Cache-hit denominator is `input_tokens`, not `input + cache_read + cache_creation`.
101
101
 
@@ -154,7 +154,7 @@ Sources: `docs/plans/2026-10-17-openai-realtime-audio-plan.md`, `docs/diagnosis/
154
154
 
155
155
  - Decisions is OpenAI-only (2026-11-13). Anthropic and xAI document no decision endpoint, and neither exposes token logprobs on current models (xAI ignores them on `grok-4.20`+). AI SDK emulates Anthropic with prompted estimates and no distributions; qgrid does not add that emulation, so a qgrid probability is always a native one.
156
156
  - The qgrid `/decide` API is provider-neutral (the AI SDK decision call in JSON), and the OpenAI provider layer converts both ways (user decision 2026-11-13). An OpenAI-shaped API was rejected because it would expose one provider's wire format at the API boundary and break deployed SDKs when a second provider (Google, Perplexity) arrives; this matches `transcribe`, which routes `openai/` and `grok/` by model prefix.
157
- - Missing instructions are a 400, not a synthesized default sentence: a default would change the judgment silently, and OpenAI itself rejects the omission.
157
+ - Missing instructions on `choice` and `score` questions are a 400, not a synthesized default sentence: a default would change the judgment silently, and OpenAI itself rejects the omission. A `boolean` question may rely on its criteria, which become the instructions.
158
158
 
159
159
  ## Grok (xAI Subscription) Runtime
160
160
 
@@ -261,7 +261,7 @@ Key decisions:
261
261
  - CLI and SDK were split so AI consumers do not install Sonamu, database, and runtime-server dependencies just to call qgrid.
262
262
  - The CLI is a direct Node/bundle runner, not a Docker wrapper. Docker was removed to keep `npm i -g ...` plus `qgrid start` usable without local Docker setup.
263
263
  - CLI user-facing configuration is intentionally small: database connection, port, public callback URL, server URL, and project name. Bundle bootstrapping details are implementation internals.
264
- - The CLI checks runtime CLIs (`codex`, `claude`) because qgrid delegates provider execution to those local binaries.
264
+ - The CLI checks for `claude` only and warns when it is missing: Anthropic execution is delegated to that local binary, while OpenAI and Grok are called directly.
265
265
  - The dashboard version should follow the CLI package version because the dashboard is shipped by the CLI bundle, not as an independently versioned web product.
266
266
  - qgrid skills ship with the CLI package, not a separate skills package. qgrid cannot be used with the AI SDK alone; a local qgrid CLI server is required, so CLI install is the right moment to sync `.agents/skills/qgrid` and `.claude/skills/qgrid` into the consuming project.
267
267
  - Sonamu 0.11 (2.11.0) keeps qgrid-side workarounds instead of pinning back: the API build sets `NODE_ENV=production` (SON-567), CI creates an empty `packages/api/.env`, and `.oxlintrc.json` disables `no-unnecessary-type-assertion` for Sonamu's lint temp files (SON-564). Remove each workaround once the matching Sonamu issue ships. Peer ranges that upstream packages have not widened yet are allowed per parent in `pnpm-workspace.yaml` `peerDependencyRules.allowedVersions`, with the reason next to each entry.
@@ -10,7 +10,7 @@ Use this reference when comparing OpenAI, Anthropic, and Grok behavior, debuggin
10
10
  | Epoch | Legacy compatibility value; not a process generation | Always `0` | `-1`; not a process generation |
11
11
  | Request concurrency | Uncapped; stateless request per call | Uncapped; fresh process per request | Uncapped by default; optional `QGRID_GROK_MAX_INFLIGHT_PER_TOKEN` excludes accounts at the cap |
12
12
  | Token selection | Smooth weighted RR over quota-eligible tokens; valid affinity may prefer its token | Smooth weighted RR over quota-eligible tokens per request | Smooth weighted RR after quota, on-demand, cooldown, entitlement, and capacity gates; valid affinity may prefer its token |
13
- | Model routing | `openai/*`; qgrid strips provider prefix before provider call | `anthropic/*`; provider canonicalizes model and strips prefix/`[1m]` | `grok/*`; qgrid strips the provider prefix and validates against the seeded/live catalog |
13
+ | Model routing | `openai/*`; qgrid strips provider prefix before provider call | `anthropic/*`; provider canonicalizes model and strips prefix/`[1m]` | `grok/*`; qgrid strips the provider prefix and looks the id up in the seeded/live catalog; an unlisted id is forwarded as-is and the upstream decides |
14
14
  | Prefix-less models | Fallback not implemented | Fallback not implemented | Fallback not implemented |
15
15
  | Effort vocabulary | Codex catalog levels `low`..`ultra` | Claude Code `--effort` levels `low`..`max` | Catalog levels `low`, `medium`, `high`, `xhigh`; thinking-off is unverified and rejected |
16
16
  | Unsupported effort | Server drops it before the request; backend default applies | Server drops it; qgrid default `low` applies | Server drops it; catalog default applies |
@@ -25,7 +25,7 @@ Use this reference when comparing OpenAI, Anthropic, and Grok behavior, debuggin
25
25
  | Cost source | qgrid model price fallback | Prefer Claude Code `total_cost_usd`, else qgrid fallback | Provider ticks are authoritative; catalog-seeded fallback when ticks are absent |
26
26
  | Settings isolation | Per-token credentials in memory | Shared project cwd plus per-token `CLAUDE_CONFIG_DIR` | Per-token OAuth credentials and stable ids in memory |
27
27
  | Streaming close | `AbortSignal` cancels selection or active transport | Abort kills the fresh child process | `AbortSignal` cancels selection or active SSE; success requires `response.completed` |
28
- | Media/voice | OpenAI image routes only | Explicitly unsupported | Image generation/editing, async video URL jobs, STT, and TTS on `api.x.ai` |
28
+ | Media/voice | Standalone Codex Images, realtime STT/TTS, GPT-Live conversations, and native Decisions | Explicitly unsupported | Image generation/editing, async video URL jobs, STT, and TTS on `api.x.ai` |
29
29
 
30
30
  ## Routing contract
31
31
 
@@ -40,7 +40,7 @@ Candidate discovery is only a hint; each candidate is rechecked and finalized in
40
40
 
41
41
  ## Tool-call loop
42
42
 
43
- Since 2.10.0, the frame returns the parent `requestLogId` at the top level of successful query responses and stream `done` events, including terminal text responses. It retains the allocated ID if logging postprocessing fails after provider success. The field is absent with `logger: false`. Tool-run steps share the ID, while `runContext.requestLogId` remains reserved for continuing pending tool calls. SDK callers read `providerMetadata.qgrid.requestLogId`; streaming metadata becomes available at completion. Delta and error events are unchanged.
43
+ Since 2.10.0, the frame returns the parent `requestLogId` at the top level of successful query responses and stream `done` events, including terminal text responses. It retains the allocated ID if logging postprocessing fails after provider success. The field is absent with `logger: false`. Tool-run steps share the ID, while `runContext.requestLogId` remains reserved for continuing pending tool calls. SDK callers read `result.finalStep.providerMetadata.qgrid.requestLogId` (AI SDK 7 keeps top-level `providerMetadata` only as a deprecated alias); streaming metadata becomes available at completion. Delta and error events are unchanged.
44
44
 
45
45
  The AI SDK provider tracks pending tool-call IDs. When the next AI SDK call contains all required tool results, it sends the existing logging `runContext` when one was returned and sends the tool results. With `logger: false`, it still correlates the pending calls locally and continues the generation without a request-log id.
46
46
 
@@ -59,7 +59,7 @@ New request logs store routed model identity in the existing model fields; they
59
59
  - Public qgrid `QueryOutput.model` and AI SDK response model metadata continue to report the provider runtime model without changing their response contract. Do not copy that prefixless response value directly into server-native storage.
60
60
  - `createQgridLogger` combines the telemetry model provider and model id for the requested value, and qualifies the observed step/final response model with that provider. AI SDK adapter ids such as `openai.responses` and `anthropic.messages` are normalized to their base provider before storage. Avoid duplicating a prefix when the model id already starts with the same provider.
61
61
 
62
- This is a forward-only storage normalization. Do not backfill legacy prefixless rows, and do not invent a new `provider` column. Dashboard and query consumers must tolerate both legacy prefixless values and new prefixed values. Treat `status` as authoritative: a running row has no confirmed serving model, so the dashboard should render an explicit running state rather than a model placeholder or fallback display.
62
+ This is a forward-only storage normalization. Do not backfill legacy prefixless rows, and do not invent a new `provider` column. Dashboard and query consumers must tolerate both legacy prefixless values and new prefixed values. Treat `status` as authoritative: a running row may not have a confirmed serving model yet, so the dashboard shows the requested model (and the serving model once the provider reports it) with a running badge rather than treating the missing model as an error.
63
63
 
64
64
  Provider-qualified ids widen `model_name` and `requested_model_name` from 50 to 255 characters on both request-log entities. Generate and apply the normal Sonamu schema migration before running the new server. Do not hand-edit generated types, hand-author a derivable migration, or rewrite existing model values as part of that width migration.
65
65
 
@@ -62,9 +62,9 @@ In 2.9.8, list and detail model labels show requested model to image model for g
62
62
 
63
63
  The list header ends its filter row with a reload button (2.10.2+) that calls the generated hooks' `refresh()` for the list and the total-cost query with the current filters; it does not refetch the token/project/model filter options, and TanStack Query's `isRefreshing` disables it while a reload is in flight.
64
64
 
65
- Structured output visibility: the list has an `Fmt` column (`voice/stt`, `voice/tts` or `voice/live` when `media_kind` is `stt`, `tts` or `live`, `video` when it is `video`, otherwise `img` when `is_image_generation` is true, otherwise `json` when `is_structured` is true, otherwise `text`) and a `broken` badge driven by `response_json_ok = false`; there is no broken-JSON list filter. At review time, all 114,647 succeeded structured rows had `response_json_ok = true` and zero false rows existed; the unindexed zero-result lookup scanned 1,286,016 rows and took about 3 seconds. Before reinstating the filter, validate the failure-signal semantics and index the predicate. The detail page shows a dark Response Type panel (zod expression by default, `type` declaration via toggle) rendered server-side from the stored `json_schema`. Plain-text rows render no panel. Rows written by pre-2.7.2 servers show `text`.
65
+ Structured output visibility: the list has an `Fmt` column (`voice/stt`, `voice/tts` or `voice/live` when `media_kind` is `stt`, `tts` or `live`, `video` when it is `video`, `decision` when it is `decision`, otherwise `img` when `is_image_generation` is true, otherwise `json` when `is_structured` is true, otherwise `text`) and a `broken` badge driven by `response_json_ok = false`; there is no broken-JSON list filter. At review time, all 114,647 succeeded structured rows had `response_json_ok = true` and zero false rows existed; the unindexed zero-result lookup scanned 1,286,016 rows and took about 3 seconds. Before reinstating the filter, validate the failure-signal semantics and index the predicate. The detail page shows a dark Response Type panel (zod expression by default, `type` declaration via toggle) rendered server-side from the stored `json_schema`. Plain-text rows render no panel. Rows written by pre-2.7.2 servers show `text`.
66
66
 
67
- Media rows (2.15.5+): `startMediaRun` writes the nullable `media_kind` column (`image`, `video`, `stt`, `tts`) at `createRun`; text runs keep it NULL, and media rows written before the column stay NULL and show their old `Fmt` label (no backfill). Speech rows store browser-playable audio (`audio/wav`, `audio/mpeg`) in `response` as `<audio src="data:...;base64,..."></audio>`, the same inline pattern image rows use, and the detail page renders it as an `<audio controls>` player; OpenAI `pcm` output is wrapped as WAV for the log copy only, while Grok `pcm`/`mulaw`/`alaw` keep the `[audio <mime> <bytes> bytes]` placeholder. The audio is stored once, not repeated in the `speech` step result. Speech `ttft_ms` is time to the first audio byte measured from the same start as `duration_ms`: the first `response.output_audio.delta` for OpenAI realtime, response-header arrival for Grok `/tts` (not streamed, so it is close to the full duration). `finishRun` takes an explicit `ttft_ms` for runs without generate steps and otherwise derives it from the first generate step. STT rows record no TTFT; since 2.16.0 their browser-playable input audio is embedded the same way in `user_prompt` (the detail page renders the USER panel through the same media parser), and other input types keep the placeholder. Inline audio grows the request-log table with every logged voice call; `logger: false` skips it. Voice step results keep word timing (`words`: TTS output words, or the words heard in the STT input; 2.17.0+). The detail page fetches that one step (subset `A`) only for `tts` rows and renders the RESPONSE clip with the shared `TimedPlayer` (highlighted, clickable words); `stt` rows show the input audio as a plain player (2.19.0+, by user decision 2026-11-09: timing on the user prompt read as wrong). `live` rows (2.19.2+) title the system prompt Instructions, hide the empty User panel, and show `response` as the Conversation; the Voice playground (`/voice?tab=tts|stt|live`, listed as TTS, STT and Live Conversation under Voice in the sidebar, with an in-page tab bar only on narrow screens; panels stay mounted so switching keeps state) runs Live Conversation on the browser's own `RTCPeerConnection` with an `oai-events` data channel, calls `QgridService.liveCall` with the offer, sends the chosen delegation model (any model the dashboard chat offers: both read `QGRID_MODEL_GROUPS` and the `Effort` enum from the synced `qgrid.types.ts`; the served list lives on the server, with the reasons retired ids are left out), effort and web search (disabled for `anthropic/`), a Request log toggle (off sends `logger: false`), a Continue button that starts a new session with the earlier history plus the last session's turns as `history` (shown dimmed above the new turns), builds its transcript from the data channel's `turn.*` events, and ends with `session.close` on that channel (see `openai-codex-runtime.md`).
67
+ Media rows (2.15.5+): `startMediaRun` writes the nullable `media_kind` column (`image`, `video`, `stt`, `tts`; `live` since 2.19.2 and `decision` since 2.22.0) at `createRun`; text runs keep it NULL, and media rows written before the column stay NULL and show their old `Fmt` label (no backfill). Speech rows store browser-playable audio (`audio/wav`, `audio/mpeg`) in `response` as `<audio src="data:...;base64,..."></audio>`, the same inline pattern image rows use, and the detail page renders it as an `<audio controls>` player; OpenAI `pcm` output is wrapped as WAV for the log copy only, while Grok `pcm`/`mulaw`/`alaw` keep the `[audio <mime> <bytes> bytes]` placeholder. The audio is stored once, not repeated in the `speech` step result. Speech `ttft_ms` is time to the first audio byte measured from the same start as `duration_ms`: the first `response.output_audio.delta` for OpenAI realtime, response-header arrival for Grok `/tts` (not streamed, so it is close to the full duration). `finishRun` takes an explicit `ttft_ms` for runs without generate steps and otherwise derives it from the first generate step. STT rows record no TTFT; since 2.16.0 their browser-playable input audio is embedded the same way in `user_prompt` (the detail page renders the USER panel through the same media parser), and other input types keep the placeholder. Inline audio grows the request-log table with every logged voice call; `logger: false` skips it. Voice step results keep word timing (`words`: TTS output words, or the words heard in the STT input; 2.17.0+). The detail page fetches that one step (subset `A`) only for `tts` rows and renders the RESPONSE clip with the shared `TimedPlayer` (highlighted, clickable words); `stt` rows show the input audio as a plain player (2.19.0+, by user decision 2026-11-09: timing on the user prompt read as wrong). `live` rows (2.19.2+) title the system prompt Instructions, hide the empty User panel, and show `response` as the Conversation; the Voice playground (`/voice?tab=tts|stt|live`, listed as TTS, STT and Live Conversation under Voice in the sidebar, with an in-page tab bar only on narrow screens; panels stay mounted so switching keeps state) runs Live Conversation on the browser's own `RTCPeerConnection` with an `oai-events` data channel, calls `QgridService.liveCall` with the offer, sends the chosen delegation model (any model the dashboard chat offers: both read `QGRID_MODEL_GROUPS` and the `Effort` enum from the synced `qgrid.types.ts`; the served list lives on the server, with the reasons retired ids are left out), effort and web search (disabled for `anthropic/`), a Request log toggle (off sends `logger: false`), a Continue button that starts a new session with the earlier history plus the last session's turns as `history` (shown dimmed above the new turns), builds its transcript from the data channel's `turn.*` events, and ends with `session.close` on that channel (see `openai-codex-runtime.md`).
68
68
 
69
69
  Voice playground (2.15.5+): the sidebar's Playground section links `/voice`, a dashboard-only test page with Text to speech and Speech to text panels that call the generated `QgridService.useSpeakMutation` / `useTranscribeMutation` with project name `qgrid_voice`; no API was added. Voice lists are web constants: OpenAI's 10 realtime presets and the 28 Grok `/tts` voices (9 female, 19 male) listed for the subscription token on 2026-11-06; the server still validates them. Instructions and the STT prompt are shown only for `openai/` models; in their place Grok TTS shows a Speed slider (0.7-1.5 in 0.05 steps, 2.18.0+), sent as `speed` only when it is not 1, and the history row title carries the speed. STT sends no `language`: a 2026-11-09 run (6 OpenAI STT models × auto/en/ko × 6 synthetic learner clips) found `en` no better than auto and `ko` translating English audio into Korean on gpt-4o-transcribe and whisper-1. The STT model list (2.20.0+, SON-593) is `openai/gpt-transcribe` (replacing `gpt-4o-transcribe`, which shuts down 2027-02-26) and `grok/grok-voice-transcribe-2.0`; the server still accepts the other ids. The page is one card with Text to speech / Speech to text tabs; both panels stay mounted (the inactive one is hidden) so form state and history survive tab switches. Each result is prepended to an in-memory history row (removable, lost on reload) with a request-log link that opens in a new tab so the history is kept. TTS voices are chips (Grok split Female/Male) above the text: a name selects the voice, and ▶ plays a bundled sample from `packages/web/public/voice-samples/{openai,grok}/<voice>.mp3` without a request (and selects it; pressing again stops). Each of the 38 samples introduces itself ("I'm <Voice>. Nice to meet you. How's it going?"), regenerated on 2026-11-09 through qgrid (`grok/grok-tts`, `openai/gpt-realtime-2.1-mini`) and checked with STT; re-encoded to 40 kbps mono MP3 (about 640 KB, shipped in the CLI bundle via `web-dist`). Do not trust the OpenAI speech self-transcript as a verbatim check: one ballad take carried an audible "Okay, let's read that line aloud exactly as written." preamble that two STT models heard while `response.output_audio_transcript.done` showed only the script. A voice added upstream needs a sample file or its ▶ fails to load. STT recordings and uploads are numbered clips so one clip run through several models reads as a comparison. A "Word timing" checkbox (default on, 2.17.0+) sends `withTimestamps`; TTS rows and STT rows with word timing (Grok, or OpenAI through the qgrid aligner, 2.19.0+) then render the clip with its words under the player (`TimedPlayer`), highlight the word being spoken (animation-frame polling with a `timeupdate` fallback when frames are throttled), and show the timing source (Grok TTS, qgrid aligner, or the failure). Clicking a word plays from its start. For OpenAI models, recordings (MediaRecorder webm/opus) and uploads are decoded with `AudioContext` at 24 kHz, mixed to mono, and sent as PCM16 WAV (`voice-audio.ts`), because the OpenAI transcription route accepts only WAV or raw PCM; Grok gets the original file (2.19.0+), which keeps a compressed upload far under the 19 MiB inline limit. Results link to their request log. Each panel (TTS, STT, Live Conversation) shows, beside it from 1280 px (below it when narrower), the `@cartanova/qgrid-ai-sdk` call for its current settings: its imports and the call (`generateSpeech`, `transcribe`, `experimental_useRealtime` plus the server `doCreateWebRTCSession`), in a separate card with a gap like the request log's columns (`voice-sdk-examples.ts`). The card is `CodePanel` (`components/qgrid/CodePanel.tsx`: dark highlighted block and copy button), which the request log's Response Type card (`ResponseTypeSection`) also uses; its highlighter covers server type/zod text and these examples (comments, `import`/`from`/`const`/`await` and `satisfies`, unless used as a property name).
70
70
 
@@ -223,7 +223,7 @@ On DELETE or missing row:
223
223
 
224
224
  OpenAI row changes:
225
225
 
226
- - active INSERT: `onTokenAdded` spawns workers.
226
+ - active INSERT: `onTokenAdded` adds the token to the pool (there are no workers to spawn).
227
227
  - active UPDATE: `onTokenUpdated`, then `onTokenActivated`.
228
228
  - inactive row: `onTokenDeactivated`.
229
229
  - reconcile uses `replaceTokens`, which removes absent tokens, updates existing tokens, adds new tokens, and activates rows present in active DB set (it sets `active: true` itself; before 2.22.0 it went through `onTokenUpdated`, which keeps the pool's previous `active`, so a missed re-activation NOTIFY left the token out until restart).
@@ -125,7 +125,7 @@ AI SDK structured output:
125
125
  - `scripts/qgrid-structured-ai-sdk-smoke.ts`
126
126
  - Uses local `packages/ai-sdk/src/index`.
127
127
  - Env: `QGRID_URL`, `SMOKE_MODEL`, `SMOKE_CASES`, `SMOKE_REPEAT`.
128
- - Uses AI SDK 6 `streamText` with `Output.object`; useful for structured-output regressions.
128
+ - Uses AI SDK 7 `streamText` with `Output.object`; useful for structured-output regressions.
129
129
 
130
130
  AI SDK tools plus structured output:
131
131
 
@@ -198,7 +198,7 @@ Dashboard throws `Module "" has been externalized for browser compatibility. Can
198
198
 
199
199
  `Direct LLM API fallback not implemented`:
200
200
 
201
- - Model likely lacks `openai/` or `anthropic/` prefix.
201
+ - Model likely lacks the `openai/`, `anthropic/`, or `grok/` prefix.
202
202
  - Do not silently route prefix-less Claude model names to Anthropic.
203
203
 
204
204
  `No anthropic tokens available`:
@@ -227,7 +227,7 @@ Dashboard throws `Module "" has been externalized for browser compatibility. Can
227
227
 
228
228
  `image generation is not supported on the Anthropic route`:
229
229
 
230
- - Image generation is OpenAI/Codex-only.
230
+ - Image generation runs on OpenAI (`openai/gpt-image-2`) and Grok (`grok/grok-imagine-image*`) image models; the Anthropic route has none.
231
231
 
232
232
  `qgrid.image: expected one image from the direct subscription Images route`:
233
233