@mrpatronz/nexusflow 2.6.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1 -3
- package/dist/agent/ClaudeSdkAdapter.d.ts +18 -0
- package/dist/agent/ClaudeSdkAdapter.d.ts.map +1 -0
- package/dist/agent/ClaudeSdkAdapter.js +185 -0
- package/dist/agent/ClaudeSdkAdapter.js.map +1 -0
- package/dist/agent/ClaudeSdkAdapter.test.d.ts +2 -0
- package/dist/agent/ClaudeSdkAdapter.test.d.ts.map +1 -0
- package/dist/agent/ClaudeSdkAdapter.test.js +155 -0
- package/dist/agent/ClaudeSdkAdapter.test.js.map +1 -0
- package/dist/agent/CliAdapterBase.d.ts.map +1 -1
- package/dist/agent/CliAdapterBase.js +3 -0
- package/dist/agent/CliAdapterBase.js.map +1 -1
- package/dist/agent/CliAdapterBase.test.js +49 -1
- package/dist/agent/CliAdapterBase.test.js.map +1 -1
- package/dist/agent/CodexCliAdapter.d.ts +1 -1
- package/dist/agent/CodexCliAdapter.d.ts.map +1 -1
- package/dist/agent/CodexCliAdapter.js +5 -4
- package/dist/agent/CodexCliAdapter.js.map +1 -1
- package/dist/agent/CodexCliAdapter.test.js +16 -1
- package/dist/agent/CodexCliAdapter.test.js.map +1 -1
- package/dist/agent/CodexSdkAdapter.d.ts +17 -0
- package/dist/agent/CodexSdkAdapter.d.ts.map +1 -0
- package/dist/agent/CodexSdkAdapter.js +132 -0
- package/dist/agent/CodexSdkAdapter.js.map +1 -0
- package/dist/agent/CodexSdkAdapter.test.d.ts +2 -0
- package/dist/agent/CodexSdkAdapter.test.d.ts.map +1 -0
- package/dist/agent/CodexSdkAdapter.test.js +76 -0
- package/dist/agent/CodexSdkAdapter.test.js.map +1 -0
- package/dist/agent/ProviderRegistry.d.ts +7 -2
- package/dist/agent/ProviderRegistry.d.ts.map +1 -1
- package/dist/agent/ProviderRegistry.js +15 -0
- package/dist/agent/ProviderRegistry.js.map +1 -1
- package/dist/agent/ProviderRegistry.test.js +19 -0
- package/dist/agent/ProviderRegistry.test.js.map +1 -1
- package/dist/agent/adapters.d.ts.map +1 -1
- package/dist/agent/adapters.js +81 -0
- package/dist/agent/adapters.js.map +1 -1
- package/dist/agent/mcp-config.d.ts +16 -0
- package/dist/agent/mcp-config.d.ts.map +1 -0
- package/dist/agent/mcp-config.js +28 -0
- package/dist/agent/mcp-config.js.map +1 -0
- package/dist/agent/mcp-config.test.d.ts +2 -0
- package/dist/agent/mcp-config.test.d.ts.map +1 -0
- package/dist/agent/mcp-config.test.js +22 -0
- package/dist/agent/mcp-config.test.js.map +1 -0
- package/dist/agent/models.d.ts +10 -0
- package/dist/agent/models.d.ts.map +1 -0
- package/dist/agent/models.js +35 -0
- package/dist/agent/models.js.map +1 -0
- package/dist/agent/models.test.d.ts +2 -0
- package/dist/agent/models.test.d.ts.map +1 -0
- package/dist/agent/models.test.js +40 -0
- package/dist/agent/models.test.js.map +1 -0
- package/dist/agent/orchestrator.d.ts +65 -0
- package/dist/agent/orchestrator.d.ts.map +1 -0
- package/dist/agent/orchestrator.js +252 -0
- package/dist/agent/orchestrator.js.map +1 -0
- package/dist/agent/orchestrator.test.d.ts +2 -0
- package/dist/agent/orchestrator.test.d.ts.map +1 -0
- package/dist/agent/orchestrator.test.js +284 -0
- package/dist/agent/orchestrator.test.js.map +1 -0
- package/dist/agent/session.d.ts +1 -0
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +3 -2
- package/dist/agent/session.js.map +1 -1
- package/dist/agent/session.test.js +9 -0
- package/dist/agent/session.test.js.map +1 -1
- package/dist/agent/smoke-chat.test.d.ts +2 -0
- package/dist/agent/smoke-chat.test.d.ts.map +1 -0
- package/dist/agent/smoke-chat.test.js +166 -0
- package/dist/agent/smoke-chat.test.js.map +1 -0
- package/dist/commands/mcp.d.ts +7 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +7 -2
- package/dist/commands/mcp.js.map +1 -1
- package/dist/core/locks.d.ts +4 -2
- package/dist/core/locks.d.ts.map +1 -1
- package/dist/core/locks.js +55 -7
- package/dist/core/locks.js.map +1 -1
- package/dist/core/locks.test.js +48 -0
- package/dist/core/locks.test.js.map +1 -1
- package/dist/core/scheduler.d.ts +1 -0
- package/dist/core/scheduler.d.ts.map +1 -1
- package/dist/core/scheduler.js +10 -0
- package/dist/core/scheduler.js.map +1 -1
- package/dist/core/scheduler.test.js +6 -0
- package/dist/core/scheduler.test.js.map +1 -1
- package/dist/core/workspace.create.test.js +51 -11
- package/dist/core/workspace.create.test.js.map +1 -1
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +123 -84
- package/dist/core/workspace.js.map +1 -1
- package/dist/gui/assets/AgentsPage-Bfyu13gc.js +3 -0
- package/dist/gui/assets/{CSPContext-BG7no5S_.js → CSPContext-DBUu9tE0.js} +1 -1
- package/dist/gui/assets/{DashboardPage-ByGTwAQa.js → DashboardPage-O5wj99kn.js} +1 -1
- package/dist/gui/assets/{GettingStartedPage-Xjx3M3RH.js → GettingStartedPage-DDWBueC7.js} +1 -1
- package/dist/gui/assets/ProjectsPage-NHkXrDM2.js +1 -0
- package/dist/gui/assets/ScaffoldRepoInline-Cmqg_s94.js +1 -0
- package/dist/gui/assets/{SettingsPage-B9iN6hsv.js → SettingsPage-Cc77HBp7.js} +1 -1
- package/dist/gui/assets/SkillsPage-D4CVxwrI.js +6 -0
- package/dist/gui/assets/StartWorkPage-RPZTN3Ui.js +1 -0
- package/dist/gui/assets/{StrategiesPage-DDu3jwJx.js → StrategiesPage-Dn66xfZN.js} +1 -1
- package/dist/gui/assets/WorkspacesPage-BgdoM5Hs.js +6 -0
- package/dist/gui/assets/{alert-dialog-CdqVrvZl.js → alert-dialog-BYZ7cgWA.js} +1 -1
- package/dist/gui/assets/index-BmH7a-Qy.css +2 -0
- package/dist/gui/assets/index-CoNaATPd.js +52 -0
- package/dist/gui/assets/isElementDisabled-uy_EOitH.js +1 -0
- package/dist/gui/assets/textarea-ByfoCb54.js +1 -0
- package/dist/gui/assets/{useAriaLabelledBy-DfRdwH8a.js → useAriaLabelledBy-ClesgjMe.js} +1 -1
- package/dist/gui/assets/useValueChanged-DeYvGnKs.js +1 -0
- package/dist/gui/assets/{vsc-D6UPv2ii.js → vsc-BTST_4ex.js} +1 -1
- package/dist/gui/index.html +5 -7
- package/dist/harness/claude.d.ts +18 -0
- package/dist/harness/claude.d.ts.map +1 -0
- package/dist/harness/claude.js +334 -0
- package/dist/harness/claude.js.map +1 -0
- package/dist/harness/codex.d.ts +20 -0
- package/dist/harness/codex.d.ts.map +1 -0
- package/dist/harness/codex.js +315 -0
- package/dist/harness/codex.js.map +1 -0
- package/dist/harness/contract.test.d.ts +2 -0
- package/dist/harness/contract.test.d.ts.map +1 -0
- package/dist/harness/contract.test.js +426 -0
- package/dist/harness/contract.test.js.map +1 -0
- package/dist/harness/harness.test.d.ts +2 -0
- package/dist/harness/harness.test.d.ts.map +1 -0
- package/dist/harness/harness.test.js +215 -0
- package/dist/harness/harness.test.js.map +1 -0
- package/dist/harness/index.d.ts +10 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +13 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/harness/interface.d.ts +42 -0
- package/dist/harness/interface.d.ts.map +1 -0
- package/dist/harness/interface.js +17 -0
- package/dist/harness/interface.js.map +1 -0
- package/dist/harness/pushable.d.ts +11 -0
- package/dist/harness/pushable.d.ts.map +1 -0
- package/dist/harness/pushable.js +32 -0
- package/dist/harness/pushable.js.map +1 -0
- package/dist/harness/types.d.ts +132 -0
- package/dist/harness/types.d.ts.map +1 -0
- package/dist/harness/types.js +12 -0
- package/dist/harness/types.js.map +1 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +8 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +11 -6
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools.d.ts +6 -2
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +213 -6
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/tools.test.js +115 -6
- package/dist/mcp/tools.test.js.map +1 -1
- package/dist/orchestration/runner.d.ts +1 -1
- package/dist/orchestration/runner.d.ts.map +1 -1
- package/dist/orchestration/runner.js +29 -14
- package/dist/orchestration/runner.js.map +1 -1
- package/dist/orchestration/runner.test.js +33 -1
- package/dist/orchestration/runner.test.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +28 -7
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +34 -1
- package/dist/server.test.js.map +1 -1
- package/dist/utils/git.d.ts +0 -15
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +4 -0
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/git.test.js +33 -1
- package/dist/utils/git.test.js.map +1 -1
- package/dist/utils/multi-git.d.ts +30 -6
- package/dist/utils/multi-git.d.ts.map +1 -1
- package/dist/utils/multi-git.js +132 -12
- package/dist/utils/multi-git.js.map +1 -1
- package/dist/utils/multi-git.test.js +153 -1
- package/dist/utils/multi-git.test.js.map +1 -1
- package/dist/utils/session-finder.d.ts +3 -0
- package/dist/utils/session-finder.d.ts.map +1 -1
- package/dist/utils/session-finder.js +10 -9
- package/dist/utils/session-finder.js.map +1 -1
- package/package.json +4 -1
- package/dist/gui/assets/AgentsPage-YyYRodOR.js +0 -3
- package/dist/gui/assets/ProjectsPage-BMdhqAGs.js +0 -1
- package/dist/gui/assets/ScaffoldRepoInline-gXyYSIz5.js +0 -1
- package/dist/gui/assets/SkillsPage-CxcsbIsQ.js +0 -6
- package/dist/gui/assets/StartWorkPage-DPVHcdy4.js +0 -1
- package/dist/gui/assets/WorkspacesPage-BWRmP0mY.js +0 -2
- package/dist/gui/assets/index-CZoZQkeC.css +0 -2
- package/dist/gui/assets/index-wy68EqfB.js +0 -50
- package/dist/gui/assets/isElementDisabled-D_fu2zfc.js +0 -1
- package/dist/gui/assets/store-D5DUHbxn.js +0 -3
- package/dist/gui/assets/styles-CVwNuFCx.js +0 -1
- package/dist/gui/assets/textarea-BNRuIXNs.js +0 -1
- package/dist/gui/assets/useValueChanged-CStSGSsD.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,c as n,f as r,g as i,i as a,p as o,s}from"./button-BDDZnIHx.js";import{An as c,At as l,Bt as u,Cn as d,Ct as f,Dn as p,En as m,G as h,Gt as g,Ht as _,It as v,Jn as y,Jt as b,Kt as x,Ln as S,Lt as C,M as w,Nt as T,On as E,Sn as D,St as ee,Tn as O,Tt as te,Ut as k,Vn as A,Vt as ne,Wt as j,Yt as M,Zn as N,Zt as P,_n as F,an as re,at as ie,bn as ae,bt as oe,cn as I,g as se,gn as L,hn as R,jn as z,kn as ce,kt as le,m as B,mn as V,nr as H,on as ue,ot as de,pn as U,pt as fe,qt as pe,rn as me,tn as he,ut as ge,vn as W,wn as G,wt as _e,xn as ve,xt as ye,yn as K,zt as be}from"./CSPContext-DBUu9tE0.js";import{t as xe}from"./useValueChanged-DeYvGnKs.js";var q=t(e(),1),Se=q.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Ce(){return q.useContext(Se)}var we=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function Te(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=Ce(),f=q.useRef(-1),[p,m]=q.useState(a??(i===we.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=q.useRef(null),g=q.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return U(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),U(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),{ref:g,index:p}}var Ee=[`top`,`right`,`bottom`,`left`],De=Math.min,J=Math.max,Y=Math.round,Oe=Math.floor,X=e=>({x:e,y:e}),ke={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ae(e,t,n){return J(e,De(t,n))}function Z(e,t){return typeof e==`function`?e(t):e}function Q(e){return e.split(`-`)[0]}function je(e){return e.split(`-`)[1]}function Me(e){return e===`x`?`y`:`x`}function Ne(e){return e===`y`?`height`:`width`}function $(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Pe(e){return Me($(e))}function Fe(e,t,n){n===void 0&&(n=!1);let r=je(e),i=Pe(e),a=Ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=We(o)),[o,We(o)]}function Ie(e){let t=We(e);return[Le(e),t,Le(t)]}function Le(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Re=[`left`,`right`],ze=[`right`,`left`],Be=[`top`,`bottom`],Ve=[`bottom`,`top`];function He(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ze:Re:t?Re:ze;case`left`:case`right`:return t?Be:Ve;default:return[]}}function Ue(e,t,n,r){let i=je(e),a=He(Q(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Le)))),a}function We(e){let t=Q(e);return ke[t]+e.slice(t.length)}function Ge(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Ke(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ge(e)}function qe(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Je(e,t={}){let{enabled:r=!0,event:i=`click`,toggle:a=!0,ignoreMouse:o=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=y}=t,u=`rootStore`in e?e.rootStore:e,d=u.context.dataRef,f=q.useRef(void 0),p=he(),m=P(),h=q.useMemo(()=>{function e(e,t,n,r){let i=me(l,t,n);e&&r===`touch`&&c>0?m.start(c,()=>{u.setOpen(!0,i)}):u.setOpen(e,i)}function t(e,t,n){let r=d.current.openEvent,i=u.select(`domReferenceElement`)!==t;return e&&i||!e||!a?!0:r&&s?!n(r.type):!1}return{onPointerDown(e){f.current=e.pointerType},onMouseDown(n){let r=f.current,a=n.nativeEvent,s=u.select(`open`);if(n.button!==0||i===`click`||x(r,!0)&&o)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),l=ne(a);if(C(l)){e(c,a,l,r);return}let d=n.currentTarget;p.request(()=>{e(c,a,d,r)})},onClick(n){if(i===`mousedown-only`)return;let r=f.current;if(i===`mousedown`&&r){f.current=void 0;return}x(r,!0)&&o||e(t(u.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,r)},onKeyDown(){f.current=void 0}}},[d,i,o,l,u,s,a,p,m,c]);return q.useMemo(()=>r?{reference:h}:n,[r,h])}function Ye(e,t,n){let{reference:r,floating:i}=e,a=$(t),o=Pe(t),s=Ne(o),c=Q(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=je(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Xe(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Z(t,e),p=Ke(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=qe(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=qe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ze=50,Qe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Xe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ye(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ze&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ye(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},$e=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Z(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Q(r),_=$(o),v=Q(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[We(o)]:Ie(o)),x=p!==`none`;!d&&x&&b.push(...Ue(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Fe(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==$(t))||T.every(e=>$(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=$(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function et(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tt(e){return Ee.some(t=>e[t]>=0)}var nt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Z(e,t);switch(i){case`referenceHidden`:{let e=et(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:tt(e)}}}case`escaped`:{let e=et(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:tt(e)}}}default:return{}}}}},rt=new Set([`left`,`top`]);async function it(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Q(n),s=je(n),c=$(n)===`y`,l=rt.has(o)?-1:1,u=a&&c?-1:1,d=Z(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var at=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await it(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ot=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Z(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=$(i),p=Me(f),m=u[p],h=u[f],g=(e,t)=>Ae(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},st=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Z(e,t),u={x:n,y:r},d=$(i),f=Me(d),p=u[f],m=u[d],h=Z(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=rt.has(Q(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ct=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Z(e,t),c=await i.detectOverflow(t,s),l=Q(n),u=je(n),d=$(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=De(p-c[m],g),y=De(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*J(c.left,c.right):S=p-2*J(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function lt(e){let t=R(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=m(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Y(n)!==a||Y(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ut(e){return O(e)?e:e.contextElement}function dt(e){let t=ut(e);if(!m(t))return X(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=lt(t),o=(a?Y(n.width):n.width)/r,s=(a?Y(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ft=X(0);function pt(e){let t=d(e);return!z()||!t.visualViewport?ft:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===d(e)}function ht(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ut(e),o=X(1);t&&(r?O(r)&&(o=dt(r)):o=dt(e));let s=mt(a,n,r)?pt(a):X(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(a&&r){let e=d(a),t=O(r)?d(r):r,n=e,i=W(n);for(;i&&t!==n;){let e=dt(i),t=i.getBoundingClientRect(),r=R(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,f*=e.y,c+=a,l+=o,n=d(i),i=W(n)}}return qe({width:u,height:f,x:c,y:l})}function gt(e,t){let n=ae(e).scrollLeft;return t?t.left+n:ht(F(e)).left+n}function _t(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gt(e,n),y:n.top+t.scrollTop}}function vt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=F(r),s=t?c(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=X(1),d=X(0),f=m(r);if((f||!a)&&((K(r)!==`body`||E(o))&&(l=ae(r)),f)){let e=ht(r);u=dt(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let p=o&&!f&&!a?_t(o,l):X(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function yt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bt(e){let t=ae(e),n=e.ownerDocument.body,r=J(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=J(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gt(e),o=-t.scrollTop;return R(n).direction===`rtl`&&(a+=J(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xt=25;function St(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=d(e),a=F(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!z()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gt(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=xt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ct(e,t){let n=ht(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=dt(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wt(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=St(e,n,t);else if(t===`document`)r=bt(F(e));else if(O(t))r=Ct(t,n);else{let n=pt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qe(r)}function Tt(e,t){let n=t.get(e);if(n)return n;let r=ve(e,[],!1).filter(e=>O(e)&&K(e)!==`body`),i=null,a=R(e).position===`fixed`,o=a?D(e):e;for(;O(o)&&!p(o);){let e=R(o),t=G(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=D(o)}return t.set(e,r),r}function Et(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?c(t)?[]:Tt(t,this._c):[].concat(n),r],o=wt(t,a[0],i),s=o.top,l=o.right,u=o.bottom,d=o.left;for(let e=1;e<a.length;e++){let n=wt(t,a[e],i);s=J(n.top,s),l=De(n.right,l),u=De(n.bottom,u),d=J(n.left,d)}return{width:l-d,height:u-s,x:d,y:s}}function Dt(e){let{width:t,height:n}=lt(e);return{width:t,height:n}}function Ot(e,t,n){let r=m(t),i=F(t),a=n===`fixed`,o=ht(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=X(0);if((r||!a)&&((K(t)!==`body`||E(i))&&(s=ae(t)),r)){let e=ht(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gt(i));let l=i&&!r&&!a?_t(i,s):X(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function kt(e){return R(e).position===`static`}function At(e,t){if(!m(e)||R(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return F(e)===n&&(n=n.ownerDocument.body),n}function jt(e,t){let n=d(e);if(c(e))return n;if(!m(e)){let t=D(e);for(;t&&!p(t);){if(O(t)&&!kt(t))return t;t=D(t)}return n}let r=At(e,t);for(;r&&ce(r)&&kt(r);)r=At(r,t);return r&&p(r)&&kt(r)&&!G(r)?n:r||L(e)||n}var Mt=async function(e){let t=this.getOffsetParent||jt,n=this.getDimensions,r=await n(e.floating);return{reference:Ot(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nt(e){return R(e).direction===`rtl`}var Pt={convertOffsetParentRelativeRectToViewportRelativeRect:vt,getDocumentElement:F,getClippingRect:Et,getOffsetParent:jt,getElementRects:Mt,getClientRects:yt,getDimensions:Dt,getScale:dt,isElement:O,isRTL:Nt};function Ft(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function It(e,t,n){let r=null,i,a=F(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Oe(d),h=Oe(a.clientWidth-(u+f)),g=Oe(a.clientHeight-(d+p)),_=Oe(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:J(0,De(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ft(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=d(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Lt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ut(e),u=i||a?[...l?ve(l):[],...t?ve(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?It(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ht(e):null;c&&g();function g(){let t=ht(e);h&&!Ft(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Rt=at,zt=ot,Bt=$e,Vt=ct,Ht=nt,Ut=st,Wt=(e,t,n)=>{let r=new Map,i=n??{},a={...Pt,...i.platform,_c:r};return Qe(e,t,{...i,platform:a})},Gt=t(H(),1),Kt=typeof document<`u`?q.useLayoutEffect:function(){};function qt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!qt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Jt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yt(e,t){let n=Jt(e);return Math.round(t*n)/n}function Xt(e){let t=q.useRef(e);return Kt(()=>{t.current=e}),t}function Zt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=q.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=q.useState(r);qt(f,r)||p(r);let[m,h]=q.useState(null),[g,_]=q.useState(null),v=q.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=q.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=q.useRef(null),C=q.useRef(null),w=q.useRef(u),T=c!=null,E=Xt(c),D=Xt(i),ee=Xt(l),O=q.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Wt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ee.current!==!1};te.current&&!qt(w.current,t)&&(w.current=t,Gt.flushSync(()=>{d(t)}))})},[f,t,n,D,ee]);Kt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=q.useRef(!1);Kt(()=>(te.current=!0,()=>{te.current=!1}),[]),Kt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let k=q.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=q.useMemo(()=>({reference:b,floating:x}),[b,x]),ne=q.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=Yt(A.floating,u.x),r=Yt(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Jt(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return q.useMemo(()=>({...u,update:O,refs:k,elements:A,floatingStyles:ne}),[u,O,k,A,ne])}var Qt=(e,t)=>{let n=Rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},$t=(e,t)=>{let n=zt(e);return{name:n.name,fn:n.fn,options:[e,t]}},en=(e,t)=>({fn:Ut(e).fn,options:[e,t]}),tn=(e,t)=>{let n=Bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nn=(e,t)=>{let n=Vt(e);return{name:n.name,fn:n.fn,options:[e,t]}},rn=(e,t)=>{let n=Ht(e);return{name:n.name,fn:n.fn,options:[e,t]}};function an(e){let{open:t=!1,onOpenChange:n,elements:i={}}=e,a=re(),o=ie()!=null,s=r(()=>new h({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new w,floatingId:a,syncOnly:!1,nested:o})).current;return U(()=>{let e={open:t,floatingId:a};i.reference!==void 0&&(e.referenceElement=i.reference,e.domReferenceElement=O(i.reference)?i.reference:null),i.floating!==void 0&&(e.floatingElement=i.floating),s.update(e)},[t,a,i.reference,i.floating,s]),s.context.onOpenChange=n,s.context.nested=o,s}function on(e={}){let{nodeId:t,externalTree:n}=e,r=an(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.useState(`open`),l=i.useState(`floatingId`),[u,d]=q.useState(null),[f,p]=q.useState(void 0),[m,h]=q.useState(void 0),g=q.useRef(null),_=de(n),v=q.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),y=Zt({...e,elements:{...v,...u&&{reference:u}}}),b=O(f)?f:null,x=m===void 0?i.state.floatingElement:m;i.useSyncedValue(`referenceElement`,f??null),i.useSyncedValue(`domReferenceElement`,f===void 0?s:b),i.useSyncedValue(`floatingElement`,x);let S=q.useCallback(e=>{let t=O(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),C=q.useCallback(e=>{(O(e)||e===null)&&(g.current=e,p(e)),(O(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!O(e))&&y.refs.setReference(e)},[y.refs,p]),w=q.useCallback(e=>{h(e),y.refs.setFloating(e)},[y.refs]),T=q.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:g}),[y.refs,C,w,S]),E=q.useMemo(()=>({...y.elements,domReference:s}),[y.elements,s]),D=q.useMemo(()=>({...y,dataRef:i.context.dataRef,open:c,onOpenChange:i.setOpen,events:i.context.events,floatingId:l,refs:T,elements:E,nodeId:t,rootStore:i}),[y,T,E,t,i,c,l]);return U(()=>{s&&(g.current=s)},[s]),U(()=>{i.context.dataRef.current.floatingContext=D;let e=_?.nodesRef.current.find(e=>e.id===t);e&&(e.context=D)}),q.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:i}),[y,T,E,D,i])}var sn=`Escape`;function cn(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function ln(e,t){return cn(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function un(e,t,n){return cn(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function dn(e,t,n){return cn(t,n?e===k:e===j,e===_)}function fn(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===sn:cn(t,n?e===j:e===k,e===g)}function pn(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:d=!1,rtl:f=!1,virtual:p=!1,focusItemOnOpen:h=`auto`,focusItemOnHover:g=!0,openOnArrowKeyDown:_=!0,disabledIndices:y=void 0,orientation:x=`vertical`,parentOrientation:C,id:w,resetOnPointerLeave:E=!0,externalTree:D,grid:O}=t,te=O!=null,k=`rootStore`in e?e.rootStore:e,j=k.useState(`open`),N=k.useState(`floatingElement`),P=k.useState(`domReferenceElement`),F=k.context.dataRef,re=T(N),ae=v(P),I=l(re),se=ie(),L=de(D),R=q.useRef(h),z=q.useRef(o??-1),ce=q.useRef(null),B=q.useRef(!0),H=V(e=>{i(z.current===-1?null:z.current,e)}),ue=q.useRef(!!N),ge=q.useRef(j),W=q.useRef(!1),G=q.useRef(!1),ve=q.useRef(null),K=l(y),xe=l(j),Se=l(o),Ce=l(E),we=he(),Te=he(),Ee=V(()=>{function e(e){p?L?.events.emit(`virtualfocus`,e):ve.current=fe(e,{sync:W.current,preventScroll:!0})}let t=n.current[z.current],r=G.current;t&&e(t),(W.current?e=>e():e=>we.request(e))(()=>{let i=n.current[z.current]||t;i&&(t||e(i),ke&&(r||!B.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});U(()=>{F.current.orientation=x},[F,x]),U(()=>{a&&(j&&N?(z.current=o??-1,R.current&&o!=null&&(G.current=!0,H())):ue.current&&(z.current=-1,H()))},[a,j,N,o,H]),U(()=>{if(a){if(!j){W.current=!1;return}if(N)if(r==null){if(W.current=!1,Se.current!=null)return;if(ue.current&&(z.current=-1,Ee()),(!ge.current||!ue.current)&&R.current&&(ce.current!=null||R.current===!0&&ce.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>Te.request(e):queueMicrotask)(t),e+=1):(z.current=ce.current==null||un(ce.current,x,f)||d?ee(n):ye(n),ce.current=null,H())};t()}}else _e(n.current,r)||(z.current=r,Ee(),G.current=!1)}},[a,j,N,r,Se,d,n,x,f,H,Ee,Te]),U(()=>{if(!a||N||!L||p||!ue.current)return;let e=L.nodesRef.current,t=e.find(e=>e.id===se)?.context?.elements.floating,n=be(le(P??t??null)),r=e.some(e=>e.context&&u(e.context.elements.floating,n));t&&!r&&B.current&&t.focus({preventScroll:!0})},[a,N,P,L,se,p]),U(()=>{ge.current=j,ue.current=!!N}),U(()=>{j||(ce.current=null,R.current=h)},[j,h]);let De=r!=null,J=V(e=>{if(!xe.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(z.current!==t||r!==t)&&(z.current=t,H(e))}),Y=V(()=>C??L?.nodesRef.current.find(e=>e.id===se)?.context?.dataRef?.current.orientation),Oe=V(()=>ee(n,K.current)),X=V(e=>{if(B.current=!1,W.current=!0,e.which===229||!xe.current&&e.currentTarget===I.current)return;if(d&&fn(e.key,x,f,te)){ln(e.key,Y())||M(e),k.setOpen(!1,me(A,e.nativeEvent)),m(P)&&(p?L?.events.emit(`virtualfocus`,P):P.focus());return}let t=z.current,r=ee(n,y),i=ye(n,y);if(ae||(e.key===`Home`&&(M(e),z.current=r,H(e)),e.key===`End`&&(M(e),z.current=i,H(e))),O!=null){let t=O(e,z.current,n,x,c,f,y,r,i);if(t!=null&&(z.current=t,H(e)),x===`both`)return}if(ln(e.key,x)){if(M(e),j&&!p&&be(e.currentTarget.ownerDocument)===e.currentTarget){z.current=un(e.key,x,f)?r:i,H(e);return}un(e.key,x,f)?c?t>=i?s&&t!==n.current.length?z.current=-1:(W.current=!1,z.current=r):z.current=oe(n.current,{startingIndex:t,disabledIndices:y}):z.current=Math.min(i,oe(n.current,{startingIndex:t,disabledIndices:y})):c?t<=r?s&&t!==-1?z.current=n.current.length:(W.current=!1,z.current=i):z.current=oe(n.current,{startingIndex:t,decrement:!0,disabledIndices:y}):z.current=Math.max(r,oe(n.current,{startingIndex:t,decrement:!0,disabledIndices:y})),_e(n.current,z.current)&&(z.current=-1),H(e)}}),ke=q.useMemo(()=>({onFocus(e){W.current=!0,J(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){W.current=!0,G.current=!1,g&&J(e)},onPointerLeave(e){if(!xe.current||!B.current||e.pointerType===`touch`)return;W.current=!0;let t=e.relatedTarget;if(!(!g||n.current.includes(t))&&Ce.current&&(ve.current?.(),ve.current=null,z.current=-1,H(e),!p)){let e=I.current,t=be(le(e));e&&u(e,t)&&e.focus({preventScroll:!0})}}}),[J,xe,I,g,n,H,Ce,p]),Ae=q.useMemo(()=>p&&j&&De&&{"aria-activedescendant":`${w}-${r}`},[p,j,De,w,r]),Z=q.useMemo(()=>({"aria-orientation":x===`both`?void 0:x,...ae?{}:Ae,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&j&&!p){let t=ne(e.nativeEvent);if(t&&!u(I.current,t))return;M(e),k.setOpen(!1,me(S,e.nativeEvent)),m(P)&&P.focus();return}X(e)},onPointerMove(){B.current=!0}}),[Ae,X,I,x,ae,k,j,p,P]),Q=q.useMemo(()=>{function e(e){k.setOpen(!0,me(A,e.nativeEvent,e.currentTarget))}function t(e){h===`auto`&&pe(e.nativeEvent)&&(R.current=!p)}function n(e){R.current=h,h===`auto`&&b(e.nativeEvent)&&(R.current=!0)}return{onKeyDown(t){let n=k.select(`open`);B.current=!1;let r=t.key.startsWith(`Arrow`),i=dn(t.key,Y(),f),a=ln(t.key,x),o=(d?i:a)||t.key===`Enter`||t.key.trim()===``;if(p&&n)return X(t);if(!(!n&&!_&&r)){if(o){let e=ln(t.key,Y());ce.current=d&&e?null:t.key}if(d){i&&(M(t),n?(z.current=Oe(),H(t)):e(t));return}a&&(Se.current!=null&&(z.current=Se.current),M(t),!n&&_?e(t):X(t),n&&H(t))}},onFocus(e){k.select(`open`)&&!p&&(z.current=-1,H(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[X,h,Oe,d,H,k,_,x,Y,f,Se,p]),je=q.useMemo(()=>({...Ae,...Q}),[Ae,Q]);return q.useMemo(()=>a?{reference:je,floating:Z,item:ke,trigger:Q}:{},[a,je,Z,Q,ke])}function mn(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:c,enabled:l=!0,resetMs:d=750,selectedIndex:p=null}=t,m=`rootStore`in e?e.rootStore:e,h=m.useState(`open`),g=P(),_=q.useRef(``),v=q.useRef(p??i??-1),y=q.useRef(null),b=V(e=>{function t(e){let t=r?.current[e];return!t||f(t)}function l(e){return t(e)?o==null||!te(s,e,o):!1}function u(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!l(n)))return n}return-1}let m=n.current;if(_.current.length>0&&e.key===` `&&(M(e),c?.(!0)),_.current.length>0&&_.current[0]!==` `&&u(m,_.current)===-1&&e.key!==` `&&c?.(!1),m==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;h&&e.key!==` `&&(M(e),c?.(!0));let b=_.current===``;b&&(v.current=p??i??-1),m.every((e,t)=>e&&l(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&_.current===e.key&&(_.current=``,v.current=y.current),_.current+=e.key,g.start(d,()=>{_.current=``,v.current=y.current,c?.(!1)});let x=((b?p??i??-1:v.current)??0)+1,S=u(m,_.current,x);S===-1?e.key!==` `&&(_.current=``,c?.(!1)):(a?.(S),y.current=S)}),x=V(e=>{let t=e.relatedTarget,n=m.select(`domReferenceElement`),r=m.select(`floatingElement`);u(n,t)||u(r,t)||(g.clear(),_.current=``,v.current=y.current,c?.(!1))});U(()=>{!h&&p!==null||(g.clear(),y.current=null,_.current!==``&&(_.current=``))},[h,p,g]),U(()=>{h&&_.current===``&&(v.current=p??i??-1)},[h,p,i]);let S=q.useMemo(()=>({onKeyDown:b,onBlur:x}),[b,x]);return q.useMemo(()=>l?{reference:S,floating:S}:{},[l,S])}var hn=q.createContext(void 0);function gn(e){let t=q.useContext(hn);if(t===void 0&&!e)throw Error(o(69));return t}var _n=i();function vn(e){return e===`starting`?ge:n}var yn=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Z(e,t)||{};if(l==null)return{};let f=Ke(u),p={x:n,y:r},m=Pe(i),h=Ne(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),ee=Math.min(f[y],E),O=D,te=w-g[h]-ee,k=w/2-g[h]/2+T,A=Ae(O,k,te),ne=!c.arrow&&je(i)!=null&&k!==A&&a.reference[h]/2-(k<O?D:ee)-g[h]/2<0,j=ne?k<O?k-O:k-te:0;return{[m]:p[m]+j,data:{[m]:A,centerOffset:k-A-j,...ne&&{alignmentOffset:j}},reset:ne}}}),bn=(e,t)=>({...yn(e),options:[e,t]}),xn=rn().fn,Sn={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await xn(e)).data?.referenceHidden||a}}}},Cn={sideX:`left`,sideY:`top`},wn={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=d(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Cn};let u=await a.getOffsetParent?.(i),f={width:0,height:0};if(o===`fixed`&&c?.visualViewport)f={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=le(i);f={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(f=await a.getDimensions(u));let p=Q(s),m=t,h=n;p===`left`&&(m=f.width-(t+r.width)),p===`top`&&(h=f.height-(n+r.height));let g=p===`left`?`right`:Cn.sideX,_=p===`top`?`bottom`:Cn.sideY;return{x:m,y:h,data:{sideX:g,sideY:_}}}};function Tn(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function En(e,t,n){let{rects:r,placement:i}=e;return{side:Tn(t,Q(i),n),align:je(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Dn(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:u=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shiftCrossAxis:y=!1,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=q.useState(null);!_&&w!==null&&T(null);let E=v.side||`flip`,D=v.align||`flip`,ee=v.fallbackAxisSide||`end`,O=typeof t==`function`?t:void 0,te=V(O),k=O?te:t,A=l(t),ne=l(_),j=se()===`rtl`,M=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],N=a===`center`?M:`${M}-${a}`,P=c,F=+(r===`bottom`),re=+(r===`top`),ie=+(r===`right`),ae=+(r===`left`);typeof P==`number`?P={top:P+F,right:P+ae,bottom:P+re,left:P+ie}:P&&={top:(P.top||0)+F,right:(P.right||0)+ae,bottom:(P.bottom||0)+re,left:(P.left||0)+ie};let oe={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:P},I=q.useRef(null),L=l(i),R=l(o),z=typeof i==`function`?0:i,ce=typeof o==`function`?0:o,B=[];m&&B.push(m),B.push(Qt(e=>{let t=En(e,r,j),n=typeof L.current==`function`?L.current(t):L.current,i=typeof R.current==`function`?R.current(t):R.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[z,ce,j,r]));let H=D===`none`&&E!==`shift`,ue=!H&&(u||y||E===`shift`),de=E===`none`?null:tn({...oe,padding:{top:P.top+1,right:P.right+1,bottom:P.bottom+1,left:P.left+1},mainAxis:!y&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:ee}),fe=H?null:$t(e=>{let t=le(e.elements.floating).documentElement;return{...oe,rootBoundary:y?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:D!==`none`,crossAxis:ue,limiter:u||y?void 0:en(e=>{if(!I.current)return{};let{width:t,height:n}=I.current.getBoundingClientRect(),r=$(Q(e.placement)),i=r===`y`?t:n,a=r===`y`?P.left+P.right:P.top+P.bottom;return{offset:i/2+a/2}})}},[oe,u,y,P,D]);E===`shift`||D===`shift`||a===`center`?B.push(fe,de):B.push(de,fe),B.push(nn({...oe,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!ne.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=d(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,f=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${f}px`)}}),bn(e=>({element:I.current||le(e.elements.floating).createElement(`div`),padding:f,offsetParent:`floating`}),[f]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Q(a),l=$(c),u=I.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(En(e,r,j)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ue&&l===`y`&&b?S:x),{}}},Sn,x),U(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let pe=q.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:me,elements:he,x:ge,y:W,middlewareData:G,update:_e,placement:ve,context:ye,isPositioned:K,floatingStyles:be}=on({rootContext:g,open:h?_:void 0,placement:N,middleware:B,strategy:n,whileElementsMounted:h?void 0:(...e)=>Lt(...e,pe),nodeId:b,externalTree:C}),{sideX:xe,sideY:Se}=G.adaptiveOrigin||Cn,Ce=K?n:`fixed`,we=q.useMemo(()=>{let e=x?{position:Ce,[xe]:ge,[Se]:W}:{position:Ce,...be};return K||(e.opacity=0),e},[x,Ce,xe,ge,Se,W,be,K]),Te=q.useRef(null);U(()=>{if(!_)return;let e=A.current,t=typeof e==`function`?e():e,n=(On(t)?t.current:t)||null;n!==Te.current&&(me.setPositionReference(n),Te.current=n)},[_,me,k,A]),q.useEffect(()=>{if(!_)return;let e=A.current;typeof e!=`function`&&On(e)&&e.current!==Te.current&&(me.setPositionReference(e.current),Te.current=e.current)},[_,me,k,A]),q.useEffect(()=>{if(h&&_&&he.reference&&he.floating)return Lt(he.reference,he.floating,_e,pe)},[h,_,he,_e,pe]);let Ee=Q(ve),De=Tn(r,Ee,j),J=je(ve)||`center`,Y=!!G.hide?.referenceHidden;U(()=>{S&&_&&K&&T(Ee)},[S,_,K,Ee]);let Oe=q.useMemo(()=>({position:`absolute`,top:G.arrow?.y,left:G.arrow?.x}),[G.arrow]),X=G.arrow?.centerOffset!==0;return q.useMemo(()=>({positionerStyles:we,arrowStyles:Oe,arrowRef:I,arrowUncentered:X,side:De,align:J,physicalSide:Ee,anchorHidden:Y,refs:me,context:ye,isPositioned:K,update:_e}),[we,Oe,I,X,De,J,Ee,Y,me,ye,K,_e])}function On(e){return e!=null&&`current`in e}function kn(e){let{children:t,elementsRef:n,labelsRef:i,onMapChange:a}=e,o=V(a),s=q.useRef(0),c=r(jn).current,l=r(An).current,[u,d]=q.useState(0),f=q.useRef(u),p=V((e,t)=>{l.set(e,t??null),f.current+=1,d(f.current)}),m=V(e=>{l.delete(e),f.current+=1,d(f.current)}),h=q.useMemo(()=>{let e=new Map;return Array.from(l.keys()).filter(e=>e.isConnected).sort(Mn).forEach((t,n)=>{let r=l.get(t)??{};e.set(t,{...r,index:n})}),e},[l,u]);U(()=>{if(typeof MutationObserver!=`function`||h.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(f.current+=1,d(f.current))});return h.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[h]),U(()=>{f.current===u&&(n.current.length!==h.size&&(n.current.length=h.size),i&&i.current.length!==h.size&&(i.current.length=h.size),s.current=h.size),o(h)},[o,h,n,i,u]),U(()=>()=>{n.current=[]},[n]),U(()=>()=>{i&&(i.current=[])},[i]);let g=V(e=>(c.add(e),()=>{c.delete(e)}));U(()=>{c.forEach(e=>e(h))},[c,h]);let _=q.useMemo(()=>({register:p,unregister:m,subscribeMapChange:g,elementsRef:n,labelsRef:i,nextIndexRef:s}),[p,m,g,n,i,s]);return(0,_n.jsx)(Se.Provider,{value:_,children:t})}function An(){return new Map}function jn(){return new Set}function Mn(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function Nn(e,t,{styles:n,transitionStatus:r,props:i,refs:o,hidden:s,inert:c=!1}){let l={...n};return c&&(l.pointerEvents=`none`),a(`div`,e,{state:t,ref:o,props:[{role:`presentation`,hidden:s,style:l},vn(r),i],stateAttributesMapping:N})}var Pn=20;function Fn(e,t,n,r){let[i,a]=q.useState(!1);U(()=>{if(!e||!t||n==null){a(!1);return}let r=le(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Pn)},[e,t,n]),B(e&&(!t||i),r)}function In(e){let t=q.useRef(``),n=q.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:q.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Ln(e,t){let{onClick:n,onPointerDown:r}=In(V((n,r)=>{(typeof e==`function`?e():e)||t(r||(I?`touch`:``))}));return q.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Rn(e){let[t,n]=q.useState(null),r=Ln(e,n);return xe(e,t=>{t&&!e&&n(null)}),q.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function zn(e){let t=e.getBoundingClientRect(),n=d(e);if(ue)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),f=l-t.width,p=u-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-p/2,bottom:t.bottom+p/2}}function Bn(e){let[t,n]=q.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function Vn(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}export{Je as _,Ln as a,we as b,kn as c,vn as d,gn as f,Pt as g,an as h,Rn as i,Dn as l,pn as m,Bn as n,Fn as o,mn as p,zn as r,Nn as s,Vn as t,wn as u,qe as v,Te as x,Y as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,m as t,o as n}from"./button-BDDZnIHx.js";import{s as r}from"./CSPContext-DBUu9tE0.js";var i=e();function a({className:e,size:a=`default`,unstyled:o=!1,...s}){return(0,i.jsx)(`span`,{className:t(!o&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] sm:text-sm dark:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:has-not-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,e)||void 0,"data-size":a,"data-slot":`textarea-control`,children:(0,i.jsx)(r,{render:e=>(0,i.jsx)(`textarea`,{className:t(`field-sizing-content min-h-17.5 w-full rounded-[inherit] px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none max-sm:min-h-20.5`,a===`sm`&&`min-h-16.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)] max-sm:min-h-19.5`,a===`lg`&&`min-h-18.5 py-[calc(--spacing(2)-1px)] max-sm:min-h-21.5`),"data-slot":`textarea`,...n(e,s)})})})}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,b as t}from"./button-BDDZnIHx.js";import{
|
|
1
|
+
import{_ as e,b as t}from"./button-BDDZnIHx.js";import{in as n,pn as r}from"./CSPContext-DBUu9tE0.js";var i=t(e(),1);function a(e,t,a,s=!0,c){let[l,u]=i.useState(),d=n(c?`${c}-label`:void 0),f=e??t??l;return r(()=>{let n=e||t||!s?void 0:o(a.current,d);l!==n&&u(n)}),f}function o(e,t){let n=s(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function s(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t}from"./button-BDDZnIHx.js";import{mn as n,pn as r}from"./CSPContext-DBUu9tE0.js";var i=t(e(),1);function a(e,t){let a=i.useRef(e),o=n(t);r(()=>{a.current!==e&&o(a.current)},[e,o]),r(()=>{a.current=e},[e])}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Mt as e}from"./index-CoNaATPd.js";function t(t){return e({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15.434 1.72887L12.14 0.144875C12.002 0.078875 11.855 0.046875 11.709 0.046875C11.353 0.046875 11.18 0.211875 11.155 0.228875C11.073 0.270875 11.005 0.337875 11.004 0.338875L4.698 6.08888L1.951 4.00488C1.832 3.91388 1.69 3.86987 1.548 3.86987C1.387 3.86987 1.226 3.92788 1.1 4.04288L0.219 4.84387C0.074 4.97587 0.001 5.15688 0.001 5.33687C0.001 5.51687 0.073 5.69688 0.218 5.82888L2.6 8.00088L0.217 10.1719C0.072 10.3039 0 10.4839 0 10.6639C0 10.8439 0.073 11.0249 0.218 11.1569L1.099 11.9579C1.226 12.0729 1.386 12.1309 1.547 12.1309C1.688 12.1309 1.83 12.0859 1.95 11.9959L4.697 9.91187L11.003 15.6619C11.003 15.6619 11.072 15.7299 11.155 15.7719C11.179 15.7889 11.353 15.9529 11.709 15.9529C11.855 15.9529 12.003 15.9209 12.141 15.8549L15.435 14.2709C15.781 14.1049 16.001 13.7539 16.001 13.3699V2.62888C16.001 2.24487 15.781 1.89488 15.435 1.72787L15.434 1.72887ZM7.217 7.99988L12.002 4.36987V11.6299L7.217 7.99988Z`},child:[]}]})(t)}function n(t){return e({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.045 7.37722L5.449 5.40722L10.636 0.676223C10.685 0.631223 10.735 0.617223 10.778 0.617223C10.786 0.617223 10.999 0.627223 10.999 0.837223V5.13222L8.044 7.37622L8.045 7.37722ZM0.217 10.1762C0.072 10.3082 0 10.4882 0 10.6682C0 10.8482 0.073 11.0292 0.218 11.1612L1.099 11.9622C1.226 12.0772 1.386 12.1352 1.547 12.1352C1.688 12.1352 1.83 12.0902 1.95 12.0002L3.887 10.5312L1.858 8.68122L0.218 10.1762H0.217ZM1.95 4.00822C1.83 3.91722 1.689 3.87322 1.547 3.87322C1.386 3.87322 1.225 3.93122 1.099 4.04622L0.218 4.84722C0.073 4.97922 0 5.16022 0 5.34022C0 5.52022 0.072 5.70022 0.217 5.83222L2.202 7.64222L10.634 15.3332C10.684 15.3792 10.735 15.3922 10.779 15.3922C10.888 15.3922 11 15.3142 11 15.1752V10.8762L1.95 4.00822ZM15.434 1.73322L12.14 0.149223C12.002 0.0832227 11.855 0.0532227 11.709 0.0532227H11.704C11.888 0.268223 12.003 0.537223 12.003 0.837223V15.1752C12.004 15.4702 11.894 15.7342 11.716 15.9472H11.734C11.748 15.9472 11.761 15.9472 11.775 15.9472C11.962 15.9472 12.123 15.8682 12.14 15.8602L15.434 14.2762C15.78 14.1102 16 13.7592 16 13.3752V2.63422C16 2.25022 15.78 1.90022 15.434 1.73322Z`},child:[]}]})(t)}export{n,t};
|
package/dist/gui/index.html
CHANGED
|
@@ -16,15 +16,13 @@
|
|
|
16
16
|
} catch (e) { /* ignore */ }
|
|
17
17
|
})();
|
|
18
18
|
</script>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-CoNaATPd.js"></script>
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/button-BDDZnIHx.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/CSPContext-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/CSPContext-DBUu9tE0.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/chevron-down-qTL8HPug.js">
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
25
|
-
<link rel="
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/styles-CVwNuFCx.js">
|
|
27
|
-
<link rel="stylesheet" crossorigin href="/assets/index-CZoZQkeC.css">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/useValueChanged-DeYvGnKs.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/isElementDisabled-uy_EOitH.js">
|
|
25
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BmH7a-Qy.css">
|
|
28
26
|
</head>
|
|
29
27
|
<body>
|
|
30
28
|
<div id="root"></div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
import { type HarnessAdapter, type SessionHandle, type SessionSummary } from "./interface.js";
|
|
3
|
+
import type { AuthStatus, ResumeSpec, StartSpec, WorkspaceRef } from "./types.js";
|
|
4
|
+
export declare class ClaudeCodeAdapter implements HarnessAdapter {
|
|
5
|
+
private readonly sessionStore?;
|
|
6
|
+
readonly vendor: "claude-code";
|
|
7
|
+
private readonly queryFn;
|
|
8
|
+
constructor(sessionStore?: unknown | undefined, queryFn?: typeof query);
|
|
9
|
+
start(spec: StartSpec): Promise<SessionHandle>;
|
|
10
|
+
resume(spec: ResumeSpec): Promise<SessionHandle>;
|
|
11
|
+
authStatus(_workspace?: WorkspaceRef, env?: Record<string, string>): Promise<AuthStatus>;
|
|
12
|
+
listSessions(_workspace: WorkspaceRef): Promise<SessionSummary[]>;
|
|
13
|
+
private spawn;
|
|
14
|
+
private pump;
|
|
15
|
+
private mapMessage;
|
|
16
|
+
private normalizeUsage;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=claude.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/harness/claude.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EAIN,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,cAAc,EAGpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAEV,UAAU,EAGV,UAAU,EAEV,SAAS,EACT,YAAY,EACb,MAAM,YAAY,CAAC;AAwBpB,qBAAa,iBAAkB,YAAW,cAAc;IAKpD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAJhC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAU;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAGpB,YAAY,CAAC,EAAE,OAAO,YAAA,EACvC,OAAO,CAAC,EAAE,OAAO,KAAK;IAKlB,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC;IAQ9C,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC;IAWhD,UAAU,CAAC,UAAU,CAAC,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IA6BxF,YAAY,CAAC,UAAU,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAYvE,OAAO,CAAC,KAAK;YA8JC,IAAI;IAqDlB,OAAO,CAAC,UAAU;IAgFlB,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { query, } from "@anthropic-ai/claude-agent-sdk";
|
|
3
|
+
import { AuthRequiredError, UnsupportedOperationError, } from "./interface.js";
|
|
4
|
+
import { Pushable } from "./pushable.js";
|
|
5
|
+
function serializeError(err) {
|
|
6
|
+
if (err instanceof Error) {
|
|
7
|
+
return {
|
|
8
|
+
message: err.message || "Unknown error",
|
|
9
|
+
name: err.name,
|
|
10
|
+
stack: err.stack,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return { message: String(err) };
|
|
14
|
+
}
|
|
15
|
+
export class ClaudeCodeAdapter {
|
|
16
|
+
sessionStore;
|
|
17
|
+
vendor = "claude-code";
|
|
18
|
+
queryFn;
|
|
19
|
+
constructor(sessionStore, queryFn) {
|
|
20
|
+
this.sessionStore = sessionStore;
|
|
21
|
+
this.queryFn = queryFn ?? query;
|
|
22
|
+
}
|
|
23
|
+
async start(spec) {
|
|
24
|
+
const auth = await this.authStatus(spec.workspace, spec.env);
|
|
25
|
+
if (!auth.configured) {
|
|
26
|
+
throw new AuthRequiredError(this.vendor, auth.message ?? "Authentication required");
|
|
27
|
+
}
|
|
28
|
+
return this.spawn(spec);
|
|
29
|
+
}
|
|
30
|
+
async resume(spec) {
|
|
31
|
+
const auth = await this.authStatus(spec.workspace, spec.env);
|
|
32
|
+
if (!auth.configured) {
|
|
33
|
+
throw new AuthRequiredError(this.vendor, auth.message ?? "Authentication required");
|
|
34
|
+
}
|
|
35
|
+
return this.spawn(spec, {
|
|
36
|
+
resume: spec.sessionId,
|
|
37
|
+
forkSession: spec.mode === "fork", // audit-preserving retries => mode:"fork"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async authStatus(_workspace, env) {
|
|
41
|
+
const hasApiKey = Boolean(env?.ANTHROPIC_API_KEY ?? process.env.ANTHROPIC_API_KEY);
|
|
42
|
+
const hasOAuth = Boolean(env?.CLAUDE_CODE_OAUTH_TOKEN ??
|
|
43
|
+
process.env.CLAUDE_CODE_OAUTH_TOKEN);
|
|
44
|
+
// Anthropic documented precedence: API key bills first when both exist
|
|
45
|
+
if (hasApiKey) {
|
|
46
|
+
return {
|
|
47
|
+
configured: true,
|
|
48
|
+
method: "api-key",
|
|
49
|
+
hasApiKeyFallback: hasOAuth,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (hasOAuth) {
|
|
53
|
+
return {
|
|
54
|
+
configured: true,
|
|
55
|
+
method: "subscription-oauth",
|
|
56
|
+
hasApiKeyFallback: false,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
configured: false,
|
|
61
|
+
method: "unauthenticated",
|
|
62
|
+
message: "No Anthropic API key or Claude Code OAuth token detected.",
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async listSessions(_workspace) {
|
|
66
|
+
// Requires CLAUDE_CODE_PROJECT_DIR_NAME=<workspaceId> and CLAUDE_CONFIG_DIR
|
|
67
|
+
// to have been set at session start so projectKey matches across hosts (verified in Spike 2).
|
|
68
|
+
throw new UnsupportedOperationError("claude-code", "listSessions", "wire to sessionStore-backed listSessions() once store adapter lands");
|
|
69
|
+
}
|
|
70
|
+
// ── internals ──────────────────────────────────────────────────────────
|
|
71
|
+
spawn(spec, overrides = {}) {
|
|
72
|
+
const out = new Pushable();
|
|
73
|
+
let disposed = false;
|
|
74
|
+
const approvalTimers = new Map();
|
|
75
|
+
const safePush = (ev) => {
|
|
76
|
+
if (disposed)
|
|
77
|
+
return;
|
|
78
|
+
try {
|
|
79
|
+
out.push(ev);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Stream ended or disposed concurrently; ignore to prevent unhandled rejections
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
// Streaming-input mode: enables multi-turn `send()` without losing the session.
|
|
86
|
+
const userInput = new Pushable();
|
|
87
|
+
const approvals = new Map();
|
|
88
|
+
const abort = new AbortController();
|
|
89
|
+
let resolveId;
|
|
90
|
+
let rejectId;
|
|
91
|
+
const sessionIdPromise = new Promise((res, rej) => {
|
|
92
|
+
resolveId = res;
|
|
93
|
+
rejectId = rej;
|
|
94
|
+
});
|
|
95
|
+
// Armor against unhandled rejections if caller never attaches a handler before interrupt/dispose
|
|
96
|
+
sessionIdPromise.catch(() => { });
|
|
97
|
+
abort.signal.addEventListener("abort", () => {
|
|
98
|
+
try {
|
|
99
|
+
rejectId(new DOMException("aborted", "AbortError"));
|
|
100
|
+
}
|
|
101
|
+
catch { }
|
|
102
|
+
}, { once: true });
|
|
103
|
+
if (spec.prompt !== undefined && spec.prompt.length > 0) {
|
|
104
|
+
try {
|
|
105
|
+
userInput.push({
|
|
106
|
+
type: "user",
|
|
107
|
+
message: {
|
|
108
|
+
role: "user",
|
|
109
|
+
content: [{ type: "text", text: spec.prompt }],
|
|
110
|
+
},
|
|
111
|
+
parent_tool_use_id: null,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
catch { }
|
|
115
|
+
}
|
|
116
|
+
// Approval bridge: canUseTool callback ↔ approval_required event + respondToApproval()
|
|
117
|
+
const canUseTool = async (_toolName, _input, { signal }) => {
|
|
118
|
+
if (disposed) {
|
|
119
|
+
return { behavior: "deny", message: "Session disposed" };
|
|
120
|
+
}
|
|
121
|
+
const requestId = randomUUID();
|
|
122
|
+
safePush({
|
|
123
|
+
type: "approval_required",
|
|
124
|
+
requestId,
|
|
125
|
+
tool: _toolName,
|
|
126
|
+
input: _input,
|
|
127
|
+
});
|
|
128
|
+
// Auto-deny on timeout so handles never hang indefinitely
|
|
129
|
+
return await new Promise((resolve) => {
|
|
130
|
+
const timer = setTimeout(() => {
|
|
131
|
+
approvalTimers.delete(requestId);
|
|
132
|
+
approvals.delete(requestId);
|
|
133
|
+
resolve({ behavior: "deny", message: "Approval request timed out after 5 minutes" });
|
|
134
|
+
}, 5 * 60 * 1000);
|
|
135
|
+
approvalTimers.set(requestId, timer);
|
|
136
|
+
approvals.set(requestId, (decision) => {
|
|
137
|
+
clearTimeout(timer);
|
|
138
|
+
approvalTimers.delete(requestId);
|
|
139
|
+
approvals.delete(requestId);
|
|
140
|
+
if (decision.behavior === "allow") {
|
|
141
|
+
resolve({
|
|
142
|
+
behavior: "allow",
|
|
143
|
+
updatedInput: decision.updatedInput,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
resolve({
|
|
148
|
+
behavior: "deny",
|
|
149
|
+
message: decision.message,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
signal?.addEventListener("abort", () => {
|
|
154
|
+
clearTimeout(timer);
|
|
155
|
+
approvalTimers.delete(requestId);
|
|
156
|
+
approvals.delete(requestId);
|
|
157
|
+
resolve({ behavior: "deny", message: "interrupted" });
|
|
158
|
+
}, { once: true });
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
void this.pump({
|
|
162
|
+
spec,
|
|
163
|
+
overrides,
|
|
164
|
+
userInput,
|
|
165
|
+
safePush,
|
|
166
|
+
out,
|
|
167
|
+
canUseTool,
|
|
168
|
+
approvals,
|
|
169
|
+
resolveId,
|
|
170
|
+
rejectId,
|
|
171
|
+
abortController: abort,
|
|
172
|
+
isDisposed: () => disposed,
|
|
173
|
+
});
|
|
174
|
+
return {
|
|
175
|
+
vendor: this.vendor,
|
|
176
|
+
sessionId: () => sessionIdPromise,
|
|
177
|
+
events: out,
|
|
178
|
+
send: (prompt) => {
|
|
179
|
+
if (disposed)
|
|
180
|
+
return;
|
|
181
|
+
try {
|
|
182
|
+
userInput.push({
|
|
183
|
+
type: "user",
|
|
184
|
+
message: {
|
|
185
|
+
role: "user",
|
|
186
|
+
content: [{ type: "text", text: prompt }],
|
|
187
|
+
},
|
|
188
|
+
parent_tool_use_id: null,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
catch { }
|
|
192
|
+
},
|
|
193
|
+
respondToApproval: (requestId, decision) => approvals.get(requestId)?.(decision),
|
|
194
|
+
interrupt: async () => abort.abort(),
|
|
195
|
+
dispose: async () => {
|
|
196
|
+
disposed = true;
|
|
197
|
+
for (const timer of approvalTimers.values()) {
|
|
198
|
+
clearTimeout(timer);
|
|
199
|
+
}
|
|
200
|
+
approvalTimers.clear();
|
|
201
|
+
approvals.clear();
|
|
202
|
+
abort.abort();
|
|
203
|
+
try {
|
|
204
|
+
userInput.end();
|
|
205
|
+
}
|
|
206
|
+
catch { }
|
|
207
|
+
try {
|
|
208
|
+
out.end();
|
|
209
|
+
}
|
|
210
|
+
catch { }
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
async pump(args) {
|
|
215
|
+
const { spec, overrides, userInput, safePush, out, canUseTool, abortController, isDisposed } = args;
|
|
216
|
+
try {
|
|
217
|
+
const options = {
|
|
218
|
+
cwd: spec.workspace.rootPath,
|
|
219
|
+
additionalDirectories: spec.workspace.additionalDirectories,
|
|
220
|
+
permissionMode: spec.permissionMode ?? "acceptEdits",
|
|
221
|
+
maxTurns: spec.maxTurns,
|
|
222
|
+
model: spec.model,
|
|
223
|
+
// Spike 1 finding: Agent SDK env REPLACES process.env, so callers must spread parent process.env.
|
|
224
|
+
env: spec.env ? { ...process.env, ...spec.env } : undefined,
|
|
225
|
+
mcpServers: spec.mcpServers,
|
|
226
|
+
canUseTool,
|
|
227
|
+
includePartialMessages: true, // enables stream_event deltas below
|
|
228
|
+
sessionStore: this.sessionStore,
|
|
229
|
+
abortController,
|
|
230
|
+
...overrides,
|
|
231
|
+
// ESCAPE HATCH — deliberately last, wins over everything above.
|
|
232
|
+
...spec.nativeOptions,
|
|
233
|
+
};
|
|
234
|
+
const queryHandle = this.queryFn({
|
|
235
|
+
prompt: userInput,
|
|
236
|
+
options,
|
|
237
|
+
});
|
|
238
|
+
for await (const msg of queryHandle) {
|
|
239
|
+
if (isDisposed())
|
|
240
|
+
break;
|
|
241
|
+
this.mapMessage(msg, safePush, args);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
catch (err) {
|
|
245
|
+
try {
|
|
246
|
+
args.rejectId(err instanceof Error ? err : new Error(String(err)));
|
|
247
|
+
}
|
|
248
|
+
catch { }
|
|
249
|
+
safePush({ type: "turn_failed", error: serializeError(err), fatal: true });
|
|
250
|
+
try {
|
|
251
|
+
out.end();
|
|
252
|
+
}
|
|
253
|
+
catch { }
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
mapMessage(msg, push, args) {
|
|
257
|
+
switch (msg.type) {
|
|
258
|
+
case "system":
|
|
259
|
+
if (msg.subtype === "init") {
|
|
260
|
+
args.resolveId(msg.session_id);
|
|
261
|
+
push({ type: "session_started", sessionId: msg.session_id });
|
|
262
|
+
}
|
|
263
|
+
break;
|
|
264
|
+
case "stream_event": {
|
|
265
|
+
// Partial assistant text deltas (requires includePartialMessages).
|
|
266
|
+
const event = msg.event;
|
|
267
|
+
if (event?.type === "content_block_delta" && event?.delta?.type === "text_delta" && event.delta.text) {
|
|
268
|
+
push({ type: "text_delta", text: event.delta.text });
|
|
269
|
+
}
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
case "assistant":
|
|
273
|
+
for (const block of msg.message?.content ?? []) {
|
|
274
|
+
if (block.type === "text") {
|
|
275
|
+
push({ type: "assistant_message", text: block.text });
|
|
276
|
+
}
|
|
277
|
+
else if (block.type === "tool_use") {
|
|
278
|
+
push({
|
|
279
|
+
type: "tool_requested",
|
|
280
|
+
callId: block.id,
|
|
281
|
+
tool: block.name,
|
|
282
|
+
input: block.input,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
break;
|
|
287
|
+
case "user": {
|
|
288
|
+
// Tool results arrive as user messages.
|
|
289
|
+
const content = msg.message?.content;
|
|
290
|
+
if (Array.isArray(content)) {
|
|
291
|
+
for (const block of content) {
|
|
292
|
+
if (block.type === "tool_result") {
|
|
293
|
+
push({
|
|
294
|
+
type: "tool_completed",
|
|
295
|
+
callId: block.tool_use_id,
|
|
296
|
+
ok: !block.is_error,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
case "result": {
|
|
304
|
+
if (msg.subtype === "success") {
|
|
305
|
+
push({
|
|
306
|
+
type: "turn_completed",
|
|
307
|
+
usage: this.normalizeUsage(msg.usage, msg.total_cost_usd),
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
push({
|
|
312
|
+
type: "turn_failed",
|
|
313
|
+
error: { message: `claude turn failed: ${msg.subtype}` },
|
|
314
|
+
fatal: msg.subtype === "error_during_execution",
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
if (args.spec.debugMirrorRaw) {
|
|
321
|
+
push({ type: "raw", vendor: "claude-code", payload: msg });
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
normalizeUsage(u, costUsdEstimate) {
|
|
325
|
+
return {
|
|
326
|
+
inputTokens: u?.input_tokens ?? 0,
|
|
327
|
+
outputTokens: u?.output_tokens ?? 0,
|
|
328
|
+
cachedInputTokens: (u?.cache_read_input_tokens ?? 0) +
|
|
329
|
+
(u?.cache_creation_input_tokens ?? 0),
|
|
330
|
+
costUsdEstimate,
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
//# sourceMappingURL=claude.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/harness/claude.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAA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,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,CAAM,EAAE,eAAwB;QACrD,OAAO;YACL,WAAW,EAAE,CAAC,EAAE,YAAY,IAAI,CAAC;YACjC,YAAY,EAAE,CAAC,EAAE,aAAa,IAAI,CAAC;YACnC,iBAAiB,EACf,CAAC,CAAC,EAAE,uBAAuB,IAAI,CAAC,CAAC;gBACjC,CAAC,CAAC,EAAE,2BAA2B,IAAI,CAAC,CAAC;YACvC,eAAe;SAChB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Codex } from "@openai/codex-sdk";
|
|
2
|
+
import { type HarnessAdapter, type SessionHandle, type SessionSummary } from "./interface.js";
|
|
3
|
+
import type { AuthStatus, ResumeSpec, StartSpec, WorkspaceRef } from "./types.js";
|
|
4
|
+
export declare class CodexAdapter implements HarnessAdapter {
|
|
5
|
+
readonly vendor: "codex";
|
|
6
|
+
private clientOpts;
|
|
7
|
+
private client;
|
|
8
|
+
private clientFactory?;
|
|
9
|
+
constructor(clientOpts?: ConstructorParameters<typeof Codex>[0], clientFactory?: (opts: ConstructorParameters<typeof Codex>[0]) => Codex);
|
|
10
|
+
start(spec: StartSpec): Promise<SessionHandle>;
|
|
11
|
+
resume(spec: ResumeSpec): Promise<SessionHandle>;
|
|
12
|
+
authStatus(_workspace?: WorkspaceRef, env?: Record<string, string>): Promise<AuthStatus>;
|
|
13
|
+
listSessions(_workspace: WorkspaceRef): Promise<SessionSummary[]>;
|
|
14
|
+
private spawn;
|
|
15
|
+
private runTurn;
|
|
16
|
+
private mapEvent;
|
|
17
|
+
private mapItem;
|
|
18
|
+
private normalizeUsage;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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