diff --git a/src/uipath/dev/server/frontend/src/types/run.ts b/src/uipath/dev/server/frontend/src/types/run.ts
index a2963d0..e9fca39 100644
--- a/src/uipath/dev/server/frontend/src/types/run.ts
+++ b/src/uipath/dev/server/frontend/src/types/run.ts
@@ -81,6 +81,7 @@ export interface RunError {
code: string;
title: string;
detail: string;
+ category: string;
}
export interface InterruptEvent {
diff --git a/src/uipath/dev/server/serializers.py b/src/uipath/dev/server/serializers.py
index 34b6527..0b175de 100644
--- a/src/uipath/dev/server/serializers.py
+++ b/src/uipath/dev/server/serializers.py
@@ -106,6 +106,9 @@ def serialize_run(run: ExecutionRun) -> dict[str, Any]:
"code": run.error.code,
"title": run.error.title,
"detail": run.error.detail,
+ "category": run.error.category.value
+ if hasattr(run.error.category, "value")
+ else str(run.error.category),
}
if run.error
else None
diff --git a/src/uipath/dev/server/static/assets/index-D9R_e2zf.js b/src/uipath/dev/server/static/assets/index-B6o1WEr7.js
similarity index 99%
rename from src/uipath/dev/server/static/assets/index-D9R_e2zf.js
rename to src/uipath/dev/server/static/assets/index-B6o1WEr7.js
index f93b947..f34670e 100644
--- a/src/uipath/dev/server/static/assets/index-D9R_e2zf.js
+++ b/src/uipath/dev/server/static/assets/index-B6o1WEr7.js
@@ -149,5 +149,5 @@ ${v.join(`
`))+1))}const m="#".repeat(j),O=p.enter("headingAtx"),L=p.enter("phrasing");T.move(m+" ");let D=p.containerPhrasing(f,{before:"# ",after:`
`,...T.current()});return/^[\t ]/.test(D)&&(D=Sq(D.charCodeAt(0))+D.slice(1)),D=D?m+" "+D:m,p.options.closeAtx&&(D+=" "+m),L(),O(),D}G2n.peek=grt;function G2n(f){return f.value||""}function grt(){return"<"}U2n.peek=brt;function U2n(f,b,p,v){const j=hSe(p),T=j==='"'?"Quote":"Apostrophe",m=p.enter("image");let O=p.enter("label");const L=p.createTracker(v);let D=L.move("![");return D+=L.move(p.safe(f.alt,{before:D,after:"]",...L.current()})),D+=L.move("]("),O(),!f.url&&f.title||/[\0- \u007F]/.test(f.url)?(O=p.enter("destinationLiteral"),D+=L.move("<"),D+=L.move(p.safe(f.url,{before:D,after:">",...L.current()})),D+=L.move(">")):(O=p.enter("destinationRaw"),D+=L.move(p.safe(f.url,{before:D,after:f.title?" ":")",...L.current()}))),O(),f.title&&(O=p.enter(`title${T}`),D+=L.move(" "+j),D+=L.move(p.safe(f.title,{before:D,after:j,...L.current()})),D+=L.move(j),O()),D+=L.move(")"),m(),D}function brt(){return"!"}q2n.peek=wrt;function q2n(f,b,p,v){const j=f.referenceType,T=p.enter("imageReference");let m=p.enter("label");const O=p.createTracker(v);let L=O.move("![");const D=p.safe(f.alt,{before:L,after:"]",...O.current()});L+=O.move(D+"]["),m();const P=p.stack;p.stack=[],m=p.enter("reference");const z=p.safe(p.associationId(f),{before:L,after:"]",...O.current()});return m(),p.stack=P,T(),j==="full"||!D||D!==z?L+=O.move(z+"]"):j==="shortcut"?L=L.slice(0,-1):L+=O.move("]"),L}function wrt(){return"!"}X2n.peek=prt;function X2n(f,b,p){let v=f.value||"",j="`",T=-1;for(;new RegExp("(^|[^`])"+j+"([^`]|$)").test(v);)j+="`";for(/[^ \r\n]/.test(v)&&(/^[ \r\n]/.test(v)&&/[ \r\n]$/.test(v)||/^`|`$/.test(v))&&(v=" "+v+" ");++T
\u007F]/.test(f.url))}V2n.peek=mrt;function V2n(f,b,p,v){const j=hSe(p),T=j==='"'?"Quote":"Apostrophe",m=p.createTracker(v);let O,L;if(K2n(f,p)){const P=p.stack;p.stack=[],O=p.enter("autolink");let z=m.move("<");return z+=m.move(p.containerPhrasing(f,{before:z,after:">",...m.current()})),z+=m.move(">"),O(),p.stack=P,z}O=p.enter("link"),L=p.enter("label");let D=m.move("[");return D+=m.move(p.containerPhrasing(f,{before:D,after:"](",...m.current()})),D+=m.move("]("),L(),!f.url&&f.title||/[\0- \u007F]/.test(f.url)?(L=p.enter("destinationLiteral"),D+=m.move("<"),D+=m.move(p.safe(f.url,{before:D,after:">",...m.current()})),D+=m.move(">")):(L=p.enter("destinationRaw"),D+=m.move(p.safe(f.url,{before:D,after:f.title?" ":")",...m.current()}))),L(),f.title&&(L=p.enter(`title${T}`),D+=m.move(" "+j),D+=m.move(p.safe(f.title,{before:D,after:j,...m.current()})),D+=m.move(j),L()),D+=m.move(")"),O(),D}function mrt(f,b,p){return K2n(f,p)?"<":"["}Y2n.peek=vrt;function Y2n(f,b,p,v){const j=f.referenceType,T=p.enter("linkReference");let m=p.enter("label");const O=p.createTracker(v);let L=O.move("[");const D=p.containerPhrasing(f,{before:L,after:"]",...O.current()});L+=O.move(D+"]["),m();const P=p.stack;p.stack=[],m=p.enter("reference");const z=p.safe(p.associationId(f),{before:L,after:"]",...O.current()});return m(),p.stack=P,T(),j==="full"||!D||D!==z?L+=O.move(z+"]"):j==="shortcut"?L=L.slice(0,-1):L+=O.move("]"),L}function vrt(){return"["}function dSe(f){const b=f.options.bullet||"*";if(b!=="*"&&b!=="+"&&b!=="-")throw new Error("Cannot serialize items with `"+b+"` for `options.bullet`, expected `*`, `+`, or `-`");return b}function yrt(f){const b=dSe(f),p=f.options.bulletOther;if(!p)return b==="*"?"-":"*";if(p!=="*"&&p!=="+"&&p!=="-")throw new Error("Cannot serialize items with `"+p+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(p===b)throw new Error("Expected `bullet` (`"+b+"`) and `bulletOther` (`"+p+"`) to be different");return p}function krt(f){const b=f.options.bulletOrdered||".";if(b!=="."&&b!==")")throw new Error("Cannot serialize items with `"+b+"` for `options.bulletOrdered`, expected `.` or `)`");return b}function Q2n(f){const b=f.options.rule||"*";if(b!=="*"&&b!=="-"&&b!=="_")throw new Error("Cannot serialize rules with `"+b+"` for `options.rule`, expected `*`, `-`, or `_`");return b}function xrt(f,b,p,v){const j=p.enter("list"),T=p.bulletCurrent;let m=f.ordered?krt(p):dSe(p);const O=f.ordered?m==="."?")":".":yrt(p);let L=b&&p.bulletLastUsed?m===p.bulletLastUsed:!1;if(!f.ordered){const P=f.children?f.children[0]:void 0;if((m==="*"||m==="-")&&P&&(!P.children||!P.children[0])&&p.stack[p.stack.length-1]==="list"&&p.stack[p.stack.length-2]==="listItem"&&p.stack[p.stack.length-3]==="list"&&p.stack[p.stack.length-4]==="listItem"&&p.indexStack[p.indexStack.length-1]===0&&p.indexStack[p.indexStack.length-2]===0&&p.indexStack[p.indexStack.length-3]===0&&(L=!0),Q2n(p)===m&&P){let z=-1;for(;++z-1?b.start:1)+(p.options.incrementListMarker===!1?0:b.children.indexOf(f))+T);let m=T.length+1;(j==="tab"||j==="mixed"&&(b&&b.type==="list"&&b.spread||f.spread))&&(m=Math.ceil(m/4)*4);const O=p.createTracker(v);O.move(T+" ".repeat(m-T.length)),O.shift(m);const L=p.enter("listItem"),D=p.indentLines(p.containerFlow(f,O.current()),P);return L(),D;function P(z,X,q){return X?(q?"":" ".repeat(m))+z:(q?T:T+" ".repeat(m-T.length))+z}}function jrt(f,b,p,v){const j=p.enter("paragraph"),T=p.enter("phrasing"),m=p.containerPhrasing(f,v);return T(),j(),m}const Art=yse(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Trt(f,b,p,v){return(f.children.some(function(m){return Art(m)})?p.containerPhrasing:p.containerFlow).call(p,f,v)}function Mrt(f){const b=f.options.strong||"*";if(b!=="*"&&b!=="_")throw new Error("Cannot serialize strong with `"+b+"` for `options.strong`, expected `*`, or `_`");return b}W2n.peek=Crt;function W2n(f,b,p,v){const j=Mrt(p),T=p.enter("strong"),m=p.createTracker(v),O=m.move(j+j);let L=m.move(p.containerPhrasing(f,{after:j,before:O,...m.current()}));const D=L.charCodeAt(0),P=sse(v.before.charCodeAt(v.before.length-1),D,j);P.inside&&(L=Sq(D)+L.slice(1));const z=L.charCodeAt(L.length-1),X=sse(v.after.charCodeAt(0),z,j);X.inside&&(L=L.slice(0,-1)+Sq(z));const q=m.move(j+j);return T(),p.attentionEncodeSurroundingInfo={after:X.outside,before:P.outside},O+L+q}function Crt(f,b,p){return p.options.strong||"*"}function Ort(f,b,p,v){return p.safe(f.value,v)}function Nrt(f){const b=f.options.ruleRepetition||3;if(b<3)throw new Error("Cannot serialize rules with repetition `"+b+"` for `options.ruleRepetition`, expected `3` or more");return b}function Drt(f,b,p){const v=(Q2n(p)+(p.options.ruleSpaces?" ":"")).repeat(Nrt(p));return p.options.ruleSpaces?v.slice(0,-1):v}const Z2n={blockquote:nrt,break:wwn,code:ort,definition:lrt,emphasis:J2n,hardBreak:wwn,heading:drt,html:G2n,image:U2n,imageReference:q2n,inlineCode:X2n,link:V2n,linkReference:Y2n,list:xrt,listItem:Srt,paragraph:jrt,root:Trt,strong:W2n,text:Ort,thematicBreak:Drt};function _rt(){return{enter:{table:Lrt,tableData:pwn,tableHeader:pwn,tableRow:Rrt},exit:{codeText:Prt,table:Irt,tableData:cEe,tableHeader:cEe,tableRow:cEe}}}function Lrt(f){const b=f._align;this.enter({type:"table",align:b.map(function(p){return p==="none"?null:p}),children:[]},f),this.data.inTable=!0}function Irt(f){this.exit(f),this.data.inTable=void 0}function Rrt(f){this.enter({type:"tableRow",children:[]},f)}function cEe(f){this.exit(f)}function pwn(f){this.enter({type:"tableCell",children:[]},f)}function Prt(f){let b=this.resume();this.data.inTable&&(b=b.replace(/\\([\\|])/g,$rt));const p=this.stack[this.stack.length-1];p.type,p.value=b,this.exit(f)}function $rt(f,b){return b==="|"?b:f}function Brt(f){const b=f||{},p=b.tableCellPadding,v=b.tablePipeAlign,j=b.stringLength,T=p?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:X,table:m,tableCell:L,tableRow:O}};function m(q,ue,Y,xe){return D(P(q,Y,xe),q.align)}function O(q,ue,Y,xe){const ce=z(q,Y,xe),Ae=D([ce]);return Ae.slice(0,Ae.indexOf(`
-`))}function L(q,ue,Y,xe){const ce=Y.enter("tableCell"),Ae=Y.enter("phrasing"),Le=Y.containerPhrasing(q,{...xe,before:T,after:T});return Ae(),ce(),Le}function D(q,ue){return Zit(q,{align:ue,alignDelimiters:v,padding:p,stringLength:j})}function P(q,ue,Y){const xe=q.children;let ce=-1;const Ae=[],Le=ue.enter("table");for(;++ce0&&!p&&(f[f.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),p}const ict={tokenize:act,partial:!0};function rct(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sct,continuation:{tokenize:lct},exit:fct}},text:{91:{name:"gfmFootnoteCall",tokenize:oct},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:cct,resolveTo:uct}}}}function cct(f,b,p){const v=this;let j=v.events.length;const T=v.parser.gfmFootnotes||(v.parser.gfmFootnotes=[]);let m;for(;j--;){const L=v.events[j][1];if(L.type==="labelImage"){m=L;break}if(L.type==="gfmFootnoteCall"||L.type==="labelLink"||L.type==="label"||L.type==="image"||L.type==="link")break}return O;function O(L){if(!m||!m._balanced)return p(L);const D=Sv(v.sliceSerialize({start:m.end,end:v.now()}));return D.codePointAt(0)!==94||!T.includes(D.slice(1))?p(L):(f.enter("gfmFootnoteCallLabelMarker"),f.consume(L),f.exit("gfmFootnoteCallLabelMarker"),b(L))}}function uct(f,b){let p=f.length;for(;p--;)if(f[p][1].type==="labelImage"&&f[p][0]==="enter"){f[p][1];break}f[p+1][1].type="data",f[p+3][1].type="gfmFootnoteCallLabelMarker";const v={type:"gfmFootnoteCall",start:Object.assign({},f[p+3][1].start),end:Object.assign({},f[f.length-1][1].end)},j={type:"gfmFootnoteCallMarker",start:Object.assign({},f[p+3][1].end),end:Object.assign({},f[p+3][1].end)};j.end.column++,j.end.offset++,j.end._bufferIndex++;const T={type:"gfmFootnoteCallString",start:Object.assign({},j.end),end:Object.assign({},f[f.length-1][1].start)},m={type:"chunkString",contentType:"string",start:Object.assign({},T.start),end:Object.assign({},T.end)},O=[f[p+1],f[p+2],["enter",v,b],f[p+3],f[p+4],["enter",j,b],["exit",j,b],["enter",T,b],["enter",m,b],["exit",m,b],["exit",T,b],f[f.length-2],f[f.length-1],["exit",v,b]];return f.splice(p,f.length-p+1,...O),f}function oct(f,b,p){const v=this,j=v.parser.gfmFootnotes||(v.parser.gfmFootnotes=[]);let T=0,m;return O;function O(z){return f.enter("gfmFootnoteCall"),f.enter("gfmFootnoteCallLabelMarker"),f.consume(z),f.exit("gfmFootnoteCallLabelMarker"),L}function L(z){return z!==94?p(z):(f.enter("gfmFootnoteCallMarker"),f.consume(z),f.exit("gfmFootnoteCallMarker"),f.enter("gfmFootnoteCallString"),f.enter("chunkString").contentType="string",D)}function D(z){if(T>999||z===93&&!m||z===null||z===91||Fs(z))return p(z);if(z===93){f.exit("chunkString");const X=f.exit("gfmFootnoteCallString");return j.includes(Sv(v.sliceSerialize(X)))?(f.enter("gfmFootnoteCallLabelMarker"),f.consume(z),f.exit("gfmFootnoteCallLabelMarker"),f.exit("gfmFootnoteCall"),b):p(z)}return Fs(z)||(m=!0),T++,f.consume(z),z===92?P:D}function P(z){return z===91||z===92||z===93?(f.consume(z),T++,D):D(z)}}function sct(f,b,p){const v=this,j=v.parser.gfmFootnotes||(v.parser.gfmFootnotes=[]);let T,m=0,O;return L;function L(ue){return f.enter("gfmFootnoteDefinition")._container=!0,f.enter("gfmFootnoteDefinitionLabel"),f.enter("gfmFootnoteDefinitionLabelMarker"),f.consume(ue),f.exit("gfmFootnoteDefinitionLabelMarker"),D}function D(ue){return ue===94?(f.enter("gfmFootnoteDefinitionMarker"),f.consume(ue),f.exit("gfmFootnoteDefinitionMarker"),f.enter("gfmFootnoteDefinitionLabelString"),f.enter("chunkString").contentType="string",P):p(ue)}function P(ue){if(m>999||ue===93&&!O||ue===null||ue===91||Fs(ue))return p(ue);if(ue===93){f.exit("chunkString");const Y=f.exit("gfmFootnoteDefinitionLabelString");return T=Sv(v.sliceSerialize(Y)),f.enter("gfmFootnoteDefinitionLabelMarker"),f.consume(ue),f.exit("gfmFootnoteDefinitionLabelMarker"),f.exit("gfmFootnoteDefinitionLabel"),X}return Fs(ue)||(O=!0),m++,f.consume(ue),ue===92?z:P}function z(ue){return ue===91||ue===92||ue===93?(f.consume(ue),m++,P):P(ue)}function X(ue){return ue===58?(f.enter("definitionMarker"),f.consume(ue),f.exit("definitionMarker"),j.includes(T)||j.push(T),Zu(f,q,"gfmFootnoteDefinitionWhitespace")):p(ue)}function q(ue){return b(ue)}}function lct(f,b,p){return f.check(Oq,b,f.attempt(ict,b,p))}function fct(f){f.exit("gfmFootnoteDefinition")}function act(f,b,p){const v=this;return Zu(f,j,"gfmFootnoteDefinitionIndent",5);function j(T){const m=v.events[v.events.length-1];return m&&m[1].type==="gfmFootnoteDefinitionIndent"&&m[2].sliceSerialize(m[1],!0).length===4?b(T):p(T)}}function hct(f){let p=(f||{}).singleTilde;const v={name:"strikethrough",tokenize:T,resolveAll:j};return p==null&&(p=!0),{text:{126:v},insideSpan:{null:[v]},attentionMarkers:{null:[126]}};function j(m,O){let L=-1;for(;++L1?L(ue):(m.consume(ue),z++,q);if(z<2&&!p)return L(ue);const xe=m.exit("strikethroughSequenceTemporary"),ce=pL(ue);return xe._open=!ce||ce===2&&!!Y,xe._close=!Y||Y===2&&!!ce,O(ue)}}}class dct{constructor(){this.map=[]}add(b,p,v){gct(this,b,p,v)}consume(b){if(this.map.sort(function(T,m){return T[0]-m[0]}),this.map.length===0)return;let p=this.map.length;const v=[];for(;p>0;)p-=1,v.push(b.slice(this.map[p][0]+this.map[p][1]),this.map[p][2]),b.length=this.map[p][0];v.push(b.slice()),b.length=0;let j=v.pop();for(;j;){for(const T of j)b.push(T);j=v.pop()}this.map.length=0}}function gct(f,b,p,v){let j=0;if(!(p===0&&v.length===0)){for(;j-1;){const we=v.events[pn][1].type;if(we==="lineEnding"||we==="linePrefix")pn--;else break}const Cn=pn>-1?v.events[pn][1].type:null,Q=Cn==="tableHead"||Cn==="tableRow"?Fe:L;return Q===Fe&&v.parser.lazy[v.now().line]?p(Ke):Q(Ke)}function L(Ke){return f.enter("tableHead"),f.enter("tableRow"),D(Ke)}function D(Ke){return Ke===124||(m=!0,T+=1),P(Ke)}function P(Ke){return Ke===null?p(Ke):Fr(Ke)?T>1?(T=0,v.interrupt=!0,f.exit("tableRow"),f.enter("lineEnding"),f.consume(Ke),f.exit("lineEnding"),q):p(Ke):Mu(Ke)?Zu(f,P,"whitespace")(Ke):(T+=1,m&&(m=!1,j+=1),Ke===124?(f.enter("tableCellDivider"),f.consume(Ke),f.exit("tableCellDivider"),m=!0,P):(f.enter("data"),z(Ke)))}function z(Ke){return Ke===null||Ke===124||Fs(Ke)?(f.exit("data"),P(Ke)):(f.consume(Ke),Ke===92?X:z)}function X(Ke){return Ke===92||Ke===124?(f.consume(Ke),z):z(Ke)}function q(Ke){return v.interrupt=!1,v.parser.lazy[v.now().line]?p(Ke):(f.enter("tableDelimiterRow"),m=!1,Mu(Ke)?Zu(f,ue,"linePrefix",v.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ke):ue(Ke))}function ue(Ke){return Ke===45||Ke===58?xe(Ke):Ke===124?(m=!0,f.enter("tableCellDivider"),f.consume(Ke),f.exit("tableCellDivider"),Y):wn(Ke)}function Y(Ke){return Mu(Ke)?Zu(f,xe,"whitespace")(Ke):xe(Ke)}function xe(Ke){return Ke===58?(T+=1,m=!0,f.enter("tableDelimiterMarker"),f.consume(Ke),f.exit("tableDelimiterMarker"),ce):Ke===45?(T+=1,ce(Ke)):Ke===null||Fr(Ke)?ze(Ke):wn(Ke)}function ce(Ke){return Ke===45?(f.enter("tableDelimiterFiller"),Ae(Ke)):wn(Ke)}function Ae(Ke){return Ke===45?(f.consume(Ke),Ae):Ke===58?(m=!0,f.exit("tableDelimiterFiller"),f.enter("tableDelimiterMarker"),f.consume(Ke),f.exit("tableDelimiterMarker"),Le):(f.exit("tableDelimiterFiller"),Le(Ke))}function Le(Ke){return Mu(Ke)?Zu(f,ze,"whitespace")(Ke):ze(Ke)}function ze(Ke){return Ke===124?ue(Ke):Ke===null||Fr(Ke)?!m||j!==T?wn(Ke):(f.exit("tableDelimiterRow"),f.exit("tableHead"),b(Ke)):wn(Ke)}function wn(Ke){return p(Ke)}function Fe(Ke){return f.enter("tableRow"),hn(Ke)}function hn(Ke){return Ke===124?(f.enter("tableCellDivider"),f.consume(Ke),f.exit("tableCellDivider"),hn):Ke===null||Fr(Ke)?(f.exit("tableRow"),b(Ke)):Mu(Ke)?Zu(f,hn,"whitespace")(Ke):(f.enter("data"),nt(Ke))}function nt(Ke){return Ke===null||Ke===124||Fs(Ke)?(f.exit("data"),hn(Ke)):(f.consume(Ke),Ke===92?Tn:nt)}function Tn(Ke){return Ke===92||Ke===124?(f.consume(Ke),nt):nt(Ke)}}function mct(f,b){let p=-1,v=!0,j=0,T=[0,0,0,0],m=[0,0,0,0],O=!1,L=0,D,P,z;const X=new dct;for(;++pp[2]+1){const ue=p[2]+1,Y=p[3]-p[2]-1;f.add(ue,Y,[])}}f.add(p[3]+1,0,[["exit",z,b]])}return j!==void 0&&(T.end=Object.assign({},sL(b.events,j)),f.add(j,0,[["exit",T,b]]),T=void 0),T}function vwn(f,b,p,v,j){const T=[],m=sL(b.events,p);j&&(j.end=Object.assign({},m),T.push(["exit",j,b])),v.end=Object.assign({},m),T.push(["exit",v,b]),f.add(p+1,0,T)}function sL(f,b){const p=f[b],v=p[0]==="enter"?"start":"end";return p[1][v]}const vct={name:"tasklistCheck",tokenize:kct};function yct(){return{text:{91:vct}}}function kct(f,b,p){const v=this;return j;function j(L){return v.previous!==null||!v._gfmTasklistFirstContentOfListItem?p(L):(f.enter("taskListCheck"),f.enter("taskListCheckMarker"),f.consume(L),f.exit("taskListCheckMarker"),T)}function T(L){return Fs(L)?(f.enter("taskListCheckValueUnchecked"),f.consume(L),f.exit("taskListCheckValueUnchecked"),m):L===88||L===120?(f.enter("taskListCheckValueChecked"),f.consume(L),f.exit("taskListCheckValueChecked"),m):p(L)}function m(L){return L===93?(f.enter("taskListCheckMarker"),f.consume(L),f.exit("taskListCheckMarker"),f.exit("taskListCheck"),O):p(L)}function O(L){return Fr(L)?b(L):Mu(L)?f.check({tokenize:xct},b,p)(L):p(L)}}function xct(f,b,p){return Zu(f,v,"whitespace");function v(j){return j===null?p(j):b(j)}}function Ect(f){return m2n([Krt(),rct(),hct(f),wct(),yct()])}const Sct={};function jct(f){const b=this,p=f||Sct,v=b.data(),j=v.micromarkExtensions||(v.micromarkExtensions=[]),T=v.fromMarkdownExtensions||(v.fromMarkdownExtensions=[]),m=v.toMarkdownExtensions||(v.toMarkdownExtensions=[]);j.push(Ect(p)),T.push(Grt()),m.push(Urt(p))}const Act={user:{label:"You",color:"var(--info)"},tool:{label:"Tool",color:"var(--warning)"},assistant:{label:"AI",color:"var(--success)"}};function Tct({message:f,onToolCallClick:b,toolCallIndices:p}){const v=f.role==="user",j=f.tool_calls&&f.tool_calls.length>0,m=Act[v?"user":j?"tool":"assistant"];return de.jsxs("div",{className:"py-1.5",children:[de.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[de.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:m.color}}),de.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:m.color},children:m.label})]}),f.content&&(v?de.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:f.content}):de.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:de.jsx(hit,{remarkPlugins:[jct],children:f.content})})),f.tool_calls&&f.tool_calls.length>0&&de.jsx("div",{className:"flex flex-wrap gap-1 mt-1 pl-2.5",children:f.tool_calls.map((O,L)=>de.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono px-1.5 py-0.5 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:O.has_result?"var(--success)":"var(--text-muted)"},onClick:()=>b==null?void 0:b(O.name,(p==null?void 0:p[L])??0),children:[O.has_result?"✓":"•"," ",O.name]},`${O.name}-${L}`))})]})}function Mct({onSend:f,disabled:b,placeholder:p}){const[v,j]=an.useState(""),T=()=>{const L=v.trim();L&&(f(L),j(""))},m=L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),T())},O=!b&&v.trim().length>0;return de.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[de.jsx("input",{value:v,onChange:L=>j(L.target.value),onKeyDown:m,disabled:b,placeholder:p??"Message...",className:"flex-1 bg-transparent text-sm py-1 focus:outline-none disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),de.jsx("button",{onClick:T,disabled:!O,className:"text-[11px] uppercase tracking-wider font-semibold px-2 py-1 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:O?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:L=>{O&&(L.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:L=>{L.currentTarget.style.background="transparent"},children:"Send"})]})}function Cct({interrupt:f,onRespond:b}){const[p,v]=an.useState("");return f.interrupt_type==="tool_call_confirmation"?de.jsxs("div",{className:"mx-3 my-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--warning) 40%, var(--border))"},children:[de.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"color-mix(in srgb, var(--warning) 10%, var(--bg-secondary))"},children:[de.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:"var(--warning)"},children:"Action Required"}),f.tool_name&&de.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--text-primary)"},children:f.tool_name})]}),f.input_value!=null&&de.jsx("pre",{className:"px-3 py-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-normal",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",maxHeight:200},children:typeof f.input_value=="string"?f.input_value:JSON.stringify(f.input_value,null,2)}),de.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[de.jsx("button",{onClick:()=>b({approved:!0}),className:"text-[10px] uppercase tracking-wider font-semibold px-3 py-1 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--success) 15%, var(--bg-secondary))",color:"var(--success)",border:"1px solid color-mix(in srgb, var(--success) 30%, var(--border))"},onMouseEnter:j=>{j.currentTarget.style.background="color-mix(in srgb, var(--success) 25%, var(--bg-secondary))"},onMouseLeave:j=>{j.currentTarget.style.background="color-mix(in srgb, var(--success) 15%, var(--bg-secondary))"},children:"Approve"}),de.jsx("button",{onClick:()=>b({approved:!1}),className:"text-[10px] uppercase tracking-wider font-semibold px-3 py-1 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)",border:"1px solid color-mix(in srgb, var(--error) 30%, var(--border))"},onMouseEnter:j=>{j.currentTarget.style.background="color-mix(in srgb, var(--error) 25%, var(--bg-secondary))"},onMouseLeave:j=>{j.currentTarget.style.background="color-mix(in srgb, var(--error) 15%, var(--bg-secondary))"},children:"Reject"})]})]}):de.jsxs("div",{className:"mx-3 my-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--accent) 40%, var(--border))"},children:[de.jsx("div",{className:"px-3 py-2",style:{background:"color-mix(in srgb, var(--accent) 10%, var(--bg-secondary))"},children:de.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:"var(--accent)"},children:"Input Required"})}),f.content!=null&&de.jsx("div",{className:"px-3 py-2 text-sm leading-relaxed",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)"},children:typeof f.content=="string"?f.content:JSON.stringify(f.content,null,2)}),de.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[de.jsx("input",{value:p,onChange:j=>v(j.target.value),onKeyDown:j=>{j.key==="Enter"&&!j.shiftKey&&p.trim()&&(j.preventDefault(),b({response:p.trim()}))},placeholder:"Type your response...",className:"flex-1 bg-transparent text-sm py-1 focus:outline-none placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),de.jsx("button",{onClick:()=>{p.trim()&&b({response:p.trim()})},disabled:!p.trim(),className:"text-[11px] uppercase tracking-wider font-semibold px-2 py-1 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:p.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},children:"Send"})]})]})}function Oct({messages:f,runId:b,runStatus:p,ws:v}){const j=an.useRef(null),T=an.useRef(!0),m=Hu(ce=>ce.addLocalChatMessage),O=Hu(ce=>ce.setFocusedSpan),L=Hu(ce=>ce.activeInterrupt[b]??null),D=Hu(ce=>ce.setActiveInterrupt),P=an.useMemo(()=>{const ce=new Map,Ae=new Map;for(const Le of f)if(Le.tool_calls){const ze=[];for(const wn of Le.tool_calls){const Fe=Ae.get(wn.name)??0;ze.push(Fe),Ae.set(wn.name,Fe+1)}ce.set(Le.message_id,ze)}return ce},[f]),[z,X]=an.useState(!1),q=()=>{const ce=j.current;if(!ce)return;const Ae=ce.scrollHeight-ce.scrollTop-ce.clientHeight<40;T.current=Ae,X(ce.scrollTop>100)};an.useEffect(()=>{T.current&&j.current&&(j.current.scrollTop=j.current.scrollHeight)});const ue=ce=>{T.current=!0,m(b,{message_id:`local-${Date.now()}`,role:"user",content:ce}),v.sendChatMessage(b,ce)},Y=ce=>{T.current=!0,v.sendInterruptResponse(b,ce),D(b,null)},xe=p==="running"||!!L;return de.jsxs("div",{className:"flex flex-col h-full",children:[de.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[de.jsxs("div",{ref:j,onScroll:q,className:"h-full overflow-y-auto px-3 py-2 space-y-0.5",children:[f.length===0&&de.jsx("p",{className:"text-[var(--text-muted)] text-sm text-center py-6",children:"No messages yet"}),f.map(ce=>de.jsx(Tct,{message:ce,toolCallIndices:P.get(ce.message_id),onToolCallClick:(Ae,Le)=>O({name:Ae,index:Le})},ce.message_id)),L&&de.jsx(Cct,{interrupt:L,onRespond:Y})]}),z&&de.jsx("button",{onClick:()=>{var ce;return(ce=j.current)==null?void 0:ce.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:de.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:de.jsx("polyline",{points:"18 15 12 9 6 15"})})})]}),de.jsx(Mct,{onSend:ue,disabled:xe,placeholder:L?"Respond to the interrupt above...":xe?"Waiting for response...":"Message..."})]})}const Nct={started:{color:"var(--accent)",label:"started"},updated:{color:"var(--info)",label:"updated"},completed:{color:"var(--success)",label:"completed"},faulted:{color:"var(--error)",label:"faulted"}},ywn={color:"var(--text-muted)",label:""};function Dct({events:f,runStatus:b}){const p=an.useRef(null),v=an.useRef(!0),[j,T]=an.useState(null),m=()=>{const O=p.current;O&&(v.current=O.scrollHeight-O.scrollTop-O.clientHeight<40)};return an.useEffect(()=>{v.current&&p.current&&(p.current.scrollTop=p.current.scrollHeight)}),f.length===0?de.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:de.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:b==="running"?"Waiting for events...":"No events yet"})}):de.jsx("div",{ref:p,onScroll:m,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:f.map((O,L)=>{const D=new Date(O.timestamp).toLocaleTimeString(void 0,{hour12:!1}),P=O.payload&&Object.keys(O.payload).length>0,z=j===L,X=O.phase?Nct[O.phase]??ywn:ywn;return de.jsxs("div",{children:[de.jsxs("div",{onClick:()=>{P&&T(z?null:L)},className:"flex items-center gap-2 px-3 py-1.5",style:{background:L%2===0?"var(--bg-primary)":"var(--bg-secondary)",cursor:P?"pointer":"default"},children:[de.jsx("span",{className:"shrink-0",style:{color:"var(--text-muted)"},children:D}),de.jsx("span",{className:"shrink-0",style:{color:X.color},children:"●"}),de.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:O.node_name}),X.label&&de.jsx("span",{className:"shrink-0 text-[10px]",style:{color:"var(--text-muted)"},children:X.label}),P&&de.jsx("span",{className:"shrink-0 text-[9px] transition-transform",style:{color:"var(--text-muted)",transform:z?"rotate(90deg)":"rotate(0deg)"},children:"▸"})]}),z&&P&&de.jsx("div",{className:"px-3 py-2 border-t border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-secondary) 80%, var(--bg-primary))"},children:de.jsx(xq,{json:JSON.stringify(O.payload,null,2),className:"text-[11px] font-mono whitespace-pre-wrap break-words"})})]},L)})})}function _ct({runId:f,status:b,ws:p,breakpointNode:v}){const j=b==="suspended",T=m=>{const O=Hu.getState().breakpoints[f]??{};p.setBreakpoints(f,Object.keys(O)),m==="step"?p.debugStep(f):m==="continue"?p.debugContinue(f):p.debugStop(f)};return de.jsxs("div",{className:"flex items-center gap-1 px-4 py-2.5 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[de.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold mr-1",style:{color:"var(--text-muted)"},children:"Debug"}),de.jsx(uEe,{label:"Step",onClick:()=>T("step"),disabled:!j,color:"var(--info)",active:j}),de.jsx(uEe,{label:"Continue",onClick:()=>T("continue"),disabled:!j,color:"var(--success)",active:j}),de.jsx(uEe,{label:"Stop",onClick:()=>T("stop"),disabled:!j,color:"var(--error)",active:j}),de.jsx("span",{className:"text-[10px] ml-auto truncate",style:{color:j?"var(--accent)":"var(--text-muted)"},children:j?v?`Paused at ${v}`:"Paused":b})]})}function uEe({label:f,onClick:b,disabled:p,color:v,active:j}){return de.jsx("button",{onClick:b,disabled:p,className:"px-2.5 py-0.5 h-5 text-[10px] uppercase tracking-wider font-semibold rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:j?v:"var(--text-muted)",background:j?`color-mix(in srgb, ${v} 10%, transparent)`:"transparent"},onMouseEnter:T=>{p||(T.currentTarget.style.background=`color-mix(in srgb, ${v} 20%, transparent)`)},onMouseLeave:T=>{T.currentTarget.style.background=j?`color-mix(in srgb, ${v} 10%, transparent)`:"transparent"},children:f})}const Lct=[],Ict=[],Rct=[],Pct=[];function $ct({run:f,ws:b}){const p=f.mode==="chat",[v,j]=an.useState(280),[T,m]=an.useState(()=>{const pn=localStorage.getItem("chatPanelWidth");return pn?parseInt(pn,10):380}),[O,L]=an.useState("primary"),[D,P]=an.useState(0),z=an.useRef(null),X=an.useRef(null),q=an.useRef(!1),ue=Hu(pn=>pn.traces[f.id]||Lct),Y=Hu(pn=>pn.logs[f.id]||Ict),xe=Hu(pn=>pn.chatMessages[f.id]||Rct),ce=Hu(pn=>pn.stateEvents[f.id]||Pct),Ae=Hu(pn=>pn.breakpoints[f.id]);an.useEffect(()=>{b.setBreakpoints(f.id,Ae?Object.keys(Ae):[])},[f.id]);const Le=an.useCallback(pn=>{b.setBreakpoints(f.id,pn)},[f.id,b]),ze=an.useCallback(pn=>{pn.preventDefault(),q.current=!0;const Cn=pn.clientY,Q=v,we=oe=>{if(!q.current)return;const Ue=z.current;if(!Ue)return;const En=Ue.clientHeight-100,ln=Math.max(80,Math.min(En,Q+(oe.clientY-Cn)));j(ln)},_e=()=>{q.current=!1,document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",_e),document.body.style.cursor="",document.body.style.userSelect="",P(oe=>oe+1)};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",we),document.addEventListener("mouseup",_e)},[v]),wn=an.useCallback(pn=>{pn.preventDefault();const Cn=pn.clientX,Q=T,we=oe=>{const Ue=X.current;if(!Ue)return;const En=Ue.clientWidth-300,ln=Math.max(280,Math.min(En,Q+(Cn-oe.clientX)));m(ln)},_e=()=>{document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",_e),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("chatPanelWidth",String(T)),P(oe=>oe+1)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",we),document.addEventListener("mouseup",_e)},[T]),Fe=p?"Chat":"Events",hn=p?"var(--accent)":"var(--success)",nt=[{id:"primary",label:Fe},{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:Y.length}],Tn=Hu(pn=>pn.activeInterrupt[f.id]??null),Ke=f.status==="running"?de.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:p?"Thinking...":"Running..."}):p&&f.status==="suspended"&&Tn?de.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Action Required"}):null;return de.jsxs("div",{ref:X,className:"flex h-full",children:[de.jsxs("div",{ref:z,className:"flex flex-col flex-1 min-w-0",children:[(f.mode==="debug"||f.status==="suspended"&&!Tn||Ae&&Object.keys(Ae).length>0)&&de.jsx(_ct,{runId:f.id,status:f.status,ws:b,breakpointNode:f.breakpoint_node}),de.jsx("div",{className:"shrink-0",style:{height:v},children:de.jsx(t2n,{entrypoint:f.entrypoint,traces:ue,runId:f.id,breakpointNode:f.breakpoint_node,breakpointNextNodes:f.breakpoint_next_nodes,onBreakpointChange:Le,fitViewTrigger:D})}),de.jsx("div",{onMouseDown:ze,className:"shrink-0 h-1.5 cursor-row-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",children:de.jsx("div",{className:"absolute inset-0 -top-1 -bottom-1"})}),de.jsx("div",{className:"flex-1 overflow-hidden",children:de.jsx(YWn,{traces:ue})})]}),de.jsx("div",{onMouseDown:wn,className:"shrink-0 w-1.5 cursor-col-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",children:de.jsx("div",{className:"absolute inset-0 -left-1 -right-1"})}),de.jsxs("div",{className:"shrink-0 flex flex-col",style:{width:T,background:"var(--bg-primary)"},children:[de.jsxs("div",{className:"flex items-center gap-1 px-2 py-2.5 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[nt.map(pn=>de.jsxs("button",{onClick:()=>L(pn.id),className:"px-2 py-0.5 h-5 text-[11px] uppercase tracking-wider font-semibold rounded transition-colors cursor-pointer",style:{color:O===pn.id?pn.id==="primary"?hn:"var(--accent)":"var(--text-muted)",background:O===pn.id?`color-mix(in srgb, ${pn.id==="primary"?hn:"var(--accent)"} 10%, transparent)`:"transparent"},onMouseEnter:Cn=>{O!==pn.id&&(Cn.currentTarget.style.color="var(--text-primary)")},onMouseLeave:Cn=>{O!==pn.id&&(Cn.currentTarget.style.color="var(--text-muted)")},children:[pn.label,pn.count!==void 0&&pn.count>0&&de.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:pn.count})]},pn.id)),Ke]}),de.jsxs("div",{className:"flex-1 overflow-hidden",children:[O==="primary"&&(p?de.jsx(Oct,{messages:xe,runId:f.id,runStatus:f.status,ws:b}):de.jsx(Dct,{events:ce,runStatus:f.status})),O==="io"&&de.jsx(Bct,{run:f}),O==="logs"&&de.jsx(ZWn,{logs:Y})]})]})]})}function Bct({run:f}){return de.jsxs("div",{className:"p-4 overflow-y-auto h-full space-y-4",children:[de.jsx(kwn,{title:"Input",color:"var(--success)",copyText:JSON.stringify(f.input_data,null,2),children:de.jsx(xq,{json:JSON.stringify(f.input_data,null,2),className:"p-3 rounded-lg text-xs font-mono whitespace-pre-wrap break-words",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"}})}),f.output_data&&de.jsx(kwn,{title:"Output",color:"var(--accent)",copyText:typeof f.output_data=="string"?f.output_data:JSON.stringify(f.output_data,null,2),children:de.jsx(xq,{json:typeof f.output_data=="string"?f.output_data:JSON.stringify(f.output_data,null,2),className:"p-3 rounded-lg text-xs font-mono whitespace-pre-wrap break-words",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"}})}),f.error&&de.jsxs("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--error) 40%, var(--border))"},children:[de.jsxs("div",{className:"px-4 py-2 text-xs font-semibold flex items-center gap-2",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)"},children:[de.jsx("span",{children:"Error"}),de.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:f.error.code})]}),de.jsxs("div",{className:"p-4 text-xs leading-normal",style:{background:"var(--bg-secondary)"},children:[de.jsx("div",{className:"font-semibold mb-2",style:{color:"var(--text-primary)"},children:f.error.title}),de.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] max-w-prose",style:{color:"var(--text-secondary)"},children:f.error.detail})]})]})]})}function kwn({title:f,color:b,copyText:p,children:v}){const[j,T]=an.useState(!1),m=an.useCallback(()=>{p&&navigator.clipboard.writeText(p).then(()=>{T(!0),setTimeout(()=>T(!1),1500)})},[p]);return de.jsxs("div",{children:[de.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[de.jsx("div",{className:"w-1 h-4 rounded-full",style:{background:b}}),de.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:b},children:f}),p&&de.jsx("button",{onClick:m,className:"ml-auto text-[10px] cursor-pointer px-1.5 py-0.5 rounded",style:{color:j?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:j?"Copied":"Copy"})]}),v]})}function zct(){const{reloadPending:f,setReloadPending:b,setEntrypoints:p}=Hu(),[v,j]=an.useState(!1);if(!f)return null;const T=async()=>{j(!0);try{await ZUn();const m=await Swn();p(m.map(O=>O.name)),b(!1)}catch(m){console.error("Reload failed:",m)}finally{j(!1)}};return de.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 flex items-center justify-between px-5 py-2.5 rounded-lg shadow-lg min-w-[400px]",style:{background:"var(--bg-secondary)",border:"1px solid var(--bg-tertiary)"},children:[de.jsx("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Files changed — reload to apply"}),de.jsxs("div",{className:"flex items-center gap-2",children:[de.jsx("button",{onClick:T,disabled:v,className:"px-3 py-1 text-sm font-medium rounded cursor-pointer",style:{background:"var(--accent)",color:"#fff",opacity:v?.6:1},children:v?"Reloading...":"Reload"}),de.jsx("button",{onClick:()=>b(!1),className:"text-sm cursor-pointer px-1",style:{color:"var(--text-muted)",background:"none",border:"none"},children:"✕"})]})]})}function Fct(){const f=KUn(),{runs:b,selectedRunId:p,setRuns:v,upsertRun:j,selectRun:T,setTraces:m,setLogs:O,setChatMessages:L,setEntrypoints:D,setStateEvents:P,setGraphCache:z}=Hu(),{view:X,runId:q,setupEntrypoint:ue,setupMode:Y,navigate:xe}=jwn();an.useEffect(()=>{X==="details"&&q&&q!==p&&T(q)},[X,q,p,T]),an.useEffect(()=>{WUn().then(v).catch(console.error),Swn().then(wn=>D(wn.map(Fe=>Fe.name))).catch(console.error)},[v,D]),an.useEffect(()=>{if(!p)return;f.subscribe(p);const wn=hn=>{j(hn),m(p,hn.traces),O(p,hn.logs);const nt=hn.messages.map(Tn=>{const Ke=Tn.contentParts??Tn.content_parts??[],pn=Tn.toolCalls??Tn.tool_calls??[];return{message_id:Tn.messageId??Tn.message_id,role:Tn.role??"assistant",content:Ke.filter(Cn=>{const Q=Cn.mimeType??Cn.mime_type??"";return Q.startsWith("text/")||Q==="application/json"}).map(Cn=>{const Q=Cn.data;return(Q==null?void 0:Q.inline)??""}).join(`
+`))}function L(q,ue,Y,xe){const ce=Y.enter("tableCell"),Ae=Y.enter("phrasing"),Le=Y.containerPhrasing(q,{...xe,before:T,after:T});return Ae(),ce(),Le}function D(q,ue){return Zit(q,{align:ue,alignDelimiters:v,padding:p,stringLength:j})}function P(q,ue,Y){const xe=q.children;let ce=-1;const Ae=[],Le=ue.enter("table");for(;++ce0&&!p&&(f[f.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),p}const ict={tokenize:act,partial:!0};function rct(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sct,continuation:{tokenize:lct},exit:fct}},text:{91:{name:"gfmFootnoteCall",tokenize:oct},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:cct,resolveTo:uct}}}}function cct(f,b,p){const v=this;let j=v.events.length;const T=v.parser.gfmFootnotes||(v.parser.gfmFootnotes=[]);let m;for(;j--;){const L=v.events[j][1];if(L.type==="labelImage"){m=L;break}if(L.type==="gfmFootnoteCall"||L.type==="labelLink"||L.type==="label"||L.type==="image"||L.type==="link")break}return O;function O(L){if(!m||!m._balanced)return p(L);const D=Sv(v.sliceSerialize({start:m.end,end:v.now()}));return D.codePointAt(0)!==94||!T.includes(D.slice(1))?p(L):(f.enter("gfmFootnoteCallLabelMarker"),f.consume(L),f.exit("gfmFootnoteCallLabelMarker"),b(L))}}function uct(f,b){let p=f.length;for(;p--;)if(f[p][1].type==="labelImage"&&f[p][0]==="enter"){f[p][1];break}f[p+1][1].type="data",f[p+3][1].type="gfmFootnoteCallLabelMarker";const v={type:"gfmFootnoteCall",start:Object.assign({},f[p+3][1].start),end:Object.assign({},f[f.length-1][1].end)},j={type:"gfmFootnoteCallMarker",start:Object.assign({},f[p+3][1].end),end:Object.assign({},f[p+3][1].end)};j.end.column++,j.end.offset++,j.end._bufferIndex++;const T={type:"gfmFootnoteCallString",start:Object.assign({},j.end),end:Object.assign({},f[f.length-1][1].start)},m={type:"chunkString",contentType:"string",start:Object.assign({},T.start),end:Object.assign({},T.end)},O=[f[p+1],f[p+2],["enter",v,b],f[p+3],f[p+4],["enter",j,b],["exit",j,b],["enter",T,b],["enter",m,b],["exit",m,b],["exit",T,b],f[f.length-2],f[f.length-1],["exit",v,b]];return f.splice(p,f.length-p+1,...O),f}function oct(f,b,p){const v=this,j=v.parser.gfmFootnotes||(v.parser.gfmFootnotes=[]);let T=0,m;return O;function O(z){return f.enter("gfmFootnoteCall"),f.enter("gfmFootnoteCallLabelMarker"),f.consume(z),f.exit("gfmFootnoteCallLabelMarker"),L}function L(z){return z!==94?p(z):(f.enter("gfmFootnoteCallMarker"),f.consume(z),f.exit("gfmFootnoteCallMarker"),f.enter("gfmFootnoteCallString"),f.enter("chunkString").contentType="string",D)}function D(z){if(T>999||z===93&&!m||z===null||z===91||Fs(z))return p(z);if(z===93){f.exit("chunkString");const X=f.exit("gfmFootnoteCallString");return j.includes(Sv(v.sliceSerialize(X)))?(f.enter("gfmFootnoteCallLabelMarker"),f.consume(z),f.exit("gfmFootnoteCallLabelMarker"),f.exit("gfmFootnoteCall"),b):p(z)}return Fs(z)||(m=!0),T++,f.consume(z),z===92?P:D}function P(z){return z===91||z===92||z===93?(f.consume(z),T++,D):D(z)}}function sct(f,b,p){const v=this,j=v.parser.gfmFootnotes||(v.parser.gfmFootnotes=[]);let T,m=0,O;return L;function L(ue){return f.enter("gfmFootnoteDefinition")._container=!0,f.enter("gfmFootnoteDefinitionLabel"),f.enter("gfmFootnoteDefinitionLabelMarker"),f.consume(ue),f.exit("gfmFootnoteDefinitionLabelMarker"),D}function D(ue){return ue===94?(f.enter("gfmFootnoteDefinitionMarker"),f.consume(ue),f.exit("gfmFootnoteDefinitionMarker"),f.enter("gfmFootnoteDefinitionLabelString"),f.enter("chunkString").contentType="string",P):p(ue)}function P(ue){if(m>999||ue===93&&!O||ue===null||ue===91||Fs(ue))return p(ue);if(ue===93){f.exit("chunkString");const Y=f.exit("gfmFootnoteDefinitionLabelString");return T=Sv(v.sliceSerialize(Y)),f.enter("gfmFootnoteDefinitionLabelMarker"),f.consume(ue),f.exit("gfmFootnoteDefinitionLabelMarker"),f.exit("gfmFootnoteDefinitionLabel"),X}return Fs(ue)||(O=!0),m++,f.consume(ue),ue===92?z:P}function z(ue){return ue===91||ue===92||ue===93?(f.consume(ue),m++,P):P(ue)}function X(ue){return ue===58?(f.enter("definitionMarker"),f.consume(ue),f.exit("definitionMarker"),j.includes(T)||j.push(T),Zu(f,q,"gfmFootnoteDefinitionWhitespace")):p(ue)}function q(ue){return b(ue)}}function lct(f,b,p){return f.check(Oq,b,f.attempt(ict,b,p))}function fct(f){f.exit("gfmFootnoteDefinition")}function act(f,b,p){const v=this;return Zu(f,j,"gfmFootnoteDefinitionIndent",5);function j(T){const m=v.events[v.events.length-1];return m&&m[1].type==="gfmFootnoteDefinitionIndent"&&m[2].sliceSerialize(m[1],!0).length===4?b(T):p(T)}}function hct(f){let p=(f||{}).singleTilde;const v={name:"strikethrough",tokenize:T,resolveAll:j};return p==null&&(p=!0),{text:{126:v},insideSpan:{null:[v]},attentionMarkers:{null:[126]}};function j(m,O){let L=-1;for(;++L1?L(ue):(m.consume(ue),z++,q);if(z<2&&!p)return L(ue);const xe=m.exit("strikethroughSequenceTemporary"),ce=pL(ue);return xe._open=!ce||ce===2&&!!Y,xe._close=!Y||Y===2&&!!ce,O(ue)}}}class dct{constructor(){this.map=[]}add(b,p,v){gct(this,b,p,v)}consume(b){if(this.map.sort(function(T,m){return T[0]-m[0]}),this.map.length===0)return;let p=this.map.length;const v=[];for(;p>0;)p-=1,v.push(b.slice(this.map[p][0]+this.map[p][1]),this.map[p][2]),b.length=this.map[p][0];v.push(b.slice()),b.length=0;let j=v.pop();for(;j;){for(const T of j)b.push(T);j=v.pop()}this.map.length=0}}function gct(f,b,p,v){let j=0;if(!(p===0&&v.length===0)){for(;j-1;){const we=v.events[pn][1].type;if(we==="lineEnding"||we==="linePrefix")pn--;else break}const Cn=pn>-1?v.events[pn][1].type:null,Q=Cn==="tableHead"||Cn==="tableRow"?Fe:L;return Q===Fe&&v.parser.lazy[v.now().line]?p(Ke):Q(Ke)}function L(Ke){return f.enter("tableHead"),f.enter("tableRow"),D(Ke)}function D(Ke){return Ke===124||(m=!0,T+=1),P(Ke)}function P(Ke){return Ke===null?p(Ke):Fr(Ke)?T>1?(T=0,v.interrupt=!0,f.exit("tableRow"),f.enter("lineEnding"),f.consume(Ke),f.exit("lineEnding"),q):p(Ke):Mu(Ke)?Zu(f,P,"whitespace")(Ke):(T+=1,m&&(m=!1,j+=1),Ke===124?(f.enter("tableCellDivider"),f.consume(Ke),f.exit("tableCellDivider"),m=!0,P):(f.enter("data"),z(Ke)))}function z(Ke){return Ke===null||Ke===124||Fs(Ke)?(f.exit("data"),P(Ke)):(f.consume(Ke),Ke===92?X:z)}function X(Ke){return Ke===92||Ke===124?(f.consume(Ke),z):z(Ke)}function q(Ke){return v.interrupt=!1,v.parser.lazy[v.now().line]?p(Ke):(f.enter("tableDelimiterRow"),m=!1,Mu(Ke)?Zu(f,ue,"linePrefix",v.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ke):ue(Ke))}function ue(Ke){return Ke===45||Ke===58?xe(Ke):Ke===124?(m=!0,f.enter("tableCellDivider"),f.consume(Ke),f.exit("tableCellDivider"),Y):wn(Ke)}function Y(Ke){return Mu(Ke)?Zu(f,xe,"whitespace")(Ke):xe(Ke)}function xe(Ke){return Ke===58?(T+=1,m=!0,f.enter("tableDelimiterMarker"),f.consume(Ke),f.exit("tableDelimiterMarker"),ce):Ke===45?(T+=1,ce(Ke)):Ke===null||Fr(Ke)?ze(Ke):wn(Ke)}function ce(Ke){return Ke===45?(f.enter("tableDelimiterFiller"),Ae(Ke)):wn(Ke)}function Ae(Ke){return Ke===45?(f.consume(Ke),Ae):Ke===58?(m=!0,f.exit("tableDelimiterFiller"),f.enter("tableDelimiterMarker"),f.consume(Ke),f.exit("tableDelimiterMarker"),Le):(f.exit("tableDelimiterFiller"),Le(Ke))}function Le(Ke){return Mu(Ke)?Zu(f,ze,"whitespace")(Ke):ze(Ke)}function ze(Ke){return Ke===124?ue(Ke):Ke===null||Fr(Ke)?!m||j!==T?wn(Ke):(f.exit("tableDelimiterRow"),f.exit("tableHead"),b(Ke)):wn(Ke)}function wn(Ke){return p(Ke)}function Fe(Ke){return f.enter("tableRow"),hn(Ke)}function hn(Ke){return Ke===124?(f.enter("tableCellDivider"),f.consume(Ke),f.exit("tableCellDivider"),hn):Ke===null||Fr(Ke)?(f.exit("tableRow"),b(Ke)):Mu(Ke)?Zu(f,hn,"whitespace")(Ke):(f.enter("data"),nt(Ke))}function nt(Ke){return Ke===null||Ke===124||Fs(Ke)?(f.exit("data"),hn(Ke)):(f.consume(Ke),Ke===92?Tn:nt)}function Tn(Ke){return Ke===92||Ke===124?(f.consume(Ke),nt):nt(Ke)}}function mct(f,b){let p=-1,v=!0,j=0,T=[0,0,0,0],m=[0,0,0,0],O=!1,L=0,D,P,z;const X=new dct;for(;++pp[2]+1){const ue=p[2]+1,Y=p[3]-p[2]-1;f.add(ue,Y,[])}}f.add(p[3]+1,0,[["exit",z,b]])}return j!==void 0&&(T.end=Object.assign({},sL(b.events,j)),f.add(j,0,[["exit",T,b]]),T=void 0),T}function vwn(f,b,p,v,j){const T=[],m=sL(b.events,p);j&&(j.end=Object.assign({},m),T.push(["exit",j,b])),v.end=Object.assign({},m),T.push(["exit",v,b]),f.add(p+1,0,T)}function sL(f,b){const p=f[b],v=p[0]==="enter"?"start":"end";return p[1][v]}const vct={name:"tasklistCheck",tokenize:kct};function yct(){return{text:{91:vct}}}function kct(f,b,p){const v=this;return j;function j(L){return v.previous!==null||!v._gfmTasklistFirstContentOfListItem?p(L):(f.enter("taskListCheck"),f.enter("taskListCheckMarker"),f.consume(L),f.exit("taskListCheckMarker"),T)}function T(L){return Fs(L)?(f.enter("taskListCheckValueUnchecked"),f.consume(L),f.exit("taskListCheckValueUnchecked"),m):L===88||L===120?(f.enter("taskListCheckValueChecked"),f.consume(L),f.exit("taskListCheckValueChecked"),m):p(L)}function m(L){return L===93?(f.enter("taskListCheckMarker"),f.consume(L),f.exit("taskListCheckMarker"),f.exit("taskListCheck"),O):p(L)}function O(L){return Fr(L)?b(L):Mu(L)?f.check({tokenize:xct},b,p)(L):p(L)}}function xct(f,b,p){return Zu(f,v,"whitespace");function v(j){return j===null?p(j):b(j)}}function Ect(f){return m2n([Krt(),rct(),hct(f),wct(),yct()])}const Sct={};function jct(f){const b=this,p=f||Sct,v=b.data(),j=v.micromarkExtensions||(v.micromarkExtensions=[]),T=v.fromMarkdownExtensions||(v.fromMarkdownExtensions=[]),m=v.toMarkdownExtensions||(v.toMarkdownExtensions=[]);j.push(Ect(p)),T.push(Grt()),m.push(Urt(p))}const Act={user:{label:"You",color:"var(--info)"},tool:{label:"Tool",color:"var(--warning)"},assistant:{label:"AI",color:"var(--success)"}};function Tct({message:f,onToolCallClick:b,toolCallIndices:p}){const v=f.role==="user",j=f.tool_calls&&f.tool_calls.length>0,m=Act[v?"user":j?"tool":"assistant"];return de.jsxs("div",{className:"py-1.5",children:[de.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[de.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:m.color}}),de.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:m.color},children:m.label})]}),f.content&&(v?de.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:f.content}):de.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:de.jsx(hit,{remarkPlugins:[jct],children:f.content})})),f.tool_calls&&f.tool_calls.length>0&&de.jsx("div",{className:"flex flex-wrap gap-1 mt-1 pl-2.5",children:f.tool_calls.map((O,L)=>de.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono px-1.5 py-0.5 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:O.has_result?"var(--success)":"var(--text-muted)"},onClick:()=>b==null?void 0:b(O.name,(p==null?void 0:p[L])??0),children:[O.has_result?"✓":"•"," ",O.name]},`${O.name}-${L}`))})]})}function Mct({onSend:f,disabled:b,placeholder:p}){const[v,j]=an.useState(""),T=()=>{const L=v.trim();L&&(f(L),j(""))},m=L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),T())},O=!b&&v.trim().length>0;return de.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[de.jsx("input",{value:v,onChange:L=>j(L.target.value),onKeyDown:m,disabled:b,placeholder:p??"Message...",className:"flex-1 bg-transparent text-sm py-1 focus:outline-none disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),de.jsx("button",{onClick:T,disabled:!O,className:"text-[11px] uppercase tracking-wider font-semibold px-2 py-1 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:O?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:L=>{O&&(L.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:L=>{L.currentTarget.style.background="transparent"},children:"Send"})]})}function Cct({interrupt:f,onRespond:b}){const[p,v]=an.useState("");return f.interrupt_type==="tool_call_confirmation"?de.jsxs("div",{className:"mx-3 my-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--warning) 40%, var(--border))"},children:[de.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"color-mix(in srgb, var(--warning) 10%, var(--bg-secondary))"},children:[de.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:"var(--warning)"},children:"Action Required"}),f.tool_name&&de.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--text-primary)"},children:f.tool_name})]}),f.input_value!=null&&de.jsx("pre",{className:"px-3 py-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-normal",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",maxHeight:200},children:typeof f.input_value=="string"?f.input_value:JSON.stringify(f.input_value,null,2)}),de.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[de.jsx("button",{onClick:()=>b({approved:!0}),className:"text-[10px] uppercase tracking-wider font-semibold px-3 py-1 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--success) 15%, var(--bg-secondary))",color:"var(--success)",border:"1px solid color-mix(in srgb, var(--success) 30%, var(--border))"},onMouseEnter:j=>{j.currentTarget.style.background="color-mix(in srgb, var(--success) 25%, var(--bg-secondary))"},onMouseLeave:j=>{j.currentTarget.style.background="color-mix(in srgb, var(--success) 15%, var(--bg-secondary))"},children:"Approve"}),de.jsx("button",{onClick:()=>b({approved:!1}),className:"text-[10px] uppercase tracking-wider font-semibold px-3 py-1 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)",border:"1px solid color-mix(in srgb, var(--error) 30%, var(--border))"},onMouseEnter:j=>{j.currentTarget.style.background="color-mix(in srgb, var(--error) 25%, var(--bg-secondary))"},onMouseLeave:j=>{j.currentTarget.style.background="color-mix(in srgb, var(--error) 15%, var(--bg-secondary))"},children:"Reject"})]})]}):de.jsxs("div",{className:"mx-3 my-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--accent) 40%, var(--border))"},children:[de.jsx("div",{className:"px-3 py-2",style:{background:"color-mix(in srgb, var(--accent) 10%, var(--bg-secondary))"},children:de.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:"var(--accent)"},children:"Input Required"})}),f.content!=null&&de.jsx("div",{className:"px-3 py-2 text-sm leading-relaxed",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)"},children:typeof f.content=="string"?f.content:JSON.stringify(f.content,null,2)}),de.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[de.jsx("input",{value:p,onChange:j=>v(j.target.value),onKeyDown:j=>{j.key==="Enter"&&!j.shiftKey&&p.trim()&&(j.preventDefault(),b({response:p.trim()}))},placeholder:"Type your response...",className:"flex-1 bg-transparent text-sm py-1 focus:outline-none placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),de.jsx("button",{onClick:()=>{p.trim()&&b({response:p.trim()})},disabled:!p.trim(),className:"text-[11px] uppercase tracking-wider font-semibold px-2 py-1 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:p.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},children:"Send"})]})]})}function Oct({messages:f,runId:b,runStatus:p,ws:v}){const j=an.useRef(null),T=an.useRef(!0),m=Hu(ce=>ce.addLocalChatMessage),O=Hu(ce=>ce.setFocusedSpan),L=Hu(ce=>ce.activeInterrupt[b]??null),D=Hu(ce=>ce.setActiveInterrupt),P=an.useMemo(()=>{const ce=new Map,Ae=new Map;for(const Le of f)if(Le.tool_calls){const ze=[];for(const wn of Le.tool_calls){const Fe=Ae.get(wn.name)??0;ze.push(Fe),Ae.set(wn.name,Fe+1)}ce.set(Le.message_id,ze)}return ce},[f]),[z,X]=an.useState(!1),q=()=>{const ce=j.current;if(!ce)return;const Ae=ce.scrollHeight-ce.scrollTop-ce.clientHeight<40;T.current=Ae,X(ce.scrollTop>100)};an.useEffect(()=>{T.current&&j.current&&(j.current.scrollTop=j.current.scrollHeight)});const ue=ce=>{T.current=!0,m(b,{message_id:`local-${Date.now()}`,role:"user",content:ce}),v.sendChatMessage(b,ce)},Y=ce=>{T.current=!0,v.sendInterruptResponse(b,ce),D(b,null)},xe=p==="running"||!!L;return de.jsxs("div",{className:"flex flex-col h-full",children:[de.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[de.jsxs("div",{ref:j,onScroll:q,className:"h-full overflow-y-auto px-3 py-2 space-y-0.5",children:[f.length===0&&de.jsx("p",{className:"text-[var(--text-muted)] text-sm text-center py-6",children:"No messages yet"}),f.map(ce=>de.jsx(Tct,{message:ce,toolCallIndices:P.get(ce.message_id),onToolCallClick:(Ae,Le)=>O({name:Ae,index:Le})},ce.message_id)),L&&de.jsx(Cct,{interrupt:L,onRespond:Y})]}),z&&de.jsx("button",{onClick:()=>{var ce;return(ce=j.current)==null?void 0:ce.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:de.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:de.jsx("polyline",{points:"18 15 12 9 6 15"})})})]}),de.jsx(Mct,{onSend:ue,disabled:xe,placeholder:L?"Respond to the interrupt above...":xe?"Waiting for response...":"Message..."})]})}const Nct={started:{color:"var(--accent)",label:"started"},updated:{color:"var(--info)",label:"updated"},completed:{color:"var(--success)",label:"completed"},faulted:{color:"var(--error)",label:"faulted"}},ywn={color:"var(--text-muted)",label:""};function Dct({events:f,runStatus:b}){const p=an.useRef(null),v=an.useRef(!0),[j,T]=an.useState(null),m=()=>{const O=p.current;O&&(v.current=O.scrollHeight-O.scrollTop-O.clientHeight<40)};return an.useEffect(()=>{v.current&&p.current&&(p.current.scrollTop=p.current.scrollHeight)}),f.length===0?de.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:de.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:b==="running"?"Waiting for events...":"No events yet"})}):de.jsx("div",{ref:p,onScroll:m,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:f.map((O,L)=>{const D=new Date(O.timestamp).toLocaleTimeString(void 0,{hour12:!1}),P=O.payload&&Object.keys(O.payload).length>0,z=j===L,X=O.phase?Nct[O.phase]??ywn:ywn;return de.jsxs("div",{children:[de.jsxs("div",{onClick:()=>{P&&T(z?null:L)},className:"flex items-center gap-2 px-3 py-1.5",style:{background:L%2===0?"var(--bg-primary)":"var(--bg-secondary)",cursor:P?"pointer":"default"},children:[de.jsx("span",{className:"shrink-0",style:{color:"var(--text-muted)"},children:D}),de.jsx("span",{className:"shrink-0",style:{color:X.color},children:"●"}),de.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:O.node_name}),X.label&&de.jsx("span",{className:"shrink-0 text-[10px]",style:{color:"var(--text-muted)"},children:X.label}),P&&de.jsx("span",{className:"shrink-0 text-[9px] transition-transform",style:{color:"var(--text-muted)",transform:z?"rotate(90deg)":"rotate(0deg)"},children:"▸"})]}),z&&P&&de.jsx("div",{className:"px-3 py-2 border-t border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-secondary) 80%, var(--bg-primary))"},children:de.jsx(xq,{json:JSON.stringify(O.payload,null,2),className:"text-[11px] font-mono whitespace-pre-wrap break-words"})})]},L)})})}function _ct({runId:f,status:b,ws:p,breakpointNode:v}){const j=b==="suspended",T=m=>{const O=Hu.getState().breakpoints[f]??{};p.setBreakpoints(f,Object.keys(O)),m==="step"?p.debugStep(f):m==="continue"?p.debugContinue(f):p.debugStop(f)};return de.jsxs("div",{className:"flex items-center gap-1 px-4 py-2.5 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[de.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold mr-1",style:{color:"var(--text-muted)"},children:"Debug"}),de.jsx(uEe,{label:"Step",onClick:()=>T("step"),disabled:!j,color:"var(--info)",active:j}),de.jsx(uEe,{label:"Continue",onClick:()=>T("continue"),disabled:!j,color:"var(--success)",active:j}),de.jsx(uEe,{label:"Stop",onClick:()=>T("stop"),disabled:!j,color:"var(--error)",active:j}),de.jsx("span",{className:"text-[10px] ml-auto truncate",style:{color:j?"var(--accent)":"var(--text-muted)"},children:j?v?`Paused at ${v}`:"Paused":b})]})}function uEe({label:f,onClick:b,disabled:p,color:v,active:j}){return de.jsx("button",{onClick:b,disabled:p,className:"px-2.5 py-0.5 h-5 text-[10px] uppercase tracking-wider font-semibold rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:j?v:"var(--text-muted)",background:j?`color-mix(in srgb, ${v} 10%, transparent)`:"transparent"},onMouseEnter:T=>{p||(T.currentTarget.style.background=`color-mix(in srgb, ${v} 20%, transparent)`)},onMouseLeave:T=>{T.currentTarget.style.background=j?`color-mix(in srgb, ${v} 10%, transparent)`:"transparent"},children:f})}const Lct=[],Ict=[],Rct=[],Pct=[];function $ct({run:f,ws:b}){const p=f.mode==="chat",[v,j]=an.useState(280),[T,m]=an.useState(()=>{const pn=localStorage.getItem("chatPanelWidth");return pn?parseInt(pn,10):380}),[O,L]=an.useState("primary"),[D,P]=an.useState(0),z=an.useRef(null),X=an.useRef(null),q=an.useRef(!1),ue=Hu(pn=>pn.traces[f.id]||Lct),Y=Hu(pn=>pn.logs[f.id]||Ict),xe=Hu(pn=>pn.chatMessages[f.id]||Rct),ce=Hu(pn=>pn.stateEvents[f.id]||Pct),Ae=Hu(pn=>pn.breakpoints[f.id]);an.useEffect(()=>{b.setBreakpoints(f.id,Ae?Object.keys(Ae):[])},[f.id]);const Le=an.useCallback(pn=>{b.setBreakpoints(f.id,pn)},[f.id,b]),ze=an.useCallback(pn=>{pn.preventDefault(),q.current=!0;const Cn=pn.clientY,Q=v,we=oe=>{if(!q.current)return;const Ue=z.current;if(!Ue)return;const En=Ue.clientHeight-100,ln=Math.max(80,Math.min(En,Q+(oe.clientY-Cn)));j(ln)},_e=()=>{q.current=!1,document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",_e),document.body.style.cursor="",document.body.style.userSelect="",P(oe=>oe+1)};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",we),document.addEventListener("mouseup",_e)},[v]),wn=an.useCallback(pn=>{pn.preventDefault();const Cn=pn.clientX,Q=T,we=oe=>{const Ue=X.current;if(!Ue)return;const En=Ue.clientWidth-300,ln=Math.max(280,Math.min(En,Q+(Cn-oe.clientX)));m(ln)},_e=()=>{document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",_e),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("chatPanelWidth",String(T)),P(oe=>oe+1)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",we),document.addEventListener("mouseup",_e)},[T]),Fe=p?"Chat":"Events",hn=p?"var(--accent)":"var(--success)",nt=[{id:"primary",label:Fe},{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:Y.length}],Tn=Hu(pn=>pn.activeInterrupt[f.id]??null),Ke=f.status==="running"?de.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:p?"Thinking...":"Running..."}):p&&f.status==="suspended"&&Tn?de.jsx("span",{className:"ml-auto text-[10px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Action Required"}):null;return de.jsxs("div",{ref:X,className:"flex h-full",children:[de.jsxs("div",{ref:z,className:"flex flex-col flex-1 min-w-0",children:[(f.mode==="debug"||f.status==="suspended"&&!Tn||Ae&&Object.keys(Ae).length>0)&&de.jsx(_ct,{runId:f.id,status:f.status,ws:b,breakpointNode:f.breakpoint_node}),de.jsx("div",{className:"shrink-0",style:{height:v},children:de.jsx(t2n,{entrypoint:f.entrypoint,traces:ue,runId:f.id,breakpointNode:f.breakpoint_node,breakpointNextNodes:f.breakpoint_next_nodes,onBreakpointChange:Le,fitViewTrigger:D})}),de.jsx("div",{onMouseDown:ze,className:"shrink-0 h-1.5 cursor-row-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",children:de.jsx("div",{className:"absolute inset-0 -top-1 -bottom-1"})}),de.jsx("div",{className:"flex-1 overflow-hidden",children:de.jsx(YWn,{traces:ue})})]}),de.jsx("div",{onMouseDown:wn,className:"shrink-0 w-1.5 cursor-col-resize bg-[var(--border)] hover:bg-[var(--accent)] transition-colors relative",children:de.jsx("div",{className:"absolute inset-0 -left-1 -right-1"})}),de.jsxs("div",{className:"shrink-0 flex flex-col",style:{width:T,background:"var(--bg-primary)"},children:[de.jsxs("div",{className:"flex items-center gap-1 px-2 py-2.5 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[nt.map(pn=>de.jsxs("button",{onClick:()=>L(pn.id),className:"px-2 py-0.5 h-5 text-[11px] uppercase tracking-wider font-semibold rounded transition-colors cursor-pointer",style:{color:O===pn.id?pn.id==="primary"?hn:"var(--accent)":"var(--text-muted)",background:O===pn.id?`color-mix(in srgb, ${pn.id==="primary"?hn:"var(--accent)"} 10%, transparent)`:"transparent"},onMouseEnter:Cn=>{O!==pn.id&&(Cn.currentTarget.style.color="var(--text-primary)")},onMouseLeave:Cn=>{O!==pn.id&&(Cn.currentTarget.style.color="var(--text-muted)")},children:[pn.label,pn.count!==void 0&&pn.count>0&&de.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:pn.count})]},pn.id)),Ke]}),de.jsxs("div",{className:"flex-1 overflow-hidden",children:[O==="primary"&&(p?de.jsx(Oct,{messages:xe,runId:f.id,runStatus:f.status,ws:b}):de.jsx(Dct,{events:ce,runStatus:f.status})),O==="io"&&de.jsx(Bct,{run:f}),O==="logs"&&de.jsx(ZWn,{logs:Y})]})]})]})}function Bct({run:f}){return de.jsxs("div",{className:"p-4 overflow-y-auto h-full space-y-4",children:[de.jsx(kwn,{title:"Input",color:"var(--success)",copyText:JSON.stringify(f.input_data,null,2),children:de.jsx(xq,{json:JSON.stringify(f.input_data,null,2),className:"p-3 rounded-lg text-xs font-mono whitespace-pre-wrap break-words",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"}})}),f.output_data&&de.jsx(kwn,{title:"Output",color:"var(--accent)",copyText:typeof f.output_data=="string"?f.output_data:JSON.stringify(f.output_data,null,2),children:de.jsx(xq,{json:typeof f.output_data=="string"?f.output_data:JSON.stringify(f.output_data,null,2),className:"p-3 rounded-lg text-xs font-mono whitespace-pre-wrap break-words",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"}})}),f.error&&de.jsxs("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--error) 40%, var(--border))"},children:[de.jsxs("div",{className:"px-4 py-2 text-xs font-semibold flex items-center gap-2",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)"},children:[de.jsx("span",{children:"Error"}),de.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:f.error.code}),de.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:f.error.category})]}),de.jsxs("div",{className:"p-4 text-xs leading-normal",style:{background:"var(--bg-secondary)"},children:[de.jsx("div",{className:"font-semibold mb-2",style:{color:"var(--text-primary)"},children:f.error.title}),de.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] max-w-prose",style:{color:"var(--text-secondary)"},children:f.error.detail})]})]})]})}function kwn({title:f,color:b,copyText:p,children:v}){const[j,T]=an.useState(!1),m=an.useCallback(()=>{p&&navigator.clipboard.writeText(p).then(()=>{T(!0),setTimeout(()=>T(!1),1500)})},[p]);return de.jsxs("div",{children:[de.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[de.jsx("div",{className:"w-1 h-4 rounded-full",style:{background:b}}),de.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:b},children:f}),p&&de.jsx("button",{onClick:m,className:"ml-auto text-[10px] cursor-pointer px-1.5 py-0.5 rounded",style:{color:j?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:j?"Copied":"Copy"})]}),v]})}function zct(){const{reloadPending:f,setReloadPending:b,setEntrypoints:p}=Hu(),[v,j]=an.useState(!1);if(!f)return null;const T=async()=>{j(!0);try{await ZUn();const m=await Swn();p(m.map(O=>O.name)),b(!1)}catch(m){console.error("Reload failed:",m)}finally{j(!1)}};return de.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 flex items-center justify-between px-5 py-2.5 rounded-lg shadow-lg min-w-[400px]",style:{background:"var(--bg-secondary)",border:"1px solid var(--bg-tertiary)"},children:[de.jsx("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Files changed — reload to apply"}),de.jsxs("div",{className:"flex items-center gap-2",children:[de.jsx("button",{onClick:T,disabled:v,className:"px-3 py-1 text-sm font-medium rounded cursor-pointer",style:{background:"var(--accent)",color:"#fff",opacity:v?.6:1},children:v?"Reloading...":"Reload"}),de.jsx("button",{onClick:()=>b(!1),className:"text-sm cursor-pointer px-1",style:{color:"var(--text-muted)",background:"none",border:"none"},children:"✕"})]})]})}function Fct(){const f=KUn(),{runs:b,selectedRunId:p,setRuns:v,upsertRun:j,selectRun:T,setTraces:m,setLogs:O,setChatMessages:L,setEntrypoints:D,setStateEvents:P,setGraphCache:z}=Hu(),{view:X,runId:q,setupEntrypoint:ue,setupMode:Y,navigate:xe}=jwn();an.useEffect(()=>{X==="details"&&q&&q!==p&&T(q)},[X,q,p,T]),an.useEffect(()=>{WUn().then(v).catch(console.error),Swn().then(wn=>D(wn.map(Fe=>Fe.name))).catch(console.error)},[v,D]),an.useEffect(()=>{if(!p)return;f.subscribe(p);const wn=hn=>{j(hn),m(p,hn.traces),O(p,hn.logs);const nt=hn.messages.map(Tn=>{const Ke=Tn.contentParts??Tn.content_parts??[],pn=Tn.toolCalls??Tn.tool_calls??[];return{message_id:Tn.messageId??Tn.message_id,role:Tn.role??"assistant",content:Ke.filter(Cn=>{const Q=Cn.mimeType??Cn.mime_type??"";return Q.startsWith("text/")||Q==="application/json"}).map(Cn=>{const Q=Cn.data;return(Q==null?void 0:Q.inline)??""}).join(`
`).trim()??"",tool_calls:pn.length>0?pn.map(Cn=>({name:Cn.name??"",has_result:!!Cn.result})):void 0}});L(p,nt),hn.graph&&hn.graph.nodes.length>0&&z(p,hn.graph),hn.states&&hn.states.length>0&&P(p,hn.states.map(Tn=>({node_name:Tn.node_name,qualified_node_name:Tn.qualified_node_name,phase:Tn.phase,timestamp:new Date(Tn.timestamp).getTime(),payload:Tn.payload})))};Tgn(p).then(wn).catch(console.error);const Fe=setTimeout(()=>{const hn=Hu.getState().runs[p];hn&&(hn.status==="pending"||hn.status==="running")&&Tgn(p).then(wn).catch(console.error)},2e3);return()=>{clearTimeout(Fe),f.unsubscribe(p)}},[p,f,j,m,O,L,P,z]);const ce=wn=>{xe(`#/runs/${wn}/traces`),T(wn)},Ae=wn=>{xe(`#/runs/${wn}/traces`),T(wn)},Le=()=>{xe("#/new")},ze=p?b[p]:null;return de.jsxs("div",{className:"flex h-screen w-screen",children:[de.jsx(uqn,{runs:Object.values(b),selectedRunId:p,onSelectRun:Ae,onNewRun:Le}),de.jsx("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)]",children:X==="new"?de.jsx(oqn,{}):X==="setup"&&ue&&Y?de.jsx(RWn,{entrypoint:ue,mode:Y,ws:f,onRunCreated:ce}):ze?de.jsx($ct,{run:ze,ws:f}):de.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a run or create a new one"})}),de.jsx(zct,{})]})}HUn.createRoot(document.getElementById("root")).render(de.jsx(an.StrictMode,{children:de.jsx(Fct,{})}));
diff --git a/src/uipath/dev/server/static/index.html b/src/uipath/dev/server/static/index.html
index fe899ea..c8c6853 100644
--- a/src/uipath/dev/server/static/index.html
+++ b/src/uipath/dev/server/static/index.html
@@ -5,7 +5,7 @@
UiPath Developer Console
-
+
diff --git a/src/uipath/dev/services/run_service.py b/src/uipath/dev/services/run_service.py
index e59e143..8e6dfce 100644
--- a/src/uipath/dev/services/run_service.py
+++ b/src/uipath/dev/services/run_service.py
@@ -27,7 +27,10 @@
UiPathDebugProtocol,
UiPathDebugRuntime,
)
-from uipath.runtime.errors import UiPathErrorContract, UiPathRuntimeError
+from uipath.runtime.errors import (
+ UiPathBaseRuntimeError,
+ UiPathErrorContract,
+)
from uipath.runtime.events import UiPathRuntimeStateEvent
from uipath.runtime.resumable.trigger import UiPathResumeTrigger
@@ -259,6 +262,9 @@ async def execute(self, run: ExecutionRun) -> None:
"code": err.code if err else "Unknown",
"title": err.title if err else "Unknown error",
"detail": err.detail if err else "",
+ "category": err.category.value
+ if err and hasattr(err.category, "value")
+ else "Unknown",
},
)
run.states.append(error_state)
@@ -285,7 +291,7 @@ async def execute(self, run: ExecutionRun) -> None:
self._add_info_log(run, "✅ Execution completed successfully")
run.end_time = datetime.now()
- except UiPathRuntimeError as e:
+ except UiPathBaseRuntimeError as e:
self._add_error_log(run)
run.status = "failed"
run.end_time = datetime.now()