spexcode 0.4.0 → 0.4.3
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/README.md +37 -17
- package/package.json +9 -5
- package/spec-cli/README.md +23 -14
- package/spec-cli/hooks/dispatch.sh +7 -5
- package/spec-cli/hooks/harness.sh +19 -8
- package/spec-cli/src/anchors.ts +163 -30
- package/spec-cli/src/cli.ts +97 -42
- package/spec-cli/src/client.ts +34 -11
- package/spec-cli/src/doctor.ts +174 -36
- package/spec-cli/src/gateway-auth.ts +194 -0
- package/spec-cli/src/gateway-hub.ts +360 -0
- package/spec-cli/src/gateway.ts +31 -16
- package/spec-cli/src/git.ts +12 -5
- package/spec-cli/src/graph.ts +53 -36
- package/spec-cli/src/graphStream.ts +265 -34
- package/spec-cli/src/guide.ts +157 -76
- package/spec-cli/src/harness-select.ts +20 -6
- package/spec-cli/src/harness.ts +266 -67
- package/spec-cli/src/help.ts +84 -41
- package/spec-cli/src/host.ts +610 -0
- package/spec-cli/src/identity-presets.d.ts +13 -0
- package/spec-cli/src/identity-presets.js +128 -0
- package/spec-cli/src/index.ts +163 -86
- package/spec-cli/src/init.ts +53 -25
- package/spec-cli/src/layout.ts +5 -5
- package/spec-cli/src/lint.ts +115 -169
- package/spec-cli/src/login-page.ts +12 -5
- package/spec-cli/src/materialize.ts +39 -13
- package/spec-cli/src/mentions.ts +16 -11
- package/spec-cli/src/opencode.ts +145 -0
- package/spec-cli/src/pi-harness.ts +124 -0
- package/spec-cli/src/project-identity.ts +73 -0
- package/spec-cli/src/pty-bridge.ts +321 -521
- package/spec-cli/src/pty-helper.mjs +86 -0
- package/spec-cli/src/reaper.ts +16 -8
- package/spec-cli/src/reviewSnapshot.ts +23 -0
- package/spec-cli/src/reviews.ts +347 -0
- package/spec-cli/src/session-timeline.ts +162 -0
- package/spec-cli/src/sessions.ts +210 -63
- package/spec-cli/src/shim-runtime.ts +169 -0
- package/spec-cli/src/slash-commands.ts +76 -0
- package/spec-cli/src/source-files.ts +79 -0
- package/spec-cli/src/specs.ts +47 -24
- package/spec-cli/src/supervise.ts +37 -15
- package/spec-cli/src/tree.ts +8 -8
- package/spec-cli/src/uninstall.ts +56 -23
- package/spec-cli/templates/hooks/prepare-commit-msg +32 -13
- package/spec-cli/templates/spec/project/.plugins/{extract → commands/extract}/spec.md +24 -18
- package/spec-cli/templates/spec/project/.plugins/{regroup → commands/regroup}/spec.md +3 -3
- package/spec-cli/templates/spec/project/.plugins/commands/rename/spec.md +11 -0
- package/spec-cli/templates/spec/project/.plugins/commands/spec.md +30 -0
- package/spec-cli/templates/spec/project/.plugins/commands/supervisor/spec.md +8 -0
- package/spec-cli/templates/spec/project/.plugins/commands/tidy/spec.md +43 -0
- package/spec-cli/templates/spec/project/.plugins/core/idle/spec.md +1 -1
- package/spec-cli/templates/spec/project/.plugins/core/mark-active/spec.md +2 -0
- package/spec-cli/templates/spec/project/.plugins/core/session-fail/spec.md +1 -1
- package/spec-cli/templates/spec/project/.plugins/core/spec-first/spec-first.sh +28 -39
- package/spec-cli/templates/spec/project/.plugins/core/spec-first/spec.md +5 -3
- package/spec-cli/templates/spec/project/.plugins/core/spec-of-file/spec.md +1 -1
- package/spec-cli/templates/spec/project/.plugins/core/spec.md +2 -2
- package/spec-cli/templates/spec/project/.plugins/core/stop-gate/spec.md +7 -1
- package/spec-cli/templates/spec/project/.plugins/prompts/forge-link/spec.md +2 -2
- package/spec-cli/templates/spec/project/.plugins/prompts/reproduce-before-fix/spec.md +5 -5
- package/spec-cli/templates/spec/project/.plugins/prompts/spec.md +10 -6
- package/spec-cli/templates/spec/project/.plugins/skills/distill/spec.md +62 -0
- package/spec-cli/templates/spec/project/.plugins/skills/spec.md +19 -0
- package/spec-cli/templates/spec/project/.plugins/spec.md +17 -12
- package/spec-cli/templates/spec/project/spec.md +6 -5
- package/spec-cli/templates/spexcode.json +4 -2
- package/spec-dashboard/dist/assets/Dashboard-CiHh-gLD.js +27 -0
- package/spec-dashboard/dist/assets/EvalsPage-DmiX3rdU.js +2 -0
- package/spec-dashboard/dist/assets/IssuesPage-CIbVGRUJ.js +1 -0
- package/spec-dashboard/dist/assets/MobileApp-D-N9_eh0.js +2 -0
- package/spec-dashboard/dist/assets/Modal-DHMzSFJ4.js +1 -0
- package/spec-dashboard/dist/assets/PageScroll-C15adEYI.js +1 -0
- package/spec-dashboard/dist/assets/ProjectsPage-sQpzglp5.js +1 -0
- package/spec-dashboard/dist/assets/SessionInterface-6GBZ9nXN.css +32 -0
- package/spec-dashboard/dist/assets/SessionInterface-B8pGU7Rg.js +39 -0
- package/spec-dashboard/dist/assets/SessionWindow-CuDO_67z.js +13 -0
- package/spec-dashboard/dist/assets/Settings-C_N1wX1f.js +1 -0
- package/spec-dashboard/dist/assets/bindings-BC9vqpYU.js +1 -0
- package/spec-dashboard/dist/assets/index-DmWbmvCq.js +41 -0
- package/spec-dashboard/dist/assets/index-GGIVdKwH.css +1 -0
- package/spec-dashboard/dist/assets/terminalFont-DmTPNdbU.js +1 -0
- package/spec-dashboard/dist/index.html +10 -10
- package/spec-dashboard/src/reviewFilters.js +279 -0
- package/spec-dashboard/src/reviewQuery.js +174 -0
- package/spec-dashboard/src/session.js +167 -0
- package/spec-eval/src/cli.ts +80 -45
- package/spec-eval/src/evaltab.ts +4 -3
- package/spec-eval/src/humanok.ts +1 -1
- package/spec-eval/src/matrix.ts +693 -0
- package/spec-eval/src/scenarios.ts +116 -4
- package/spec-eval/src/sessioneval.ts +726 -66
- package/spec-cli/src/migrate-table.ts +0 -398
- package/spec-cli/src/migrate.ts +0 -386
- package/spec-cli/templates/spec/project/.plugins/distill/spec.md +0 -74
- package/spec-cli/templates/spec/project/.plugins/supervisor/spec.md +0 -8
- package/spec-cli/templates/spec/project/.plugins/tidy/spec.md +0 -25
- package/spec-dashboard/dist/assets/Dashboard-CTcH2eW9.js +0 -27
- package/spec-dashboard/dist/assets/EvalsPage-CJNKwHLN.js +0 -2
- package/spec-dashboard/dist/assets/FoldToggle-CVFbBpyW.js +0 -1
- package/spec-dashboard/dist/assets/IssuesPage-kULjonqj.js +0 -1
- package/spec-dashboard/dist/assets/MobileApp-B0ZJju8K.js +0 -1
- package/spec-dashboard/dist/assets/SessionInterface-BRKJqU2U.js +0 -71
- package/spec-dashboard/dist/assets/SessionInterface-DYP7pi_n.css +0 -32
- package/spec-dashboard/dist/assets/SessionWindow-CDhEL7wO.js +0 -9
- package/spec-dashboard/dist/assets/Settings-BL6FV_8S.js +0 -1
- package/spec-dashboard/dist/assets/index-DmQsNYKK.css +0 -1
- package/spec-dashboard/dist/assets/index-DulGPk6A.js +0 -41
- /package/spec-cli/templates/spec/project/.plugins/{distill → skills/distill}/digest.mjs +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{u as B,j as n,I as G,r,T as Ts,a as ke,U as Cs,i as be,V as Fs,W as As}from"./index-DmWbmvCq.js";import{a2 as ie,E as es,a3 as D,a4 as ds,X as V,a5 as Ps,a6 as Os,a7 as ss,s as ns,a8 as Is,a9 as ts,aa as Ks,ab as zs,ac as Bs,ad as Us,ae as Ce,af as Z,ag as Y,ah as Vs,ai as _s,aj as Fe,ak as we,al as qs,am as as,an as Hs,ao as Xs,k as Qs,ap as Ys,d as Ds,D as ge,r as ls,aq as Gs,F as Ae,e as hs,n as Js,ar as Zs,as as Ws,h as en}from"./SessionWindow-CuDO_67z.js";import"./PageScroll-C15adEYI.js";const is={video:"vid",image:"img",transcript:"txt",data:"data"},sn=["is","state","verdict","freshness","evidence","node","filer","session","scope"],ms=e=>`eval:${e.node}·${e.scenario}`;function nn({e}){const a=B(),i=e.humanOk&&a("evalsFeed.okdTip",{by:e.humanOk.by,at:new Date(e.humanOk.ts).toLocaleString()});return n.jsx(ds,{state:n.jsx(V,{kind:"eval",state:e.state}),title:e.scenario,meta:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"ef-node",style:{color:`hsl(${e.hue??210} 60% 70%)`},children:e.node}),e.by&&n.jsx("span",{children:a("evalsFeed.filedBy",{by:e.by})}),n.jsx("span",{children:a("evalsFeed.filedAt",{at:tn(e.ts)})})]}),aside:n.jsxs(n.Fragment,{children:[e.inSession&&n.jsx("span",{className:"rl-tag in-session",children:a("evalsFeed.sessionTag")}),ts(e).some(o=>is[o])&&n.jsx("span",{className:"rl-tag",children:ts(e).map(o=>is[o]).filter(Boolean).join("·")}),e.humanOk&&n.jsx("span",{role:"img",className:"ef-okd","data-tip":i,"aria-label":i,children:n.jsx(G,{name:"check",size:11})})]})})}const tn=e=>{const a=Math.max(0,(Date.now()-new Date(e).getTime())/1e3);return a<3600?`${Math.max(1,Math.floor(a/60))}m`:a<86400?`${Math.floor(a/3600)}h`:`${Math.floor(a/86400)}d`},W=(e,a,i,o=p=>p)=>{var p,d;return(((d=(p=e==null?void 0:e.facets)==null?void 0:p[a])==null?void 0:d.options)??[]).map(x=>({value:x.value,label:x.value===""?i:o(x.value)}))};function an({pageData:e,loading:a=!1,sessions:i=[],queryText:o="",onQueryText:p,hrefFor:d,notice:x=null,leading:f=null,error:j=null,empty:S=null,pagination:L=null}){var re,ee;const h=B(),m=String(o??"").trim()||ie,b=(c,U)=>p(Is(m,c,U)),E=Array.isArray(e==null?void 0:e.items)?e.items:[],y=E.filter(c=>c.filterKind===es.RESULT),R=E.filter(c=>c.filterKind===es.BLIND),I=((re=e==null?void 0:e.counts)==null?void 0:re.fail)||0,M=((ee=e==null?void 0:e.counts)==null?void 0:ee.pass)||0,A=D(m,"verdict"),P=[...R.map(c=>({key:`blind:${c.node}·${c.scenario}`,cls:"se-blind",content:n.jsx(ds,{state:n.jsx(V,{kind:"eval",state:"missing"}),title:c.scenario,meta:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"ef-node",style:{color:`hsl(${c.hue??210} 60% 70%)`},children:c.node}),n.jsx("span",{children:h("sessionEval.unmeasured")})]})})})),...y.map(c=>({key:ms(c),href:d(c),content:n.jsx(nn,{e:c})}))],O={label:h("reviewList.facetReview"),value:D(m,"state"),options:W(e,"review",h("reviewList.all"),c=>h(c==="reviewed"?"reviewList.reviewed":"reviewList.needsReview"))},v={label:h("reviewList.facetFreshness"),value:D(m,"freshness"),options:W(e,"freshness",h("reviewList.all"),c=>h(`reviewList.freshness.${c}`))},T={label:h("reviewList.facetKind"),value:D(m,"evidence")||"all",options:W(e,"kind",h("evalsFeed.kind.all"),c=>h(`evalsFeed.kind.${c}`))},K={label:h("reviewList.facetSession"),value:D(m,"session"),options:W(e,"session",h("reviewList.all"),c=>h(c==="present"?"reviewList.sessionPresent":"reviewList.sessionMissing"))},N=D(m,"evidence");return n.jsx(Ps,{notice:x,leading:f,error:j,loading:a,title:h("evalsFeed.title"),search:{value:String(o??"").trim()?o:ie,onSubmit:p,placeholder:h("reviewList.searchEvals"),label:h("reviewList.search"),keys:sn,suggest:{node:W(e,"node",h("reviewList.all")).filter(c=>c.value),filer:W(e,"filer",h("reviewList.all")).filter(c=>c.value).map(({value:c})=>{const U=i.find(_=>_.id===c);return{value:c,label:U?ns(U):null}}),scope:i.map(c=>({value:c.id,label:ns(c)}))}},sections:[{key:"fail",label:n.jsx(V,{kind:"eval",state:"fail",title:h("reviewList.verdict.fail"),showLabel:!0}),count:I,active:A==="fail",onSelect:()=>b("verdict",A==="fail"?"":"fail")},{key:"pass",label:n.jsx(V,{kind:"eval",state:"pass",title:h("reviewList.verdict.pass"),showLabel:!0}),count:M,active:A==="pass",onSelect:()=>b("verdict",A==="pass"?"":"pass")}],sectionMode:"filters",facets:n.jsxs(n.Fragment,{children:[n.jsx(ss,{label:v.label,value:v.value,options:v.options,clearLabel:h("reviewList.all"),onChange:c=>b("freshness",c)}),n.jsx(ss,{label:T.label,value:T.value,options:T.options,onChange:c=>b("evidence",c==="all"?"":c)})]}),secondaryFilters:n.jsx(Os,{label:h("reviewList.filters"),clearLabel:h("reviewList.all"),groups:[{label:O.label,value:O.value,active:!!O.value,options:O.options,onChange:c=>b("state",c)},{label:K.label,value:K.value,active:!!K.value,options:K.options,onChange:c=>b("session",c)},{label:v.label,value:v.value,active:!!v.value,options:v.options,onChange:c=>b("freshness",c),mobileOnly:!0},{label:T.label,value:T.value,active:!!N,options:T.options,clearLabel:null,onChange:c=>b("evidence",c==="all"?"":c),mobileOnly:!0}]}),rows:P,pagination:L,empty:S||{hasData:((e==null?void 0:e.sourceTotal)??0)>0,dataset:h("evalsFeed.datasetEmpty"),filtered:h("evalsFeed.noMatches")}})}const ln=[{name:"ok",color:"green",when:e=>!e.okd&&e.isLatest,descKey:"annotator.cmd.okDesc"}];function rn(e,a){return ln.filter(i=>i.when(e)).map(i=>({...i,run:a[i.name]}))}function on(e,a){return(e||"").replace(/\{(\w+)\}/g,(i,o)=>a[o]!=null?String(a[o]):i)}const rs=(e,a)=>{let i=null;for(const o of e)if(o.at<=a)i=o;else break;return i},cn=e=>{if(!e||!Array.isArray(e.events))return null;const a=e.v===1?"time":typeof e.axis=="string"?e.axis:"time",i=e.v===1?o=>o.tMs:o=>o.at;return{axis:a,events:e.events.map(o=>({at:i(o),step:o.step,...o.node?{node:o.node}:{}}))}},un=(e,a,i)=>e==="time"?we(a):e==="frame"?`#${a}`:e==="line"?`L${a}`:e==="index"?i?`${a}/${i}`:`${a}`:String(a);function os({events:e,axis:a,extent:i,activeStepIdx:o,onSeek:p}){return n.jsx("div",{className:"an-ruler",children:e.map((d,x)=>n.jsxs("button",{className:`an-step ${o===x?"on":""}`,onClick:()=>p(d.at),"data-tip":d.node?`→ ${d.node}`:void 0,children:[un(a,d.at,i)," ",d.step]},x))})}const xe=8;function dn({hidden:e,total:a,histIdx:i,onPick:o}){const p=B(),d=Hs(),x=p("annotator.abMore",{n:e.length});return n.jsxs("div",{className:"an-ab-more",ref:d.ref,children:[n.jsx(be,{icon:"ellipsis",size:14,className:"an-ab-morebtn",label:x,"aria-haspopup":"menu","aria-expanded":d.open,onClick:f=>d.toggle(f.currentTarget),onKeyDown:d.onTriggerKeyDown}),d.open&&n.jsx("div",{className:"rl-menu an-ab-menu",role:"menu","aria-label":x,ref:d.menuRef,onKeyDown:d.onMenuKeyDown,children:e.map(f=>{const j=Ce(f);return n.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":f.idx===i,tabIndex:-1,className:"rl-menu-item an-ab-menuitem",onFocus:d.onItemFocus,onClick:()=>{d.close(!0),o(f.idx)},children:[n.jsx(V,{kind:"eval",state:j,size:13}),n.jsxs("span",{className:"an-ab-menupos",children:[a-f.idx,"/",a]}),n.jsx("span",{className:"an-ab-menudate",children:new Date(f.ts).toLocaleString()})]},`${f.ts}-${f.idx}`)})})]})}function hn({entry:e,history:a,sourceKey:i="project",specs:o=[],sessions:p=[],onWrite:d,onOpenSession:x,onFocusNode:f=null,listHref:j=null,backHref:S=null,backLabel:L=null,queue:h={prev:[],next:[]}}){var Ye,De,Ge,Je,Ze,We;const m=B(),b=r.useRef(null),E=r.useRef(null),y=r.useRef(null),R=r.useRef(null),I=r.useRef(0),[M,A]=r.useState([]),[P,O]=r.useState("time"),[v,T]=r.useState(null),[K,N]=r.useState(""),[re,ee]=r.useState(!1),[c,U]=r.useState(null),_=r.useRef(null),se=r.useRef(null),ne=r.useRef(null),ye=r.useRef(0),[vs,Pe]=r.useState(0),[je,Oe]=r.useState(-1),[Ie,Ke]=r.useState(null),[oe,Ee]=r.useState(!1),[ze,Le]=r.useState(!1),[Me,Ne]=r.useState(null),[ce,$e]=r.useState(null),[C,Be]=r.useState(null),[F,te]=r.useState(0),w=C&&C[F]||e,fs=`${F}:${w.ts||w.codeSha||w.blob||"reading"}`,xs=`${i}·${e.node}·${e.scenario}·${fs}`,[ps,bs]=r.useState([]);r.useEffect(()=>{let s=!0;return Ts().then(t=>{s&&Array.isArray(t)&&bs(t)}).catch(()=>{}),()=>{s=!1}},[]),r.useEffect(()=>{T(null),N(""),A([]),U(null),te(0),Be(null),Be(Array.isArray(a)?a:[e])},[e.node,e.scenario,e.ts,e.blob,(Ye=e.humanOk)==null?void 0:Ye.ts,a]),r.useEffect(()=>{T(null),U(null)},[F]);const ae=Ks(w),q=ae.find(s=>s.kind==="video"&&s.state==="present"),ue=ae.filter(s=>s.kind==="image"),ws=ae.filter(s=>s.kind!=="video"&&s.kind!=="image"),H=!!q,de=e.thread??null,Se=r.useMemo(()=>((de==null?void 0:de.replies)??[]).filter(s=>s.rid!==void 0),[de]),Ue=C&&((De=C[0])==null?void 0:De.by)||e.by||null,z=r.useMemo(()=>Se.map((s,t)=>{const l=zs(Bs(s.body),M);return l&&l.seekable?{i:t,tMs:l.tMs,step:l.step,label:l.label}:null}).filter(Boolean).sort((s,t)=>s.tMs-t.tMs),[Se,M]),Ve=r.useRef(M);Ve.current=M;const _e=r.useRef(z);_e.current=z;const he=r.useCallback(()=>{const s=ye.current,t=Ve.current;let l=-1;for(let g=0;g<t.length&&t[g].at<=s;g++)l=g;Oe(g=>g===l?g:l);let u=null;for(const g of _e.current)if(g.tMs<=s)u=g.i;else break;Ke(g=>g===u?g:u)},[]);r.useEffect(()=>{he()},[z,M,he]),r.useEffect(()=>{ye.current=0,_.current&&(_.current.style.width="0%"),se.current&&(se.current.style.left="0%"),ne.current&&(ne.current.textContent=""),Oe(-1),Ke(null),Pe(0),Ee(!1),Le(!1),Ne(null),$e(null)},[e.blob,e.scenario,e.node]),r.useEffect(()=>{if(A([]),O("time"),!w.timelineBlob)return;let s=!0;return fetch(ke(`/api/evidence/${w.timelineBlob}`)).then(t=>t.ok?t.json():null).then(t=>{const l=s&&cn(t);l&&(A(l.events),O(l.axis))}).catch(()=>{}),()=>{s=!1}},[w.timelineBlob]),r.useEffect(()=>{const s=b.current;if(!s)return;const t=()=>{const k=Math.round((s.currentTime||0)*1e3),$=Math.round((s.duration||0)*1e3);ye.current=k;const Q=$?k/$*100:0;_.current&&(_.current.style.width=`${Q}%`),se.current&&(se.current.style.left=`${Q}%`),ne.current&&(ne.current.textContent=`${we(k)} / ${we($)}`),he()},l=()=>{Pe(s.duration||0),t()},u=()=>Ee(!0),g=()=>Ee(!1);return s.addEventListener("timeupdate",t),s.addEventListener("seeked",t),s.addEventListener("loadedmetadata",l),s.addEventListener("durationchange",l),s.addEventListener("play",u),s.addEventListener("pause",g),l(),()=>{s.removeEventListener("timeupdate",t),s.removeEventListener("seeked",t),s.removeEventListener("loadedmetadata",l),s.removeEventListener("durationchange",l),s.removeEventListener("play",u),s.removeEventListener("pause",g)}},[q==null?void 0:q.hash,e.node,e.scenario,F,he]);const X=Math.round(vs*1e3),me=M[je]||null,qe=P==="time"?X:P==="frame"?ue.length:P==="index"?M.length:0,J=r.useCallback(s=>{const t=b.current;t&&(t.currentTime=s/1e3)},[]),ve=r.useCallback(()=>{const s=b.current;s&&(s.paused?s.play():s.pause())},[]),He=(s,t)=>{$e(s),t!=null&&J(t)},fe=r.useCallback(async s=>{const t=b.current;if(!(t!=null&&t.videoWidth))return null;ee(!0),N(m("annotator.capturing"));try{t.seeking&&await new Promise($=>t.addEventListener("seeked",$,{once:!0}));const l=document.createElement("canvas");l.width=t.videoWidth,l.height=t.videoHeight;const u=l.getContext("2d");u.drawImage(t,0,0,l.width,l.height),s&&(u.strokeStyle="#ff9a3c",u.lineWidth=Math.max(2,l.width/300),u.strokeRect(s.x/100*l.width,s.y/100*l.height,s.w/100*l.width,s.h/100*l.height));const g=await new Promise($=>l.toBlob($,"image/png")),{hash:k}=await Cs(g);if(!k)throw new Error("no hash");return N(""),k}catch{return N(m("annotator.failed")),null}finally{ee(!1)}},[m]),ks=r.useCallback(async()=>{var l;const s=b.current;if(!s)return null;s.pause();const t=Math.round((s.currentTime??0)*1e3);return{tMs:t,step:((l=rs(M,t))==null?void 0:l.step)??null,frame:await fe(null)}},[M,fe]),Re=r.useCallback(async s=>{const t=b.current;if(!t)return;t.pause();const l=Math.round((t.currentTime||0)*1e3),u=rs(M,l),g=await fe(s),k=[Us(l,u==null?void 0:u.step)];g&&k.push(``),u!=null&&u.node&&u.node!==e.node&&k.push(`re: [[${u.node}]]`),k.push(""),U({seq:++I.current,body:k.join(`
|
|
2
|
+
`)})},[M,e.node,fe]),Te=r.useCallback(s=>{var u;if(!z.length)return;let t=z.findIndex(g=>g.i===ce);if(t<0){const g=Math.round((((u=b.current)==null?void 0:u.currentTime)||0)*1e3);t=z.reduce((k,$,Q)=>$.tMs<=g?Q:k,-1)}t=Math.min(z.length-1,Math.max(0,t+s));const l=z[t];$e(l.i),J(l.tMs)},[z,ce,J]);r.useEffect(()=>{if(!H)return;const s=t=>{const l=document.activeElement;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.tagName==="SELECT"||l.isContentEditable))return;const u=b.current;u&&(t.key===" "?(t.preventDefault(),ve()):t.key==="ArrowRight"?(t.preventDefault(),u.currentTime=Math.min(u.duration||u.currentTime,u.currentTime+(t.shiftKey?1:5))):t.key==="ArrowLeft"?(t.preventDefault(),u.currentTime=Math.max(0,u.currentTime-(t.shiftKey?1:5))):t.key===","?(t.preventDefault(),u.currentTime=Math.max(0,u.currentTime-1/30)):t.key==="."?(t.preventDefault(),u.duration&&(u.currentTime=Math.min(u.duration,u.currentTime+1/30))):t.key==="ArrowDown"?(t.preventDefault(),Te(1)):t.key==="ArrowUp"?(t.preventDefault(),Te(-1)):(t.key==="a"||t.key==="A")&&(t.preventDefault(),Re(null)))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[H,ve,Te,Re]);const Xe=s=>{var u;const t=(u=y.current)==null?void 0:u.getBoundingClientRect(),l=b.current;!t||!t.width||!l||!l.duration||(l.currentTime=Math.min(1,Math.max(0,(s-t.left)/t.width))*l.duration)},gs=s=>{s.preventDefault(),Le(!0),Xe(s.clientX)},ys=s=>{var l;const t=(l=y.current)==null?void 0:l.getBoundingClientRect();t!=null&&t.width&&Ne(Math.min(100,Math.max(0,(s.clientX-t.left)/t.width*100)))};r.useEffect(()=>{if(!ze)return;const s=l=>Xe(l.clientX),t=()=>Le(!1);return window.addEventListener("mousemove",s),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",t)}},[ze]);const Qe=s=>{const t=E.current.getBoundingClientRect();return{x:(s.clientX-t.left)/t.width*100,y:(s.clientY-t.top)/t.height*100}},js=s=>{if(s.button!==0||re)return;const t=Qe(s);T({x0:t.x,y0:t.y,x:t.x,y:t.y})},Es=s=>{var l,u;if(!v)return;const t=Qe(s);!((l=b.current)!=null&&l.paused)&&(Math.abs(t.x-v.x0)>1||Math.abs(t.y-v.y0)>1)&&((u=b.current)==null||u.pause()),T({...v,x:t.x,y:t.y})},Ls=()=>{if(!v)return;const s={x:Math.min(v.x0,v.x),y:Math.min(v.y0,v.y),w:Math.abs(v.x-v.x0),h:Math.abs(v.y-v.y0)};if(T(null),s.w<1&&s.h<1){ve();return}Re(s)},le=v&&{x:Math.min(v.x0,v.x),y:Math.min(v.y0,v.y),w:Math.abs(v.x-v.x0),h:Math.abs(v.y-v.y0)},Ms=async()=>{const s=await As(e.node,e.scenario).catch(t=>({error:String(t)}));d==null||d((s==null?void 0:s.error)||"")},Ns=[...rn({okd:!!w.humanOk,isLatest:!C||F===0},{ok:Ms}).map(s=>({name:s.name,description:m(s.descKey),ui:!0,color:s.color,run:s.run})),...ps.map(s=>({name:s.name,description:s.desc||s.title,source:"review",prefill:()=>on(s.body,{node:e.node,scenario:e.scenario,expected:w.expected||""})}))],$s=n.jsxs(n.Fragment,{children:[n.jsx(V,{kind:"eval",state:Ce(w),showLabel:!0,className:"an-verdict-badge",size:16}),w.humanOk&&n.jsxs("span",{className:"an-okd","data-tip":m("annotator.okBy",{by:w.humanOk.by,at:new Date(w.humanOk.ts).toLocaleString()}),children:[n.jsx(G,{name:"circle-check",size:14})," ",m("annotator.okd")]}),C&&C.length>1&&(()=>{const s=C.length,t=Math.min(xe,s),l=F<xe?Array.from({length:t},(k,$)=>t-1-$):[F,...Array.from({length:xe-1},(k,$)=>xe-2-$)],u=new Set(l),g=C.map((k,$)=>({...k,idx:$})).filter(k=>!u.has(k.idx));return n.jsxs("div",{className:"an-ab",children:[n.jsx(be,{icon:"chevron-left",size:13,className:"an-ab-nav",disabled:F>=C.length-1,onClick:()=>te(k=>Math.min(C.length-1,k+1)),label:m("annotator.abOlder")}),g.length>0&&n.jsx(dn,{hidden:g,total:s,histIdx:F,onPick:te}),n.jsx("div",{className:"an-ab-track",children:l.map(k=>{const $=C[k],Q=Ce($);return n.jsx("button",{type:"button",className:`an-ab-pip ${k===F?"on":""}`,"aria-current":k===F?"true":void 0,onClick:()=>te(k),"aria-label":`${s-k}/${s} · ${m(`score.${Q}`)} · ${new Date($.ts).toLocaleString()}`,children:n.jsx(V,{kind:"eval",state:Q,size:13})},`${$.ts}-${k}`)})}),n.jsx(be,{icon:"chevron-right",size:13,className:"an-ab-nav",disabled:F<=0,onClick:()=>te(k=>Math.max(0,k-1)),label:m("annotator.abNewer")}),n.jsx("span",{className:"an-ab-pos",children:F===0?m("annotator.abLatest"):m("annotator.abPos",{i:C.length-F,n:C.length})})]})})()]}),Ss=n.jsxs(n.Fragment,{children:[n.jsxs(Z,{label:m("detail.sideReading"),children:[w.evaluator&&n.jsx(Y,{text:w.evaluator}),n.jsx(Y,{text:new Date(w.ts).toLocaleString()})]}),n.jsx(Z,{label:m("detail.sideNode"),children:n.jsx(Y,{text:e.node,mono:!0,tip:f?m("session.issuesFocusNode"):e.node,onClick:f?()=>f(e.node):null})}),Ue&&n.jsx(Z,{label:m("detail.sideFiler"),children:n.jsx(Vs,{originator:Ue,sessions:p,kind:"eval",onOpenSession:x})}),w.humanOk&&n.jsxs(Z,{label:m("detail.sideOk"),children:[n.jsx(Y,{text:`☑ ${w.humanOk.by}`}),n.jsx(Y,{text:new Date(w.humanOk.ts).toLocaleString(),dim:!0})]}),!w.fresh&&(((Ge=w.staleAxes)==null?void 0:Ge.length)??0)>0&&n.jsxs(Z,{label:m("nodeView.eval.staleLabel"),children:[n.jsx(Y,{text:w.staleAxes.join(" · "),tip:m("nodeView.eval.staleReadoutTitle")}),(((Je=w.codeDrift)==null?void 0:Je.length)??0)>0&&n.jsx(Y,{text:w.codeDrift.map(s=>`${s.file.split("/").pop()} +${s.behind}`).join(", "),dim:!0})]}),(h.prev.length>0||h.next.length>0)&&n.jsx(Z,{label:m("detail.sideQueue"),children:[["prev",m("detail.queuePrev")],["next",m("detail.queueNext")]].map(([s,t])=>h[s].length>0&&n.jsxs("div",{className:"ds-queue-group",children:[n.jsx("span",{className:"ds-queue-group-label",children:t}),h[s].map(l=>n.jsxs("a",{className:"ds-queue-row",href:l.href,"data-tip":`${l.node} · ${l.scenario}`,children:[n.jsx(V,{kind:"eval",state:l.state,size:13}),n.jsx("span",{className:"ds-queue-scenario",children:l.scenario}),n.jsx("span",{className:"ds-queue-node",children:l.node})]},l.key))]},s))})]}),Rs=n.jsx(_s,{onSend:(s,t)=>Fs({node:e.node,scenario:e.scenario,body:s,codeSha:w.codeSha,evidence:t}),specs:o,sessions:p,focusId:e.node,onDone:d,anchorNow:H?ks:null,draft:c,commands:Ns},xs);return n.jsxs(Fe,{title:e.scenario,titleMeta:n.jsx("span",{className:"an-node",children:e.node}),status:$s,side:Ss,composer:Rs,listHref:j,backHref:S,backLabel:L,children:[w.expected&&n.jsxs("div",{className:"an-expected",children:[n.jsx("b",{children:m("nodeView.eval.expected")})," ",w.expected]}),ae.length>0&&((Ze=w.verdict)==null?void 0:Ze.note)&&n.jsxs("div",{className:"an-expected an-prior-note",children:[n.jsx("b",{children:m("nodeView.eval.noteLabel")})," ",w.verdict.note]}),q&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"an-player",ref:R,children:[n.jsxs("div",{className:`an-stage ${oe?"playing":"paused"}`,ref:E,onMouseDown:js,onMouseMove:Es,onMouseUp:Ls,children:[n.jsx("video",{className:"an-video",ref:b,src:ke(`/api/evidence/${q.hash}`),preload:"metadata",playsInline:!0}),le&&n.jsx("div",{className:"an-rect live",style:{left:`${le.x}%`,top:`${le.y}%`,width:`${le.w}%`,height:`${le.h}%`}}),!oe&&!v&&n.jsx("div",{className:"an-bigplay","aria-hidden":!0,children:n.jsx(G,{name:"play",size:22})})]}),n.jsxs("div",{className:"an-bar",children:[n.jsx(be,{icon:oe?"pause":"play",size:14,className:"an-play",label:m(oe?"annotator.pause":"annotator.play"),onClick:ve}),n.jsxs("div",{className:"an-seek",ref:y,onMouseDown:gs,onMouseMove:ys,onMouseLeave:()=>Ne(null),children:[n.jsx("div",{className:"an-seek-trk"}),X>0&&P==="time"&&M.map((s,t)=>n.jsx("div",{className:"an-band",style:{left:`${s.at/X*100}%`},"data-tip":s.step},`band-${t}`)),n.jsx("div",{className:"an-seek-play",ref:_}),X>0&&z.map(s=>n.jsx("button",{type:"button",className:`an-mk ${ce===s.i?"on":""} ${Ie===s.i?"active":""}`,style:{left:`${s.tMs/X*100}%`},"data-tip":s.label,onMouseDown:t=>t.stopPropagation(),onClick:t=>{t.stopPropagation(),He(s.i,s.tMs)}},`mk-${s.i}`)),n.jsx("div",{className:"an-knob",ref:se}),Me!=null&&X>0&&n.jsx("div",{className:"an-seek-hov",style:{left:`${Me}%`},children:we(Me/100*X)})]}),n.jsx("span",{className:"an-time",ref:ne}),me&&n.jsx("span",{className:"an-curstep","data-tip":me.node?`→ ${me.node}`:void 0,children:me.step}),n.jsx(qs,{target:R})]})]}),M.length>0&&n.jsx(os,{events:M,axis:P,extent:qe,activeStepIdx:je,onSeek:J}),K&&n.jsx("div",{className:"an-flash",children:K})]}),!q&&M.length>0&&n.jsx(os,{events:M,axis:P,extent:qe,activeStepIdx:je,onSeek:J}),ue.length>0&&n.jsx("div",{className:"an-gallery",children:ue.map((s,t)=>n.jsx(as,{e:s,alt:e.scenario},`${s.hash}-${t}`))}),ws.map((s,t)=>n.jsx(as,{e:s,alt:e.scenario,collapsed:H||ue.length>0},`${s.hash}-${t}`)),ae.length===0&&((We=w.verdict)!=null&&We.note?n.jsx("pre",{className:"eval-transcript",children:w.verdict.note}):n.jsx("div",{className:"an-hint",children:m("nodeView.eval.noImage")})),n.jsx(mn,{entry:e,comments:Se,seekMs:H?J:null,selIdx:ce,activeIdx:Ie,onSelect:H?He:null,events:H?M:null,onWrite:d})]})}function mn({entry:e,comments:a,seekMs:i,selIdx:o,activeIdx:p,onSelect:d,events:x,onWrite:f}){var S;const j=B();return n.jsxs("section",{className:"an-thread",children:[n.jsx("div",{className:"an-comments-head",children:n.jsx("span",{children:j("annotator.comments",{n:a.length})})}),n.jsx(Xs,{replies:a,onSeek:i,selIdx:o,activeIdx:p,onSelect:d,events:x,threadId:((S=e.thread)==null?void 0:S.id)??null,onRemarkChange:()=>f==null?void 0:f("")})]})}const pe=new Map;function cs(e,a){if(!(e!=null&&e.evalRevision)||!(a!=null&&a.epoch))return!0;const i=e.evalRevision;return i.epoch!==a.epoch||i.generation<a.generation?!1:i.generation!==a.generation?!0:!(a.revision&&i.content!==a.revision||a.value&&(!e.summary||["measured","total","pass","fail","review","blind","unknown"].some(p=>e.summary[p]!==a.value[p])))}function us(e,a,i){const o=`${i||""}\0${e}\0${a}`;if(pe.has(o))return pe.get(o);const p=new URLSearchParams({node:e,scenario:a});i&&p.set("scope",i);const d=fetch(ke(`/api/evals/detail?${p}`),{cache:"no-store"}).then(x=>x.ok?x.json():x.status===404?!1:Promise.reject(new Error(`HTTP ${x.status}`))).finally(()=>pe.delete(o));return pe.set(o,d),d}function vn(e,a,i,o=!0){const p=String(e||"").indexOf("/"),d=p>0?e.slice(0,p):e,x=p>0?e.slice(p+1):"",f=`${a||""}\0${d}\0${x}`,[j,S]=r.useState({identity:"",data:null,error:null}),L=r.useRef(0),h=r.useRef(i);h.current=i;const m=r.useCallback(()=>{if(!o||!d||!x)return Promise.resolve();const E=++L.current;return S(y=>y.identity===f?{...y,error:null}:{identity:f,data:null,error:null}),us(d,x,a).then(async y=>{if(E===L.current){if(y&&!cs(y,h.current)){const R=await us(d,x,a);if(E!==L.current)return;if(R&&!cs(R,h.current))throw new Error("stale session eval detail");y=R}S({identity:f,data:y,error:null})}}).catch(y=>{if(E!==L.current)return;const R=y instanceof Error?y.message:String(y);S(I=>({identity:f,data:I.identity===f&&I.data?I.data:!1,error:R}))})},[o,f,d,x,a]);r.useEffect(()=>{o&&m()},[o,d,x,a,i==null?void 0:i.epoch,i==null?void 0:i.generation,i==null?void 0:i.revision]);const b=j.identity===f?j:{data:null,error:null};return{data:b.data,error:b.error,reload:m}}function fn({sessionId:e}){const i=B()("sessionEval.scopeDoor");return n.jsx("a",{className:"se-door",href:ge(en(e)),"data-tip":i,"aria-label":i,children:n.jsx(G,{name:"arrow-left",size:16})})}function xn({sessionId:e,pageData:a,loading:i,error:o,sessions:p,queryText:d,onQueryText:x,hrefFor:f,hrefForPage:j,notice:S}){const L=B(),h=(a==null?void 0:a.unknown)||0,m=e&&!i&&!o&&((a==null?void 0:a.sourceTotal)??0)===0?L("sessionEval.none"):null,b=e?n.jsxs("div",{className:"se-gates",children:[n.jsx(fn,{sessionId:e}),a&&a.gates.map(E=>n.jsxs("span",{className:`se-gate ${E.ok?"ok":"bad"}`,"data-tip":E.detail,children:[n.jsx(G,{name:E.ok?"check":"x",size:11})," ",E.label]},E.label)),h>0&&n.jsxs("span",{className:"se-gate bad","data-tip":L("sessionEval.unknownCoverage",{n:h}),children:[n.jsx(G,{name:"info",size:11})," ",h]}),a&&n.jsx("span",{className:"se-acts",children:n.jsx("a",{className:"se-export",href:ke(`/api/sessions/${encodeURIComponent(e)}/evals?format=html`),target:"_blank",rel:"noreferrer","data-tip":L("sessionEval.exportTitle"),"aria-label":L("sessionEval.export"),children:n.jsx(G,{name:"download",size:13})})})]}):null;return n.jsx(an,{pageData:a,loading:i,sessions:p,queryText:d,onQueryText:x,hrefFor:f,notice:S,leading:b,error:o?L("sessionEval.loadFailed",{reason:o}):null,empty:m,pagination:a?{page:a.page,pageCount:a.pageCount,prev:a.prev,next:a.next,hrefFor:j}:null})}function pn({param:e,detail:a,sessionId:i,loading:o=!1,error:p,specs:d,sessions:x,listHref:f,backHref:j,backLabel:S,onOpenSession:L,onFocusNode:h,onWrite:m,notice:b}){const E=B(),y=e.indexOf("/"),R=y>0?e.slice(0,y):e,I=y>0?e.slice(y+1):null,M=r.useMemo(()=>{const P=v=>({key:ms(v),node:v.node,scenario:v.scenario,state:v.state,href:ge(i?Ae(i,v.node,v.scenario):hs(v.node,v.scenario))}),O=(a==null?void 0:a.neighbors)||{prev:[],next:[]};return{prev:O.prev.map(P),next:O.next.map(P)}},[a==null?void 0:a.neighbors,i]);if(p)return n.jsx(Fe,{failure:E("sessionEval.loadFailed",{reason:p}),listHref:f,listLabel:E("reviewShell.backToEvals")});if(o)return n.jsx("div",{className:"fv-note",children:E("common.loading")});const A=(a==null?void 0:a.selected)||null;return A?n.jsxs("div",{className:"page-detail-stack",children:[b&&n.jsx("div",{className:"fv-notice",children:b}),n.jsx(hn,{entry:A,history:a.history,sourceKey:i||"project",specs:d,sessions:x,onOpenSession:L,onFocusNode:h,onWrite:m,listHref:f,backHref:j,backLabel:S,queue:M})]}):n.jsx(Fe,{missing:E("reviewShell.evalNotFound",{node:R,scenario:I||""}),listHref:f,listLabel:E("reviewShell.backToEvals")})}function yn({specs:e=[],sessions:a=[],reloadBoard:i,onOpenSession:o,onFocusNode:p=null}){var K;const d=B(),{param:x,query:f}=Qs(),j=D(f.q||"","scope")||null,S=((K=a.find(N=>N.id===j))==null?void 0:K.evalSummary)||null,L=vn(x,j,S,!!x),h=String(f.q??"").trim()||ie,m=Ys(f.page),b=Ds("evals",h,m,{enabled:!x,refreshKey:e}),[E,y]=r.useState(""),R=N=>{N&&(y(N),setTimeout(()=>y(""),6e3))},I=async N=>{R(N),await(i==null?void 0:i()),await L.reload()},M=N=>ge(j?Ae(j,N.node,N.scenario):hs(N.node,N.scenario)),A=j?ge(Ae(j)):ls("evals"),P=Gs("evals",j),O=d("detail.backToEvals"),v=N=>Js("evals",null,{query:Zs(N,ie)}),T=N=>ls("evals",null,Ws(h,ie,N));return x?n.jsx(pn,{param:x,detail:L.data&&L.data!==!1?L.data:null,sessionId:j,loading:L.data===null,error:L.error,specs:e,sessions:a,listHref:A,backHref:P,backLabel:O,onOpenSession:o,onFocusNode:p,onWrite:I,notice:E}):n.jsx(xn,{sessionId:j,pageData:b.data,loading:b.loading,error:b.error,sessions:a,queryText:f.q||"",onQueryText:v,hrefFor:M,hrefForPage:T,notice:E})}export{pn as EvalDetailPage,fn as EvalScopeDoor,xn as EvalsListPage,yn as default,cs as detailMatchesProjection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as P,r as v,j as s,Z as Y,$ as z,a0 as Q,I as U,a1 as G,a2 as V}from"./index-DmWbmvCq.js";import{k as X,at as I,ap as Z,d as J,aj as D,r as T,au as W,ao as ee,ai as se,af as R,ag as C,ah as te,X as _,aq as ne,u as ie,a3 as M,a4 as oe,av as le,a5 as ae,as as re,a6 as ce,a7 as ue,n as de,ar as fe,C as pe,aw as me,O as ve,U as xe,a8 as be}from"./SessionWindow-CuDO_67z.js";import{M as ge}from"./Modal-DHMzSFJ4.js";import"./PageScroll-C15adEYI.js";const ye=e=>e.status!=="open",je=e=>{const r=Math.max(0,(Date.now()-new Date(e).getTime())/1e3);return Number.isFinite(r)?r<3600?`${Math.max(1,Math.floor(r/60))}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`:""},we=e=>{const r=String(e||"").split("#"),l=r.length>1?r.at(-1):r[0];return`#${l.length>16?`${l.slice(0,13)}…`:l}`},he=["is","state","store","author","node","session"],A=(e,r,l,f=u=>u)=>{var u,o;return(((o=(u=e==null?void 0:e.facets)==null?void 0:u[r])==null?void 0:o.options)??[]).map(a=>({value:a.value,label:a.value===""?l:f(a.value)}))};function Se({data:e,loading:r,error:l,reload:f,specs:u,sessions:o,query:a,notice:c,flash:d}){var $,B,q,O;const i=P(),[p,x]=v.useState(!1);if(ie(p,()=>x(!1)),e&&!e.enabled)return s.jsx("div",{className:"fv-note",children:i("session.issuesOff")});const b=Array.isArray(e==null?void 0:e.items)?e.items:[],g=String(a.q??"").trim()||I,w=n=>de("issues",null,{query:fe(n,I)}),y=(n,F)=>w(be(g,n,F)),L=(((B=($=e==null?void 0:e.facets)==null?void 0:$.store)==null?void 0:B.options)??[]).map(n=>n.value).filter(Boolean),N=Array.isArray(e==null?void 0:e.stores)&&e.stores.length?e.stores:[{id:"local",label:"local",kind:"local"}],h=b,m=((q=e==null?void 0:e.counts)==null?void 0:q.open)||0,S=((O=e==null?void 0:e.counts)==null?void 0:O.closed)||0,t=M(g,"state"),j=h.map(n=>{var K,H;const F=n.status||"open";return{key:n.id,href:T("issues",n.id),content:s.jsx(s.Fragment,{children:s.jsx(oe,{state:s.jsx(_,{kind:"issue",state:F}),title:n.concern,meta:s.jsxs(s.Fragment,{children:[s.jsx("span",{"data-tip":n.id,children:we(n.id)}),n.by&&s.jsx("span",{"data-tip":n.by,children:i("reviewList.openedBy",{by:le(n.by)})}),n.created&&s.jsx("span",{children:i("reviewList.openedAt",{at:je(n.created)})})]}),aside:s.jsxs(s.Fragment,{children:[(((K=n.replies)==null?void 0:K.length)??0)>0&&s.jsxs("span",{className:"rl-comments","data-tip":i("session.issuesReplies",{n:n.replies.length}),children:[s.jsx(U,{name:"message-square",size:14}),n.replies.length]}),L.length>1&&s.jsx("span",{className:`rl-tag fv-store-${n.store==="local"?"local":"forge"}`,children:n.store}),((H=n.nodes)==null?void 0:H[0])&&s.jsx("span",{className:"rl-tag node",children:n.nodes[0]})]})})})}}),k={label:i("reviewList.facetStore"),value:M(g,"store"),options:A(e,"store",i("reviewList.all"))},E={label:i("reviewList.facetSession"),value:M(g,"session"),options:A(e,"session",i("reviewList.all"),n=>i(n==="present"?"reviewList.sessionPresent":"reviewList.sessionMissing"))};return s.jsx(ae,{notice:c,loading:r,error:l,title:i("reviewList.issuesTitle"),action:s.jsxs("button",{type:"button",className:"rl-new",onClick:()=>x(!0),children:[s.jsx(U,{name:"plus",size:14}),i("session.issuesNew")]}),search:{value:String(a.q??"").trim()?a.q:I,onSubmit:w,placeholder:i("reviewList.searchIssues"),label:i("reviewList.search"),keys:he,suggest:{author:A(e,"author",i("reviewList.all")).filter(n=>n.value),node:A(e,"node",i("reviewList.all")).filter(n=>n.value)}},sections:[{key:"open",label:i("reviewList.open"),count:m,active:t===""||t==="open",onSelect:()=>y("state","open")},{key:"closed",label:i("reviewList.closed"),count:S,active:t!==""&&t!=="open",onSelect:()=>y("state","closed")}],facets:s.jsx(ue,{label:k.label,value:k.value,options:k.options,clearLabel:i("reviewList.all"),onChange:n=>y("store",n),mobile:!0}),secondaryFilters:s.jsx(ce,{label:i("reviewList.filters"),clearLabel:i("reviewList.all"),groups:[{label:E.label,value:E.value,active:!!E.value,options:E.options,onChange:n=>y("session",n)}]}),rows:j,pagination:e?{page:e.page,pageCount:e.pageCount,prev:e.prev,next:e.next,hrefFor:n=>T("issues",null,re(g,I,n))}:null,empty:{hasData:((e==null?void 0:e.sourceTotal)??0)>0,dataset:i("session.issuesEmpty"),filtered:i("session.issuesNoMatch")},children:p&&s.jsx(ge,{title:i("session.issuesNew"),closeLabel:i("common.close"),onClose:()=>x(!1),className:"fv-new-modal",children:s.jsx(Ie,{specs:u,sessions:o,stores:N,onCancel:()=>x(!1),onDone:async n=>{x(!1),d(n),await(f==null?void 0:f())}})})})}function Le({issue:e,specs:r,sessions:l,onFocusNode:f,onOpenSession:u,onWrite:o,notice:a}){const c=P(),d=e.store==="local",i=ye(e),[p,x]=v.useState(""),[b,g]=v.useState(""),w=Array.isArray(e.nodes)?e.nodes:[],y=Array.isArray(e.replies)?e.replies:[],L=e.status||"open",N=(m,S)=>async()=>{if(!p){x(m);try{const t=await S();t!=null&&t.ok?(g(""),await(o==null?void 0:o(""))):g((t==null?void 0:t.error)||`${m} failed`)}finally{x("")}}},h=(m,S,t,j)=>s.jsx("button",{type:"button",className:`fv-close-issue fv-life-${m}`,disabled:!!p,"data-tip":j,onMouseDown:k=>k.preventDefault(),onClick:N(m,t),children:p===m?c("session.issuesActing"):S});return s.jsxs(D,{title:e.concern,backHref:ne("issues"),backLabel:c("detail.backToIssues"),status:s.jsx(_,{kind:"issue",state:L,showLabel:!0,className:"ds-status-pill",size:16}),side:s.jsxs(s.Fragment,{children:[s.jsx(R,{label:c("detail.sideIssue"),children:s.jsx(C,{text:e.id,mono:!0})}),s.jsxs(R,{label:c("detail.sideStore"),children:[s.jsx(C,{text:e.store,className:`fv-store fv-store-${d?"local":"forge"}`}),e.url&&s.jsx(C,{text:c("session.issuesOpenOnStore",{store:Ce(e.store)}),href:e.url,external:!0})]}),e.by&&s.jsx(R,{label:c("detail.sideOriginator"),children:d?s.jsx(te,{originator:e.by,sessions:l,kind:"issue",onOpenSession:u}):s.jsx(C,{text:e.by,dim:!0})}),w.length>0&&s.jsx(R,{label:c("detail.sideNodes"),children:w.map(m=>s.jsx(C,{text:m,mono:!0,tip:c("session.issuesFocusNode"),onClick:()=>f==null?void 0:f(m)},m))})]}),composer:s.jsx(se,{onSend:(m,S)=>Q(e.id,m,S),specs:r,sessions:l,focusId:w[0]||null,onDone:o,actionsEnd:!i&&s.jsxs(s.Fragment,{children:[b&&s.jsx("span",{className:"fv-error",children:b}),d&&h("promote",c("session.issuesPromote"),()=>Y(e.id),c("session.issuesPromoteTitle")),h("close",c("session.issuesCloseIssue"),()=>z(e.id),c("session.issuesCloseIssueTitle"))]})},e.id),children:[a&&s.jsx("div",{className:"fv-notice",children:a}),e.body&&s.jsx("div",{className:"fvd-body",children:s.jsx(W,{body:e.body})}),s.jsx(ee,{replies:y,threadId:d?e.id:null,onRemarkChange:()=>o==null?void 0:o("")})]})}function Ne(e){const[r,l]=v.useState(null),[f,u]=v.useState(null),o=v.useRef(0),a=v.useCallback(async()=>{if(!e)return null;const c=++o.current;u(null);try{const d=await G(e);return c===o.current&&l(d),d}catch(d){return c===o.current&&(l(!1),u(d instanceof Error?d.message:String(d))),null}},[e]);return v.useEffect(()=>{l(null),u(null),e&&a()},[e,a]),{issue:r,error:f,reload:a}}function Pe({onFocusNode:e,onOpenSession:r,specs:l=[],sessions:f=[]}){const u=P(),{param:o,query:a}=X(),c=String(a.q??"").trim()||I,d=Z(a.page),i=J("issues",c,d,{enabled:!o,refreshKey:f}),p=Ne(o),[x,b]=v.useState(""),g=y=>{y&&(b(y),setTimeout(()=>b(""),6e3))},w=async y=>{g(y),await(o?p.reload():i.reload())};return o?p.issue==null?s.jsx("div",{className:"fv-note",children:u("session.issuesLoading")}):p.error?s.jsx(D,{failure:p.error,listHref:T("issues"),listLabel:u("reviewShell.backToIssues")}):p.issue===!1?s.jsx(D,{missing:u("reviewShell.issueNotFound",{id:o}),listHref:T("issues"),listLabel:u("reviewShell.backToIssues")}):s.jsx(Le,{issue:p.issue,specs:l,sessions:f,onFocusNode:e,onOpenSession:r,onWrite:w,notice:x}):s.jsx(Se,{data:i.data,loading:i.loading,error:i.error,reload:i.reload,specs:l,sessions:f,query:a,notice:x,flash:g})}const ke={github:"GitHub",gitlab:"GitLab"},Ce=e=>ke[e]||e;function Ie({specs:e,sessions:r,stores:l,onCancel:f,onDone:u}){var S;const o=P(),[a,c]=v.useState(((S=l[0])==null?void 0:S.id)||"local"),[d,i]=v.useState(""),[p,x]=v.useState(""),[b,g]=v.useState(!1),[w,y]=v.useState(""),L=v.useRef(null),{launchers:N}=pe(),h=me({inputRef:L,value:p,setValue:x,specs:e,sessions:r,launchers:N,up:!0,fixedAbove:".fv-new-modal"});v.useEffect(()=>{var t;l.some(j=>j.id===a)||c(((t=l[0])==null?void 0:t.id)||"local")},[l,a]);const m=async()=>{const t=d.trim();if(!(!t||b)){g(!0),y("");try{const j=await V({concern:t,body:p.trim()||void 0,store:a});j!=null&&j.ok?(i(""),x(""),await(u==null?void 0:u(j.outcomes||""))):y((j==null?void 0:j.error)||o("session.issuesPostFailed"))}finally{g(!1)}}};return s.jsxs("div",{className:"fv-new-form",children:[s.jsxs("label",{className:"fv-store-pick",children:[s.jsx("span",{children:o("session.issuesStoreLabel")}),s.jsx("select",{value:a,disabled:b,onChange:t=>c(t.target.value),children:l.map(t=>s.jsx("option",{value:t.id,children:t.label||t.id},t.id))})]}),s.jsx("input",{className:"fv-input",value:d,placeholder:o("session.issuesConcernPlaceholder"),disabled:b,onChange:t=>i(t.target.value)}),s.jsxs("div",{className:"fv-tawrap",children:[s.jsx(ve,{ref:L,className:"fv-textarea",rows:3,value:p,placeholder:o("session.issuesBodyPlaceholder"),disabled:b,onChange:t=>{x(t.target.value),h.sync(t.target)},onSelect:t=>h.sync(t.target),onBlur:h.close,onKeyDown:t=>{xe(t)||h.onKeyDown(t)||t.key==="Enter"&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),m())}}),h.menuEl]}),s.jsxs("div",{className:"fv-actions",children:[w&&s.jsx("span",{className:"fv-error",children:w}),s.jsx("button",{type:"button",className:"fv-cancel",disabled:b,onClick:f,children:o("common.cancel")}),s.jsx("button",{type:"button",className:"fv-post",disabled:b||!d.trim(),onClick:m,children:o(b?"session.issuesSending":"session.issuesPost")})]})]})}export{he as ISSUE_QUERY_KEYS,Le as IssueDetailPage,Se as IssuesListPage,Pe as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EvalsPage-DmiX3rdU.js","assets/index-DmWbmvCq.js","assets/index-GGIVdKwH.css","assets/SessionWindow-CuDO_67z.js","assets/PageScroll-C15adEYI.js","assets/IssuesPage-CIbVGRUJ.js","assets/Modal-DHMzSFJ4.js","assets/Settings-C_N1wX1f.js","assets/bindings-BC9vqpYU.js","assets/terminalFont-DmTPNdbU.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{u as _,r as c,d as J,e as U,j as s,s as q,_ as R}from"./index-DmWbmvCq.js";import{b as G,c as I,s as z,k as K,n as C,p as Q,q as Y,A as M,f as V,t as Z,H as W,I as X,v as ss,w as es,x as as,y as ns,R as ts,z as ls,S as L,B as is,C as cs,D as rs,F as os,J as ms}from"./SessionWindow-CuDO_67z.js";import"./PageScroll-C15adEYI.js";const O=e=>new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),A=e=>new Date(e).toLocaleDateString([],{month:"short",day:"numeric"}),F=e=>new Date(e).toDateString(),ds=(e,t)=>e!=null&&e.length===t.length&&(e.length===0||JSON.stringify(e[e.length-1])===JSON.stringify(t[t.length-1]));function us({s:e,sessions:t}){const o=_(),[m,l]=c.useState(null),[u,w]=c.useState(null),[f,h]=c.useState(""),[N,x]=c.useState(!1),[y,g]=c.useState(null),a=c.useRef(null),p=c.useRef(!0),j=c.useCallback(()=>J(e.id).then(n=>{n&&l(d=>ds(d,n.events)?d:n.events)}),[e.id]);c.useEffect(()=>{l(null),w(null),p.current=!0,j(),U(e.id).then(n=>{n&&w(n)})},[e.id,j]),c.useEffect(()=>{const n=setInterval(j,8e3);return()=>clearInterval(n)},[j]),c.useEffect(()=>{j()},[e.status,e.note,j]);const i=()=>{const n=a.current;n&&(p.current=n.scrollHeight-n.scrollTop-n.clientHeight<48)};c.useEffect(()=>{const n=a.current;n&&p.current&&(n.scrollTop=n.scrollHeight)},[m]);const S=async()=>{const n=f.trim();if(!n||N)return;x(!0),g(null);const d=await q(e.id,n,{replyVia:"note"});x(!1),d.ok?(h(""),j()):g(d.error||o("mobile.sendFailed"))},E=n=>{if(!n)return o("mobile.you");const d=t.find(k=>k.id===n);return d?z(d):n.slice(0,8)},b=[];let T=null;for(const[n,d]of(m||[]).entries())if(F(d.ts)!==T&&(T=F(d.ts),b.push(s.jsx("div",{className:"m-day",children:A(d.ts)},`d${n}`))),d.kind==="status"){const k=d.display||d.status;b.push(s.jsxs("div",{className:"m-ev",children:[s.jsxs("div",{className:"m-ev-head",children:[s.jsx("span",{className:"m-ev-glyph",style:{color:I[k]},children:G[k]||"·"}),s.jsx("span",{className:"m-ev-word",style:{color:I[k]},children:o(`status.${k}`)}),s.jsx("span",{className:"m-ev-time",children:O(d.ts)})]}),d.note&&s.jsx("div",{className:"m-ev-note",children:d.note})]},n))}else b.push(s.jsxs("div",{className:"m-ev m-ev-sent",children:[s.jsxs("div",{className:"m-ev-head",children:[s.jsx("span",{className:"m-ev-from",children:E(d.from)}),s.jsx("span",{className:"m-ev-time",children:O(d.ts)})]}),s.jsx("div",{className:"m-ev-text",children:d.text})]},n));const P=e.liveness==="offline"||e.status==="offline";return s.jsxs("div",{className:"tl-chat",children:[s.jsxs("div",{className:"m-timeline",ref:a,onScroll:i,children:[(u==null?void 0:u.prompt)&&s.jsxs("details",{className:"m-ev m-ev-prompt",children:[s.jsxs("summary",{children:[o("mobile.asked"),e.created?` · ${A(e.created)} ${O(e.created)}`:""]}),s.jsx("div",{className:"m-ev-text",children:u.prompt})]}),m===null?s.jsx("div",{className:"m-empty",children:o("common.loading")}):b.length===0?s.jsx("div",{className:"m-empty",children:o("mobile.noEvents")}):b]}),P&&s.jsx("div",{className:"m-offline",children:o("mobile.offlineHint")}),y&&s.jsx("div",{className:"m-senderr",children:y}),s.jsx("div",{className:"m-composer",children:s.jsxs("div",{className:"m-composer-line",children:[s.jsx("textarea",{className:"m-input",rows:1,placeholder:o("mobile.inputPlaceholder"),value:f,onChange:n=>h(n.target.value)}),s.jsx("button",{className:"m-send",disabled:!f.trim()||N,onClick:S,children:o("mobile.send")})]})})]})}const hs=c.lazy(()=>R(()=>import("./EvalsPage-DmiX3rdU.js"),__vite__mapDeps([0,1,2,3,4]))),xs=c.lazy(()=>R(()=>import("./IssuesPage-CIbVGRUJ.js"),__vite__mapDeps([5,1,2,3,4,6]))),bs=c.lazy(()=>R(()=>import("./Settings-C_N1wX1f.js"),__vite__mapDeps([7,1,2,8,4,9]))),ps={spec:"nodeView.paneSpec",history:"nodeView.paneHistory",issues:"nodeView.paneIssues",eval:"nodeView.paneEval",edit:"nodeView.paneEdit"},H=(e,t)=>t.filter(o=>{var m;return(m=o.ops)==null?void 0:m.some(l=>l.nodeId===e.id)});function $({status:e}){const t=L[e]||L.pending;return s.jsx("span",{className:"m-dot",style:{background:t.color}})}function js({node:e,kids:t,editors:o,onTap:m}){return s.jsxs("button",{className:"m-row",onClick:m,children:[s.jsx($,{status:e.status}),s.jsx("span",{className:"m-row-title",children:e.title}),o.length>0&&s.jsx("span",{className:"m-row-faces",children:o.slice(0,3).map(l=>s.jsx(M,{seed:l.id,status:l.status,title:V(l)},l.id))}),e.version?s.jsxs("span",{className:"m-row-ver",children:["v",e.version]}):null,t>0&&s.jsxs("span",{className:"m-row-kids",children:["▸",t]}),s.jsx("span",{className:"m-row-chev",children:"›"})]})}function vs({node:e,childrenOf:t,sessions:o,onOpenChild:m}){const l=_(),u=t(e.id),w=Q(e),f=[...u.length?[{key:"children",label:l("mobile.childrenTab",{n:u.length})}]:[],...w.map(i=>({key:i.key,label:l(ps[i.key])}))],[h,N]=c.useState(null),[x,y]=c.useState({issues:{},eval:{}});c.useEffect(()=>{N(null),y({issues:{},eval:{}})},[e.id]);const g=(i,S)=>y(E=>({...E,[i]:is(E[i],S)})),a=h&&f.some(i=>i.key===h)?h:f[0].key,p=Y(e.id,a==="history"),j=H(e,o);return s.jsxs("div",{className:"m-node",children:[s.jsxs("div",{className:"m-node-head",children:[s.jsx($,{status:e.status}),s.jsx("span",{className:"m-node-title",children:e.title}),e.version?s.jsxs("span",{className:"m-node-ver",children:["v",e.version]}):null,s.jsx("span",{className:"m-node-status",children:l(`status.${e.status}`)}),j.length>0&&s.jsx("span",{className:"m-node-faces",title:l("mobile.liveEditors",{n:j.length}),children:j.map(i=>s.jsx(M,{seed:i.id,status:i.status,title:V(i)},i.id))})]}),e.desc&&s.jsx("div",{className:"m-node-desc",children:e.desc}),s.jsx("div",{className:"m-tabs",children:f.map(i=>s.jsx("button",{className:i.key===a?"m-tab on":"m-tab",onClick:()=>N(i.key),children:i.label},i.key))}),s.jsxs("div",{className:a==="history"?"m-pane-host fixed":"m-pane-host",children:[a==="children"&&s.jsx("div",{className:"m-children",children:u.map(i=>s.jsx(js,{node:i,kids:t(i.id).length,editors:H(i,o),onTap:()=>m(i.id)},i.id))}),a==="spec"&&s.jsx(Z,{node:e}),a==="history"&&s.jsx(W,{node:e,rows:p}),a==="issues"&&s.jsx(X,{node:e,sessions:o,filter:x.issues,onFilter:i=>g("issues",i)}),a==="eval"&&s.jsx(ss,{node:e,sessions:o,filter:x.eval,onFilter:i=>g("eval",i)}),a==="edit"&&s.jsx(es,{node:e})]})]})}function fs({s:e,sessions:t,onBack:o}){const m=_();return s.jsxs("div",{className:"m-sessdetail chat",children:[s.jsxs("div",{className:"m-sess-card",children:[s.jsx("button",{className:"m-sess-back",onClick:o,"aria-label":m("mobile.back"),children:"‹"}),s.jsxs("div",{className:"m-sess-meta",children:[s.jsx("span",{className:"m-sess-name",children:z(e)}),s.jsxs("span",{className:"m-sess-status",style:{color:I[e.status]},children:[m(`status.${e.status}`),e.merges?` · ×${e.merges}`:""," · ",s.jsx("span",{className:"m-sess-id8",children:e.id.slice(0,8)})]})]}),s.jsx("a",{className:"m-sess-evalbtn",href:rs(os(e.id)),title:m("sessionEval.btnTitle"),children:m("sessionEval.btn")})]}),s.jsx(us,{s:e,sessions:t})]})}function Ns({draft:e,setDraft:t,onBack:o,onLaunched:m}){const l=_(),{launchers:u,launcher:w,pickLauncher:f}=cs(),[h,N]=c.useState(!1),[x,y]=c.useState(null),g=async()=>{const a=e.trim();if(!a||h)return;N(!0),y(null);const p=await ms(a,w);N(!1),p.ok?(t(""),m()):y(p.error||l("mobile.launchFailed"))};return s.jsxs("div",{className:"m-sessdetail m-new",children:[s.jsxs("div",{className:"m-sess-card",children:[s.jsx("button",{className:"m-sess-back",onClick:o,"aria-label":l("mobile.back"),children:"‹"}),s.jsx("div",{className:"m-sess-meta",children:s.jsx("span",{className:"m-sess-name",children:l("mobile.newSession")})})]}),s.jsxs("div",{className:"m-new-body",children:[s.jsx("textarea",{className:"m-input m-new-input",rows:5,placeholder:l("mobile.newPlaceholder"),value:e,onChange:a=>t(a.target.value)}),u.length>0&&s.jsxs("label",{className:"m-new-launcher",children:[s.jsx("span",{className:"m-new-launcher-label",children:l("session.launcherLabel")}),s.jsx("select",{className:"m-new-launcher-select",value:w,onChange:a=>f(a.target.value),children:u.map(a=>s.jsx("option",{value:a.name,children:a.name},a.name))})]}),x&&s.jsx("div",{className:"m-senderr",children:x}),s.jsx("button",{className:"m-send m-new-go",disabled:!e.trim()||h,onClick:g,children:l(h?"mobile.launching":"mobile.launch")})]})]})}function gs({specs:e,sessions:t,openId:o,setOpenId:m,creating:l,setCreating:u,newDraft:w,setNewDraft:f}){const h=_(),N=o?t.find(a=>a.id===o):null,{expanded:x,toggle:y}=as(),g=c.useMemo(()=>ns(t,a=>x.has(a)),[t,x]);return l?s.jsx(Ns,{draft:w,setDraft:f,onBack:()=>u(!1),onLaunched:()=>u(!1)}):N?s.jsx(fs,{s:N,sessions:t,onBack:()=>m(null)}):s.jsxs("div",{className:"m-sesslist",children:[s.jsxs("button",{className:"m-new-btn",onClick:()=>u(!0),children:[s.jsx("span",{className:"m-new-btn-plus",children:"+"}),h("mobile.newSession")]}),!t.length&&s.jsx("div",{className:"m-empty big",children:h("mobile.noSessions")}),g.map(a=>{if(a.type==="zone")return s.jsx("div",{className:"m-zone",children:h(`sessionZone.${a.zone}`)},`z-${a.zone}`);const p=a.s,j=a.expandable||a.depth?s.jsx(ts,{guides:a.guides,expandable:a.expandable,expanded:a.expanded,rollup:a.rollup,kin:a.kin,onToggle:()=>y(p.id)}):null;return s.jsx("button",{className:"m-sess-row",onClick:()=>m(p.id),children:s.jsx(ls,{s:p,locked:!1,showAvatar:!1,lead:j})},p.id)})]})}function ks({specs:e,sessions:t,reloadBoard:o}){const m=_(),l=c.useMemo(()=>Object.fromEntries(e.map(r=>[r.id,r])),[e]),u=c.useMemo(()=>e.find(r=>!r.parent)||e[0],[e]),w=c.useMemo(()=>{const r={};return e.forEach(v=>{var D;v.parent&&(r[D=v.parent]??(r[D]=[])).push(v)}),v=>r[v]||[]},[e]),[f,h]=c.useState("specs"),[N,x]=c.useState(()=>u?[u.id]:[]),[y,g]=c.useState(null),[a,p]=c.useState(!1),[j,i]=c.useState(""),{page:S,param:E}=K(),b=S==="evals"||S==="issues"||S==="settings"?S:f;c.useEffect(()=>{S==="sessions"&&E&&(h("sessions"),g(E))},[S,E]);const T=r=>{if(r==="evals"||r==="issues"){C(r);return}h(r),(S==="evals"||S==="issues"||S==="settings")&&C(r==="specs"?"graph":"sessions")},P=r=>{h("sessions"),g(r),C("sessions",r)},n=N.filter(r=>l[r]),d=n[n.length-1]||(u==null?void 0:u.id),k=d?l[d]:null,B=r=>x(v=>[...v.filter(D=>l[D]),r]);return s.jsxs("div",{className:"m-app",children:[s.jsx("main",{className:"m-main",children:b==="evals"||b==="issues"||b==="settings"?s.jsx("div",{className:"m-review",children:s.jsx(c.Suspense,{fallback:s.jsx("div",{className:"m-empty",children:m("common.loading")}),children:b==="settings"?s.jsx(bs,{}):b==="evals"?s.jsx(hs,{specs:e,sessions:t,reloadBoard:o,onOpenSession:P,onFocusNode:r=>{h("specs"),x([u.id,r].filter(v=>l[v])),C("graph")}}):s.jsx(xs,{specs:e,sessions:t,onOpenSession:P,onFocusNode:r=>{h("specs"),x([u.id,r].filter(v=>l[v])),C("graph")}})})}):b==="specs"?s.jsxs("div",{className:"m-specs",children:[s.jsx("nav",{className:"m-crumbs",children:n.map((r,v)=>s.jsxs("span",{className:"m-crumb",children:[v>0&&s.jsx("span",{className:"m-crumb-sep",children:"›"}),s.jsx("button",{className:v===n.length-1?"m-crumb-btn cur":"m-crumb-btn",onClick:()=>x(n.slice(0,v+1)),children:l[r].title})]},r))}),k&&s.jsx(vs,{node:k,childrenOf:w,sessions:t,onOpenChild:B},k.id)]}):s.jsx(gs,{specs:e,sessions:t,openId:y,setOpenId:g,creating:a,setCreating:p,newDraft:j,setNewDraft:i})}),s.jsxs("nav",{className:"m-tabbar",children:[s.jsxs("button",{className:b==="specs"?"m-tabbar-btn on":"m-tabbar-btn",onClick:()=>T("specs"),children:[s.jsx("span",{className:"m-tabbar-ico",children:"❯_"}),m("mobile.specsTab")]}),s.jsxs("button",{className:b==="sessions"?"m-tabbar-btn on":"m-tabbar-btn",onClick:()=>T("sessions"),children:[s.jsx("span",{className:"m-tabbar-ico",children:"◐"}),m("mobile.sessionsTab"),t.length>0&&s.jsx("span",{className:"m-tabbar-badge",children:t.length})]}),s.jsxs("button",{className:b==="evals"?"m-tabbar-btn on":"m-tabbar-btn",onClick:()=>T("evals"),children:[s.jsx("span",{className:"m-tabbar-ico",children:"✓"}),m("mobile.evalsTab")]}),s.jsxs("button",{className:b==="issues"?"m-tabbar-btn on":"m-tabbar-btn",onClick:()=>T("issues"),children:[s.jsx("span",{className:"m-tabbar-ico",children:"◎"}),m("mobile.issuesTab")]})]})]})}export{ks as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,i as o}from"./index-DmWbmvCq.js";function r({title:a,closeLabel:d,onClose:l,className:s,children:n}){return e.jsx("div",{className:"legend-backdrop","data-focus-overlay":!0,onClick:l,children:e.jsxs("div",{className:s?`legend ${s}`:"legend",role:"dialog","aria-modal":"true","aria-label":a,onClick:i=>i.stopPropagation(),children:[e.jsxs("div",{className:"legend-head",children:[e.jsx("span",{className:"legend-title",children:a}),e.jsx(o,{icon:"x",size:13,className:"legend-close",label:d,onClick:l})]}),e.jsx("div",{className:"legend-body",children:n})]})})}export{r as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as h,j as L}from"./index-DmWbmvCq.js";const w="spex.page-scroll:",T=()=>typeof window>"u"?"":`${window.location.pathname}${window.location.search}${window.location.hash}`,$=n=>{try{return Number(sessionStorage.getItem(`${w}${n}`))||0}catch{return 0}},p=(n,r)=>{try{sessionStorage.setItem(`${w}${n}`,String(r))}catch{}};function A({className:n="",scrollKey:r=T(),children:g,...E}){const f=h.useRef(null);return h.useLayoutEffect(()=>{const e=f.current;if(!e)return;const o=$(r);let i=o,c=o>0,u=0,t=0,a;const m=()=>{c=!1,t&&cancelAnimationFrame(t),t=0,a==null||a.disconnect()},l=()=>{if(t=0,!c)return;const v=Math.max(0,e.scrollHeight-e.clientHeight);if(e.scrollTop=Math.min(o,v),v<o){u=0;return}if(Math.abs(e.scrollTop-o)>1){u=0,t=requestAnimationFrame(l);return}i=e.scrollTop,p(r,i),++u<2?t=requestAnimationFrame(l):m()},d=()=>{c||(i=e.scrollTop,p(r,i))},s=()=>{m(),d()};return e.scrollTop=o,c&&(a=new MutationObserver(()=>{t||(t=requestAnimationFrame(l))}),a.observe(e,{childList:!0,subtree:!0,characterData:!0}),t=requestAnimationFrame(l)),e.addEventListener("scroll",d,{passive:!0}),e.addEventListener("pointerdown",s,!0),e.addEventListener("wheel",s,{passive:!0,capture:!0}),e.addEventListener("keydown",s,!0),()=>{e.removeEventListener("scroll",d),e.removeEventListener("pointerdown",s,!0),e.removeEventListener("wheel",s,!0),e.removeEventListener("keydown",s,!0),m(),p(r,i)}},[r]),L.jsx("div",{ref:f,className:`page-scroll${n?` ${n}`:""}`,...E,children:g})}export{A as P};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as T,r,q as O,t as $,C as J,j as e,v as M,I as L,b as A,w as _,x as q,P as K,i as F,p as U,y as B,z as V,A as Q,B as W,D as X,E as Y,F as Z,G as ee,H as se,J as te,K as ae,L as oe}from"./index-DmWbmvCq.js";import{M as re}from"./Modal-DHMzSFJ4.js";import{P as ne}from"./PageScroll-C15adEYI.js";const R=["claude","codex","opencode","pi"];function D({onSet:t,onClear:l,placeholder:s,busy:o,t:n}){const[a,b]=r.useState("");return e.jsxs("form",{className:"proj-drawer proj-pw",onSubmit:d=>{d.preventDefault(),a&&(t(a),b(""))},children:[e.jsx("input",{className:"proj-add-path",type:"password",value:a,onChange:d=>b(d.target.value),placeholder:s,"aria-label":s}),e.jsx("button",{className:"proj-act primary",type:"submit",disabled:!a||o,children:n("projects.passwordSet")}),e.jsx("button",{className:"proj-act",type:"button",disabled:o,onClick:l,children:n("projects.passwordClear")})]})}function ce({onAdded:t,onClose:l,t:s}){const[o,n]=r.useState(""),[a,b]=r.useState(null),[d,p]=r.useState(!0),[i,y]=r.useState(!1),[g,m]=r.useState(null),[S,f]=r.useState(""),[C,v]=r.useState(!1),[P,h]=r.useState(!1),[c,N]=r.useState([]),x=r.useCallback(async j=>{if(i)return;p(!0),m(null),f("");const k=await V(j);if(p(!1),!k.ok){m(k.error==="network"?s("projects.actionFailed"):k.error);return}b(k),n(k.path),v(!1),h(!1),N([])},[i,s]);r.useEffect(()=>{x("")},[]),r.useEffect(()=>{const j=k=>{k.key==="Escape"&&!i&&l()};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[i,l]);const I=!!a&&o===a.path,z=I&&!a.gitRoot,G=I&&!a.initialized,u=I&&!d&&!i&&!a.cataloged&&(!z||C)&&(!P||!!c.length),w=j=>N(k=>k.includes(j)?k.filter(H=>H!==j):[...k,j]),E=async j=>{if(j.preventDefault(),!u)return;y(!0),m(null),f("");const k=await Z(a.path,{...z?{initGit:C}:{},...G&&P?{init:{harness:c.join(",")}}:{}});if(y(!1),k.ok){t(k.project);return}m(k.error==="network"?s("projects.actionFailed"):k.error),f(k.output||"")};return e.jsx(re,{title:s("projects.addTitle"),closeLabel:s("common.close"),onClose:()=>{i||l()},className:"proj-add-modal",children:e.jsxs("form",{className:"proj-add-flow",onSubmit:E,children:[e.jsxs("div",{className:"proj-add-pathbar",children:[e.jsx(F,{icon:"arrow-left",size:14,className:"proj-act icon",label:s("projects.browseParent"),disabled:!(a!=null&&a.parent)||d||i,onClick:()=>x(a.parent)}),e.jsx("button",{type:"button",className:"proj-act icon proj-home-btn","data-tip":s("projects.browseHome"),"aria-label":s("projects.browseHome"),disabled:!(a!=null&&a.home)||d||i,onClick:()=>x(a.home),children:"~"}),e.jsx("input",{className:"proj-add-path",value:o,autoFocus:!0,spellCheck:!1,onChange:j=>{n(j.target.value),m(null)},onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),o.trim()&&x(o.trim()))},placeholder:s("projects.addPlaceholder"),"aria-label":s("projects.addPlaceholder"),disabled:i}),e.jsx("button",{className:"proj-act",type:"button",disabled:!o.trim()||d||i,onClick:()=>x(o.trim()),children:s(d?"projects.browseLoading":"projects.browseGo")})]}),e.jsxs("div",{className:"proj-folder-list","aria-label":s("projects.folderList"),"aria-busy":d,children:[!d&&(a==null?void 0:a.entries.map(j=>e.jsxs("button",{type:"button",className:"proj-folder-row",onClick:()=>x(j.path),disabled:i,children:[e.jsx(L,{name:"chevron-right",size:13}),e.jsx("span",{className:"proj-folder-name",children:j.name}),j.git&&e.jsx("span",{className:"proj-folder-tag",children:"Git"}),j.initialized&&e.jsx("span",{className:"proj-folder-tag spex",children:"SpexCode"})]},j.path))),!d&&a&&!a.entries.length&&e.jsx("div",{className:"proj-folder-empty",children:s("projects.folderEmpty")}),d&&e.jsx("div",{className:"proj-folder-empty",children:s("projects.browseLoading")})]}),I&&e.jsxs("div",{className:"proj-add-options",children:[e.jsx("div",{className:"proj-add-selected",title:a.path,children:a.path}),a.gitRoot?e.jsxs("div",{className:"proj-add-state",children:[e.jsx(L,{name:"check",size:13})," Git ",e.jsx("code",{children:a.gitRoot})]}):e.jsxs("label",{className:"proj-add-check",children:[e.jsx("input",{type:"checkbox",checked:C,onChange:j=>v(j.target.checked),disabled:i}),e.jsx("span",{children:s("projects.initGit")})]}),a.initialized?e.jsxs("div",{className:"proj-add-state",children:[e.jsx(L,{name:"check",size:13})," ",s("projects.spexInitialized")]}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"proj-add-check",children:[e.jsx("input",{type:"checkbox",checked:P,onChange:j=>{h(j.target.checked),f(""),m(null)},disabled:i}),e.jsx("span",{children:s("projects.initSpex")})]}),P&&e.jsxs("fieldset",{className:"proj-add-harnesses",disabled:i,children:[e.jsx("legend",{children:s("projects.harnessTargets")}),R.map(j=>e.jsxs("label",{className:"proj-add-harness",children:[e.jsx("input",{type:"checkbox",checked:c.includes(j),onChange:()=>w(j)}),e.jsx("span",{children:j})]},j))]})]}),a.cataloged&&e.jsx("div",{className:"proj-op-status ok",children:s("projects.alreadyAdded")})]}),(g||S)&&e.jsxs("div",{className:"proj-add-result",children:[g&&e.jsx("div",{className:"proj-err",children:g}),S&&e.jsx("pre",{className:"proj-log",children:S})]}),e.jsxs("div",{className:"proj-add-actions",children:[e.jsx("button",{className:"proj-act",type:"button",disabled:i,onClick:l,children:s("common.cancel")}),e.jsx("button",{className:"proj-act primary",type:"submit",disabled:!u,children:s(i?"projects.addBusy":"projects.addSubmit")})]})]})})}function ie({p:t,onRefresh:l,t:s}){const[o,n]=r.useState(null),[a,b]=r.useState(""),[d,p]=r.useState(!1),[i,y]=r.useState(null),[g,m]=r.useState(!1),[S,f]=r.useState(0),[C,v]=r.useState(t.identity.icon),[P,h]=r.useState(!1),[c,N]=r.useState(null);r.useEffect(()=>{let u=!0;return n(null),y(null),m(!1),Q(t.id).then(w=>{if(u){if(!w.ok){y(w.error==="network"?s("projects.actionFailed"):w.error);return}n({content:w.content,revision:w.revision}),b(w.content),v(t.identity.icon)}}),()=>{u=!1}},[t.id,t.identity.icon,S,s]);let x=!1;try{const u=JSON.parse(a);x=!u||typeof u!="object"||Array.isArray(u)}catch{x=!0}const I=!!o&&a!==o.content,z=async()=>{var w,E;if(!o||x||!I||d)return;p(!0),y(null),m(!1);const u=await ee(t.id,a,o.revision);if(p(!1),!u.ok){y(u.error==="network"?s("projects.actionFailed"):u.error);return}n({content:u.content,revision:u.revision}),b(u.content),m(!0);try{v(((E=(w=JSON.parse(u.content))==null?void 0:w.dashboard)==null?void 0:E.icon)||t.identity.icon)}catch{}l()},G=async u=>{if(!o||P)return!1;const w=C;v(u),h(!0),N(null),m(!1);const E=await se(t.id,u,o.revision);return h(!1),E.ok?(n({content:E.content,revision:E.revision}),b(E.content),v(E.identity.icon),m(!0),l(),!0):(v(w),N(E.error==="network"?s("projects.actionFailed"):E.error),!1)};return e.jsxs("div",{className:"proj-drawer proj-config",children:[e.jsxs("div",{className:"proj-config-head",children:[e.jsx("code",{children:"spexcode.json"}),g&&e.jsx("span",{className:"proj-op-status ok",children:s("projects.configSaved")})]}),o?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{className:x?"proj-config-editor invalid":"proj-config-editor",value:a,onChange:u=>{b(u.target.value),m(!1),y(null)},"aria-label":s("projects.configEditor"),spellCheck:!1,disabled:d}),e.jsxs("div",{className:"proj-setup-row",children:[e.jsx("button",{className:"proj-act primary",type:"button",disabled:!I||x||d,onClick:z,children:s(d?"projects.configSaving":"projects.configSave")}),e.jsx("button",{className:"proj-act",type:"button",disabled:d,onClick:()=>f(u=>u+1),children:s("projects.configReload")}),x&&e.jsx("span",{className:"proj-err",children:s("projects.configInvalid")}),i&&e.jsx("span",{className:"proj-err",children:i})]}),e.jsx(B,{value:C,onChange:G,label:s("projects.projectIcon"),editLabel:s("projects.editProjectIcon"),name:`project-icon-${t.id}`,disabled:d||P}),c&&e.jsx("span",{className:"proj-err",children:c})]}):e.jsxs("div",{className:"proj-setup-row",children:[!i&&e.jsx("span",{className:"proj-dim",children:s("projects.configLoading")}),i&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"proj-err",children:i}),e.jsx("button",{className:"proj-act",type:"button",onClick:()=>f(u=>u+1),children:s("projects.configReload")})]})]})]})}function le({p:t,busyOp:l,run:s,result:o,t:n}){const[a,b]=r.useState([]),d=p=>b(i=>i.includes(p)?i.filter(y=>y!==p):[...i,p]);return e.jsxs("div",{className:"proj-drawer proj-setup",children:[e.jsxs("div",{className:"proj-setup-row",children:[e.jsx("span",{className:"proj-dim",children:n("projects.harnessLabel")}),R.map(p=>e.jsx("button",{type:"button",className:a.includes(p)?"proj-act on":"proj-act","aria-pressed":a.includes(p),disabled:!!l,onClick:()=>d(p),children:p},p))]}),e.jsxs("div",{className:"proj-setup-row",children:[e.jsx("button",{className:"proj-act primary",type:"button",disabled:!!l||!a.length,title:a.length?void 0:n("projects.harnessRequired"),onClick:()=>s("init",()=>W(t.id,a.join(","))),children:n(l==="init"?"projects.running":"projects.init")}),e.jsx("button",{className:"proj-act",type:"button",disabled:!!l,onClick:()=>s("doctor",()=>X(t.id)),children:n(l==="doctor"?"projects.running":"projects.doctor")})]}),o&&e.jsxs("div",{className:"proj-op-result proj-full",children:[e.jsx("div",{className:o.ok?"proj-op-status ok":"proj-op-status fail",children:o.ok?n("projects.opOk",{op:n(`projects.${o.op}`)}):n("projects.opFail",{op:n(`projects.${o.op}`),code:o.code??"?"})}),o.output?e.jsx("pre",{className:"proj-log",children:o.output}):null]})]})}function de({p:t,health:l,onRefresh:s,t:o}){const[n,a]=r.useState(null),[b,d]=r.useState(!1),[p,i]=r.useState(null),[y,g]=r.useState(null),[m,S]=r.useState(null),f=t.id===K,C=t.online===!1,v=C?"stopped":l||"probing",P=async c=>{d(!0),g(null);const N=await c();d(!1),N.ok?a(null):g(N.error||o("projects.actionFailed")),s()},h=async(c,N)=>{i(c),g(null),S(null);const x=await N();i(null),c!=="serve"?S({op:c,ok:x.ok,code:x.code,output:x.output||(x.ok?"":x.error||"")}):x.ok||g(x.error||o("projects.actionFailed")),s()};return e.jsxs("li",{className:f?"proj-row current":"proj-row",children:[e.jsxs("div",{className:"proj-row-main",children:[e.jsx("span",{className:`proj-health h-${v}`,"data-tip":o(`projects.health.${v}`)}),e.jsx(A,{icon:t.identity.icon,size:26}),e.jsx("span",{className:"proj-name",children:t.identity.title}),t.gated&&e.jsx(L,{name:"lock",size:12,className:"proj-locked"}),f&&e.jsx("span",{className:"proj-tag",children:o("projects.current")}),e.jsx("span",{className:"proj-path",title:t.id,children:t.root||t.id}),e.jsxs("span",{className:"proj-actions",children:[e.jsx(F,{icon:"settings",label:o("projects.configTitle"),className:n==="config"?"proj-act icon on":"proj-act icon",size:13,onClick:()=>{a(c=>c==="config"?null:"config"),g(null)}}),e.jsx(F,{icon:"terminal",label:o("projects.setupTitle"),className:n==="setup"?"proj-act icon on":"proj-act icon",size:13,onClick:()=>{a(c=>c==="setup"?null:"setup"),g(null)}}),e.jsx(F,{icon:"lock",label:o("projects.passwordTitle"),className:n==="pw"?"proj-act icon on":"proj-act icon",size:13,onClick:()=>{a(c=>c==="pw"?null:"pw"),g(null)}}),C?e.jsx("button",{className:"proj-act primary",type:"button",disabled:!!p,onClick:()=>h("serve",()=>te(t.id)),children:o(p==="serve"?"projects.startBusy":"projects.start")}):e.jsx("a",{className:"proj-act primary",href:U(t.id),children:o("projects.open")})]})]}),y&&e.jsx("div",{className:"proj-err",children:y}),n==="pw"&&e.jsx(D,{t:o,busy:b,placeholder:o("projects.passwordPlaceholder"),onSet:c=>P(()=>oe(t.id,c)),onClear:()=>P(()=>ae(t.id))}),n==="config"&&e.jsx(ie,{p:t,onRefresh:s,t:o}),n==="setup"&&e.jsx(le,{p:t,busyOp:p,run:h,result:m,t:o})]})}function je({gateway:t,onRefresh:l,t:s}){const[o,n]=r.useState(t.identity.icon),[a,b]=r.useState(!1),[d,p]=r.useState(null);r.useEffect(()=>{n(t.identity.icon)},[t.identity.icon]);const i=async y=>{if(a||!t.revision)return!1;const g=o;n(y),b(!0),p(null);const m=await Y(y,t.revision);return b(!1),m.ok?(n(m.gateway.identity.icon),l(),!0):(n(g),p(m.error==="network"?s("projects.actionFailed"):m.error),!1)};return e.jsxs("div",{className:"proj-gateway-identity",children:[e.jsx(B,{value:o,onChange:i,label:s("projects.gatewayIcon"),editLabel:s("projects.editGatewayIcon"),name:"gateway-icon",fallback:"gateway",disabled:a||!t.revision}),d&&e.jsx("span",{className:"proj-err",children:d})]})}function he(){const t=T(),[l,s]=r.useState({kind:"loading"}),[o,n]=r.useState({}),[a,b]=r.useState(null),[d,p]=r.useState(!1),[i,y]=r.useState(!1),[g,m]=r.useState(null),S=r.useRef(0),f=r.useCallback(async()=>{const h=++S.current,c=await O();h===S.current&&(c.state==="ok"?(s({kind:"ok",adminGated:c.adminGated,gateway:c.gateway,projects:c.projects}),c.projects.filter(N=>N.online!==!1).forEach(N=>{$(N.id).then(x=>{h===S.current&&n(I=>({...I,[N.id]:x}))})})):c.state==="denied"?s({kind:"denied",reason:c.reason}):s(N=>N.kind==="ok"?N:{kind:"absent"}))},[]);r.useEffect(()=>{f();const h=setInterval(f,J),c=()=>{document.hidden||f()};return document.addEventListener("visibilitychange",c),()=>{clearInterval(h),document.removeEventListener("visibilitychange",c)}},[f]);const C=async h=>{y(!0),m(null);const c=await h();y(!1),c.ok?b(null):m(c.error||t("projects.actionFailed")),f()},v=l.kind==="loading"?e.jsx("div",{className:"loading",children:t("hud.loading")}):l.kind==="denied"?e.jsx(M,{scope:"admin",locked:l.reason==="locked",onUnlocked:f}):l.kind==="absent"?e.jsx("div",{className:"proj-empty",children:e.jsx("p",{children:t("projects.absent")})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"proj-head",children:[e.jsx("span",{className:"proj-count",children:t("projects.count",{n:l.projects.length})}),e.jsxs("button",{className:d?"proj-act on":"proj-act",onClick:()=>p(!0),children:[e.jsx(L,{name:"plus",size:12})," ",t("projects.add")]}),e.jsxs("button",{className:a==="admin"?"proj-act on":"proj-act",onClick:()=>{b(h=>h==="admin"?null:"admin"),m(null)},children:[e.jsx(L,{name:"lock",size:12})," ",t("projects.adminPassword")]})]}),!l.adminGated&&e.jsx("div",{className:"proj-hint",children:t("projects.adminUngated")}),a==="admin"&&e.jsxs("div",{className:"proj-admin-pw",children:[e.jsx(D,{t,busy:i,placeholder:t("projects.adminPasswordPlaceholder"),onSet:h=>C(()=>q(h)),onClear:()=>C(()=>_())}),g&&e.jsx("div",{className:"proj-err",children:g})]}),l.projects.length?e.jsx("ul",{className:"proj-list",children:l.projects.map(h=>e.jsx(de,{p:h,health:o[h.id],onRefresh:f,t},h.id))}):e.jsx("div",{className:"proj-empty",children:e.jsx("p",{children:t("projects.empty")})}),e.jsx("div",{className:"proj-page-details","aria-label":t("projects.gatewaySettings"),children:e.jsx(je,{gateway:l.gateway,onRefresh:f,t})})]}),P=l.kind==="ok"?l.gateway.identity:{icon:"gateway"};return e.jsxs("div",{className:"page-pane page-projects",children:[e.jsx(ne,{className:"page-projects-scroll",children:e.jsxs("div",{className:"proj-body",children:[e.jsxs("div",{className:"cred-brand proj-brand",children:[e.jsx(A,{icon:P.icon,fallback:"gateway",size:30}),e.jsx("span",{children:"$ spexcode"})]}),e.jsx("h1",{className:"page-title",children:t("projects.title")}),v]})}),d&&e.jsx(ce,{t,onClose:()=>p(!1),onAdded:()=>{p(!1),f()}})]})}export{he as default};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
3
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
4
|
+
* https://github.com/chjj/term.js
|
|
5
|
+
* @license MIT
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in
|
|
15
|
+
* all copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
* THE SOFTWARE.
|
|
24
|
+
*
|
|
25
|
+
* Originally forked from (with the author's permission):
|
|
26
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
27
|
+
* http://bellard.org/jslinux/
|
|
28
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
29
|
+
* The original design remains. The terminal itself
|
|
30
|
+
* has been extended to include xterm CSI codes, among
|
|
31
|
+
* other features.
|
|
32
|
+
*/.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}
|