Spaces:
Sleeping
Sleeping
timchen0618 commited on
Commit ·
6307feb
1
Parent(s): 3c34d20
traj_ext: add display name mapping for 6 run types
Browse files- frontend/dist/assets/{ExperimentsApp-CAtTRsSE.js → ExperimentsApp-C3DPbVA4.js} +0 -0
- frontend/dist/assets/{ModelApp-D95m_diX.js → ModelApp-iANtF2yU.js} +1 -1
- frontend/dist/assets/{PlanRevisionsApp-DLzg8L3_.js → PlanRevisionsApp-DyyEVbkc.js} +1 -1
- frontend/dist/assets/{SelectedToolsApp-0o0B97mi.js → SelectedToolsApp-IfXYrFjJ.js} +1 -1
- frontend/dist/assets/TrajExtApp-C6ITxHh-.js +0 -1
- frontend/dist/assets/TrajExtApp-CLnrQONN.js +1 -0
- frontend/dist/assets/{VisualizerApp-COBLMQdU.js → VisualizerApp-DGOKN__B.js} +2 -2
- frontend/dist/assets/{index-8LLguJlN.js → index-qU3_rjRK.js} +0 -0
- frontend/dist/index.html +1 -1
- frontend/src/traj_ext/TrajExtApp.tsx +12 -2
frontend/dist/assets/{ExperimentsApp-CAtTRsSE.js → ExperimentsApp-C3DPbVA4.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
frontend/dist/assets/{ModelApp-D95m_diX.js → ModelApp-iANtF2yU.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as i,p as re,a as le,j as e}from"./index-
|
| 2 |
${u.repo}`:u.repo,children:u.presetName||u.name}),e.jsxs("div",{className:"text-[10px] text-gray-500",children:[u.column," | ",u.n_rows," rows | ",u.n_samples," samples"]})]}),e.jsx("button",{onClick:v=>{v.stopPropagation(),G(M===u.id?null:u.id),O("")},className:`transition-colors shrink-0 ${M===u.id?"text-blue-400":"text-gray-600 hover:text-blue-400"}`,title:"Save as preset",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})})}),e.jsx("button",{onClick:v=>{v.stopPropagation(),b(u.id)},className:"text-gray-600 hover:text-red-400 transition-colors shrink-0",title:"Remove",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),M===u.id&&e.jsxs("div",{className:"flex gap-1 mt-1 ml-6",children:[e.jsx("input",{type:"text",value:B,onChange:v=>O(v.target.value),onKeyDown:v=>{v.key==="Enter"&&z(u),v.key==="Escape"&&G(null)},placeholder:"Preset name...",className:"flex-1 px-2 py-1 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none",autoFocus:!0}),e.jsx("button",{onClick:()=>z(u),className:"px-2 py-1 text-xs bg-blue-600 hover:bg-blue-500 rounded text-white",children:"Save"})]})]},u.id))})]},r)})})]}),R&&(()=>{const r=t.find(a=>a.id===R);return r!=null&&r.presetId?e.jsxs("div",{className:"p-3 border-t border-gray-700 space-y-2",children:[e.jsx("div",{className:"text-[10px] text-gray-500 uppercase font-semibold tracking-wider",children:"Edit Preset"}),e.jsx("input",{type:"text",value:_,onChange:a=>J(a.target.value),onKeyDown:a=>{a.key==="Enter"&&_.trim()&&(w(r.presetId,r.id,{name:_.trim()}),$(null)),a.key==="Escape"&&$(null)},placeholder:"Preset name...",className:"w-full px-2 py-1 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none",autoFocus:!0}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>{_.trim()&&(w(r.presetId,r.id,{name:_.trim()}),$(null))},disabled:!_.trim(),className:"flex-1 px-2 py-1 text-xs bg-blue-600 hover:bg-blue-500 disabled:bg-gray-700 disabled:text-gray-500 rounded text-white transition-colors",children:"Save"}),e.jsx("button",{onClick:()=>{j(r.presetId,r.id),$(null)},className:"px-2 py-1 text-xs bg-red-900 hover:bg-red-800 rounded text-red-300 transition-colors",children:"Delete"}),e.jsx("button",{onClick:()=>$(null),className:"px-2 py-1 text-xs bg-gray-700 hover:bg-gray-600 rounded text-gray-300 transition-colors",children:"Cancel"})]})]}):null})(),e.jsx("div",{className:"p-3 border-t border-gray-700",children:k?e.jsxs("div",{className:"space-y-2",children:[e.jsx("input",{type:"text",value:m,onChange:r=>y(r.target.value),onKeyDown:r=>r.key==="Enter"&&K(),placeholder:"org/dataset-name",className:"w-full px-2 py-1.5 text-sm bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none",autoFocus:!0}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:P,onChange:r=>N(r.target.value),placeholder:"Response col (auto-detect)",className:"flex-1 px-2 py-1 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none"}),e.jsx("input",{type:"text",value:F,onChange:r=>W(r.target.value),placeholder:"Split",className:"w-16 px-2 py-1 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none"})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx("input",{type:"text",value:H,onChange:r=>Y(r.target.value),placeholder:"Prompt col (auto-detect)",className:"flex-1 px-2 py-1 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:K,disabled:!m.trim()||n[m.trim()],className:"flex-1 px-2 py-1.5 text-sm bg-blue-600 hover:bg-blue-500 disabled:bg-gray-700 disabled:text-gray-500 rounded text-white transition-colors",children:n[m.trim()]?"Loading...":"Load"}),e.jsx("button",{onClick:()=>o(!1),className:"px-3 py-1.5 text-sm bg-gray-700 hover:bg-gray-600 rounded text-gray-300 transition-colors",children:"Cancel"})]})]}):e.jsx("button",{onClick:()=>{$(null),o(!0),y(""),N(""),W("train"),Y("")},className:"w-full px-3 py-2 text-sm bg-blue-600 hover:bg-blue-500 rounded text-white font-medium transition-colors",children:"+ Add Repo"})})]})}function de(t){if(!t)return[{text:"(no response)",className:"text-gray-500 italic"}];const l=[],n=t.split(`
|
| 3 |
`);for(let c=0;c<n.length;c++){const p=n[c],s=p.toLowerCase().trim();let x="text-gray-300";s.startsWith("wait")||s.startsWith("hmm")||s.startsWith("but wait")?x="text-yellow-400":s.startsWith("let me try")||s.startsWith("let me reconsider")||s.startsWith("let me think")?x="text-cyan-400":s.startsWith("so the answer")||s.startsWith("so the expression")||s.startsWith("therefore")||s.startsWith("the final")?x="text-green-400 font-bold":s.startsWith("i give up")||s.startsWith("i can't find")||s.startsWith("i'm stuck")||s.startsWith("i'm sorry")?x="text-red-400 font-bold":p.includes("=")&&/[+\-*/]/.test(p)&&(x="text-gray-100"),l.push({text:p,className:x}),c<n.length-1&&l.push({text:`
|
| 4 |
`,className:""})}return l}function ue(t){if(!t||!t.trim())return[];try{const l=JSON.parse(t);if(Array.isArray(l)&&l.length>0&&l[0].role!==void 0)return l.map(n=>({role:String(n.role||"unknown"),content:String(n.content??"")}))}catch{}if(t.includes("<|im_start|>"))return t.split("<|im_start|>").filter(Boolean).map(n=>{const c=n.indexOf(`
|
|
|
|
| 1 |
+
import{r as i,p as re,a as le,j as e}from"./index-qU3_rjRK.js";const U="/api/model",X="/api/presets/model";async function L(t,l){const n=await fetch(t,{headers:{"Content-Type":"application/json"},...l});if(!n.ok){const c=await n.json().catch(()=>({error:n.statusText}));throw new Error(c.error||n.statusText)}return n.json()}const A={loadDataset(t,l,n,c){return L(`${U}/datasets/load`,{method:"POST",body:JSON.stringify({repo:t,column:l,split:n,prompt_column:c})})},listDatasets(){return L(`${U}/datasets/`)},getQuestion(t,l){return L(`${U}/datasets/${t}/question/${l}`)},getSummary(t){return L(`${U}/datasets/${t}/summary`)},unloadDataset(t){return L(`${U}/datasets/${t}`,{method:"DELETE"})},listPresets(){return L(`${X}`)},createPreset(t,l,n,c){return L(`${X}`,{method:"POST",body:JSON.stringify({name:t,repo:l,column:n,split:c})})},updatePreset(t,l){return L(`${X}/${t}`,{method:"PUT",body:JSON.stringify(l)})},deletePreset(t){return L(`${X}/${t}`,{method:"DELETE"})}};function ie(){const t=i.useRef(re().params),[l,n]=i.useState([]),[c,p]=i.useState([]),[s,x]=i.useState("all"),[b,g]=i.useState({}),[h,S]=i.useState({}),[I,j]=i.useState(null),[w,k]=i.useState({}),[o,m]=i.useState(null);i.useEffect(()=>{A.listPresets().then(p).catch(()=>{})},[]),i.useEffect(()=>{const a=re().params,d=parseInt(a.get("q")||"0"),f=parseInt(a.get("s")||"0"),u=a.get("filter")||"all";x(u),(!isNaN(d)||!isNaN(f))&&(window.__initialQ=isNaN(d)?0:d,window.__initialS=isNaN(f)?0:f)},[]);const y=i.useMemo(()=>{const r={};for(const a of l){const d=a.questionFingerprint;r[d]||(r[d]=[]),r[d].push(a)}return r},[l]),P=i.useMemo(()=>Object.keys(y).sort(),[y]);i.useEffect(()=>{if(o&&y[o])return;const r=P.find(a=>y[a].some(d=>d.active));r?m(r):P.length>0?m(P[0]):m(null)},[P,y,o]);const N=i.useMemo(()=>l.filter(r=>r.active&&r.questionFingerprint===o),[l,o]),[F,W]=i.useState([]);i.useEffect(()=>{const r=new Set(N.map(a=>a.id));W(a=>{const d=a.filter(v=>r.has(v)),f=N.map(v=>v.id).filter(v=>!a.includes(v)),u=[...d,...f];return u.length===a.length&&u.every((v,C)=>v===a[C])?a:u})},[N]);const H=i.useMemo(()=>{const r=new Map(N.map(a=>[a.id,a]));return F.map(a=>r.get(a)).filter(a=>a!==void 0)},[N,F]),Y=i.useCallback((r,a)=>{r!==a&&W(d=>{const f=[...d],u=f.indexOf(r),v=f.indexOf(a);return u===-1||v===-1?d:(f.splice(u,1),f.splice(v,0,r),f)})},[]),D=o?w[o]:void 0,E=(D==null?void 0:D.questionIdx)??0,M=(D==null?void 0:D.sampleIdx)??0,G=i.useCallback(r=>{o&&k(a=>{const d=a[o]??{questionIdx:0,sampleIdx:0},f=typeof r=="function"?r(d.questionIdx):r;return{...a,[o]:{...d,questionIdx:f}}})},[o]),B=i.useCallback(r=>{o&&k(a=>{const d=a[o]??{questionIdx:0,sampleIdx:0},f=typeof r=="function"?r(d.sampleIdx):r;return{...a,[o]:{...d,sampleIdx:f}}})},[o]);i.useEffect(()=>{const r=new URLSearchParams,a=l.filter(d=>d.active);a.length>0&&(r.set("repos",a.map(d=>d.repo).join(",")),r.set("cols",a.map(d=>d.column).join(",")),r.set("pcols",a.map(d=>d.promptColumn||"formatted_prompt").join(","))),r.set("q",String(E)),r.set("s",String(M)),s!=="all"&&r.set("filter",s),o&&r.set("group",o),le({params:r})},[l,E,M,s,o]),i.useEffect(()=>{N.forEach(r=>{const a=`${r.id}:${E}`;b[a]||A.getQuestion(r.id,E).then(d=>{g(f=>({...f,[a]:d}))}).catch(()=>{})})},[E,N]);const O=i.useCallback(async(r,a,d,f,u,v)=>{S(C=>({...C,[r]:!0})),j(null);try{const{question_fingerprint:C,...Q}=await A.loadDataset(r,a,d,f),V=C??"",ee={...Q,questionFingerprint:V,active:!0,presetId:u,presetName:v};n(T=>T.some(q=>q.id===ee.id)?T:[...T,ee]),k(T=>{if(T[V])return T;const q=window,ne=typeof q.__initialQ=="number"?q.__initialQ:0,oe=typeof q.__initialS=="number"?q.__initialS:0,te=Object.keys(T).length===0;return{...T,[V]:{questionIdx:te?ne:0,sampleIdx:te?oe:0}}}),m(V)}catch(C){j(C instanceof Error?C.message:"Failed to load dataset")}finally{S(C=>({...C,[r]:!1}))}},[]);i.useEffect(()=>{var u,v,C;const r=t.current,a=((u=r.get("repos"))==null?void 0:u.split(",").filter(Boolean))||[],d=((v=r.get("cols"))==null?void 0:v.split(","))||[],f=((C=r.get("pcols"))==null?void 0:C.split(","))||[];for(let Q=0;Q<a.length;Q++)O(a[Q],d[Q]||void 0,void 0,f[Q]||void 0)},[O]);const R=i.useCallback(async r=>{await A.unloadDataset(r).catch(()=>{}),n(a=>a.filter(d=>d.id!==r))},[]),$=i.useCallback(r=>{n(a=>{const d=a.map(u=>u.id===r?{...u,active:!u.active}:u),f=d.find(u=>u.id===r);return f&&f.active&&m(f.questionFingerprint),d})},[]),_=i.useCallback((r,a)=>{n(d=>d.map(f=>f.id===r?{...f,presetName:a}:f))},[]),J=i.useCallback(r=>{n(a=>a.map(d=>d.id===r?{...d,presetId:void 0,presetName:void 0}:d))},[]),K=Math.min(...N.map(r=>r.n_rows),1/0),z=Math.max(...N.map(r=>r.n_samples),0);return{datasets:l,presets:c,setPresets:p,questionIdx:E,setQuestionIdx:G,sampleIdx:M,setSampleIdx:B,filter:s,setFilter:x,loading:h,error:I,setError:j,activeDatasets:N,orderedActiveDatasets:H,maxQuestions:K,maxSamples:z,addDataset:O,removeDataset:R,toggleDataset:$,updateDatasetPresetName:_,clearDatasetPreset:J,getQuestionData:r=>b[`${r}:${E}`],reorderPanels:Y,groups:y,groupIds:P,currentGroupId:o,setCurrentGroupId:m}}const se=[{bg:"bg-blue-500",border:"border-blue-500",text:"text-blue-400",label:"text-blue-300"},{bg:"bg-emerald-500",border:"border-emerald-500",text:"text-emerald-400",label:"text-emerald-300"},{bg:"bg-amber-500",border:"border-amber-500",text:"text-amber-400",label:"text-amber-300"},{bg:"bg-purple-500",border:"border-purple-500",text:"text-purple-400",label:"text-purple-300"},{bg:"bg-rose-500",border:"border-rose-500",text:"text-rose-400",label:"text-rose-300"},{bg:"bg-cyan-500",border:"border-cyan-500",text:"text-cyan-400",label:"text-cyan-300"}];function ce({datasets:t,presets:l,loading:n,groups:c,groupIds:p,currentGroupId:s,onAddDataset:x,onRemoveDataset:b,onToggleDataset:g,onSetCurrentGroup:h,onLoadPreset:S,onSavePreset:I,onDeletePreset:j,onUpdatePreset:w}){const[k,o]=i.useState(!1),[m,y]=i.useState(""),[P,N]=i.useState(""),[F,W]=i.useState("train"),[H,Y]=i.useState(""),[D,E]=i.useState(""),[M,G]=i.useState(null),[B,O]=i.useState(""),[R,$]=i.useState(null),[_,J]=i.useState(""),K=()=>{m.trim()&&(x(m.trim(),P.trim()||void 0,F.trim()||void 0,H.trim()||void 0),y(""),o(!1))},z=r=>{B.trim()&&(I(B.trim(),r.repo,r.column,r.split),O(""),G(null))},Z=r=>{const a=p.indexOf(r);return se[a%se.length]};return e.jsxs("div",{className:"w-72 min-w-72 bg-gray-900 border-r border-gray-700 flex flex-col h-full",children:[e.jsxs("div",{className:"p-3 border-b border-gray-700",children:[e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsx("h3",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Presets"})}),l.length===0?e.jsx("p",{className:"text-xs text-gray-500 italic",children:"No presets saved"}):e.jsxs(e.Fragment,{children:[l.length>6&&e.jsx("input",{type:"text",value:D,onChange:r=>E(r.target.value),placeholder:"Search presets...",className:"w-full px-2 py-1 mb-2 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none"}),e.jsx("div",{className:"flex flex-wrap gap-1 max-h-32 overflow-y-auto",children:l.filter(r=>!D||r.name.toLowerCase().includes(D.toLowerCase())||r.repo.toLowerCase().includes(D.toLowerCase())).map(r=>e.jsxs("div",{className:"group relative",children:[e.jsx("button",{onClick:()=>S(r),className:"px-2 py-1 text-xs bg-gray-800 hover:bg-gray-700 rounded border border-gray-600 text-gray-300 transition-colors",title:`${r.repo} (${r.column}, ${r.split??"train"})`,children:r.name}),e.jsx("div",{className:"hidden group-hover:flex absolute top-full left-0 mt-1 z-10 gap-1",children:e.jsx("button",{onClick:()=>j(r.id),className:"px-1.5 py-0.5 text-[10px] bg-red-900 hover:bg-red-800 rounded text-red-300",children:"Delete"})})]},r.id))})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[e.jsx("h3",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2",children:"Loaded Repos"}),t.length===0?e.jsx("p",{className:"text-xs text-gray-500 italic",children:"No repos loaded. Add one below."}):e.jsx("div",{className:"space-y-3",children:p.map(r=>{const a=Z(r),d=c[r],f=r===s;return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>h(r),className:`w-full flex items-center gap-1.5 mb-1 px-1 py-0.5 rounded transition-colors ${f?"bg-gray-800":"hover:bg-gray-800/50"}`,children:[e.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${a.bg} shrink-0`}),e.jsxs("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${f?a.label:"text-gray-500"}`,children:["Group ",p.indexOf(r)+1,e.jsxs("span",{className:"normal-case font-normal ml-1 text-gray-600",children:["(",d.length," repo",d.length!==1?"s":"",")"]})]}),f&&e.jsx("span",{className:"text-[9px] text-gray-600 ml-auto",children:"viewing"})]}),e.jsx("div",{className:`space-y-1 border-l-2 ml-1 pl-2 ${f?a.border:"border-gray-700"}`,children:d.map(u=>e.jsxs("div",{children:[e.jsxs("div",{onClick:()=>{u.presetId&&($(R===u.id?null:u.id),J(u.presetName||""),o(!1))},className:`flex items-center gap-2 px-2 py-1.5 rounded text-sm transition-colors ${u.active?"bg-gray-800":"bg-gray-900 opacity-60"} ${R===u.id?"ring-1 ring-blue-500":""} ${u.presetId?"cursor-pointer":""}`,children:[e.jsx("input",{type:"checkbox",checked:u.active,onChange:()=>g(u.id),onClick:v=>v.stopPropagation(),className:"rounded border-gray-600 bg-gray-800 text-blue-500 focus:ring-blue-500 focus:ring-offset-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-gray-200 truncate text-xs font-medium",title:u.presetName?`${u.presetName}
|
| 2 |
${u.repo}`:u.repo,children:u.presetName||u.name}),e.jsxs("div",{className:"text-[10px] text-gray-500",children:[u.column," | ",u.n_rows," rows | ",u.n_samples," samples"]})]}),e.jsx("button",{onClick:v=>{v.stopPropagation(),G(M===u.id?null:u.id),O("")},className:`transition-colors shrink-0 ${M===u.id?"text-blue-400":"text-gray-600 hover:text-blue-400"}`,title:"Save as preset",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})})}),e.jsx("button",{onClick:v=>{v.stopPropagation(),b(u.id)},className:"text-gray-600 hover:text-red-400 transition-colors shrink-0",title:"Remove",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),M===u.id&&e.jsxs("div",{className:"flex gap-1 mt-1 ml-6",children:[e.jsx("input",{type:"text",value:B,onChange:v=>O(v.target.value),onKeyDown:v=>{v.key==="Enter"&&z(u),v.key==="Escape"&&G(null)},placeholder:"Preset name...",className:"flex-1 px-2 py-1 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none",autoFocus:!0}),e.jsx("button",{onClick:()=>z(u),className:"px-2 py-1 text-xs bg-blue-600 hover:bg-blue-500 rounded text-white",children:"Save"})]})]},u.id))})]},r)})})]}),R&&(()=>{const r=t.find(a=>a.id===R);return r!=null&&r.presetId?e.jsxs("div",{className:"p-3 border-t border-gray-700 space-y-2",children:[e.jsx("div",{className:"text-[10px] text-gray-500 uppercase font-semibold tracking-wider",children:"Edit Preset"}),e.jsx("input",{type:"text",value:_,onChange:a=>J(a.target.value),onKeyDown:a=>{a.key==="Enter"&&_.trim()&&(w(r.presetId,r.id,{name:_.trim()}),$(null)),a.key==="Escape"&&$(null)},placeholder:"Preset name...",className:"w-full px-2 py-1 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none",autoFocus:!0}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>{_.trim()&&(w(r.presetId,r.id,{name:_.trim()}),$(null))},disabled:!_.trim(),className:"flex-1 px-2 py-1 text-xs bg-blue-600 hover:bg-blue-500 disabled:bg-gray-700 disabled:text-gray-500 rounded text-white transition-colors",children:"Save"}),e.jsx("button",{onClick:()=>{j(r.presetId,r.id),$(null)},className:"px-2 py-1 text-xs bg-red-900 hover:bg-red-800 rounded text-red-300 transition-colors",children:"Delete"}),e.jsx("button",{onClick:()=>$(null),className:"px-2 py-1 text-xs bg-gray-700 hover:bg-gray-600 rounded text-gray-300 transition-colors",children:"Cancel"})]})]}):null})(),e.jsx("div",{className:"p-3 border-t border-gray-700",children:k?e.jsxs("div",{className:"space-y-2",children:[e.jsx("input",{type:"text",value:m,onChange:r=>y(r.target.value),onKeyDown:r=>r.key==="Enter"&&K(),placeholder:"org/dataset-name",className:"w-full px-2 py-1.5 text-sm bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none",autoFocus:!0}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:P,onChange:r=>N(r.target.value),placeholder:"Response col (auto-detect)",className:"flex-1 px-2 py-1 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none"}),e.jsx("input",{type:"text",value:F,onChange:r=>W(r.target.value),placeholder:"Split",className:"w-16 px-2 py-1 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none"})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx("input",{type:"text",value:H,onChange:r=>Y(r.target.value),placeholder:"Prompt col (auto-detect)",className:"flex-1 px-2 py-1 text-xs bg-gray-800 border border-gray-600 rounded text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:K,disabled:!m.trim()||n[m.trim()],className:"flex-1 px-2 py-1.5 text-sm bg-blue-600 hover:bg-blue-500 disabled:bg-gray-700 disabled:text-gray-500 rounded text-white transition-colors",children:n[m.trim()]?"Loading...":"Load"}),e.jsx("button",{onClick:()=>o(!1),className:"px-3 py-1.5 text-sm bg-gray-700 hover:bg-gray-600 rounded text-gray-300 transition-colors",children:"Cancel"})]})]}):e.jsx("button",{onClick:()=>{$(null),o(!0),y(""),N(""),W("train"),Y("")},className:"w-full px-3 py-2 text-sm bg-blue-600 hover:bg-blue-500 rounded text-white font-medium transition-colors",children:"+ Add Repo"})})]})}function de(t){if(!t)return[{text:"(no response)",className:"text-gray-500 italic"}];const l=[],n=t.split(`
|
| 3 |
`);for(let c=0;c<n.length;c++){const p=n[c],s=p.toLowerCase().trim();let x="text-gray-300";s.startsWith("wait")||s.startsWith("hmm")||s.startsWith("but wait")?x="text-yellow-400":s.startsWith("let me try")||s.startsWith("let me reconsider")||s.startsWith("let me think")?x="text-cyan-400":s.startsWith("so the answer")||s.startsWith("so the expression")||s.startsWith("therefore")||s.startsWith("the final")?x="text-green-400 font-bold":s.startsWith("i give up")||s.startsWith("i can't find")||s.startsWith("i'm stuck")||s.startsWith("i'm sorry")?x="text-red-400 font-bold":p.includes("=")&&/[+\-*/]/.test(p)&&(x="text-gray-100"),l.push({text:p,className:x}),c<n.length-1&&l.push({text:`
|
| 4 |
`,className:""})}return l}function ue(t){if(!t||!t.trim())return[];try{const l=JSON.parse(t);if(Array.isArray(l)&&l.length>0&&l[0].role!==void 0)return l.map(n=>({role:String(n.role||"unknown"),content:String(n.content??"")}))}catch{}if(t.includes("<|im_start|>"))return t.split("<|im_start|>").filter(Boolean).map(n=>{const c=n.indexOf(`
|
frontend/dist/assets/{PlanRevisionsApp-DLzg8L3_.js → PlanRevisionsApp-DyyEVbkc.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as i,j as t}from"./index-
|
| 2 |
`),n=p.split(`
|
| 3 |
`),d=new Set(x),m=new Set(n),s=[];let o=0,a=0;for(;o<x.length||a<n.length;){const u=x[o],l=n[a];o>=x.length?(s.push({text:n[a],type:"add"}),a++):a>=n.length?(s.push({text:x[o],type:"del"}),o++):u===l?(s.push({text:u,type:"same"}),o++,a++):m.has(u)?d.has(l)?(s.push({text:u,type:"del"}),s.push({text:l,type:"add"}),o++,a++):(s.push({text:l,type:"add"}),a++):(s.push({text:u,type:"del"}),o++)}return s}function _({prev:r,curr:p}){const x=i.useMemo(()=>S(r,p),[r,p]);return t.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap leading-relaxed",children:x.map((n,d)=>n.type==="same"?t.jsx("span",{className:"text-gray-300",children:n.text+`
|
| 4 |
`},d):n.type==="add"?t.jsx("span",{className:"bg-green-900/40 text-green-300",children:"+ "+n.text+`
|
|
|
|
| 1 |
+
import{r as i,j as t}from"./index-qU3_rjRK.js";function S(r,p){const x=r.split(`
|
| 2 |
`),n=p.split(`
|
| 3 |
`),d=new Set(x),m=new Set(n),s=[];let o=0,a=0;for(;o<x.length||a<n.length;){const u=x[o],l=n[a];o>=x.length?(s.push({text:n[a],type:"add"}),a++):a>=n.length?(s.push({text:x[o],type:"del"}),o++):u===l?(s.push({text:u,type:"same"}),o++,a++):m.has(u)?d.has(l)?(s.push({text:u,type:"del"}),s.push({text:l,type:"add"}),o++,a++):(s.push({text:l,type:"add"}),a++):(s.push({text:u,type:"del"}),o++)}return s}function _({prev:r,curr:p}){const x=i.useMemo(()=>S(r,p),[r,p]);return t.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap leading-relaxed",children:x.map((n,d)=>n.type==="same"?t.jsx("span",{className:"text-gray-300",children:n.text+`
|
| 4 |
`},d):n.type==="add"?t.jsx("span",{className:"bg-green-900/40 text-green-300",children:"+ "+n.text+`
|
frontend/dist/assets/{SelectedToolsApp-0o0B97mi.js → SelectedToolsApp-IfXYrFjJ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as o,j as e}from"./index-
|
| 2 |
|
| 3 |
---
|
| 4 |
|
|
|
|
| 1 |
+
import{r as o,j as e}from"./index-qU3_rjRK.js";const k={reasoning:{border:"border-purple-700",labelColor:"text-purple-400",bg:"bg-purple-950/30"},tool_call:{border:"border-blue-700",labelColor:"text-blue-400",bg:"bg-blue-950/30"},tool_result:{border:"border-gray-600",labelColor:"text-gray-400",bg:"bg-gray-800/30"},final_answer:{border:"border-green-700",labelColor:"text-green-400",bg:"bg-green-950/30"},unknown:{border:"border-gray-700",labelColor:"text-gray-500",bg:""}};function _(l){if(!l)return[];const s=[],i=l.split(/\n\n(?=\[)/);for(const n of i){const r=n.trim();r.startsWith("[Reasoning]:")?s.push({type:"reasoning",label:"Reasoning",content:r.slice(12).trim()}):r.startsWith("[Tool call]")?s.push({type:"tool_call",label:"Tool Call",content:r.slice(11).trim()}):r.startsWith("[Tool result]:")?s.push({type:"tool_result",label:"Tool Result",content:r.slice(14).trim()}):r.startsWith("[Final answer]:")?s.push({type:"final_answer",label:"Final Answer",content:r.slice(15).trim()}):r&&s.push({type:"unknown",label:"—",content:r})}return s}function C(l){if(!l)return[];const s=[],i=l.split(`
|
| 2 |
|
| 3 |
---
|
| 4 |
|
frontend/dist/assets/TrajExtApp-C6ITxHh-.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as a,j as e}from"./index-8LLguJlN.js";function w(l){if(!l||l==="(no trajectory steps)")return[];const n=[],d=l.split(/\n\n(?=\[)/);for(const c of d){const r=c.trim();r.startsWith("[Reasoning]:")?n.push({type:"reasoning",content:r.slice(12).trim()}):r.startsWith("[Tool call]")?n.push({type:"tool_call",content:r.slice(11).trim()}):r.startsWith("[Tool result]:")?n.push({type:"tool_result",content:r.slice(14).trim()}):r.startsWith("[Final answer]:")?n.push({type:"final_answer",content:r.slice(15).trim()}):r&&n.push({type:"unknown",content:r})}return n}const C={reasoning:{border:"border-purple-700",label:"Reasoning",labelColor:"text-purple-400",bg:"bg-purple-950/30"},tool_call:{border:"border-blue-700",label:"Tool Call",labelColor:"text-blue-400",bg:"bg-blue-950/30"},tool_result:{border:"border-gray-600",label:"Tool Result",labelColor:"text-gray-400",bg:"bg-gray-800/30"},final_answer:{border:"border-green-700",label:"Final Answer",labelColor:"text-green-400",bg:"bg-green-950/30"},unknown:{border:"border-gray-700",label:"—",labelColor:"text-gray-500",bg:""}};function S({text:l}){const n=a.useMemo(()=>w(l),[l]);return n.length===0?e.jsx("div",{className:"text-gray-500 text-xs",children:"No trajectory steps."}):e.jsx("div",{className:"space-y-2",children:n.map((d,c)=>{const r=C[d.type];return e.jsxs("div",{className:`border-l-2 ${r.border} ${r.bg} pl-3 py-1 rounded-r`,children:[e.jsx("div",{className:`text-[10px] font-bold uppercase tracking-widest mb-1 ${r.labelColor}`,children:r.label}),e.jsx("pre",{className:"text-xs text-gray-300 whitespace-pre-wrap font-mono leading-relaxed",children:d.content})]},c)})})}const k=["trajectory","prompt","both"];function E(){const[l,n]=a.useState([]),[d,c]=a.useState(!0),[r,f]=a.useState(null),[h,g]=a.useState(0),[o,j]=a.useState("trajectory"),[u,v]=a.useState(""),[x,N]=a.useState("all"),[m,_]=a.useState({});a.useEffect(()=>{c(!0),fetch("/api/traj-ext/").then(t=>{if(!t.ok)throw new Error(t.statusText);return t.json()}).then(t=>{n(t.rows),c(!1)}).catch(t=>{f(t.message),c(!1)})},[]);const y=a.useMemo(()=>Array.from(new Set(l.map(i=>i.run_name??""))).filter(Boolean).sort(),[l]),b=a.useMemo(()=>{let t=l;if(x!=="all"&&(t=t.filter(p=>p.run_name===x)),!u.trim())return t;const i=u.toLowerCase();return t.filter(p=>p.query_id.includes(i)||p.question.toLowerCase().includes(i))},[l,u,x]),s=b[h]??null;return a.useEffect(()=>{s&&(o!=="prompt"&&o!=="both"||m[s.run_id]||fetch(`/api/traj-ext/${encodeURIComponent(s.run_id)}`).then(t=>t.json()).then(t=>_(i=>({...i,[s.run_id]:t.formatted_prompt??""}))).catch(()=>{}))},[s==null?void 0:s.run_id,o]),d?e.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:"Loading traj-ext data from HuggingFace…"}):r?e.jsxs("div",{className:"h-full flex items-center justify-center text-red-400",children:["Error: ",r]}):e.jsxs("div",{className:"h-full flex overflow-hidden bg-gray-950 text-gray-100",children:[e.jsxs("div",{className:"w-64 shrink-0 flex flex-col border-r border-gray-800 bg-gray-900",children:[e.jsxs("div",{className:"p-2 border-b border-gray-800 space-y-1.5",children:[y.length>0&&e.jsxs("select",{value:x,onChange:t=>{N(t.target.value),g(0)},className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded px-2 py-1.5",children:[e.jsxs("option",{value:"all",children:["All runs (",l.length,")"]}),y.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsx("input",{type:"text",placeholder:"Search queries…",value:u,onChange:t=>{v(t.target.value),g(0)},className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded px-2 py-1.5 placeholder-gray-600"}),e.jsxs("div",{className:"text-[10px] text-gray-600",children:[b.length,x!=="all"||u?` / ${l.length}`:""," trajectories"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:b.map((t,i)=>e.jsxs("button",{onClick:()=>g(i),className:`w-full text-left px-3 py-2 border-b border-gray-800/50 text-xs transition-colors ${h===i?"bg-blue-900/40 text-blue-200 border-l-2 border-l-blue-500":"text-gray-400 hover:bg-gray-800"}`,children:[e.jsxs("div",{className:"font-medium text-gray-200",children:["#",t.query_id]}),e.jsxs("div",{className:"text-gray-500 truncate mt-0.5",children:[t.question.slice(0,60),"…"]}),e.jsxs("div",{className:"flex gap-2 mt-1 text-[10px] text-gray-600 flex-wrap items-center",children:[e.jsxs("span",{children:[t.n_tool_calls," tools"]}),e.jsxs("span",{children:[t.n_reasoning_steps," reasoning"]}),e.jsx("span",{className:t.status==="completed"?"text-green-600":"text-amber-600",children:t.status}),t.n_tool_calls===0&&e.jsx("span",{className:"px-1 py-0.5 rounded bg-yellow-900/50 text-yellow-300 font-semibold",children:"direct"})]}),t.run_name&&x==="all"&&e.jsx("div",{className:"mt-0.5 text-[9px] text-indigo-400 truncate",children:t.run_name})]},t.run_id))})]}),s?e.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2 bg-gray-900/60 border-b border-gray-800 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-100",children:["Query #",s.query_id]}),e.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${s.status==="completed"?"bg-green-900/50 text-green-300":"bg-amber-900/50 text-amber-300"}`,children:s.status}),e.jsxs("span",{className:"text-xs text-gray-500",children:[s.n_tool_calls," tool calls · ",s.n_reasoning_steps," reasoning"]}),s.n_tool_calls===0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-yellow-900/50 text-yellow-300 text-xs font-semibold",children:"direct"}),e.jsx("div",{className:"ml-auto flex gap-1",children:k.map(t=>e.jsx("button",{onClick:()=>j(t),className:`px-2 py-0.5 text-xs rounded border transition-colors capitalize ${o===t?"bg-blue-700 border-blue-500 text-white":"bg-gray-800 border-gray-700 text-gray-400 hover:border-gray-500"}`,children:t},t))})]}),e.jsx("div",{className:"mt-1 text-xs text-gray-300 leading-snug",children:s.question})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 min-w-0",children:[(o==="prompt"||o==="both")&&e.jsxs("div",{children:[o==="both"&&e.jsx("div",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-2",children:"Prompt"}),m[s.run_id]?e.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap text-gray-200 bg-gray-900 border border-gray-700 rounded p-3 leading-relaxed",children:m[s.run_id]}):e.jsx("div",{className:"text-gray-500 text-xs p-3",children:"Loading prompt…"})]}),(o==="trajectory"||o==="both")&&e.jsxs("div",{children:[o==="both"&&e.jsx("div",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-2 mt-4",children:"Trajectory"}),e.jsx(S,{text:s.trajectory_text})]})]})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-500",children:"No trajectory selected."})]})}export{E as default};
|
|
|
|
|
|
frontend/dist/assets/TrajExtApp-CLnrQONN.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as l,j as e}from"./index-qU3_rjRK.js";function S(a){if(!a||a==="(no trajectory steps)")return[];const n=[],d=a.split(/\n\n(?=\[)/);for(const c of d){const r=c.trim();r.startsWith("[Reasoning]:")?n.push({type:"reasoning",content:r.slice(12).trim()}):r.startsWith("[Tool call]")?n.push({type:"tool_call",content:r.slice(11).trim()}):r.startsWith("[Tool result]:")?n.push({type:"tool_result",content:r.slice(14).trim()}):r.startsWith("[Final answer]:")?n.push({type:"final_answer",content:r.slice(15).trim()}):r&&n.push({type:"unknown",content:r})}return n}const T={reasoning:{border:"border-purple-700",label:"Reasoning",labelColor:"text-purple-400",bg:"bg-purple-950/30"},tool_call:{border:"border-blue-700",label:"Tool Call",labelColor:"text-blue-400",bg:"bg-blue-950/30"},tool_result:{border:"border-gray-600",label:"Tool Result",labelColor:"text-gray-400",bg:"bg-gray-800/30"},final_answer:{border:"border-green-700",label:"Final Answer",labelColor:"text-green-400",bg:"bg-green-950/30"},unknown:{border:"border-gray-700",label:"—",labelColor:"text-gray-500",bg:""}};function C({text:a}){const n=l.useMemo(()=>S(a),[a]);return n.length===0?e.jsx("div",{className:"text-gray-500 text-xs",children:"No trajectory steps."}):e.jsx("div",{className:"space-y-2",children:n.map((d,c)=>{const r=T[d.type];return e.jsxs("div",{className:`border-l-2 ${r.border} ${r.bg} pl-3 py-1 rounded-r`,children:[e.jsx("div",{className:`text-[10px] font-bold uppercase tracking-widest mb-1 ${r.labelColor}`,children:r.label}),e.jsx("pre",{className:"text-xs text-gray-300 whitespace-pre-wrap font-mono leading-relaxed",children:d.content})]},c)})})}const k={traj_ext:"Full Trajectory (Tags)",traj_orig_ext:"Full Trajectory (Original Messages)",traj_summary_ext:"Summary (Tags)",traj_summary_orig_ext:"Summary (Original Messages)",traj_summary_ext_selected_tools:"Selected Tools (Tags)",traj_summary_orig_ext_selected_tools:"Selected Tools (Original Messages)"},f=a=>k[a]??a,E=["trajectory","prompt","both"];function q(){const[a,n]=l.useState([]),[d,c]=l.useState(!0),[r,j]=l.useState(null),[h,p]=l.useState(0),[o,_]=l.useState("trajectory"),[u,N]=l.useState(""),[x,v]=l.useState("all"),[m,w]=l.useState({});l.useEffect(()=>{c(!0),fetch("/api/traj-ext/").then(t=>{if(!t.ok)throw new Error(t.statusText);return t.json()}).then(t=>{n(t.rows),c(!1)}).catch(t=>{j(t.message),c(!1)})},[]);const y=l.useMemo(()=>Array.from(new Set(a.map(i=>i.run_name??""))).filter(Boolean).sort(),[a]),b=l.useMemo(()=>{let t=a;if(x!=="all"&&(t=t.filter(g=>g.run_name===x)),!u.trim())return t;const i=u.toLowerCase();return t.filter(g=>g.query_id.includes(i)||g.question.toLowerCase().includes(i))},[a,u,x]),s=b[h]??null;return l.useEffect(()=>{s&&(o!=="prompt"&&o!=="both"||m[s.run_id]||fetch(`/api/traj-ext/${encodeURIComponent(s.run_id)}`).then(t=>t.json()).then(t=>w(i=>({...i,[s.run_id]:t.formatted_prompt??""}))).catch(()=>{}))},[s==null?void 0:s.run_id,o]),d?e.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:"Loading traj-ext data from HuggingFace…"}):r?e.jsxs("div",{className:"h-full flex items-center justify-center text-red-400",children:["Error: ",r]}):e.jsxs("div",{className:"h-full flex overflow-hidden bg-gray-950 text-gray-100",children:[e.jsxs("div",{className:"w-64 shrink-0 flex flex-col border-r border-gray-800 bg-gray-900",children:[e.jsxs("div",{className:"p-2 border-b border-gray-800 space-y-1.5",children:[y.length>0&&e.jsxs("select",{value:x,onChange:t=>{v(t.target.value),p(0)},className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded px-2 py-1.5",children:[e.jsxs("option",{value:"all",children:["All runs (",a.length,")"]}),y.map(t=>e.jsx("option",{value:t,children:f(t)},t))]}),e.jsx("input",{type:"text",placeholder:"Search queries…",value:u,onChange:t=>{N(t.target.value),p(0)},className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded px-2 py-1.5 placeholder-gray-600"}),e.jsxs("div",{className:"text-[10px] text-gray-600",children:[b.length,x!=="all"||u?` / ${a.length}`:""," trajectories"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:b.map((t,i)=>e.jsxs("button",{onClick:()=>p(i),className:`w-full text-left px-3 py-2 border-b border-gray-800/50 text-xs transition-colors ${h===i?"bg-blue-900/40 text-blue-200 border-l-2 border-l-blue-500":"text-gray-400 hover:bg-gray-800"}`,children:[e.jsxs("div",{className:"font-medium text-gray-200",children:["#",t.query_id]}),e.jsxs("div",{className:"text-gray-500 truncate mt-0.5",children:[t.question.slice(0,60),"…"]}),e.jsxs("div",{className:"flex gap-2 mt-1 text-[10px] text-gray-600 flex-wrap items-center",children:[e.jsxs("span",{children:[t.n_tool_calls," tools"]}),e.jsxs("span",{children:[t.n_reasoning_steps," reasoning"]}),e.jsx("span",{className:t.status==="completed"?"text-green-600":"text-amber-600",children:t.status}),t.n_tool_calls===0&&e.jsx("span",{className:"px-1 py-0.5 rounded bg-yellow-900/50 text-yellow-300 font-semibold",children:"direct"})]}),t.run_name&&x==="all"&&e.jsx("div",{className:"mt-0.5 text-[9px] text-indigo-400 truncate",children:f(t.run_name)})]},t.run_id))})]}),s?e.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2 bg-gray-900/60 border-b border-gray-800 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-100",children:["Query #",s.query_id]}),e.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${s.status==="completed"?"bg-green-900/50 text-green-300":"bg-amber-900/50 text-amber-300"}`,children:s.status}),e.jsxs("span",{className:"text-xs text-gray-500",children:[s.n_tool_calls," tool calls · ",s.n_reasoning_steps," reasoning"]}),s.n_tool_calls===0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-yellow-900/50 text-yellow-300 text-xs font-semibold",children:"direct"}),e.jsx("div",{className:"ml-auto flex gap-1",children:E.map(t=>e.jsx("button",{onClick:()=>_(t),className:`px-2 py-0.5 text-xs rounded border transition-colors capitalize ${o===t?"bg-blue-700 border-blue-500 text-white":"bg-gray-800 border-gray-700 text-gray-400 hover:border-gray-500"}`,children:t},t))})]}),e.jsx("div",{className:"mt-1 text-xs text-gray-300 leading-snug",children:s.question})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 min-w-0",children:[(o==="prompt"||o==="both")&&e.jsxs("div",{children:[o==="both"&&e.jsx("div",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-2",children:"Prompt"}),m[s.run_id]?e.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap text-gray-200 bg-gray-900 border border-gray-700 rounded p-3 leading-relaxed",children:m[s.run_id]}):e.jsx("div",{className:"text-gray-500 text-xs p-3",children:"Loading prompt…"})]}),(o==="trajectory"||o==="both")&&e.jsxs("div",{children:[o==="both"&&e.jsx("div",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wide mb-2 mt-4",children:"Trajectory"}),e.jsx(C,{text:s.trajectory_text})]})]})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-gray-500",children:"No trajectory selected."})]})}export{q as default};
|
frontend/dist/assets/{VisualizerApp-COBLMQdU.js → VisualizerApp-DGOKN__B.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelApp-
|
| 2 |
-
import{u as o,j as e,n as d,r as a,_ as r}from"./index-
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelApp-iANtF2yU.js","assets/index-qU3_rjRK.js","assets/index-C3c50h0w.css","assets/PlanRevisionsApp-DyyEVbkc.js","assets/TrajExtApp-CLnrQONN.js","assets/SelectedToolsApp-IfXYrFjJ.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{u as o,j as e,n as d,r as a,_ as r}from"./index-qU3_rjRK.js";const c=a.lazy(()=>r(()=>import("./ModelApp-iANtF2yU.js"),__vite__mapDeps([0,1,2]))),n=a.lazy(()=>r(()=>import("./PlanRevisionsApp-DyyEVbkc.js"),__vite__mapDeps([3,1,2]))),x=a.lazy(()=>r(()=>import("./TrajExtApp-CLnrQONN.js"),__vite__mapDeps([4,1,2]))),m=a.lazy(()=>r(()=>import("./SelectedToolsApp-IfXYrFjJ.js"),__vite__mapDeps([5,1,2]))),i=[{id:"model",label:"Model Trace",activeClass:"border-blue-500 text-blue-400"},{id:"plan-revisions",label:"Plan Revisions",activeClass:"border-amber-500 text-amber-400"},{id:"traj-ext",label:"Traj Ext",activeClass:"border-emerald-500 text-emerald-400"},{id:"selected-tools",label:"Selected Tools",activeClass:"border-amber-400 text-amber-300"}],p=new Set(i.map(t=>t.id));function u(){const t=o(),s=p.has(t.tab)?t.tab:"model";return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsx("div",{className:"flex items-center border-b border-gray-800 bg-gray-900/50 px-2 shrink-0",children:i.map(l=>e.jsx("button",{onClick:()=>d({page:"viz",tab:l.id}),className:`px-5 py-2 text-sm font-medium border-b-2 transition-colors ${s===l.id?l.activeClass:"border-transparent text-gray-500 hover:text-gray-300"}`,children:l.label},l.id))}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsxs(a.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:[s==="model"&&e.jsx("div",{className:"theme-model h-full",children:e.jsx(c,{})}),s==="plan-revisions"&&e.jsx("div",{className:"h-full",children:e.jsx(n,{})}),s==="traj-ext"&&e.jsx("div",{className:"h-full",children:e.jsx(x,{})}),s==="selected-tools"&&e.jsx("div",{className:"h-full",children:e.jsx(m,{})})]})})]})}export{u as default};
|
frontend/dist/assets/{index-8LLguJlN.js → index-qU3_rjRK.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
frontend/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<title>RACA Dashboard</title>
|
| 7 |
-
<script type="module" crossorigin src="/assets/index-
|
| 8 |
<link rel="stylesheet" crossorigin href="/assets/index-C3c50h0w.css">
|
| 9 |
</head>
|
| 10 |
<body class="bg-gray-950 text-gray-100">
|
|
|
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
<title>RACA Dashboard</title>
|
| 7 |
+
<script type="module" crossorigin src="/assets/index-qU3_rjRK.js"></script>
|
| 8 |
<link rel="stylesheet" crossorigin href="/assets/index-C3c50h0w.css">
|
| 9 |
</head>
|
| 10 |
<body class="bg-gray-950 text-gray-100">
|
frontend/src/traj_ext/TrajExtApp.tsx
CHANGED
|
@@ -69,6 +69,16 @@ function TrajectoryView({ text }: { text: string }) {
|
|
| 69 |
);
|
| 70 |
}
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
const VIEW_MODES = ["trajectory", "prompt", "both"] as const;
|
| 73 |
type ViewMode = typeof VIEW_MODES[number];
|
| 74 |
|
|
@@ -132,7 +142,7 @@ export default function TrajExtApp() {
|
|
| 132 |
>
|
| 133 |
<option value="all">All runs ({data.length})</option>
|
| 134 |
{runNames.map(name => (
|
| 135 |
-
<option key={name} value={name}>{name}</option>
|
| 136 |
))}
|
| 137 |
</select>
|
| 138 |
)}
|
|
@@ -165,7 +175,7 @@ export default function TrajExtApp() {
|
|
| 165 |
)}
|
| 166 |
</div>
|
| 167 |
{row.run_name && runFilter === "all" && (
|
| 168 |
-
<div className="mt-0.5 text-[9px] text-indigo-400 truncate">{row.run_name}</div>
|
| 169 |
)}
|
| 170 |
</button>
|
| 171 |
))}
|
|
|
|
| 69 |
);
|
| 70 |
}
|
| 71 |
|
| 72 |
+
const RUN_DISPLAY_NAMES: Record<string, string> = {
|
| 73 |
+
"traj_ext": "Full Trajectory (Tags)",
|
| 74 |
+
"traj_orig_ext": "Full Trajectory (Original Messages)",
|
| 75 |
+
"traj_summary_ext": "Summary (Tags)",
|
| 76 |
+
"traj_summary_orig_ext": "Summary (Original Messages)",
|
| 77 |
+
"traj_summary_ext_selected_tools": "Selected Tools (Tags)",
|
| 78 |
+
"traj_summary_orig_ext_selected_tools": "Selected Tools (Original Messages)",
|
| 79 |
+
};
|
| 80 |
+
const displayName = (raw: string) => RUN_DISPLAY_NAMES[raw] ?? raw;
|
| 81 |
+
|
| 82 |
const VIEW_MODES = ["trajectory", "prompt", "both"] as const;
|
| 83 |
type ViewMode = typeof VIEW_MODES[number];
|
| 84 |
|
|
|
|
| 142 |
>
|
| 143 |
<option value="all">All runs ({data.length})</option>
|
| 144 |
{runNames.map(name => (
|
| 145 |
+
<option key={name} value={name}>{displayName(name)}</option>
|
| 146 |
))}
|
| 147 |
</select>
|
| 148 |
)}
|
|
|
|
| 175 |
)}
|
| 176 |
</div>
|
| 177 |
{row.run_name && runFilter === "all" && (
|
| 178 |
+
<div className="mt-0.5 text-[9px] text-indigo-400 truncate">{displayName(row.run_name)}</div>
|
| 179 |
)}
|
| 180 |
</button>
|
| 181 |
))}
|