spexcode 0.2.1 → 0.2.2
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 +147 -103
- package/README.zh-CN.md +123 -88
- package/package.json +1 -1
- package/spec-cli/bin/spex.mjs +24 -1
- package/spec-cli/src/attach.ts +50 -0
- package/spec-cli/src/cli.ts +214 -62
- package/spec-cli/src/client.ts +47 -9
- package/spec-cli/src/{self.ts → doctor.ts} +26 -25
- package/spec-cli/src/guide.ts +63 -11
- package/spec-cli/src/harness.ts +48 -19
- package/spec-cli/src/help.ts +137 -49
- package/spec-cli/src/index.ts +31 -11
- package/spec-cli/src/issues.ts +48 -21
- package/spec-cli/src/layout.ts +4 -4
- package/spec-cli/src/localIssues.ts +44 -60
- package/spec-cli/src/materialize.ts +4 -2
- package/spec-cli/src/mentions.ts +22 -1
- package/spec-cli/src/pty-bridge.ts +39 -4
- package/spec-cli/src/ranker.ts +31 -12
- package/spec-cli/src/search.bench.mjs +30 -7
- package/spec-cli/src/search.ts +39 -0
- package/spec-cli/src/sessions.ts +149 -62
- package/spec-cli/src/specs.ts +16 -4
- package/spec-cli/src/supervise.ts +30 -6
- package/spec-cli/src/tree.ts +118 -0
- package/spec-cli/templates/hooks/post-merge +2 -2
- package/spec-cli/templates/hooks/pre-commit +34 -15
- package/spec-cli/templates/hooks/prepare-commit-msg +8 -1
- package/spec-dashboard/dist/assets/Dashboard-BwZ2KzxB.js +27 -0
- package/spec-dashboard/dist/assets/Dashboard-C5ap-Sga.css +1 -0
- package/spec-dashboard/dist/assets/EvalsPage-DV75EdP4.js +3 -0
- package/spec-dashboard/dist/assets/FoldToggle-GwE0-k1d.js +1 -0
- package/spec-dashboard/dist/assets/IssuesPage-B17pnl9I.js +1 -0
- package/spec-dashboard/dist/assets/MobileApp-WEZbR8M1.js +1 -0
- package/spec-dashboard/dist/assets/SessionInterface-DYP7pi_n.css +32 -0
- package/spec-dashboard/dist/assets/SessionInterface-Sh8kHpnj.js +71 -0
- package/spec-dashboard/dist/assets/SessionWindow-EzFq-hLG.js +9 -0
- package/spec-dashboard/dist/assets/Settings-Dgtg-Xb9.js +1 -0
- package/spec-dashboard/dist/assets/index-CCmnCbKS.css +1 -0
- package/spec-dashboard/dist/assets/index-Dd0_U5rk.js +41 -0
- package/spec-dashboard/dist/index.html +2 -2
- package/spec-yatsu/src/cli.ts +89 -15
- package/spec-yatsu/src/scenariofresh.ts +100 -30
- package/spec-dashboard/dist/assets/index-Ct_ubwrd.css +0 -32
- package/spec-dashboard/dist/assets/index-DehTZ-h9.js +0 -145
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{u as he,r as s,s as qe,j as n,e as We,f as Ye}from"./index-Dd0_U5rk.js";import{V as Ge,W as Ze,X as Je,Y as Ce,Z as Qe,g as ie,n as et,_ as J,$ as tt,a0 as Ae,a1 as nt,a2 as st,u as at,z as ce,a3 as lt,o as ot,a4 as rt}from"./SessionWindow-EzFq-hLG.js";import{F as ue}from"./FoldToggle-GwE0-k1d.js";const de=(l,v)=>{let m=null;for(const N of l)if(N.tMs<=v)m=N;else break;return m},fe=l=>{var v,m;return((v=l.verdict)==null?void 0:v.status)==="pass"?"✓":((m=l.verdict)==null?void 0:m.status)==="fail"?"✗":"·"},Ie=l=>{var v,m;return((v=l.verdict)==null?void 0:v.status)==="pass"?"pass":((m=l.verdict)==null?void 0:m.status)==="fail"?"fail":"legacy"};function it({entry:l,specs:v=[],sessions:m=[],onWrite:N,onOpenSession:R}){var Se,Re,Te,Le,De;const c=he(),f=s.useRef(null),p=s.useRef(null),j=s.useRef(null),w=s.useRef(null),x=s.useRef(0),[u,M]=s.useState([]),[i,g]=s.useState(null),[y,b]=s.useState(""),[E,B]=s.useState(!1),[T,A]=s.useState(null),I=s.useRef(null),P=s.useRef(null),L=s.useRef(null),d=s.useRef(0),[Q,me]=s.useState(0),[ve,pe]=s.useState(-1),[xe,ge]=s.useState(null),[_,ee]=s.useState(!1),[ye,te]=s.useState(!1),[ne,se]=s.useState(null),[q,ae]=s.useState(null),[k,be]=s.useState(null),[D,W]=s.useState(0),h=k&&k[D]||l;s.useEffect(()=>{g(null),b(""),M([]),A(null),W(0),be(null);let e=!0;return fetch(qe(l.node,"evals")).then(t=>t.ok?t.json():null).then(t=>{e&&Array.isArray(t==null?void 0:t.readings)&&be(t.readings.filter(a=>a.scenario===l.scenario))}).catch(()=>{}),()=>{e=!1}},[l.node,l.scenario,l.ts,l.blob]),s.useEffect(()=>{g(null),A(null)},[D]);const O=Ge(h),V=O.find(e=>e.kind==="video"&&e.state==="present"),je=O.filter(e=>e.kind==="image"),Fe=O.filter(e=>e.kind==="transcript"),C=!!V,X=l.thread??null,le=s.useMemo(()=>X?[{by:X.by,at:X.created,body:X.body},...X.replies||[]]:[],[X]),Ke=k&&((Se=k[0])==null?void 0:Se.by)||l.by||null,$=s.useMemo(()=>le.map((e,t)=>{const a=Ze(Je(e.body),u);return a&&a.seekable?{i:t,tMs:a.tMs,step:a.step,label:a.label}:null}).filter(Boolean).sort((e,t)=>e.tMs-t.tMs),[le,u]),we=s.useRef(u);we.current=u;const Me=s.useRef($);Me.current=$;const Y=s.useCallback(()=>{const e=d.current,t=we.current;let a=-1;for(let r=0;r<t.length&&t[r].tMs<=e;r++)a=r;pe(r=>r===a?r:a);let o=null;for(const r of Me.current)if(r.tMs<=e)o=r.i;else break;ge(r=>r===o?r:o)},[]);s.useEffect(()=>{Y()},[$,u,Y]),s.useEffect(()=>{d.current=0,I.current&&(I.current.style.width="0%"),P.current&&(P.current.style.left="0%"),L.current&&(L.current.textContent=""),pe(-1),ge(null),me(0),ee(!1),te(!1),se(null),ae(null)},[l.blob,l.scenario,l.node]),s.useEffect(()=>{if(M([]),!h.timelineBlob||!C)return;let e=!0;return fetch(`/api/yatsu/blob/${h.timelineBlob}`).then(t=>t.ok?t.json():null).then(t=>{e&&Array.isArray(t==null?void 0:t.events)&&M(t.events)}).catch(()=>{}),()=>{e=!1}},[h.timelineBlob,C]),s.useEffect(()=>{const e=f.current;if(!e)return;const t=()=>{const S=Math.round((e.currentTime||0)*1e3),F=Math.round((e.duration||0)*1e3);d.current=S;const K=F?S/F*100:0;I.current&&(I.current.style.width=`${K}%`),P.current&&(P.current.style.left=`${K}%`),L.current&&(L.current.textContent=`${J(S)} / ${J(F)}`),Y()},a=()=>{me(e.duration||0),t()},o=()=>ee(!0),r=()=>ee(!1);return e.addEventListener("timeupdate",t),e.addEventListener("seeked",t),e.addEventListener("loadedmetadata",a),e.addEventListener("durationchange",a),e.addEventListener("play",o),e.addEventListener("pause",r),a(),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("seeked",t),e.removeEventListener("loadedmetadata",a),e.removeEventListener("durationchange",a),e.removeEventListener("play",o),e.removeEventListener("pause",r)}},[V==null?void 0:V.hash,l.node,l.scenario,D,Y]);const z=Math.round(Q*1e3),G=u[ve]||null,U=s.useCallback(e=>{const t=f.current;t&&(t.currentTime=e/1e3)},[]),Z=s.useCallback(()=>{const e=f.current;e&&(e.paused?e.play():e.pause())},[]),ke=(e,t)=>{ae(e),t!=null&&U(t)},Be=s.useCallback(()=>{var t,a;const e=Math.round((((t=f.current)==null?void 0:t.currentTime)??0)*1e3);return{tMs:e,step:((a=de(u,e))==null?void 0:a.step)??null}},[u]),Ne=s.useCallback(()=>{const e=f.current;if(!e)return;e.pause();const t=Math.round((e.currentTime||0)*1e3),a=de(u,t),o=[Ce(t,a==null?void 0:a.step)];a!=null&&a.node&&a.node!==l.node&&o.push(`re: [[${a.node}]]`),o.push(""),A({seq:++x.current,body:o.join(`
|
|
2
|
+
`)})},[u,l.node]),oe=s.useCallback(e=>{var o;if(!$.length)return;let t=$.findIndex(r=>r.i===q);if(t<0){const r=Math.round((((o=f.current)==null?void 0:o.currentTime)||0)*1e3);t=$.reduce((S,F,K)=>F.tMs<=r?K:S,-1)}t=Math.min($.length-1,Math.max(0,t+e));const a=$[t];ae(a.i),U(a.tMs)},[$,q,U]);s.useEffect(()=>{if(!C)return;const e=t=>{const a=document.activeElement;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.tagName==="SELECT"||a.isContentEditable))return;const o=f.current;o&&(t.key===" "?(t.preventDefault(),Z()):t.key==="ArrowRight"?(t.preventDefault(),o.currentTime=Math.min(o.duration||o.currentTime,o.currentTime+(t.shiftKey?1:5))):t.key==="ArrowLeft"?(t.preventDefault(),o.currentTime=Math.max(0,o.currentTime-(t.shiftKey?1:5))):t.key===","?(t.preventDefault(),o.currentTime=Math.max(0,o.currentTime-1/30)):t.key==="."?(t.preventDefault(),o.duration&&(o.currentTime=Math.min(o.duration,o.currentTime+1/30))):t.key==="ArrowDown"?(t.preventDefault(),oe(1)):t.key==="ArrowUp"?(t.preventDefault(),oe(-1)):(t.key==="a"||t.key==="A")&&(t.preventDefault(),Ne()))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[C,Z,oe,Ne]);const Ee=e=>{var o;const t=(o=j.current)==null?void 0:o.getBoundingClientRect(),a=f.current;!t||!t.width||!a||!a.duration||(a.currentTime=Math.min(1,Math.max(0,(e-t.left)/t.width))*a.duration)},Ve=e=>{e.preventDefault(),te(!0),Ee(e.clientX)},Xe=e=>{var a;const t=(a=j.current)==null?void 0:a.getBoundingClientRect();t!=null&&t.width&&se(Math.min(100,Math.max(0,(e.clientX-t.left)/t.width*100)))};s.useEffect(()=>{if(!ye)return;const e=a=>Ee(a.clientX),t=()=>te(!1);return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[ye]);const $e=e=>{const t=p.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*100,y:(e.clientY-t.top)/t.height*100}},ze=e=>{if(e.button!==0||E)return;const t=$e(e);g({x0:t.x,y0:t.y,x:t.x,y:t.y})},Oe=e=>{var a,o;if(!i)return;const t=$e(e);!((a=f.current)!=null&&a.paused)&&(Math.abs(t.x-i.x0)>1||Math.abs(t.y-i.y0)>1)&&((o=f.current)==null||o.pause()),g({...i,x:t.x,y:t.y})},Ue=async e=>{const t=f.current;if(!(t!=null&&t.videoWidth))return;const a=Math.round((t.currentTime??0)*1e3),o=de(u,a);B(!0),b(c("annotator.capturing"));try{const r=document.createElement("canvas");r.width=t.videoWidth,r.height=t.videoHeight;const S=r.getContext("2d");S.drawImage(t,0,0,r.width,r.height),S.strokeStyle="#ff9a3c",S.lineWidth=Math.max(2,r.width/300),S.strokeRect(e.x/100*r.width,e.y/100*r.height,e.w/100*r.width,e.h/100*r.height);const F=await new Promise(_e=>r.toBlob(_e,"image/png")),{hash:K}=await We(F);if(!K)throw new Error("no hash");const re=[Ce(a,o==null?void 0:o.step),``];o!=null&&o.node&&o.node!==l.node&&re.push(`re: [[${o.node}]]`),re.push(""),A({seq:++x.current,body:re.join(`
|
|
3
|
+
`)}),b("")}catch{b(c("annotator.failed"))}finally{B(!1)}},He=()=>{if(!i)return;const e={x:Math.min(i.x0,i.x),y:Math.min(i.y0,i.y),w:Math.abs(i.x-i.x0),h:Math.abs(i.y-i.y0)};if(g(null),e.w<1&&e.h<1){Z();return}Ue(e)},H=i&&{x:Math.min(i.x0,i.x),y:Math.min(i.y0,i.y),w:Math.abs(i.x-i.x0),h:Math.abs(i.y-i.y0)};return n.jsxs("div",{className:"an-detail",children:[n.jsxs("header",{className:"an-head",children:[n.jsx("span",{className:"an-title",children:l.scenario}),n.jsx("span",{className:"an-node",children:l.node}),n.jsx("span",{className:`an-verdict-badge ${Ie(h)}`,children:fe(h)}),h.evaluator&&n.jsx("span",{className:"an-meta",children:h.evaluator}),n.jsx("span",{className:"an-meta",children:new Date(h.ts).toLocaleString()}),n.jsx(Qe,{originator:Ke,sessions:m,kind:"eval",onOpenSession:R}),k&&k.length>1&&n.jsxs("div",{className:"an-ab",children:[n.jsx(ie,{icon:"chevron-left",size:13,className:"an-ab-nav",disabled:D>=k.length-1,onClick:()=>W(e=>Math.min(k.length-1,e+1)),label:c("annotator.abOlder")}),n.jsx("div",{className:"an-ab-track",children:k.slice().reverse().map((e,t)=>{const a=k.length-1-t;return n.jsx("button",{type:"button",className:`an-ab-pip ${Ie(e)} ${a===D?"on":""}`,onClick:()=>W(a),"data-tip":`${fe(e)} ${new Date(e.ts).toLocaleString()}`,children:fe(e)},`${e.ts}-${a}`)})}),n.jsx(ie,{icon:"chevron-right",size:13,className:"an-ab-nav",disabled:D<=0,onClick:()=>W(e=>Math.max(0,e-1)),label:c("annotator.abNewer")}),n.jsx("span",{className:"an-ab-pos",children:D===0?c("annotator.abLatest"):c("annotator.abPos",{i:k.length-D,n:k.length})})]})]}),n.jsxs("div",{className:"an-work",children:[n.jsxs("div",{className:"an-stage-col",children:[h.expected&&n.jsxs("div",{className:"an-expected",children:[n.jsx("b",{children:c("nodeView.eval.expected")})," ",h.expected]}),O.length>0&&((Re=h.verdict)==null?void 0:Re.note)&&n.jsxs("div",{className:"an-expected an-prior-note",children:[n.jsx("b",{children:c("nodeView.eval.noteLabel")})," ",h.verdict.note]}),!h.fresh&&(((Te=h.staleAxes)==null?void 0:Te.length)??0)>0&&n.jsxs("div",{className:"an-expected an-stale","data-tip":c("nodeView.eval.staleReadoutTitle"),children:[n.jsx("b",{children:c("nodeView.eval.staleLabel")})," ",h.staleAxes.join(" · "),(((Le=h.codeDrift)==null?void 0:Le.length)??0)>0&&n.jsxs("span",{className:"an-stale-files",children:[" — ",h.codeDrift.map(e=>`${e.file.split("/").pop()} +${e.behind}`).join(", ")]})]}),V&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"an-player",ref:w,children:[n.jsxs("div",{className:`an-stage ${_?"playing":"paused"}`,ref:p,onMouseDown:ze,onMouseMove:Oe,onMouseUp:He,children:[n.jsx("video",{className:"an-video",ref:f,src:`/api/yatsu/blob/${V.hash}`,preload:"metadata",playsInline:!0}),H&&n.jsx("div",{className:"an-rect live",style:{left:`${H.x}%`,top:`${H.y}%`,width:`${H.w}%`,height:`${H.h}%`}}),!_&&!i&&n.jsx("div",{className:"an-bigplay","aria-hidden":!0,children:n.jsx(et,{name:"play",size:22})})]}),n.jsxs("div",{className:"an-bar",children:[n.jsx(ie,{icon:_?"pause":"play",size:14,className:"an-play",label:c(_?"annotator.pause":"annotator.play"),onClick:Z}),n.jsxs("div",{className:"an-seek",ref:j,onMouseDown:Ve,onMouseMove:Xe,onMouseLeave:()=>se(null),children:[n.jsx("div",{className:"an-seek-trk"}),z>0&&u.map((e,t)=>n.jsx("div",{className:"an-band",style:{left:`${e.tMs/z*100}%`},"data-tip":e.step},`band-${t}`)),n.jsx("div",{className:"an-seek-play",ref:I}),z>0&&$.map(e=>n.jsx("button",{type:"button",className:`an-mk ${q===e.i?"on":""} ${xe===e.i?"active":""}`,style:{left:`${e.tMs/z*100}%`},"data-tip":e.label,onMouseDown:t=>t.stopPropagation(),onClick:t=>{t.stopPropagation(),ke(e.i,e.tMs)}},`mk-${e.i}`)),n.jsx("div",{className:"an-knob",ref:P}),ne!=null&&z>0&&n.jsx("div",{className:"an-seek-hov",style:{left:`${ne}%`},children:J(ne/100*z)})]}),n.jsx("span",{className:"an-time",ref:L}),G&&n.jsx("span",{className:"an-curstep","data-tip":G.node?`→ ${G.node}`:void 0,children:G.step}),n.jsx(tt,{target:w})]})]}),u.length>0&&n.jsx("div",{className:"an-ruler",children:u.map((e,t)=>n.jsxs("button",{className:`an-step ${ve===t?"on":""}`,onClick:()=>U(e.tMs),"data-tip":e.node?`→ ${e.node}`:void 0,children:[J(e.tMs)," ",e.step]},t))}),n.jsx("div",{className:"an-hint",children:c("annotator.hint")}),n.jsx("div",{className:"an-keys",children:c("annotator.keys")}),y&&n.jsx("div",{className:"an-flash",children:y})]}),je.length>0&&n.jsx("div",{className:"an-gallery",children:je.map((e,t)=>n.jsx(Ae,{e,alt:l.scenario},`${e.hash}-${t}`))}),Fe.map((e,t)=>n.jsx(Ae,{e,alt:l.scenario},`${e.hash}-${t}`)),O.length===0&&((De=h.verdict)!=null&&De.note?n.jsx("pre",{className:"eval-transcript",children:h.verdict.note}):n.jsx("div",{className:"an-hint",children:c("nodeView.eval.noImage")}))]}),n.jsx(ct,{entry:l,comments:le,specs:v,sessions:m,onWrite:N,codeSha:h.codeSha,seekMs:C?U:null,anchorNow:C?Be:null,draft:T,selIdx:q,activeIdx:xe,onSelect:C?ke:null,events:C?u:null})]})]})}function ct({entry:l,comments:v,codeSha:m,specs:N,sessions:R,onWrite:c,seekMs:f,anchorNow:p,draft:j,selIdx:w,activeIdx:x,onSelect:u,events:M}){var y;const i=he(),g=(b,E)=>Ye({node:l.node,scenario:l.scenario,body:b,codeSha:m,evidence:E});return n.jsxs("aside",{className:"an-rail",children:[n.jsx("div",{className:"an-comments-head",children:i("annotator.comments",{n:v.length})}),n.jsx("div",{className:"an-rail-list",children:n.jsx(nt,{replies:v,onSeek:f,selIdx:w,activeIdx:x,onSelect:u,events:M,threadId:((y=l.thread)==null?void 0:y.id)??null,onRemarkChange:()=>c==null?void 0:c("")})}),n.jsx("div",{className:"an-rail-compose",children:n.jsx(st,{onSend:g,specs:N,sessions:R,focusId:l.node,onDone:c,anchorNow:p,draft:j},`${l.node}·${l.scenario}`)})]})}function Pe({rowKeys:l,sel:v,onSel:m,detail:N,children:R}){const[c,f]=s.useState(!1),p=s.useRef({});p.current={rowKeys:l,sel:v},s.useEffect(()=>{const w=x=>{var b;const u=(b=x.target)==null?void 0:b.tagName;if(u==="INPUT"||u==="TEXTAREA"||x.metaKey||x.ctrlKey||x.altKey||x.key!=="j"&&x.key!=="k")return;x.preventDefault(),x.stopPropagation();const{rowKeys:M,sel:i}=p.current;if(!M.length)return;const g=M.indexOf(i),y=g<0?x.key==="j"?0:M.length-1:Math.max(0,Math.min(M.length-1,g+(x.key==="j"?1:-1)));m(M[y])};return window.addEventListener("keydown",w,!0),()=>window.removeEventListener("keydown",w,!0)},[m]),s.useEffect(()=>{var w;(w=document.querySelector(".fv-list-col .sel"))==null||w.scrollIntoView({block:"nearest"})},[v]);const j=n.jsx(ue,{className:"fv-fold-inline",onToggle:()=>f(!0)});return n.jsxs("div",{className:`fv-master ${c?"folded":""}`,children:[c&&n.jsx(ue,{className:"fv-unfold",folded:!0,onToggle:()=>f(!1)}),n.jsx("div",{className:"fv-list-col",style:c?{display:"none"}:void 0,children:typeof R=="function"?R(j):n.jsxs(n.Fragment,{children:[n.jsx(ue,{className:"fv-fold",onToggle:()=>f(!0)}),R]})}),n.jsx("div",{className:"fv-detail",children:N})]})}function ut({specs:l=[],sessions:v=[],reloadBoard:m,onOpenSession:N}){const R=he(),{page:c,param:f}=at(),[p,j]=s.useState(null),[w,x]=s.useState(""),[u,M]=s.useState([]),i=s.useRef([]),g=s.useMemo(()=>new Map(u.map(d=>[ce(d),d])),[u]);i.current=u.map(ce);const y=p&&g.has(p)?p:i.current[0]??null,b=s.useMemo(()=>{if(!f)return null;const d=f.indexOf("/");return d>0?`eval:${f.slice(0,d)}·${f.slice(d+1)}`:null},[f]),[E,B]=s.useState(null);s.useEffect(()=>{c==="evals"&&b&&(j(b),B(b))},[c,b]),s.useEffect(()=>{E&&g.has(E)&&B(null)},[E,g]);const T=p&&!g.has(p),A=s.useMemo(()=>!T||lt(l).some(d=>ce(d)===p),[T,l,p]);s.useEffect(()=>{T&&!A&&(j(null),B(null))},[T,A]),s.useEffect(()=>{p&&!E&&u.length&&!g.has(p)&&j(null)},[p,E,u,g]),s.useEffect(()=>{if(c!=="evals"||!y||T)return;const d=/^eval:([^·]+)·(.+)$/.exec(y);d&&ot("evals",`${d[1]}/${d[2]}`,{replace:!0})},[c,y,T]);const I=s.useCallback(d=>M(d),[]),P=d=>{d&&(x(d),setTimeout(()=>x(""),6e3))},L=y?g.get(y):null;return n.jsx(Pe,{rowKeys:i.current,sel:y,onSel:j,detail:L?n.jsx(it,{entry:L,specs:l,sessions:v,onOpenSession:N,onWrite:async d=>{P(d),await(m==null?void 0:m())}}):n.jsx("div",{className:"fv-note",children:R("evalsFeed.empty")}),children:d=>n.jsxs(n.Fragment,{children:[w&&n.jsx("div",{className:"fv-notice",children:w}),n.jsx(rt,{nodes:l,sessions:v,sel:y,onSel:Q=>j(Q),onRows:I,mustShow:E,lead:d})]})})}const mt=Object.freeze(Object.defineProperty({__proto__:null,EvalMasterDetail:Pe,default:ut},Symbol.toStringTag,{value:"Module"}));export{it as E,Pe as a,mt as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as l,j as t}from"./index-Dd0_U5rk.js";import{n as a}from"./SessionWindow-EzFq-hLG.js";function r(){return t.jsx(a,{name:"panel-left",className:"fold-toggle-icon"})}function m({className:n,folded:e,onToggle:s}){const o=l()(e?"masterList.unfold":"masterList.fold");return t.jsx("button",{type:"button",className:n,"data-tip":o,"aria-label":o,onClick:s,children:t.jsx(r,{})})}export{m as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as D,r as a,j as s,h as Y,i as W,k as ss,m as es}from"./index-Dd0_U5rk.js";import{a5 as Z,a6 as ts,g as ns,Z as ls,a7 as as,a1 as os,a2 as is,a8 as cs}from"./SessionWindow-EzFq-hLG.js";import{F as _}from"./FoldToggle-GwE0-k1d.js";import{u as rs,M as ds}from"./Dashboard-BwZ2KzxB.js";function js({onFocusNode:t,onOpenSession:k,specs:v=[],sessions:x=[],issuesData:N=null,reloadIssues:o,issueId:d=null}){const i=D(),c=N,[h,p]=a.useState(!1),[j,m]=a.useState(!1),[g,w]=a.useState(!1),[S,b]=a.useState(!1),[l,y]=a.useState("all"),[f,n]=a.useState(""),[u,L]=a.useState(null),T=a.useRef([]),G=a.useCallback(()=>o==null?void 0:o(!0),[o]),V=e=>{e&&(n(e),setTimeout(()=>n(""),6e3))},C=Array.isArray(c==null?void 0:c.issues)?c.issues:[],P=e=>e.status!=="open",B=[...new Set(C.map(e=>e.store).filter(Boolean))],J=Array.isArray(c==null?void 0:c.stores)&&c.stores.length?c.stores:[{id:"local",label:"local",kind:"local"}];a.useEffect(()=>{if(!d||!C.length)return;const e=C.find(r=>r.id===d);e&&(l!=="all"&&e.store!==l&&y("all"),P(e)&&w(!0),M(e)||b(!1),L(`issue:${e.id}`))},[d,C,l]);const K=l==="all"?C:C.filter(e=>e.store===l),M=e=>!!Z(x,e.by)||Array.isArray(e.replies)&&e.replies.some(r=>Z(x,r.by)),I=g?K:K.filter(e=>!P(e)),E=S?I.filter(M):I,F=I.filter(M).length,O=K.filter(P).length,H=a.useMemo(()=>new Map(E.map(e=>[`issue:${e.id}`,e])),[E]);T.current=E.map(e=>`issue:${e.id}`);const A=u&&H.has(u)?u:T.current[0]??null,U=a.useRef({});if(U.current={effSel:A},rs(h,()=>p(!1)),a.useEffect(()=>{const e=r=>{var X;const R=(X=r.target)==null?void 0:X.tagName;if(R==="INPUT"||R==="TEXTAREA"||r.metaKey||r.ctrlKey||r.altKey||r.key!=="j"&&r.key!=="k")return;r.preventDefault(),r.stopPropagation();const $=T.current;if(!$.length)return;const z=$.indexOf(U.current.effSel),Q=z<0?r.key==="j"?0:$.length-1:Math.max(0,Math.min($.length-1,z+(r.key==="j"?1:-1)));L($[Q])};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[]),a.useEffect(()=>{var e;(e=document.querySelector(".fv-list-col .sel"))==null||e.scrollIntoView({block:"nearest"})},[A]),c==null)return s.jsx("div",{className:"fv-note",children:i("session.issuesLoading")});if(!c.enabled)return s.jsx("div",{className:"fv-note",children:i("session.issuesOff")});const q=A?H.get(A):null;return s.jsxs("div",{className:`fv-master ${j?"folded":""}`,children:[j&&s.jsx(_,{className:"fv-unfold",folded:!0,onToggle:()=>m(!1)}),s.jsxs("div",{className:"fv-list-col",style:j?{display:"none"}:void 0,children:[f&&s.jsx("div",{className:"fv-notice",children:f}),s.jsxs("section",{className:"fv-group",children:[s.jsxs("header",{className:"fv-group-head",children:[s.jsxs("span",{className:"fv-head-row",children:[s.jsx(_,{className:"fv-fold-inline",onToggle:()=>m(!0)}),B.length>1&&s.jsx(ts,{value:l,onChange:y,options:[{value:"all",label:i("session.issuesStoreAll")},...B.map(e=>({value:e,label:e}))]}),s.jsx(ns,{icon:"plus",size:12,className:"fv-new-btn",label:i("session.issuesNew"),onClick:()=>p(!0)})]}),(F>0||O>0)&&s.jsxs("span",{className:"ef-chipbar",children:[F>0&&s.jsx("button",{type:"button",className:`ef-chip fv-live ${S?"on":""}`,onClick:()=>b(e=>!e),"data-tip":i("masterList.liveChipTitle"),children:i("masterList.liveChip",{n:F})}),O>0&&s.jsx("button",{type:"button",className:`ef-chip fv-concluded ${g?"on":""}`,onClick:()=>w(e=>!e),children:i("nodeView.closedIssues",{n:O})})]})]}),!E.length&&s.jsx("div",{className:"fv-note",children:i("session.issuesEmpty")}),E.map(e=>{var R;const r=`issue:${e.id}`;return s.jsxs("button",{className:`fv-row ${A===r?"sel":""}`,onClick:()=>L(r),children:[s.jsx("span",{className:`fv-dot st-${e.status||"open"}`,"data-tip":e.status}),s.jsx("span",{className:"fv-concern","data-tip":e.concern,children:e.concern}),(((R=e.replies)==null?void 0:R.length)??0)>0&&s.jsx("span",{className:"fv-replies","data-tip":i("session.issuesReplies",{n:e.replies.length}),children:e.replies.length}),B.length>1&&s.jsx("span",{className:`fv-store fv-store-${e.store==="local"?"local":"forge"}`,children:e.store})]},e.id)})]})]}),s.jsx("div",{className:"fv-detail",children:q?s.jsx(us,{issue:q,specs:v,sessions:x,onFocusNode:t,onOpenSession:k,onWrite:async e=>{V(e),await G()}}):s.jsx("div",{className:"fv-note",children:i("session.issuesEmpty")})}),h&&s.jsx(ds,{title:i("session.issuesNew"),closeLabel:i("common.close"),onClose:()=>p(!1),className:"fv-new-modal",children:s.jsx(ms,{specs:v,sessions:x,stores:J,onCancel:()=>p(!1),onDone:async e=>{p(!1),V(e),await G()}})})]})}function us({issue:t,specs:k,sessions:v,onFocusNode:x,onOpenSession:N,onWrite:o}){const d=D(),i=t.store==="local",c=t.status!=="open",[h,p]=a.useState(""),[j,m]=a.useState(""),g=Array.isArray(t.nodes)?t.nodes:[],w=Array.isArray(t.replies)?t.replies:[],S=(l,y)=>async()=>{if(!h){p(l);try{const f=await y();f!=null&&f.ok?(m(""),await(o==null?void 0:o(""))):m((f==null?void 0:f.error)||`${l} failed`)}finally{p("")}}},b=(l,y,f,n)=>s.jsx("button",{type:"button",className:`fv-close-issue fv-life-${l}`,disabled:!!h,"data-tip":n,onMouseDown:u=>u.preventDefault(),onClick:S(l,f),children:h===l?d("session.issuesActing"):y});return s.jsxs("div",{className:"fvd",children:[s.jsxs("div",{className:"fvd-scroll",children:[s.jsx("header",{className:"fvd-head",children:s.jsx("span",{className:"fvd-concern",children:t.concern})}),s.jsxs("div",{className:"fvd-meta",children:[t.status&&s.jsx("span",{className:`fv-status fv-st-${t.status}`,children:t.status}),s.jsx("span",{className:`fv-store fv-store-${i?"local":"forge"}`,children:t.store}),i?s.jsx(ls,{originator:t.by,sessions:v,kind:"issue",onOpenSession:N}):t.by&&s.jsx("span",{className:"fv-by",children:t.by}),g.map(l=>s.jsx("button",{type:"button",className:"fv-chip",onClick:()=>x==null?void 0:x(l),"data-tip":d("session.issuesFocusNode"),children:l},l)),t.url&&s.jsx("a",{className:"fv-link",href:t.url,target:"_blank",rel:"noreferrer",children:d("session.issuesOpenOnForge")})]}),t.body&&s.jsx("div",{className:"fvd-body",children:s.jsx(as,{body:t.body})}),s.jsx(os,{replies:w,threadId:i?t.id:null,onRemarkChange:()=>o==null?void 0:o("")})]}),s.jsx("div",{className:"fvd-compose",children:s.jsx(is,{onSend:(l,y)=>ss(t.id,l,y),specs:k,sessions:v,focusId:g[0]||null,onDone:o,actionsEnd:!c&&s.jsxs(s.Fragment,{children:[j&&s.jsx("span",{className:"fv-error",children:j}),i&&b("promote",d("session.issuesPromote"),()=>Y(t.id),d("session.issuesPromoteTitle")),b("close",d("session.issuesCloseIssue"),()=>W(t.id),d("session.issuesCloseIssueTitle"))]})},t.id)})]})}const fs=t=>t.id==="local"?"L":t.id==="github"?"GH":t.id==="gitlab"?"GL":(t.id||"?").slice(0,2).toUpperCase();function ms({specs:t,sessions:k,stores:v,onCancel:x,onDone:N}){var f;const o=D(),[d,i]=a.useState(((f=v[0])==null?void 0:f.id)||"local"),[c,h]=a.useState(""),[p,j]=a.useState(""),[m,g]=a.useState(!1),[w,S]=a.useState(""),b=a.useRef(null),l=cs({inputRef:b,value:p,setValue:j,specs:t,sessions:k,up:!0,fixedAbove:".fv-new-modal"});a.useEffect(()=>{var n;v.some(u=>u.id===d)||i(((n=v[0])==null?void 0:n.id)||"local")},[v,d]);const y=async()=>{const n=c.trim();if(!(!n||m)){g(!0),S("");try{const u=await es({concern:n,body:p.trim()||void 0,store:d});u!=null&&u.ok?(h(""),j(""),await(N==null?void 0:N(u.outcomes||""))):S((u==null?void 0:u.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:d,disabled:m,onChange:n=>i(n.target.value),children:v.map(n=>s.jsxs("option",{value:n.id,children:[fs(n)," · ",n.label||n.id]},n.id))})]}),s.jsx("input",{className:"fv-input",value:c,placeholder:o("session.issuesConcernPlaceholder"),disabled:m,onChange:n=>h(n.target.value)}),s.jsxs("div",{className:"fv-tawrap",children:[s.jsx("textarea",{ref:b,className:"fv-textarea",rows:3,value:p,placeholder:o("session.issuesBodyPlaceholder"),disabled:m,onChange:n=>{j(n.target.value),l.sync(n.target)},onSelect:n=>l.sync(n.target),onBlur:l.close,onKeyDown:n=>{l.onKeyDown(n)||n.key==="Enter"&&(n.metaKey||n.ctrlKey)&&(n.preventDefault(),y())}}),l.menuEl]}),s.jsxs("div",{className:"fv-actions",children:[s.jsx("span",{className:w?"fv-error":"fv-hint",children:w||o("session.issuesMentionHint")}),s.jsx("button",{type:"button",className:"fv-cancel",disabled:m,onClick:x,children:o("common.cancel")}),s.jsx("button",{type:"button",className:"fv-send",disabled:m||!c.trim(),onClick:y,children:o(m?"session.issuesSending":"session.issuesPost")})]})]})}export{js as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as k,r as b,j as s}from"./index-Dd0_U5rk.js";import{q as M,t as A,A as y,j as g,v as H,H as V,w as R,E as _,c as $,G as B,x as G,S}from"./SessionWindow-EzFq-hLG.js";const L={spec:"nodeView.paneSpec",history:"nodeView.paneHistory",issues:"nodeView.paneIssues",eval:"nodeView.paneEval",edit:"nodeView.paneEdit"},C=(e,l)=>l.filter(u=>{var h;return(h=u.ops)==null?void 0:h.some(n=>n.nodeId===e.id)});function T({status:e}){const l=S[e]||S.pending;return s.jsx("span",{className:"m-dot",style:{background:l.color}})}function U({node:e,kids:l,editors:u,onTap:h}){return s.jsxs("button",{className:"m-row",onClick:h,children:[s.jsx(T,{status:e.status}),s.jsx("span",{className:"m-row-title",children:e.title}),u.length>0&&s.jsx("span",{className:"m-row-faces",children:u.slice(0,3).map(n=>s.jsx(y,{seed:n.id,status:n.status,title:g(n)},n.id))}),e.version?s.jsxs("span",{className:"m-row-ver",children:["v",e.version]}):null,l>0&&s.jsxs("span",{className:"m-row-kids",children:["▸",l]}),s.jsx("span",{className:"m-row-chev",children:"›"})]})}function q({node:e,childrenOf:l,sessions:u,onOpenChild:h}){const n=k(),m=l(e.id),d=M(e),i=[...m.length?[{key:"children",label:n("mobile.childrenTab",{n:m.length})}]:[],...d.map(a=>({key:a.key,label:n(L[a.key])}))],[r,x]=b.useState(null);b.useEffect(()=>{x(null)},[e.id]);const c=r&&i.some(a=>a.key===r)?r:i[0].key,j=A(e.id,c==="history"),N=C(e,u);return s.jsxs("div",{className:"m-node",children:[s.jsxs("div",{className:"m-node-head",children:[s.jsx(T,{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:n(`status.${e.status}`)}),N.length>0&&s.jsx("span",{className:"m-node-faces",title:n("mobile.liveEditors",{n:N.length}),children:N.map(a=>s.jsx(y,{seed:a.id,status:a.status,title:g(a)},a.id))})]}),e.desc&&s.jsx("div",{className:"m-node-desc",children:e.desc}),s.jsx("div",{className:"m-tabs",children:i.map(a=>s.jsx("button",{className:a.key===c?"m-tab on":"m-tab",onClick:()=>x(a.key),children:a.label},a.key))}),s.jsxs("div",{className:c==="history"?"m-pane-host fixed":"m-pane-host",children:[c==="children"&&s.jsx("div",{className:"m-children",children:m.map(a=>s.jsx(U,{node:a,kids:l(a.id).length,editors:C(a,u),onTap:()=>h(a.id)},a.id))}),c==="spec"&&s.jsx(H,{node:e}),c==="history"&&s.jsx(V,{node:e,rows:j}),c==="issues"&&s.jsx(R,{node:e}),c==="edit"&&s.jsx(_,{node:e})]})]})}function D({sessions:e,openId:l,setOpenId:u,byId:h,goToNode:n}){const m=k(),d=l?e.find(i=>i.id===l):null;if(d){const i=d.ops||[];return s.jsxs("div",{className:"m-sessdetail",children:[s.jsxs("div",{className:"m-sess-card",children:[s.jsx(y,{seed:d.id,status:d.status}),s.jsxs("div",{className:"m-sess-meta",children:[s.jsx("span",{className:"m-sess-name",children:g(d)}),s.jsx("span",{className:"m-sess-status",style:{color:$[d.status]},children:m(`status.${d.status}`)})]})]}),d.activity&&s.jsx("div",{className:"m-sess-activity",children:d.activity}),s.jsx("div",{className:"m-sess-section",children:m("mobile.changing",{n:i.length})}),i.length===0?s.jsx("div",{className:"m-empty",children:m("mobile.noChanges")}):i.map((r,x)=>{const c=h[r.nodeId];return s.jsxs("button",{className:"m-row",disabled:!c,onClick:()=>c&&n(r.nodeId),children:[s.jsx("span",{className:`ov-mark ov-${r.op}`,children:B[r.op]||"•"}),s.jsx("span",{className:"m-row-title",children:c?c.title:r.nodeId}),c&&s.jsx("span",{className:"m-row-chev",children:"›"})]},x)})]})}return e.length?s.jsx("div",{className:"m-sesslist",children:e.map(i=>s.jsx("button",{className:"m-sess-row",onClick:()=>u(i.id),children:s.jsx(G,{s:i,locked:!1})},i.id))}):s.jsx("div",{className:"m-empty big",children:m("mobile.noSessions")})}function z({specs:e,sessions:l,project:u}){const h=k(),n=b.useMemo(()=>Object.fromEntries(e.map(t=>[t.id,t])),[e]),m=b.useMemo(()=>e.find(t=>!t.parent)||e[0],[e]),d=b.useMemo(()=>{const t={};return e.forEach(o=>{var p;o.parent&&(t[p=o.parent]??(t[p]=[])).push(o)}),o=>t[o]||[]},[e]),i=b.useMemo(()=>t=>{const o=[];for(let p=n[t];p;p=p.parent?n[p.parent]:null)o.unshift(p.id);return o},[n]),[r,x]=b.useState("specs"),[c,j]=b.useState(()=>m?[m.id]:[]),[N,a]=b.useState(null),v=c.filter(t=>n[t]),w=v[v.length-1]||(m==null?void 0:m.id),f=w?n[w]:null,E=t=>j(o=>[...o.filter(p=>n[p]),t]),I=t=>{j(i(t)),a(null),x("specs")},P=r==="specs"?v.length>1:!!N,O=()=>{r==="specs"?j(t=>t.slice(0,-1)):a(null)};return s.jsxs("div",{className:"m-app",children:[s.jsxs("header",{className:"m-topbar",children:[P?s.jsx("button",{className:"m-back",onClick:O,"aria-label":h("mobile.back"),children:"‹"}):s.jsx("span",{className:"m-back ghost","aria-hidden":"true"}),s.jsx("span",{className:"m-brand",children:u||"SpexCode"})]}),s.jsx("main",{className:"m-main",children:r==="specs"?s.jsxs("div",{className:"m-specs",children:[s.jsx("nav",{className:"m-crumbs",children:v.map((t,o)=>s.jsxs("span",{className:"m-crumb",children:[o>0&&s.jsx("span",{className:"m-crumb-sep",children:"›"}),s.jsx("button",{className:o===v.length-1?"m-crumb-btn cur":"m-crumb-btn",onClick:()=>j(v.slice(0,o+1)),children:n[t].title})]},t))}),f&&s.jsx(q,{node:f,childrenOf:d,sessions:l,onOpenChild:E},f.id)]}):s.jsx(D,{sessions:l,openId:N,setOpenId:a,byId:n,goToNode:I})}),s.jsxs("nav",{className:"m-tabbar",children:[s.jsxs("button",{className:r==="specs"?"m-tabbar-btn on":"m-tabbar-btn",onClick:()=>x("specs"),children:[s.jsx("span",{className:"m-tabbar-ico",children:"❯_"}),h("mobile.specsTab")]}),s.jsxs("button",{className:r==="sessions"?"m-tabbar-btn on":"m-tabbar-btn",onClick:()=>x("sessions"),children:[s.jsx("span",{className:"m-tabbar-ico",children:"◐"}),h("mobile.sessionsTab"),l.length>0&&s.jsx("span",{className:"m-tabbar-badge",children:l.length})]})]})]})}export{z 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 .xterm-scroll-area{visibility:hidden}.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{-webkit-user-select:text;user-select:text;white-space:pre}.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}
|