@kb-labs/agent-entry 2.82.0 → 2.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/widgets/117.js +1 -2
- package/dist/widgets/165.js +1 -2
- package/dist/widgets/300.js +6 -7
- package/dist/widgets/326.js +1 -2
- package/dist/widgets/370.js +1 -2
- package/dist/widgets/405.js +1 -2
- package/dist/widgets/418.js +5 -6
- package/dist/widgets/451.js +1 -2
- package/dist/widgets/50.js +1 -2
- package/dist/widgets/546.js +1 -2
- package/dist/widgets/669.js +1 -2
- package/dist/widgets/694.js +1 -2
- package/dist/widgets/707.js +1 -2
- package/dist/widgets/775.js +1 -2
- package/dist/widgets/{162.js → 805.js} +10 -11
- package/dist/widgets/945.js +1 -2
- package/dist/widgets/968.js +4 -5
- package/dist/widgets/__federation_expose_AgentsPage.js +1 -2
- package/dist/widgets/mf-manifest.json +7 -7
- package/dist/widgets/mf-stats.json +33 -17
- package/dist/widgets/remoteEntry.js +4 -5
- package/package.json +13 -13
- package/dist/widgets/117.js.map +0 -1
- package/dist/widgets/162.js.map +0 -1
- package/dist/widgets/165.js.map +0 -1
- package/dist/widgets/300.js.map +0 -1
- package/dist/widgets/326.js.map +0 -1
- package/dist/widgets/370.js.map +0 -1
- package/dist/widgets/405.js.map +0 -1
- package/dist/widgets/418.js.map +0 -1
- package/dist/widgets/451.js.map +0 -1
- package/dist/widgets/50.js.map +0 -1
- package/dist/widgets/546.js.map +0 -1
- package/dist/widgets/669.js.map +0 -1
- package/dist/widgets/694.js.map +0 -1
- package/dist/widgets/707.js.map +0 -1
- package/dist/widgets/775.js.map +0 -1
- package/dist/widgets/945.js.map +0 -1
- package/dist/widgets/968.js.map +0 -1
- package/dist/widgets/__federation_expose_AgentsPage.js.map +0 -1
- package/dist/widgets/remoteEntry.js.map +0 -1
package/dist/widgets/945.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";(self.
|
|
2
|
-
//# sourceMappingURL=945.js.map
|
|
1
|
+
"use strict";(self.rspackChunk_kb_labs_agent_entry=self.rspackChunk_kb_labs_agent_entry||[]).push([[945],{6026(e,r){var n=Symbol.for("react.transitional.element");function t(e,r,t){var s=null;if(void 0!==t&&(s=""+t),void 0!==r.key&&(s=""+r.key),"key"in r)for(var a in t={},r)"key"!==a&&(t[a]=r[a]);else t=r;return{$$typeof:n,type:e,key:s,ref:void 0!==(r=t.ref)?r:null,props:t}}r.Fragment=Symbol.for("react.fragment"),r.jsx=t,r.jsxs=t},4552(e,r,n){e.exports=n(6026)}}]);
|
package/dist/widgets/968.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
"use strict";(self.
|
|
1
|
+
"use strict";(self.rspackChunk_kb_labs_agent_entry=self.rspackChunk_kb_labs_agent_entry||[]).push([[968],{3755(e,r,a){a.r(r),a.d(r,{colors:()=>t,darkSemanticColors:()=>b,darkTheme:()=>c,generateCSSVars:()=>p,generateThemeCSS:()=>d,lightSemanticColors:()=>m,lightTheme:()=>f,radius:()=>i,shadows:()=>o,spacing:()=>s,typography:()=>n});var t={primary:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},secondary:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},success:{50:"#f0fdf4",500:"#22c55e",600:"#16a34a",700:"#15803d"},warning:{50:"#fffbeb",500:"#f59e0b",600:"#d97706",700:"#b45309"},error:{50:"#fef2f2",500:"#ef4444",600:"#dc2626",700:"#b91c1c"},neutral:{0:"#ffffff",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d4d4d4",400:"#9ca3af",500:"#6b7280",600:"#525252",700:"#404040",800:"#27272a",900:"#1a1a1c",950:"#0d0d0f"},muted:{background:"#F3F4F6",foreground:"#6B7280"}},s={0:"0",1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem"},n={fontFamily:{sans:["Inter","system-ui","-apple-system","sans-serif"],mono:["Fira Code","Courier New","monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}]},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"}},i={none:"0",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem",full:"9999px"},o={sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",none:"none"},f={colors:t,spacing:s,typography:n,radius:i,shadows:o},c={colors:t,spacing:s,typography:n,radius:i,shadows:o},m={"bg-primary":"#F9FAFB","bg-secondary":"#FFFFFF","bg-tertiary":"#F3F4F6","text-primary":"#111827","text-secondary":"#6B7280","text-tertiary":"#6B7280","text-inverse":"#FFFFFF","border-primary":"#E5E7EB","border-secondary":"#D4D4D4",link:"#2563EB","link-hover":"#1E40AF","accent-subtle":"#DBEAFE",success:"#16A34A",warning:"#F59E0B",error:"#DC2626",info:"#0EA5E9",disabled:"#9CA3AF",shadow:"rgba(0, 0, 0, 0.05)"},b={"bg-primary":"#0D0D0F","bg-secondary":"#1A1A1C","bg-tertiary":"#27272A","text-primary":"#F5F5F7","text-secondary":"#A1A1AA","text-tertiary":"#A1A1AA","text-inverse":"#1A1A1C","border-primary":"#3F3F46","border-secondary":"#52525B",link:"#3B82F6","link-hover":"#60A5FA","accent-subtle":"#1E3A8A",success:"#22C55E",warning:"#EAB308",error:"#EF4444",info:"#38BDF8",disabled:"#52525B",shadow:"rgba(0, 0, 0, 0.4)"};function p(e,r){let{colors:a,spacing:t,typography:s,radius:n,shadows:i}=e,o=[];return Object.entries(r).forEach(([e,r])=>{o.push(` --${e}: ${r};`)}),Object.entries(a).forEach(([e,r])=>{"object"==typeof r&&null!==r&&Object.entries(r).forEach(([r,a])=>{o.push(` --color-${e}-${r}: ${a};`)})}),Object.entries(t).forEach(([e,r])=>{o.push(` --spacing-${e}: ${r};`)}),Object.entries(s).forEach(([e,r])=>{"object"==typeof r?Object.entries(r).forEach(([r,a])=>{o.push(` --typography-${e}-${r}: ${a};`)}):o.push(` --typography-${e}: ${r};`)}),Object.entries(n).forEach(([e,r])=>{o.push(` --radius-${e}: ${r};`)}),Object.entries(i).forEach(([e,r])=>{o.push(` --shadow-${e}: ${r};`)}),o.join("\n")}function d(e,r){return`
|
|
2
2
|
:root {
|
|
3
|
-
${p(e,
|
|
3
|
+
${p(e,m)}
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.dark {
|
|
7
|
-
${p(r,
|
|
7
|
+
${p(r,b)}
|
|
8
8
|
}
|
|
9
|
-
`.trim()}}}]);
|
|
10
|
-
//# sourceMappingURL=968.js.map
|
|
9
|
+
`.trim()}}}]);
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_kb_labs_agent_entry=self.webpackChunk_kb_labs_agent_entry||[]).push([["596"],{6026(e,t){var n=Symbol.for("react.transitional.element");function r(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var l in r={},t)"key"!==l&&(r[l]=t[l]);else r=t;return{$$typeof:n,type:e,key:o,ref:void 0!==(t=r.ref)?t:null,props:r}}t.Fragment=Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r},4552(e,t,n){e.exports=n(6026)},5387(e,t,n){n.r(t),n.d(t,{default:()=>K});var r=n(4552),o=n(2913),l=n.n(o),i=n(6831),s=n(1349),a=n(2383);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],i=!0,s=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(s)throw r}}return l}}(e,t)||f(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}}function p(e){var t,n=e.currentSessionId,o=e.onSessionChange,l=e.onNewChat,i=(0,s.useUITheme)().token,c=(0,a.useData)("/v1/plugins/agents/sessions?limit=20"),u=c.data,d=c.isLoading,f=null!=(t=null==u?void 0:u.sessions)?t:[],p=function(e){var t=f.find(function(t){return t.id===e});t&&o(e,t)};return(0,r.jsxs)(s.UISpace,{size:"small",style:{width:"100%"},children:[(0,r.jsx)(s.UIIcon,{name:"HistoryOutlined",style:{color:i.colorTextTertiary}}),(0,r.jsx)(s.UISelect,{style:{flex:1,minWidth:200},placeholder:"New chat",value:null!=n?n:void 0,onChange:function(e){return p(e)},loading:d,allowClear:!0,onClear:l,notFoundContent:d?(0,r.jsx)(s.UISpin,{size:"small"}):(0,r.jsx)(s.UITypographyText,{type:"secondary",children:"No sessions yet"}),optionLabelProp:"label",options:f.map(function(e){return{value:e.id,label:e.name||e.task||"Untitled",lastActivityAt:e.lastActivityAt}}),optionRender:function(e){var t,n,o,l,i;return(0,r.jsxs)(s.UISpace,{style:{width:"100%",justifyContent:"space-between"},children:[(0,r.jsx)(s.UITypographyText,{ellipsis:!0,style:{maxWidth:180},children:e.label}),(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:11},children:(t=new Date(e.data.lastActivityAt),o=Math.floor((n=new Date().getTime()-t.getTime())/6e4),l=Math.floor(n/36e5),i=Math.floor(n/864e5),o<1?"just now":o<60?"".concat(o,"m ago"):l<24?"".concat(l,"h ago"):i<7?"".concat(i,"d ago"):t.toLocaleDateString())})]})}}),(0,r.jsx)(s.UITooltip,{title:"New Chat",children:(0,r.jsx)(s.UIButton,{variant:"primary",icon:(0,r.jsx)(s.UIIcon,{name:"PlusOutlined"}),onClick:l})})]})}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,l,i){try{var s=e[l](i),a=s.value}catch(e){n(e);return}s.done?t(a):Promise.resolve(a).then(r,o)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function i(e){h(l,r,o,i,s,"next",e)}function s(e){h(l,r,o,i,s,"throw",e)}i(void 0)})}}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function m(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],i=!0,s=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(s)throw r}}return l}}(e,t)||b(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}}function S(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(i,"next",{value:a(0)}),s(i,"throw",{value:a(1)}),s(i,"return",{value:a(2)}),"function"==typeof Symbol&&s(i,Symbol.iterator,{value:function(){return this}}),i;function a(s){return function(a){var c=[s,a];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var j=n(296).theme.useToken;function k(e){var t=e.turns,n=e.isLoading,o=e.sessionId,l=j().token;return n?(0,r.jsxs)(s.UIFlex,{justify:"center",align:"center",style:{minHeight:240,gap:8},children:[(0,r.jsx)(s.UISpin,{size:"small"}),(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:13},children:"Loading history..."})]}):0===t.length?(0,r.jsx)(s.UIFlex,{justify:"center",align:"center",style:{minHeight:240},children:(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:14},children:"Ask anything to get started"})}):(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",padding:"16px 16px 40px",gap:24},children:t.map(function(e){return(0,r.jsx)(w,{turn:e,sessionId:o,token:l},e.id)})})}function w(e){var t,n,o,l=e.turn,i=e.sessionId,a=e.token;if("user"===l.type){var c=l.steps.find(function(e){return"text"===e.type});return(0,r.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,r.jsx)("span",{style:{maxWidth:"68%",background:a.colorFillTertiary,borderRadius:"".concat(a.borderRadiusLG,"px ").concat(a.borderRadiusLG,"px 3px ").concat(a.borderRadiusLG,"px"),padding:"10px 16px",fontSize:14,lineHeight:1.55,color:a.colorText,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(null==c?void 0:c.type)==="text"?c.content:""})})}var u="streaming"===l.status,d=l.steps.filter(function(e){return"text"===e.type}),f=d.filter(function(e){var t,n;return!D(null!=(t=e.content)?t:"")&&(null==(n=e.content)?void 0:n.trim())}),p=d.some(function(e){var t;return D(null!=(t=e.content)?t:"")}),y=l.steps.find(function(e){return"tool_use"===e.type&&"report"===e.toolName}),h=null==y||null==(t=y.input)?void 0:t.answer,g=l.steps.filter(function(e){return"text"!==e.type&&("tool_use"!==e.type||"report"!==e.toolName)}),x=g.length>0||u||p,m=h||null,v=null==(n=l.metadata)?void 0:n.fileChanges,b=null==(o=l.metadata)?void 0:o.runId,S=!u&&v&&v.length>0&&!!i&&!!b,j={display:"flex",flexDirection:"column",borderLeft:"2px solid ".concat(a.colorBorderSecondary),paddingLeft:12,gap:6,marginLeft:6};return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[x&&(0,r.jsxs)("div",{style:j,children:[g.map(function(e,t){return(0,r.jsx)(C,{step:e,isLast:!1,isStreaming:u&&t===g.length-1&&!m&&0===f.length,token:a},e.id)}),u&&(0===l.steps.length||p)&&(0,r.jsx)(T,{token:a})]}),m&&(0,r.jsx)("div",{style:j,children:(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(I,{color:a.colorPrimary,pulse:!1}),(0,r.jsx)(s.UIMarkdownViewer,{content:m,style:{flex:1}})]})}),!m&&f.map(function(e){var t;return"text"===e.type&&(null==(t=e.content)?void 0:t.trim())?(0,r.jsx)("div",{style:j,children:(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(I,{color:a.colorPrimary,pulse:!1}),(0,r.jsx)(s.UIMarkdownViewer,{content:e.content,style:{flex:1}})]})},e.id):null}),S&&(0,r.jsx)("div",{style:j,children:(0,r.jsx)(z,{sessionId:i,runId:b,fileChanges:v,token:a})})]})}function I(e){var t=e.color,n=e.pulse;return(0,r.jsx)("span",{style:{flexShrink:0,width:10,height:10,marginTop:5,borderRadius:"50%",background:t,opacity:n?.7:1,animation:n?"none":void 0}})}function T(e){var t=e.token;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,r.jsx)(I,{color:t.colorTextTertiary,pulse:!0}),(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:13},children:"Agent is analyzing and executing steps..."})]})}function C(e){var t,n,o,l=e.step,i=e.isStreaming,a=e.token;switch(l.type){case"thinking":var c,u,d=null!=(c=null==(u=l.content)?void 0:u.trim())?c:"";if(D(d))return null;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(I,{color:a.colorWarning,pulse:i}),(0,r.jsx)("div",{style:{flex:1},children:(0,r.jsx)(s.UIMarkdownViewer,{content:d,style:{fontSize:13,opacity:.8}})})]});case"tool_use":return(0,r.jsx)(R,{step:l,isStreaming:i,token:a});case"tool_result":return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(I,{color:l.success?a.colorSuccess:a.colorError}),(0,r.jsxs)("div",{style:{flex:1},children:[(0,r.jsxs)("span",{style:{fontSize:13,color:a.colorTextSecondary},children:[(0,r.jsx)("span",{style:{fontWeight:500,color:a.colorText},children:M(l.toolName)}),void 0!==l.durationMs&&(0,r.jsxs)("span",{style:{marginLeft:6,fontSize:11,color:a.colorTextTertiary},children:[l.durationMs,"ms"]})]}),!l.success&&l.error&&(0,r.jsx)("p",{style:{margin:"4px 0 0",fontSize:12,color:a.colorError},children:l.error})]})]});case"subagent":return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(I,{color:a.colorPrimary}),(0,r.jsxs)("span",{style:{fontSize:13,color:a.colorTextSecondary},children:[(0,r.jsxs)("span",{style:{fontWeight:500,color:a.colorText},children:["Agent: ",l.agentName]}),(0,r.jsxs)("span",{style:{marginLeft:6},children:[" — ",null==(n=l.task)?void 0:n.slice(0,60),(null!=(t=null==(o=l.task)?void 0:o.length)?t:0)>60?"...":""]})]})]});case"error":return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(I,{color:a.colorError}),(0,r.jsxs)("div",{style:{flex:1},children:[(0,r.jsx)("span",{style:{fontSize:13,fontWeight:500,color:a.colorError},children:l.code}),(0,r.jsx)("p",{style:{margin:"4px 0 0",fontSize:12,color:a.colorError},children:l.message})]})]});default:return null}}function R(e){var t,n,o=e.step,i=e.isStreaming,s=e.token,a=v(l().useState(!1),2),c=a[0],u=a[1],d="pending"===o.status,f="done"===o.status,p="error"===o.status,y=f&&!1===o.success,h=function(e){var t=e.input;if(!t)return{};var n=e.toolName.toLowerCase(),r=n.includes("read"),o=n.includes("write")||n.includes("patch")||n.includes("edit"),l=null!=(s=null!=(a=null!=(c=t.path)?c:t.filePath)?a:t.file_path)?s:t.file;if(l){var i=null!=(h=String(l).split("/").pop())?h:String(l);if(r){var s,a,c,u,d,f,p,y,h,g,x,m,v,b,S=null!=(x=null!=(m=t.offset)?m:t.startLine)?x:t.start_line,j=null!=(v=null!=(b=t.limit)?b:t.endLine)?v:t.end_line;void 0!==S&&void 0!==j?g="".concat(S,"-").concat(Number(S)+Number(j)):void 0!==j&&(g="".concat(j," lines"))}return{summary:i,filePath:String(l),badge:g}}var k=null!=(u=null!=(d=null!=(f=t.query)?f:t.text)?d:t.pattern)?u:t.search;if(k)return{summary:String(k).slice(0,100)};var w=null!=(p=t.command)?p:t.cmd;if(w)return{summary:String(w).slice(0,100)};if(o)return{};var I=null!=(y=t.content)?y:t.message;return I?{summary:String(I).slice(0,100)}:{}}(o),g=f&&!!(null==(n=o.metadata)?void 0:n.diff),x=f&&null!=o.output,m=o.input,b=/write|patch|edit/i.test(o.toolName)&&f&&!!(null!=(t=null==m?void 0:m.content)?t:null==m?void 0:m.new_content),S=x||g||b||p,j=d?i?s.colorTextTertiary:s.colorPrimary:f&&!y?s.colorSuccess:s.colorError,k=o.metadata,w=f&&(null==k?void 0:k.uiHint)==="todo"&&null!=k.structured?k.structured.todoList:void 0;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(I,{color:j,pulse:d&&i}),(0,r.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,r.jsxs)("button",{onClick:function(){return S&&u(function(e){return!e})},disabled:!S,style:{display:"inline-flex",alignItems:"center",gap:6,background:"none",border:"none",padding:0,cursor:S?"pointer":"default",fontSize:13,color:s.colorText,flexWrap:"wrap"},children:[(0,r.jsx)("span",{style:{fontWeight:500},children:M(o.toolName)}),h.badge&&(0,r.jsx)("span",{style:{fontSize:11,color:s.colorTextSecondary,background:s.colorFillSecondary,borderRadius:s.borderRadiusSM,padding:"0 5px"},children:h.badge}),f&&(null==k?void 0:k.resultCount)!==void 0&&(0,r.jsxs)("span",{style:{fontSize:11,color:s.colorTextSecondary,background:s.colorFillSecondary,borderRadius:s.borderRadiusSM,padding:"0 5px"},children:[k.resultCount," results"]}),f&&(null==k?void 0:k.confidence)!==void 0&&(0,r.jsxs)("span",{style:{fontSize:11,color:s.colorTextSecondary,background:s.colorFillSecondary,borderRadius:s.borderRadiusSM,padding:"0 5px"},children:[Math.round(100*k.confidence),"%"]}),f&&(null==k?void 0:k.exitCode)!==void 0&&0!==k.exitCode&&(0,r.jsxs)("span",{style:{fontSize:11,color:s.colorError,background:s.colorErrorBg,borderRadius:s.borderRadiusSM,padding:"0 5px"},children:["exit ",k.exitCode]}),f&&((null==k?void 0:k.linesAdded)!==void 0||(null==k?void 0:k.linesRemoved)!==void 0)&&(0,r.jsxs)("span",{style:{fontSize:11,color:s.colorSuccess,background:s.colorSuccessBg,borderRadius:s.borderRadiusSM,padding:"0 5px"},children:[(null==k?void 0:k.linesAdded)!=null&&k.linesAdded>0?"+".concat(k.linesAdded):"",(null==k?void 0:k.linesRemoved)!=null&&k.linesRemoved>0?" -".concat(k.linesRemoved):""]}),!d&&void 0!==o.durationMs&&(0,r.jsxs)("span",{style:{fontSize:11,color:s.colorTextTertiary},children:[o.durationMs,"ms"]}),S&&(0,r.jsx)("span",{style:{fontSize:11,color:s.colorTextTertiary},children:c?"collapse":"expand"})]}),h.summary&&(0,r.jsx)("p",{style:{margin:"2px 0 0",fontSize:12,color:s.colorTextSecondary},children:h.filePath?(0,r.jsx)(U,{path:h.filePath,label:h.summary,token:s}):h.summary}),null!=w&&(0,r.jsx)(L,{todoList:w,token:s}),p&&o.error&&(0,r.jsx)("p",{style:{margin:"4px 0 0",fontSize:12,color:s.colorError},children:o.error}),y&&!c&&null!=o.output&&(0,r.jsx)("p",{style:{margin:"4px 0 0",fontSize:12,color:s.colorError},children:String(o.output)}),c&&(0,r.jsx)("div",{style:{marginTop:6},children:(0,r.jsx)(A,{step:o,hasDiff:g,hasOutput:x,token:s})})]})]})}function A(e){var t=e.step,n=e.hasDiff,o=e.hasOutput,l=e.token,i=t.input,a=t.toolName.toLowerCase(),c=a.includes("write")||a.includes("patch")||a.includes("edit"),u=a.includes("read"),d=a.includes("bash")||a.includes("exec")||a.includes("shell")||a.includes("run"),f=a.includes("grep")||a.includes("search")||a.includes("glob")||a.includes("list")||a.includes("rag"),p={margin:0,padding:"8px 10px",fontSize:12,lineHeight:1.5,borderRadius:l.borderRadius,overflow:"auto",maxHeight:300,whiteSpace:"pre-wrap",wordBreak:"break-all"};if(c){if(n)return(0,r.jsx)(O,{diff:t.metadata.diff,token:l});var y=null!=(h=null!=(g=null==i?void 0:i.content)?g:null==i?void 0:i.new_content)?h:null==i?void 0:i.text;if(y){var h,g,v,b,S,j=null!=(v=null!=(b=null!=(S=null==i?void 0:i.path)?S:null==i?void 0:i.filePath)?b:null==i?void 0:i.file_path)?v:null==i?void 0:i.file,k=j?j.split(".").pop():void 0;return(0,r.jsxs)("div",{children:[j&&(0,r.jsx)("div",{style:{fontSize:11,color:l.colorTextTertiary,padding:"3px 8px",background:l.colorFillSecondary,borderRadius:"".concat(l.borderRadius,"px ").concat(l.borderRadius,"px 0 0")},children:j}),(0,r.jsx)("pre",{style:m(x({},p),{background:l.colorFillSecondary,borderRadius:j?"0 0 ".concat(l.borderRadius,"px ").concat(l.borderRadius,"px"):l.borderRadius}),className:k?"lang-".concat(k):void 0,children:String(y)})]})}return null}if(u&&o)return(0,r.jsx)("pre",{style:m(x({},p),{background:l.colorFillSecondary}),children:B(t.output)});if(d&&o)return(0,r.jsx)("pre",{style:m(x({},p),{background:l.colorBgSpotlight,color:l.colorTextLightSolid}),children:B(t.output)});if(f&&o)return(0,r.jsx)("pre",{style:m(x({},p),{background:l.colorFillSecondary}),children:B(t.output)});if(n)return(0,r.jsx)(O,{diff:t.metadata.diff,token:l});if(o){var w="done"===t.status&&!1===t.success,I=B(t.output);return w?(0,r.jsx)("pre",{style:m(x({},p),{background:l.colorErrorBg,color:l.colorError}),children:I}):(0,r.jsx)(s.UIMarkdownViewer,{content:I,style:{fontSize:12}})}return null}function O(e){var t=e.diff,n=e.token,o=t.split("\n");return(0,r.jsx)("pre",{style:{margin:0,padding:"8px 10px",fontSize:12,lineHeight:1.5,borderRadius:n.borderRadius,overflow:"auto",maxHeight:300,background:n.colorFillSecondary,whiteSpace:"pre"},children:o.map(function(e,t){var o=e.startsWith("+")&&!e.startsWith("+++")?n.colorSuccess:e.startsWith("-")&&!e.startsWith("---")?n.colorError:e.startsWith("@@")?n.colorInfo:void 0;return(0,r.jsxs)("span",{style:o?{color:o}:void 0,children:[e,"\n"]},t)})})}function U(e){var t=e.path,n=e.label,o=e.token,i=v(l().useState(!1),2),s=i[0],a=i[1];return(0,r.jsxs)("span",{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(t).then(function(){a(!0),setTimeout(function(){return a(!1)},1500)})},title:t,style:{cursor:"pointer",color:s?o.colorSuccess:o.colorTextSecondary,fontFamily:"monospace",fontSize:12},children:[n,s?" ✓":""]})}function z(e){var t=e.sessionId,n=e.runId,o=e.fileChanges,i=e.token,c=v(l().useState(new Set),2),u=c[0],d=c[1],f=(0,a.useMutateData)("/v1/plugins/agents/sessions/".concat(t,"/rollback"),"POST"),p=(0,a.useMutateData)("/v1/plugins/agents/sessions/".concat(t,"/approve"),"POST"),h=o.filter(function(e){return!u.has(e.changeId)&&!e.approved});if(0===h.length)return null;var x=h.every(function(e){return e.approved});return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(I,{color:i.colorSuccess}),(0,r.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[(0,r.jsxs)(s.UITypographyText,{style:{fontSize:13,fontWeight:500},children:[h.length," ",W(h.length)," changed"]}),!x&&(0,r.jsxs)(s.UIFlex,{gap:4,children:[(0,r.jsx)("button",{onClick:function(){return g(function(){return S(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.mutateAsync({runId:n})];case 1:return e.sent(),d(new Set(h.map(function(e){return e.changeId}))),[3,3];case 2:return e.sent(),console.error("Failed to approve changes"),[3,3];case 3:return[2]}})})()},disabled:p.isLoading||f.isLoading,title:"Approve all changes",style:{background:i.colorSuccessBg,border:"1px solid ".concat(i.colorSuccessBorder),color:i.colorSuccess,borderRadius:i.borderRadius,padding:"2px 8px",fontSize:12,cursor:"pointer"},children:"✓"}),(0,r.jsx)("button",{onClick:function(){(0,s.UIModalConfirm)({title:"Rollback changes?",content:"This will revert ".concat(h.length," ").concat(W(h.length)," to the state before the agent run."),okText:"Rollback",okButtonProps:{danger:!0},cancelText:"Cancel",onOk:function(){return g(function(){var e,t;return S(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,f.mutateAsync({runId:n})];case 1:return(null==(e=(t=r.sent()).conflicts)?void 0:e.length)&&console.warn("Rolled back: ".concat(t.rolledBack,", skipped due to conflicts: ").concat(t.skipped)),d(new Set(h.map(function(e){return e.changeId}))),[3,3];case 2:return r.sent(),console.error("Failed to rollback changes"),[3,3];case 3:return[2]}})})()}})},disabled:f.isLoading||p.isLoading,title:"Rollback all changes",style:{background:i.colorErrorBg,border:"1px solid ".concat(i.colorErrorBorder),color:i.colorError,borderRadius:i.borderRadius,padding:"2px 8px",fontSize:12,cursor:"pointer"},children:"✕"})]})]}),(0,r.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:h.map(function(e){return(0,r.jsx)(P,{change:e,sessionId:t,onDismiss:function(){return d(function(t){return new Set(((function(e){if(Array.isArray(e))return y(e)})(t)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||b(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e.changeId]))})},token:i},e.changeId)})})]})]})}function P(e){var t,n=e.change,o=e.sessionId,i=e.onDismiss,c=e.token,u=v(l().useState(!1),2),d=u[0],f=u[1],p=(0,a.useMutateData)("/v1/plugins/agents/sessions/".concat(o,"/rollback"),"POST"),y=(0,a.useMutateData)("/v1/plugins/agents/sessions/".concat(o,"/approve"),"POST"),h=d?"/v1/plugins/agents/sessions/".concat(o,"/changes/").concat(encodeURIComponent(n.changeId),"/diff"):"",x=(0,a.useData)(h,{enabled:d}),m=x.data,b=x.isLoading,j=x.isError,k=n.isNew?(0,r.jsx)(s.UITag,{color:"success",children:"new"}):"delete"===n.operation?(0,r.jsx)(s.UITag,{color:"error",children:"del"}):(0,r.jsx)(s.UITag,{color:"blue",children:"mod"});return(0,r.jsxs)("li",{children:[(0,r.jsxs)("div",{onClick:function(){return f(function(e){return!e})},style:{display:"flex",alignItems:"center",gap:6,fontSize:12,cursor:"pointer",padding:"2px 4px",borderRadius:c.borderRadiusSM,background:d?c.colorFillSecondary:"transparent"},children:[k,(0,r.jsx)("span",{style:{flex:1,fontFamily:"monospace",color:c.colorTextSecondary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:null!=(t=n.filePath.split("/").pop())?t:n.filePath}),(0,r.jsx)("span",{style:{color:c.colorTextTertiary,fontFamily:"monospace",fontSize:11},children:n.filePath.includes("/")?n.filePath.slice(0,n.filePath.lastIndexOf("/")):""}),!n.approved&&(0,r.jsxs)("div",{style:{display:"flex",gap:4},onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)("button",{onClick:function(e){e.stopPropagation(),y.mutateAsync({changeIds:[n.changeId]}).then(i).catch(function(){console.error("Failed to approve file")})},disabled:y.isLoading,title:"Approve",style:{background:"none",border:"none",cursor:"pointer",color:c.colorSuccess,fontSize:13,padding:"0 2px"},children:"✓"}),(0,r.jsx)("button",{onClick:function(e){e.stopPropagation(),(0,s.UIModalConfirm)({title:"Rollback file?",content:n.filePath,okText:"Rollback",okButtonProps:{danger:!0},cancelText:"Cancel",onOk:function(){return g(function(){return S(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.mutateAsync({changeIds:[n.changeId]})];case 1:return e.sent(),i(),[3,3];case 2:return e.sent(),console.error("Failed to rollback file"),[3,3];case 3:return[2]}})})()}})},disabled:p.isLoading,title:"Rollback",style:{background:"none",border:"none",cursor:"pointer",color:c.colorError,fontSize:13,padding:"0 2px"},children:"✕"})]})]}),d&&(0,r.jsxs)("div",{style:{marginTop:4,marginLeft:4},children:[b&&(0,r.jsx)(s.UISpin,{size:"small"}),(null==m?void 0:m.diff)&&(0,r.jsx)(O,{diff:m.diff,token:c}),j&&(0,r.jsx)("span",{style:{color:c.colorError,fontSize:12},children:"Failed to load diff"})]})]})}var E={completed:"✓","in-progress":"●",blocked:"✕",pending:"○"};function L(e){var t,n=e.todoList,o=e.token;if(!(null==n||null==(t=n.items)?void 0:t.length))return null;var l=n.items.filter(function(e){return"completed"===e.status}).length;return(0,r.jsxs)("div",{style:{marginTop:6,background:o.colorFillTertiary,borderRadius:o.borderRadius,padding:"8px 10px"},children:[(0,r.jsxs)("div",{style:{fontSize:11,color:o.colorTextTertiary,marginBottom:6,fontWeight:500},children:[l,"/",n.items.length]}),(0,r.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:n.items.map(function(e){var t;return(0,r.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,lineHeight:1.5,padding:"2px 0"},children:[(0,r.jsx)("span",{style:{fontSize:12,flexShrink:0,width:14,textAlign:"center",lineHeight:1},children:null!=(t=E[e.status])?t:"○"}),"completed"===e.status?(0,r.jsx)(s.UITypographyText,{type:"success",style:{flex:1,minWidth:0,textDecoration:"line-through"},children:e.description}):"pending"===e.status||"blocked"===e.status?(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{flex:1,minWidth:0},children:e.description}):(0,r.jsx)(s.UITypographyText,{style:{flex:1,minWidth:0},children:e.description}),"medium"!==e.priority&&(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:11,flexShrink:0},children:e.priority})]},e.id)})})]})}function M(e){var t=e.trim().toLowerCase().replace(/[_-]/g," ");if(t.includes("fs read")||t.includes("read file"))return"Read";if(t.includes("fs write")||t.includes("write file"))return"Write";if(t.includes("fs patch")||t.includes("patch file")||t.includes("fs edit")||t.includes("edit file"))return"Edit";if(t.includes("fs delete")||t.includes("delete file")||t.includes("remove file"))return"Delete";if(t.includes("fs list")||t.includes("list files")||t.includes("glob"))return"Glob";if(t.includes("grep")||t.includes("search content"))return"Grep";if(t.includes("bash")||t.includes("exec")||t.includes("shell")||t.includes("run command"))return"Bash";if(t.includes("rag")||t.includes("mind"))return"Mind";if(t.includes("todo"))return"TodoWrite";var n=e.indexOf(":");return(n>=0?e.slice(n+1):e).replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,function(e){return e.toUpperCase()})}function D(e){var t=e.trim().toLowerCase();return!!("[executing tools...]"===t||"[thinking...]"===t||"[planning...]"===t||"[analyzing...]"===t||"analyzing context and choosing the next step."===t||t.startsWith("checking facts with tool:")||t.startsWith("running step with tool:")||t.startsWith("running the next step"))||"done."===t||"ok."===t||"done"===t||"ok"===t}function W(e){return 1===e?"file":"files"}function B(e){if("string"==typeof e)return e.slice(0,2e3);try{return JSON.stringify(e,null,2).slice(0,2e3)}catch(t){return String(e).slice(0,2e3)}}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t,n,r,o,l,i){try{var s=e[l](i),a=s.value}catch(e){n(e);return}s.done?t(a):Promise.resolve(a).then(r,o)}function _(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function i(e){N(l,r,o,i,s,"next",e)}function s(e){N(l,r,o,i,s,"throw",e)}i(void 0)})}}function q(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],i=!0,s=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(s)throw r}}return l}}(e,t)||$(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(e){return function(e){if(Array.isArray(e))return F(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){if(e){if("string"==typeof e)return F(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(e,t)}}function V(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(i,"next",{value:a(0)}),s(i,"throw",{value:a(1)}),s(i,"return",{value:a(2)}),"function"==typeof Symbol&&s(i,Symbol.iterator,{value:function(){return this}}),i;function a(s){return function(a){var c=[s,a];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function J(e,t){if(e.sequence!==t.sequence)return e.sequence-t.sequence;if(e.type!==t.type){if("user"===e.type)return -1;if("user"===t.type)return 1}return e.startedAt.localeCompare(t.startedAt)}let K=function(){var e,t,n,c,f,y,h,g,x,m,v,b,S,j,w,I,T,C,R,A,O,U,z,P,E,L,M,D,W,B,F,N,$,K,Z=(0,s.useUITheme)().token,Q=l().useRef(null),X=H((0,i.useSearchParams)(),2),Y=X[0],ee=X[1],et=H((0,o.useState)(function(){return Y.get("session")}),2),en=et[0],er=et[1],eo=H((0,o.useState)(function(){return Y.get("session")}),2),el=eo[0],ei=eo[1],es=H((0,o.useState)(""),2),ea=es[0],ec=es[1],eu=H((0,o.useState)(null),2),ed=eu[0],ef=eu[1],ep=H((0,o.useState)("idle"),2),ey=ep[0],eh=ep[1],eg=H((0,o.useState)([]),2),ex=eg[0],em=eg[1],ev=H((0,o.useState)("auto"),2),eb=ev[0],eS=ev[1],ej=H((0,o.useState)("medium"),2),ek=ej[0],ew=ej[1],eI=H((0,o.useState)(!0),2),eT=eI[0],eC=eI[1],eR=H((0,o.useState)("execute"),2),eA=eR[0],eO=eR[1],eU=H((0,o.useState)(!1),2),ez=eU[0],eP=eU[1],eE="mind-assistant",eL=en?(e="https:"===window.location.protocol?"wss:":"ws:",t=window.location.host,"".concat(e,"//").concat(t,"/api/v1/ws/plugins/agents/session/").concat(en)):null,eM=(0,a.useMutateData)("/v1/plugins/agents/run","POST"),eD=(0,a.useMutateData)(ed?"/v1/plugins/agents/run/".concat(ed,"/stop"):"/v1/plugins/agents/run/noop/stop","POST"),eW=en?"/v1/plugins/agents/sessions/".concat(en,"/turns"):"",eB=(0,a.useData)(eW,{enabled:!!en}),eF=eB.data,eN=eB.isFetching,e_=eB.refetch;(0,o.useEffect)(function(){en&&eF&&!eN&&ei(en)},[en,eF,eN]);var eq=(c=(n={url:eL,onComplete:function(e,t){eh(e?"completed":"failed"),e_(),console.log("[AgentsPage] Run completed:",t)},onTurnsChanged:function(){em([])},onError:function(e){console.error("[AgentsPage] WebSocket error:",e),s.UIMessage.error("Connection error: ".concat(e.message))}}).url,y=void 0===(f=n.autoReconnect)||f,g=void 0===(h=n.reconnectDelay)?1e3:h,m=void 0===(x=n.maxReconnectAttempts)?5:x,v=n.onComplete,b=n.onTurnsChanged,S=n.onError,w=(j=u((0,o.useState)("disconnected"),2))[0],I=j[1],C=(T=u((0,o.useState)([]),2))[0],R=T[1],O=(A=u((0,o.useState)(null),2))[0],U=A[1],z=(0,o.useRef)(null),P=(0,o.useRef)(0),E=(0,o.useRef)(null),L=(0,o.useRef)(!1),M=(0,o.useRef)(!1),D=(0,o.useRef)(v),W=(0,o.useRef)(S),B=(0,o.useRef)(b),(0,o.useEffect)(function(){D.current=v},[v]),(0,o.useEffect)(function(){W.current=S},[S]),(0,o.useEffect)(function(){B.current=b},[b]),F=(0,o.useCallback)(function(){null!==E.current&&(clearTimeout(E.current),E.current=null),z.current&&(z.current.onclose=null,z.current.onerror=null,z.current.onmessage=null,z.current.close(),z.current=null)},[]),N=(0,o.useCallback)(function(e){F(),I("connecting"),P.current=0;var t=new WebSocket(e);z.current=t,t.onopen=function(){},t.onmessage=function(e){try{var t=JSON.parse(e.data);switch(t.type){case"conversation:snapshot":var n,r=t.payload,o=r.completedTurns,l=r.activeTurns,i=d(o).concat(d(l)).sort(function(e,t){return e.sequence-t.sequence});M.current=!1,R(function(e){if(0===e.length)return i;var t=new Map,n=!0,r=!1,o=void 0;try{for(var l,s=i[Symbol.iterator]();!(n=(l=s.next()).done);n=!0){var a=l.value;t.set(a.id,a)}}catch(e){r=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw o}}var c=!0,u=!1,f=void 0;try{for(var p,y=e[Symbol.iterator]();!(c=(p=y.next()).done);c=!0){var h=p.value,g=t.get(h.id);g&&"streaming"===h.status&&"streaming"===g.status&&h.steps.length>g.steps.length&&t.set(h.id,h)}}catch(e){u=!0,f=e}finally{try{c||null==y.return||y.return()}finally{if(u)throw f}}return d(t.values()).sort(function(e,t){return e.sequence-t.sequence})}),null==(n=B.current)||n.call(B);break;case"turn:snapshot":var s,a=t.payload.turn;M.current=!1,R(function(e){var t=d(e),n=t.findIndex(function(e){return e.id===a.id});if(n>=0){var r=t[n];if("streaming"===r.status&&"streaming"===a.status&&a.steps.length<r.steps.length)return e;t[n]=a}else{var o=t.findIndex(function(e){return e.sequence>a.sequence});o>=0?t.splice(o,0,a):t.push(a)}return t}),null==(s=B.current)||s.call(B);break;case"connection:ready":P.current=0,I("connected");break;case"run:completed":var c,u=t.payload,f=u.success,p=u.summary;M.current=!0,null==(c=D.current)||c.call(D,f,p);break;case"error":var y,h=t.payload,g=h.code,x=h.message;U({code:g,message:x}),null==(y=W.current)||y.call(W,{code:g,message:x})}}catch(e){console.error("[useAgentWebSocket] Failed to parse message:",e)}},t.onerror=function(){I("error")},t.onclose=function(t){L.current&&!M.current&&y&&P.current<m?(P.current++,I("reconnecting"),E.current=setTimeout(function(){L.current&&N(e)},g*P.current)):I("disconnected")}},[y,F,m,g]),$=(0,o.useCallback)(function(e){var t;(null==(t=z.current)?void 0:t.readyState)===WebSocket.OPEN&&z.current.send(JSON.stringify(e))},[]),K=(0,o.useCallback)(function(){R([]),U(null),M.current=!1},[]),(0,o.useEffect)(function(){return L.current=!1,F(),R([]),U(null),M.current=!1,c?(L.current=!0,N(c)):I("disconnected"),function(){L.current=!1,F()}},[c]),{status:w,isConnected:"connected"===w,turns:C,error:O,send:$,clearTurns:K}),eH=(0,o.useCallback)(function(e,t){er(e),ei(null),ee({session:e},{replace:!0}),ef(null),eh("idle"),em([]),eq.clearTurns()},[eq,ee]),eG=(0,o.useCallback)(function(){er(null),ei(null),ee({},{replace:!0}),ef(null),eh("idle"),em([]),eq.clearTurns()},[eq,ee]),e$=(0,o.useCallback)(function(){return _(function(){var e,t,n,r;return V(this,function(o){switch(o.label){case 0:if(!ea.trim())return[2];e=ea.trim(),ec(""),eh("running"),t={id:"optimistic-user-".concat(Date.now()),type:"user",sequence:9999,startedAt:new Date().toISOString(),completedAt:new Date().toISOString(),status:"completed",steps:[{type:"text",id:"opt-1",timestamp:new Date().toISOString(),content:e,role:"user"}],metadata:{agentId:"user"}},em(function(e){return G(e).concat([t])}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,eM.mutateAsync({task:e,agentId:eE,sessionId:null!=en?en:void 0,tier:ek,enableEscalation:eT,responseMode:eb})];case 2:return n=o.sent(),en||(er(n.sessionId),ei(n.sessionId),ee({session:n.sessionId},{replace:!0})),ef(n.runId),[3,4];case 3:return r=o.sent(),em(function(e){return e.filter(function(e){return e.id!==t.id})}),eh("failed"),s.UIMessage.error("Failed to start: ".concat(q(r,Error)?r.message:String(r))),[3,4];case 4:return[2]}})})()},[ea,eE,en,ek,eT,eb,ee,eM]),eV=(0,o.useCallback)(function(){return _(function(){var e;return V(this,function(t){switch(t.label){case 0:if(!ed)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,eD.mutateAsync({reason:"Stopped by user"})];case 2:return t.sent(),eh("stopped"),s.UIMessage.info("Stopped"),[3,4];case 3:return e=t.sent(),s.UIMessage.error("Failed to stop: ".concat(q(e,Error)?e.message:String(e))),[3,4];case 4:return[2]}})})()},[ed,eD]),eJ="running"===ey||eM.isLoading,eK=null!==en&&en!==el,eZ=function(){if(eK)return[];var e=null!=(i=null==eF?void 0:eF.turns)?i:[],t=eq.turns,n=new Map;if(0===t.length){var r=!0,o=!1,l=void 0;try{for(var i,s,a=e[Symbol.iterator]();!(r=(s=a.next()).done);r=!0){var c=s.value;n.set(c.id,c)}}catch(e){o=!0,l=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw l}}}else{var u=!0,d=!1,f=void 0;try{for(var p,y=e[Symbol.iterator]();!(u=(p=y.next()).done);u=!0){var h=p.value;n.set(h.id,h)}}catch(e){d=!0,f=e}finally{try{u||null==y.return||y.return()}finally{if(d)throw f}}var g=!0,x=!1,m=void 0;try{for(var v,b=t[Symbol.iterator]();!(g=(v=b.next()).done);g=!0){var S=v.value;n.set(S.id,S)}}catch(e){x=!0,m=e}finally{try{g||null==b.return||b.return()}finally{if(x)throw m}}}var j=new Set(G(n.values()).filter(function(e){return"user"===e.type}).flatMap(function(e){return e.steps.filter(function(e){return"text"===e.type}).map(function(e){var t;return null==(t=e.content)?void 0:t.trim()})}).filter(Boolean)),k=!0,w=!1,I=void 0;try{for(var T,C=ex[Symbol.iterator]();!(k=(T=C.next()).done);k=!0){var R,A,O=T.value,U=null==(A=O.steps.find(function(e){return"text"===e.type}))||null==(R=A.content)?void 0:R.trim();U&&!j.has(U)&&n.set(O.id,O)}}catch(e){w=!0,I=e}finally{try{k||null==C.return||C.return()}finally{if(w)throw I}}return G(n.values()).sort(J)}(),eQ=function(){if(!eJ||eZ.some(function(e){return"assistant"===e.type&&"streaming"===e.status}))return eZ;var e=G(eZ).reverse().find(function(e){return"user"===e.type});if(!e||eZ.some(function(t){return"assistant"===t.type&&"completed"===t.status&&t.sequence>e.sequence}))return eZ;var t={id:"thinking-loader-".concat(e.id),type:"assistant",sequence:e.sequence+.1,startedAt:new Date().toISOString(),completedAt:null,status:"streaming",steps:[],metadata:{agentId:"assistant-loader"}};return G(eZ).concat([t]).sort(J)}(),eX=eK||eN&&0===eZ.length&&!!en;return(0,r.jsx)("div",{style:{padding:16,height:"100%"},children:(0,r.jsxs)(s.UICard,{title:(0,r.jsxs)(s.UISpace,{children:[(0,r.jsx)(s.UIIcon,{name:"RobotOutlined"}),(0,r.jsx)("span",{children:"Agent"})]}),extra:(0,r.jsx)(p,{currentSessionId:en,onSessionChange:eH,onNewChat:eG}),style:{height:"100%",display:"flex",flexDirection:"column"},styles:{body:{flex:1,display:"flex",flexDirection:"column",padding:0,overflow:"hidden"}},children:[(0,r.jsx)("div",{ref:Q,style:{flex:1,overflow:"auto"},children:(0,r.jsx)(k,{turns:eQ,isLoading:eX,sessionId:en})}),(0,r.jsx)("div",{style:{borderTop:"1px solid ".concat(Z.colorBorderSecondary),padding:"12px 16px",background:Z.colorBgContainer,display:"flex",justifyContent:"center"},children:(0,r.jsxs)("div",{onFocus:function(){return eP(!0)},onBlur:function(){return eP(!1)},style:{width:"65%",maxWidth:780,border:"1px solid ".concat(ez?"execute"===eA?Z.colorError:Z.colorPrimary:"plan"===eA?Z.colorPrimary:Z.colorBorder),borderRadius:Z.borderRadiusLG,background:Z.colorBgContainer,boxShadow:ez?"0 0 0 2px ".concat("execute"===eA?Z.colorErrorBg:Z.colorPrimaryBg):"none",transition:"border-color 0.2s, box-shadow 0.2s",overflow:"hidden"},children:[(0,r.jsx)(s.UIInputTextArea,{value:ea,onChange:function(e){return ec(e.target.value)},onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||"running"===ey||eM.isLoading||(e.preventDefault(),e$())},placeholder:"Message...",autoSize:{minRows:2,maxRows:8},disabled:eJ,variant:"borderless",style:{resize:"none",padding:"10px 12px 4px",border:"none",boxShadow:"none",outline:"none"}}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 8px 8px"},children:[(0,r.jsxs)(s.UISpace,{size:6,children:[(0,r.jsx)(s.UISelect,{value:eA,onChange:function(e){return eO(e)},disabled:eJ,size:"small",variant:"borderless",style:{width:110},options:[{value:"execute",label:"Execute"},{value:"plan",label:"Plan"}]}),(0,r.jsx)(s.UISelect,{value:eb,onChange:function(e){return eS(e)},disabled:eJ,size:"small",variant:"borderless",style:{width:80},options:[{value:"auto",label:"Auto"},{value:"brief",label:"Brief"},{value:"deep",label:"Deep"}]}),(0,r.jsx)(s.UISelect,{value:ek,onChange:function(e){return ew(e)},disabled:eJ,size:"small",variant:"borderless",style:{width:100},options:[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}]}),(0,r.jsxs)(s.UISpace,{size:4,align:"center",children:[(0,r.jsx)(s.UISwitch,{checked:eT,onChange:eC,disabled:eJ||"large"===ek,size:"small"}),(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:12},children:"Auto escalate"})]})]}),(0,r.jsx)("div",{children:eJ?(0,r.jsx)(s.UIButton,{danger:!0,size:"small",icon:eD.isLoading?(0,r.jsx)(s.UIIcon,{name:"LoadingOutlined"}):(0,r.jsx)(s.UIIcon,{name:"StopOutlined"}),onClick:eV,disabled:eD.isLoading,children:"Stop"}):(0,r.jsx)(s.UIButton,{variant:"primary",size:"small",icon:eM.isLoading?(0,r.jsx)(s.UIIcon,{name:"LoadingOutlined"}):(0,r.jsx)(s.UIIcon,{name:"SendOutlined"}),onClick:e$,disabled:!ea.trim()||eM.isLoading,children:"Send"})})]})]})})]})})}}}]);
|
|
2
|
-
//# sourceMappingURL=__federation_expose_AgentsPage.js.map
|
|
1
|
+
"use strict";(self.rspackChunk_kb_labs_agent_entry=self.rspackChunk_kb_labs_agent_entry||[]).push([[596],{6026(e,t){var n=Symbol.for("react.transitional.element");function r(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var l in r={},t)"key"!==l&&(r[l]=t[l]);else r=t;return{$$typeof:n,type:e,key:o,ref:void 0!==(t=r.ref)?t:null,props:r}}t.Fragment=Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r},4552(e,t,n){e.exports=n(6026)},5387(e,t,n){n.r(t),n.d(t,{default:()=>K});var r=n(4552),o=n(2913),l=n.n(o),i=n(6831),s=n(1349),a=n(2383);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],i=!0,s=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(s)throw r}}return l}}(e,t)||f(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}}function p(e){var t,n=e.currentSessionId,o=e.onSessionChange,l=e.onNewChat,i=(0,s.useUITheme)().token,c=(0,a.useData)("/v1/plugins/agents/sessions?limit=20"),u=c.data,d=c.isLoading,f=null!=(t=null==u?void 0:u.sessions)?t:[],p=function(e){var t=f.find(function(t){return t.id===e});t&&o(e,t)};return(0,r.jsxs)(s.UISpace,{size:"small",style:{width:"100%"},children:[(0,r.jsx)(s.UIIcon,{name:"HistoryOutlined",style:{color:i.colorTextTertiary}}),(0,r.jsx)(s.UISelect,{style:{flex:1,minWidth:200},placeholder:"New chat",value:null!=n?n:void 0,onChange:function(e){return p(e)},loading:d,allowClear:!0,onClear:l,notFoundContent:d?(0,r.jsx)(s.UISpin,{size:"small"}):(0,r.jsx)(s.UITypographyText,{type:"secondary",children:"No sessions yet"}),optionLabelProp:"label",options:f.map(function(e){return{value:e.id,label:e.name||e.task||"Untitled",lastActivityAt:e.lastActivityAt}}),optionRender:function(e){var t,n,o,l,i;return(0,r.jsxs)(s.UISpace,{style:{width:"100%",justifyContent:"space-between"},children:[(0,r.jsx)(s.UITypographyText,{ellipsis:!0,style:{maxWidth:180},children:e.label}),(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:11},children:(t=new Date(e.data.lastActivityAt),o=Math.floor((n=new Date().getTime()-t.getTime())/6e4),l=Math.floor(n/36e5),i=Math.floor(n/864e5),o<1?"just now":o<60?"".concat(o,"m ago"):l<24?"".concat(l,"h ago"):i<7?"".concat(i,"d ago"):t.toLocaleDateString())})]})}}),(0,r.jsx)(s.UITooltip,{title:"New Chat",children:(0,r.jsx)(s.UIButton,{variant:"primary",icon:(0,r.jsx)(s.UIIcon,{name:"PlusOutlined"}),onClick:l})})]})}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n,r,o,l,i){try{var s=e[l](i),a=s.value}catch(e){n(e);return}s.done?t(a):Promise.resolve(a).then(r,o)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function i(e){h(l,r,o,i,s,"next",e)}function s(e){h(l,r,o,i,s,"throw",e)}i(void 0)})}}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function m(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],i=!0,s=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(s)throw r}}return l}}(e,t)||b(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}}function S(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(i,"next",{value:a(0)}),s(i,"throw",{value:a(1)}),s(i,"return",{value:a(2)}),"function"==typeof Symbol&&s(i,Symbol.iterator,{value:function(){return this}}),i;function a(s){return function(a){var c=[s,a];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var j=n(296).theme.useToken;function k(e){var t=e.turns,n=e.isLoading,o=e.sessionId,l=j().token;return n?(0,r.jsxs)(s.UIFlex,{justify:"center",align:"center",style:{minHeight:240,gap:8},children:[(0,r.jsx)(s.UISpin,{size:"small"}),(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:13},children:"Loading history..."})]}):0===t.length?(0,r.jsx)(s.UIFlex,{justify:"center",align:"center",style:{minHeight:240},children:(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:14},children:"Ask anything to get started"})}):(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",padding:"16px 16px 40px",gap:24},children:t.map(function(e){return(0,r.jsx)(I,{turn:e,sessionId:o,token:l},e.id)})})}function I(e){var t,n,o,l=e.turn,i=e.sessionId,a=e.token;if("user"===l.type){var c=l.steps.find(function(e){return"text"===e.type});return(0,r.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,r.jsx)("span",{style:{maxWidth:"68%",background:a.colorFillTertiary,borderRadius:"".concat(a.borderRadiusLG,"px ").concat(a.borderRadiusLG,"px 3px ").concat(a.borderRadiusLG,"px"),padding:"10px 16px",fontSize:14,lineHeight:1.55,color:a.colorText,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(null==c?void 0:c.type)==="text"?c.content:""})})}var u="streaming"===l.status,d=l.steps.filter(function(e){return"text"===e.type}),f=d.filter(function(e){var t,n;return!D(null!=(t=e.content)?t:"")&&(null==(n=e.content)?void 0:n.trim())}),p=d.some(function(e){var t;return D(null!=(t=e.content)?t:"")}),y=l.steps.find(function(e){return"tool_use"===e.type&&"report"===e.toolName}),h=null==y||null==(t=y.input)?void 0:t.answer,g=l.steps.filter(function(e){return"text"!==e.type&&("tool_use"!==e.type||"report"!==e.toolName)}),x=g.length>0||u||p,m=h||null,v=null==(n=l.metadata)?void 0:n.fileChanges,b=null==(o=l.metadata)?void 0:o.runId,S=!u&&v&&v.length>0&&!!i&&!!b,j={display:"flex",flexDirection:"column",borderLeft:"2px solid ".concat(a.colorBorderSecondary),paddingLeft:12,gap:6,marginLeft:6};return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[x&&(0,r.jsxs)("div",{style:j,children:[g.map(function(e,t){return(0,r.jsx)(C,{step:e,isLast:!1,isStreaming:u&&t===g.length-1&&!m&&0===f.length,token:a},e.id)}),u&&(0===l.steps.length||p)&&(0,r.jsx)(T,{token:a})]}),m&&(0,r.jsx)("div",{style:j,children:(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(w,{color:a.colorPrimary,pulse:!1}),(0,r.jsx)(s.UIMarkdownViewer,{content:m,style:{flex:1}})]})}),!m&&f.map(function(e){var t;return"text"===e.type&&(null==(t=e.content)?void 0:t.trim())?(0,r.jsx)("div",{style:j,children:(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(w,{color:a.colorPrimary,pulse:!1}),(0,r.jsx)(s.UIMarkdownViewer,{content:e.content,style:{flex:1}})]})},e.id):null}),S&&(0,r.jsx)("div",{style:j,children:(0,r.jsx)(z,{sessionId:i,runId:b,fileChanges:v,token:a})})]})}function w(e){var t=e.color,n=e.pulse;return(0,r.jsx)("span",{style:{flexShrink:0,width:10,height:10,marginTop:5,borderRadius:"50%",background:t,opacity:n?.7:1,animation:n?"none":void 0}})}function T(e){var t=e.token;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,r.jsx)(w,{color:t.colorTextTertiary,pulse:!0}),(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:13},children:"Agent is analyzing and executing steps..."})]})}function C(e){var t,n,o,l=e.step,i=e.isStreaming,a=e.token;switch(l.type){case"thinking":var c,u,d=null!=(c=null==(u=l.content)?void 0:u.trim())?c:"";if(D(d))return null;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(w,{color:a.colorWarning,pulse:i}),(0,r.jsx)("div",{style:{flex:1},children:(0,r.jsx)(s.UIMarkdownViewer,{content:d,style:{fontSize:13,opacity:.8}})})]});case"tool_use":return(0,r.jsx)(R,{step:l,isStreaming:i,token:a});case"tool_result":return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(w,{color:l.success?a.colorSuccess:a.colorError}),(0,r.jsxs)("div",{style:{flex:1},children:[(0,r.jsxs)("span",{style:{fontSize:13,color:a.colorTextSecondary},children:[(0,r.jsx)("span",{style:{fontWeight:500,color:a.colorText},children:M(l.toolName)}),void 0!==l.durationMs&&(0,r.jsxs)("span",{style:{marginLeft:6,fontSize:11,color:a.colorTextTertiary},children:[l.durationMs,"ms"]})]}),!l.success&&l.error&&(0,r.jsx)("p",{style:{margin:"4px 0 0",fontSize:12,color:a.colorError},children:l.error})]})]});case"subagent":return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(w,{color:a.colorPrimary}),(0,r.jsxs)("span",{style:{fontSize:13,color:a.colorTextSecondary},children:[(0,r.jsxs)("span",{style:{fontWeight:500,color:a.colorText},children:["Agent: ",l.agentName]}),(0,r.jsxs)("span",{style:{marginLeft:6},children:[" — ",null==(n=l.task)?void 0:n.slice(0,60),(null!=(t=null==(o=l.task)?void 0:o.length)?t:0)>60?"...":""]})]})]});case"error":return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(w,{color:a.colorError}),(0,r.jsxs)("div",{style:{flex:1},children:[(0,r.jsx)("span",{style:{fontSize:13,fontWeight:500,color:a.colorError},children:l.code}),(0,r.jsx)("p",{style:{margin:"4px 0 0",fontSize:12,color:a.colorError},children:l.message})]})]});default:return null}}function R(e){var t,n,o=e.step,i=e.isStreaming,s=e.token,a=v(l().useState(!1),2),c=a[0],u=a[1],d="pending"===o.status,f="done"===o.status,p="error"===o.status,y=f&&!1===o.success,h=function(e){var t=e.input;if(!t)return{};var n=e.toolName.toLowerCase(),r=n.includes("read"),o=n.includes("write")||n.includes("patch")||n.includes("edit"),l=null!=(s=null!=(a=null!=(c=t.path)?c:t.filePath)?a:t.file_path)?s:t.file;if(l){var i=null!=(h=String(l).split("/").pop())?h:String(l);if(r){var s,a,c,u,d,f,p,y,h,g,x,m,v,b,S=null!=(x=null!=(m=t.offset)?m:t.startLine)?x:t.start_line,j=null!=(v=null!=(b=t.limit)?b:t.endLine)?v:t.end_line;void 0!==S&&void 0!==j?g="".concat(S,"-").concat(Number(S)+Number(j)):void 0!==j&&(g="".concat(j," lines"))}return{summary:i,filePath:String(l),badge:g}}var k=null!=(u=null!=(d=null!=(f=t.query)?f:t.text)?d:t.pattern)?u:t.search;if(k)return{summary:String(k).slice(0,100)};var I=null!=(p=t.command)?p:t.cmd;if(I)return{summary:String(I).slice(0,100)};if(o)return{};var w=null!=(y=t.content)?y:t.message;return w?{summary:String(w).slice(0,100)}:{}}(o),g=f&&!!(null==(n=o.metadata)?void 0:n.diff),x=f&&null!=o.output,m=o.input,b=/write|patch|edit/i.test(o.toolName)&&f&&!!(null!=(t=null==m?void 0:m.content)?t:null==m?void 0:m.new_content),S=x||g||b||p,j=d?i?s.colorTextTertiary:s.colorPrimary:f&&!y?s.colorSuccess:s.colorError,k=o.metadata,I=f&&(null==k?void 0:k.uiHint)==="todo"&&null!=k.structured?k.structured.todoList:void 0;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(w,{color:j,pulse:d&&i}),(0,r.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,r.jsxs)("button",{onClick:function(){return S&&u(function(e){return!e})},disabled:!S,style:{display:"inline-flex",alignItems:"center",gap:6,background:"none",border:"none",padding:0,cursor:S?"pointer":"default",fontSize:13,color:s.colorText,flexWrap:"wrap"},children:[(0,r.jsx)("span",{style:{fontWeight:500},children:M(o.toolName)}),h.badge&&(0,r.jsx)("span",{style:{fontSize:11,color:s.colorTextSecondary,background:s.colorFillSecondary,borderRadius:s.borderRadiusSM,padding:"0 5px"},children:h.badge}),f&&(null==k?void 0:k.resultCount)!==void 0&&(0,r.jsxs)("span",{style:{fontSize:11,color:s.colorTextSecondary,background:s.colorFillSecondary,borderRadius:s.borderRadiusSM,padding:"0 5px"},children:[k.resultCount," results"]}),f&&(null==k?void 0:k.confidence)!==void 0&&(0,r.jsxs)("span",{style:{fontSize:11,color:s.colorTextSecondary,background:s.colorFillSecondary,borderRadius:s.borderRadiusSM,padding:"0 5px"},children:[Math.round(100*k.confidence),"%"]}),f&&(null==k?void 0:k.exitCode)!==void 0&&0!==k.exitCode&&(0,r.jsxs)("span",{style:{fontSize:11,color:s.colorError,background:s.colorErrorBg,borderRadius:s.borderRadiusSM,padding:"0 5px"},children:["exit ",k.exitCode]}),f&&((null==k?void 0:k.linesAdded)!==void 0||(null==k?void 0:k.linesRemoved)!==void 0)&&(0,r.jsxs)("span",{style:{fontSize:11,color:s.colorSuccess,background:s.colorSuccessBg,borderRadius:s.borderRadiusSM,padding:"0 5px"},children:[(null==k?void 0:k.linesAdded)!=null&&k.linesAdded>0?"+".concat(k.linesAdded):"",(null==k?void 0:k.linesRemoved)!=null&&k.linesRemoved>0?" -".concat(k.linesRemoved):""]}),!d&&void 0!==o.durationMs&&(0,r.jsxs)("span",{style:{fontSize:11,color:s.colorTextTertiary},children:[o.durationMs,"ms"]}),S&&(0,r.jsx)("span",{style:{fontSize:11,color:s.colorTextTertiary},children:c?"collapse":"expand"})]}),h.summary&&(0,r.jsx)("p",{style:{margin:"2px 0 0",fontSize:12,color:s.colorTextSecondary},children:h.filePath?(0,r.jsx)(U,{path:h.filePath,label:h.summary,token:s}):h.summary}),null!=I&&(0,r.jsx)(L,{todoList:I,token:s}),p&&o.error&&(0,r.jsx)("p",{style:{margin:"4px 0 0",fontSize:12,color:s.colorError},children:o.error}),y&&!c&&null!=o.output&&(0,r.jsx)("p",{style:{margin:"4px 0 0",fontSize:12,color:s.colorError},children:String(o.output)}),c&&(0,r.jsx)("div",{style:{marginTop:6},children:(0,r.jsx)(A,{step:o,hasDiff:g,hasOutput:x,token:s})})]})]})}function A(e){var t=e.step,n=e.hasDiff,o=e.hasOutput,l=e.token,i=t.input,a=t.toolName.toLowerCase(),c=a.includes("write")||a.includes("patch")||a.includes("edit"),u=a.includes("read"),d=a.includes("bash")||a.includes("exec")||a.includes("shell")||a.includes("run"),f=a.includes("grep")||a.includes("search")||a.includes("glob")||a.includes("list")||a.includes("rag"),p={margin:0,padding:"8px 10px",fontSize:12,lineHeight:1.5,borderRadius:l.borderRadius,overflow:"auto",maxHeight:300,whiteSpace:"pre-wrap",wordBreak:"break-all"};if(c){if(n)return(0,r.jsx)(O,{diff:t.metadata.diff,token:l});var y=null!=(h=null!=(g=null==i?void 0:i.content)?g:null==i?void 0:i.new_content)?h:null==i?void 0:i.text;if(y){var h,g,v,b,S,j=null!=(v=null!=(b=null!=(S=null==i?void 0:i.path)?S:null==i?void 0:i.filePath)?b:null==i?void 0:i.file_path)?v:null==i?void 0:i.file,k=j?j.split(".").pop():void 0;return(0,r.jsxs)("div",{children:[j&&(0,r.jsx)("div",{style:{fontSize:11,color:l.colorTextTertiary,padding:"3px 8px",background:l.colorFillSecondary,borderRadius:"".concat(l.borderRadius,"px ").concat(l.borderRadius,"px 0 0")},children:j}),(0,r.jsx)("pre",{style:m(x({},p),{background:l.colorFillSecondary,borderRadius:j?"0 0 ".concat(l.borderRadius,"px ").concat(l.borderRadius,"px"):l.borderRadius}),className:k?"lang-".concat(k):void 0,children:String(y)})]})}return null}if(u&&o)return(0,r.jsx)("pre",{style:m(x({},p),{background:l.colorFillSecondary}),children:B(t.output)});if(d&&o)return(0,r.jsx)("pre",{style:m(x({},p),{background:l.colorBgSpotlight,color:l.colorTextLightSolid}),children:B(t.output)});if(f&&o)return(0,r.jsx)("pre",{style:m(x({},p),{background:l.colorFillSecondary}),children:B(t.output)});if(n)return(0,r.jsx)(O,{diff:t.metadata.diff,token:l});if(o){var I="done"===t.status&&!1===t.success,w=B(t.output);return I?(0,r.jsx)("pre",{style:m(x({},p),{background:l.colorErrorBg,color:l.colorError}),children:w}):(0,r.jsx)(s.UIMarkdownViewer,{content:w,style:{fontSize:12}})}return null}function O(e){var t=e.diff,n=e.token,o=t.split("\n");return(0,r.jsx)("pre",{style:{margin:0,padding:"8px 10px",fontSize:12,lineHeight:1.5,borderRadius:n.borderRadius,overflow:"auto",maxHeight:300,background:n.colorFillSecondary,whiteSpace:"pre"},children:o.map(function(e,t){var o=e.startsWith("+")&&!e.startsWith("+++")?n.colorSuccess:e.startsWith("-")&&!e.startsWith("---")?n.colorError:e.startsWith("@@")?n.colorInfo:void 0;return(0,r.jsxs)("span",{style:o?{color:o}:void 0,children:[e,"\n"]},t)})})}function U(e){var t=e.path,n=e.label,o=e.token,i=v(l().useState(!1),2),s=i[0],a=i[1];return(0,r.jsxs)("span",{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(t).then(function(){a(!0),setTimeout(function(){return a(!1)},1500)})},title:t,style:{cursor:"pointer",color:s?o.colorSuccess:o.colorTextSecondary,fontFamily:"monospace",fontSize:12},children:[n,s?" ✓":""]})}function z(e){var t=e.sessionId,n=e.runId,o=e.fileChanges,i=e.token,c=v(l().useState(new Set),2),u=c[0],d=c[1],f=(0,a.useMutateData)("/v1/plugins/agents/sessions/".concat(t,"/rollback"),"POST"),p=(0,a.useMutateData)("/v1/plugins/agents/sessions/".concat(t,"/approve"),"POST"),h=o.filter(function(e){return!u.has(e.changeId)&&!e.approved});if(0===h.length)return null;var x=h.every(function(e){return e.approved});return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,r.jsx)(w,{color:i.colorSuccess}),(0,r.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[(0,r.jsxs)(s.UITypographyText,{style:{fontSize:13,fontWeight:500},children:[h.length," ",W(h.length)," changed"]}),!x&&(0,r.jsxs)(s.UIFlex,{gap:4,children:[(0,r.jsx)("button",{onClick:function(){return g(function(){return S(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.mutateAsync({runId:n})];case 1:return e.sent(),d(new Set(h.map(function(e){return e.changeId}))),[3,3];case 2:return e.sent(),console.error("Failed to approve changes"),[3,3];case 3:return[2]}})})()},disabled:p.isLoading||f.isLoading,title:"Approve all changes",style:{background:i.colorSuccessBg,border:"1px solid ".concat(i.colorSuccessBorder),color:i.colorSuccess,borderRadius:i.borderRadius,padding:"2px 8px",fontSize:12,cursor:"pointer"},children:"✓"}),(0,r.jsx)("button",{onClick:function(){(0,s.UIModalConfirm)({title:"Rollback changes?",content:"This will revert ".concat(h.length," ").concat(W(h.length)," to the state before the agent run."),okText:"Rollback",okButtonProps:{danger:!0},cancelText:"Cancel",onOk:function(){return g(function(){var e,t;return S(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,f.mutateAsync({runId:n})];case 1:return(null==(e=(t=r.sent()).conflicts)?void 0:e.length)&&console.warn("Rolled back: ".concat(t.rolledBack,", skipped due to conflicts: ").concat(t.skipped)),d(new Set(h.map(function(e){return e.changeId}))),[3,3];case 2:return r.sent(),console.error("Failed to rollback changes"),[3,3];case 3:return[2]}})})()}})},disabled:f.isLoading||p.isLoading,title:"Rollback all changes",style:{background:i.colorErrorBg,border:"1px solid ".concat(i.colorErrorBorder),color:i.colorError,borderRadius:i.borderRadius,padding:"2px 8px",fontSize:12,cursor:"pointer"},children:"✕"})]})]}),(0,r.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:h.map(function(e){return(0,r.jsx)(P,{change:e,sessionId:t,onDismiss:function(){return d(function(t){return new Set(((function(e){if(Array.isArray(e))return y(e)})(t)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||b(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e.changeId]))})},token:i},e.changeId)})})]})]})}function P(e){var t,n=e.change,o=e.sessionId,i=e.onDismiss,c=e.token,u=v(l().useState(!1),2),d=u[0],f=u[1],p=(0,a.useMutateData)("/v1/plugins/agents/sessions/".concat(o,"/rollback"),"POST"),y=(0,a.useMutateData)("/v1/plugins/agents/sessions/".concat(o,"/approve"),"POST"),h=d?"/v1/plugins/agents/sessions/".concat(o,"/changes/").concat(encodeURIComponent(n.changeId),"/diff"):"",x=(0,a.useData)(h,{enabled:d}),m=x.data,b=x.isLoading,j=x.isError,k=n.isNew?(0,r.jsx)(s.UITag,{color:"success",children:"new"}):"delete"===n.operation?(0,r.jsx)(s.UITag,{color:"error",children:"del"}):(0,r.jsx)(s.UITag,{color:"blue",children:"mod"});return(0,r.jsxs)("li",{children:[(0,r.jsxs)("div",{onClick:function(){return f(function(e){return!e})},style:{display:"flex",alignItems:"center",gap:6,fontSize:12,cursor:"pointer",padding:"2px 4px",borderRadius:c.borderRadiusSM,background:d?c.colorFillSecondary:"transparent"},children:[k,(0,r.jsx)("span",{style:{flex:1,fontFamily:"monospace",color:c.colorTextSecondary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:null!=(t=n.filePath.split("/").pop())?t:n.filePath}),(0,r.jsx)("span",{style:{color:c.colorTextTertiary,fontFamily:"monospace",fontSize:11},children:n.filePath.includes("/")?n.filePath.slice(0,n.filePath.lastIndexOf("/")):""}),!n.approved&&(0,r.jsxs)("div",{style:{display:"flex",gap:4},onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)("button",{onClick:function(e){e.stopPropagation(),y.mutateAsync({changeIds:[n.changeId]}).then(i).catch(function(){console.error("Failed to approve file")})},disabled:y.isLoading,title:"Approve",style:{background:"none",border:"none",cursor:"pointer",color:c.colorSuccess,fontSize:13,padding:"0 2px"},children:"✓"}),(0,r.jsx)("button",{onClick:function(e){e.stopPropagation(),(0,s.UIModalConfirm)({title:"Rollback file?",content:n.filePath,okText:"Rollback",okButtonProps:{danger:!0},cancelText:"Cancel",onOk:function(){return g(function(){return S(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,p.mutateAsync({changeIds:[n.changeId]})];case 1:return e.sent(),i(),[3,3];case 2:return e.sent(),console.error("Failed to rollback file"),[3,3];case 3:return[2]}})})()}})},disabled:p.isLoading,title:"Rollback",style:{background:"none",border:"none",cursor:"pointer",color:c.colorError,fontSize:13,padding:"0 2px"},children:"✕"})]})]}),d&&(0,r.jsxs)("div",{style:{marginTop:4,marginLeft:4},children:[b&&(0,r.jsx)(s.UISpin,{size:"small"}),(null==m?void 0:m.diff)&&(0,r.jsx)(O,{diff:m.diff,token:c}),j&&(0,r.jsx)("span",{style:{color:c.colorError,fontSize:12},children:"Failed to load diff"})]})]})}var E={completed:"✓","in-progress":"●",blocked:"✕",pending:"○"};function L(e){var t,n=e.todoList,o=e.token;if(!(null==n||null==(t=n.items)?void 0:t.length))return null;var l=n.items.filter(function(e){return"completed"===e.status}).length;return(0,r.jsxs)("div",{style:{marginTop:6,background:o.colorFillTertiary,borderRadius:o.borderRadius,padding:"8px 10px"},children:[(0,r.jsxs)("div",{style:{fontSize:11,color:o.colorTextTertiary,marginBottom:6,fontWeight:500},children:[l,"/",n.items.length]}),(0,r.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:n.items.map(function(e){var t;return(0,r.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,lineHeight:1.5,padding:"2px 0"},children:[(0,r.jsx)("span",{style:{fontSize:12,flexShrink:0,width:14,textAlign:"center",lineHeight:1},children:null!=(t=E[e.status])?t:"○"}),"completed"===e.status?(0,r.jsx)(s.UITypographyText,{type:"success",style:{flex:1,minWidth:0,textDecoration:"line-through"},children:e.description}):"pending"===e.status||"blocked"===e.status?(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{flex:1,minWidth:0},children:e.description}):(0,r.jsx)(s.UITypographyText,{style:{flex:1,minWidth:0},children:e.description}),"medium"!==e.priority&&(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:11,flexShrink:0},children:e.priority})]},e.id)})})]})}function M(e){var t=e.trim().toLowerCase().replace(/[_-]/g," ");if(t.includes("fs read")||t.includes("read file"))return"Read";if(t.includes("fs write")||t.includes("write file"))return"Write";if(t.includes("fs patch")||t.includes("patch file")||t.includes("fs edit")||t.includes("edit file"))return"Edit";if(t.includes("fs delete")||t.includes("delete file")||t.includes("remove file"))return"Delete";if(t.includes("fs list")||t.includes("list files")||t.includes("glob"))return"Glob";if(t.includes("grep")||t.includes("search content"))return"Grep";if(t.includes("bash")||t.includes("exec")||t.includes("shell")||t.includes("run command"))return"Bash";if(t.includes("rag")||t.includes("mind"))return"Mind";if(t.includes("todo"))return"TodoWrite";var n=e.indexOf(":");return(n>=0?e.slice(n+1):e).replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,function(e){return e.toUpperCase()})}function D(e){var t=e.trim().toLowerCase();return!!("[executing tools...]"===t||"[thinking...]"===t||"[planning...]"===t||"[analyzing...]"===t||"analyzing context and choosing the next step."===t||t.startsWith("checking facts with tool:")||t.startsWith("running step with tool:")||t.startsWith("running the next step"))||"done."===t||"ok."===t||"done"===t||"ok"===t}function W(e){return 1===e?"file":"files"}function B(e){if("string"==typeof e)return e.slice(0,2e3);try{return JSON.stringify(e,null,2).slice(0,2e3)}catch(t){return String(e).slice(0,2e3)}}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t,n,r,o,l,i){try{var s=e[l](i),a=s.value}catch(e){n(e);return}s.done?t(a):Promise.resolve(a).then(r,o)}function _(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function i(e){N(l,r,o,i,s,"next",e)}function s(e){N(l,r,o,i,s,"throw",e)}i(void 0)})}}function q(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],i=!0,s=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(s)throw r}}return l}}(e,t)||$(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(e){return function(e){if(Array.isArray(e))return F(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){if(e){if("string"==typeof e)return F(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(e,t)}}function V(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(i,"next",{value:a(0)}),s(i,"throw",{value:a(1)}),s(i,"return",{value:a(2)}),"function"==typeof Symbol&&s(i,Symbol.iterator,{value:function(){return this}}),i;function a(s){return function(a){var c=[s,a];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function J(e,t){if(e.sequence!==t.sequence)return e.sequence-t.sequence;if(e.type!==t.type){if("user"===e.type)return -1;if("user"===t.type)return 1}return e.startedAt.localeCompare(t.startedAt)}let K=function(){var e,t,n,c,f,y,h,g,x,m,v,b,S,j,I,w,T,C,R,A,O,U,z,P,E,L,M,D,W,B,F,N,$,K,Z=(0,s.useUITheme)().token,Q=l().useRef(null),X=H((0,i.useSearchParams)(),2),Y=X[0],ee=X[1],et=H((0,o.useState)(function(){return Y.get("session")}),2),en=et[0],er=et[1],eo=H((0,o.useState)(function(){return Y.get("session")}),2),el=eo[0],ei=eo[1],es=H((0,o.useState)(""),2),ea=es[0],ec=es[1],eu=H((0,o.useState)(null),2),ed=eu[0],ef=eu[1],ep=H((0,o.useState)("idle"),2),ey=ep[0],eh=ep[1],eg=H((0,o.useState)([]),2),ex=eg[0],em=eg[1],ev=H((0,o.useState)("auto"),2),eb=ev[0],eS=ev[1],ej=H((0,o.useState)("medium"),2),ek=ej[0],eI=ej[1],ew=H((0,o.useState)(!0),2),eT=ew[0],eC=ew[1],eR=H((0,o.useState)("execute"),2),eA=eR[0],eO=eR[1],eU=H((0,o.useState)(!1),2),ez=eU[0],eP=eU[1],eE="mind-assistant",eL=en?(e="https:"===window.location.protocol?"wss:":"ws:",t=window.location.host,"".concat(e,"//").concat(t,"/api/v1/ws/plugins/agents/session/").concat(en)):null,eM=(0,a.useMutateData)("/v1/plugins/agents/run","POST"),eD=(0,a.useMutateData)(ed?"/v1/plugins/agents/run/".concat(ed,"/stop"):"/v1/plugins/agents/run/noop/stop","POST"),eW=en?"/v1/plugins/agents/sessions/".concat(en,"/turns"):"",eB=(0,a.useData)(eW,{enabled:!!en}),eF=eB.data,eN=eB.isFetching,e_=eB.refetch;(0,o.useEffect)(function(){en&&eF&&!eN&&ei(en)},[en,eF,eN]);var eq=(c=(n={url:eL,onComplete:function(e,t){eh(e?"completed":"failed"),e_(),console.log("[AgentsPage] Run completed:",t)},onTurnsChanged:function(){em([])},onError:function(e){console.error("[AgentsPage] WebSocket error:",e),s.UIMessage.error("Connection error: ".concat(e.message))}}).url,y=void 0===(f=n.autoReconnect)||f,g=void 0===(h=n.reconnectDelay)?1e3:h,m=void 0===(x=n.maxReconnectAttempts)?5:x,v=n.onComplete,b=n.onTurnsChanged,S=n.onError,I=(j=u((0,o.useState)("disconnected"),2))[0],w=j[1],C=(T=u((0,o.useState)([]),2))[0],R=T[1],O=(A=u((0,o.useState)(null),2))[0],U=A[1],z=(0,o.useRef)(null),P=(0,o.useRef)(0),E=(0,o.useRef)(null),L=(0,o.useRef)(!1),M=(0,o.useRef)(!1),D=(0,o.useRef)(v),W=(0,o.useRef)(S),B=(0,o.useRef)(b),(0,o.useEffect)(function(){D.current=v},[v]),(0,o.useEffect)(function(){W.current=S},[S]),(0,o.useEffect)(function(){B.current=b},[b]),F=(0,o.useCallback)(function(){null!==E.current&&(clearTimeout(E.current),E.current=null),z.current&&(z.current.onclose=null,z.current.onerror=null,z.current.onmessage=null,z.current.close(),z.current=null)},[]),N=(0,o.useCallback)(function(e){F(),w("connecting"),P.current=0;var t=new WebSocket(e);z.current=t,t.onopen=function(){},t.onmessage=function(e){try{var t=JSON.parse(e.data);switch(t.type){case"conversation:snapshot":var n,r=t.payload,o=r.completedTurns,l=r.activeTurns,i=d(o).concat(d(l)).sort(function(e,t){return e.sequence-t.sequence});M.current=!1,R(function(e){if(0===e.length)return i;var t=new Map,n=!0,r=!1,o=void 0;try{for(var l,s=i[Symbol.iterator]();!(n=(l=s.next()).done);n=!0){var a=l.value;t.set(a.id,a)}}catch(e){r=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw o}}var c=!0,u=!1,f=void 0;try{for(var p,y=e[Symbol.iterator]();!(c=(p=y.next()).done);c=!0){var h=p.value,g=t.get(h.id);g&&"streaming"===h.status&&"streaming"===g.status&&h.steps.length>g.steps.length&&t.set(h.id,h)}}catch(e){u=!0,f=e}finally{try{c||null==y.return||y.return()}finally{if(u)throw f}}return d(t.values()).sort(function(e,t){return e.sequence-t.sequence})}),null==(n=B.current)||n.call(B);break;case"turn:snapshot":var s,a=t.payload.turn;M.current=!1,R(function(e){var t=d(e),n=t.findIndex(function(e){return e.id===a.id});if(n>=0){var r=t[n];if("streaming"===r.status&&"streaming"===a.status&&a.steps.length<r.steps.length)return e;t[n]=a}else{var o=t.findIndex(function(e){return e.sequence>a.sequence});o>=0?t.splice(o,0,a):t.push(a)}return t}),null==(s=B.current)||s.call(B);break;case"connection:ready":P.current=0,w("connected");break;case"run:completed":var c,u=t.payload,f=u.success,p=u.summary;M.current=!0,null==(c=D.current)||c.call(D,f,p);break;case"error":var y,h=t.payload,g=h.code,x=h.message;U({code:g,message:x}),null==(y=W.current)||y.call(W,{code:g,message:x})}}catch(e){console.error("[useAgentWebSocket] Failed to parse message:",e)}},t.onerror=function(){w("error")},t.onclose=function(t){L.current&&!M.current&&y&&P.current<m?(P.current++,w("reconnecting"),E.current=setTimeout(function(){L.current&&N(e)},g*P.current)):w("disconnected")}},[y,F,m,g]),$=(0,o.useCallback)(function(e){var t;(null==(t=z.current)?void 0:t.readyState)===WebSocket.OPEN&&z.current.send(JSON.stringify(e))},[]),K=(0,o.useCallback)(function(){R([]),U(null),M.current=!1},[]),(0,o.useEffect)(function(){return L.current=!1,F(),R([]),U(null),M.current=!1,c?(L.current=!0,N(c)):w("disconnected"),function(){L.current=!1,F()}},[c]),{status:I,isConnected:"connected"===I,turns:C,error:O,send:$,clearTurns:K}),eH=(0,o.useCallback)(function(e,t){er(e),ei(null),ee({session:e},{replace:!0}),ef(null),eh("idle"),em([]),eq.clearTurns()},[eq,ee]),eG=(0,o.useCallback)(function(){er(null),ei(null),ee({},{replace:!0}),ef(null),eh("idle"),em([]),eq.clearTurns()},[eq,ee]),e$=(0,o.useCallback)(function(){return _(function(){var e,t,n,r;return V(this,function(o){switch(o.label){case 0:if(!ea.trim())return[2];e=ea.trim(),ec(""),eh("running"),t={id:"optimistic-user-".concat(Date.now()),type:"user",sequence:9999,startedAt:new Date().toISOString(),completedAt:new Date().toISOString(),status:"completed",steps:[{type:"text",id:"opt-1",timestamp:new Date().toISOString(),content:e,role:"user"}],metadata:{agentId:"user"}},em(function(e){return G(e).concat([t])}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,eM.mutateAsync({task:e,agentId:eE,sessionId:null!=en?en:void 0,tier:ek,enableEscalation:eT,responseMode:eb})];case 2:return n=o.sent(),en||(er(n.sessionId),ei(n.sessionId),ee({session:n.sessionId},{replace:!0})),ef(n.runId),[3,4];case 3:return r=o.sent(),em(function(e){return e.filter(function(e){return e.id!==t.id})}),eh("failed"),s.UIMessage.error("Failed to start: ".concat(q(r,Error)?r.message:String(r))),[3,4];case 4:return[2]}})})()},[ea,eE,en,ek,eT,eb,ee,eM]),eV=(0,o.useCallback)(function(){return _(function(){var e;return V(this,function(t){switch(t.label){case 0:if(!ed)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,eD.mutateAsync({reason:"Stopped by user"})];case 2:return t.sent(),eh("stopped"),s.UIMessage.info("Stopped"),[3,4];case 3:return e=t.sent(),s.UIMessage.error("Failed to stop: ".concat(q(e,Error)?e.message:String(e))),[3,4];case 4:return[2]}})})()},[ed,eD]),eJ="running"===ey||eM.isLoading,eK=null!==en&&en!==el,eZ=function(){if(eK)return[];var e=null!=(i=null==eF?void 0:eF.turns)?i:[],t=eq.turns,n=new Map;if(0===t.length){var r=!0,o=!1,l=void 0;try{for(var i,s,a=e[Symbol.iterator]();!(r=(s=a.next()).done);r=!0){var c=s.value;n.set(c.id,c)}}catch(e){o=!0,l=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw l}}}else{var u=!0,d=!1,f=void 0;try{for(var p,y=e[Symbol.iterator]();!(u=(p=y.next()).done);u=!0){var h=p.value;n.set(h.id,h)}}catch(e){d=!0,f=e}finally{try{u||null==y.return||y.return()}finally{if(d)throw f}}var g=!0,x=!1,m=void 0;try{for(var v,b=t[Symbol.iterator]();!(g=(v=b.next()).done);g=!0){var S=v.value;n.set(S.id,S)}}catch(e){x=!0,m=e}finally{try{g||null==b.return||b.return()}finally{if(x)throw m}}}var j=new Set(G(n.values()).filter(function(e){return"user"===e.type}).flatMap(function(e){return e.steps.filter(function(e){return"text"===e.type}).map(function(e){var t;return null==(t=e.content)?void 0:t.trim()})}).filter(Boolean)),k=!0,I=!1,w=void 0;try{for(var T,C=ex[Symbol.iterator]();!(k=(T=C.next()).done);k=!0){var R,A,O=T.value,U=null==(A=O.steps.find(function(e){return"text"===e.type}))||null==(R=A.content)?void 0:R.trim();U&&!j.has(U)&&n.set(O.id,O)}}catch(e){I=!0,w=e}finally{try{k||null==C.return||C.return()}finally{if(I)throw w}}return G(n.values()).sort(J)}(),eQ=function(){if(!eJ||eZ.some(function(e){return"assistant"===e.type&&"streaming"===e.status}))return eZ;var e=G(eZ).reverse().find(function(e){return"user"===e.type});if(!e||eZ.some(function(t){return"assistant"===t.type&&"completed"===t.status&&t.sequence>e.sequence}))return eZ;var t={id:"thinking-loader-".concat(e.id),type:"assistant",sequence:e.sequence+.1,startedAt:new Date().toISOString(),completedAt:null,status:"streaming",steps:[],metadata:{agentId:"assistant-loader"}};return G(eZ).concat([t]).sort(J)}(),eX=eK||eN&&0===eZ.length&&!!en;return(0,r.jsx)("div",{style:{padding:16,height:"100%"},children:(0,r.jsxs)(s.UICard,{title:(0,r.jsxs)(s.UISpace,{children:[(0,r.jsx)(s.UIIcon,{name:"RobotOutlined"}),(0,r.jsx)("span",{children:"Agent"})]}),extra:(0,r.jsx)(p,{currentSessionId:en,onSessionChange:eH,onNewChat:eG}),style:{height:"100%",display:"flex",flexDirection:"column"},styles:{body:{flex:1,display:"flex",flexDirection:"column",padding:0,overflow:"hidden"}},children:[(0,r.jsx)("div",{ref:Q,style:{flex:1,overflow:"auto"},children:(0,r.jsx)(k,{turns:eQ,isLoading:eX,sessionId:en})}),(0,r.jsx)("div",{style:{borderTop:"1px solid ".concat(Z.colorBorderSecondary),padding:"12px 16px",background:Z.colorBgContainer,display:"flex",justifyContent:"center"},children:(0,r.jsxs)("div",{onFocus:function(){return eP(!0)},onBlur:function(){return eP(!1)},style:{width:"65%",maxWidth:780,border:"1px solid ".concat(ez?"execute"===eA?Z.colorError:Z.colorPrimary:"plan"===eA?Z.colorPrimary:Z.colorBorder),borderRadius:Z.borderRadiusLG,background:Z.colorBgContainer,boxShadow:ez?"0 0 0 2px ".concat("execute"===eA?Z.colorErrorBg:Z.colorPrimaryBg):"none",transition:"border-color 0.2s, box-shadow 0.2s",overflow:"hidden"},children:[(0,r.jsx)(s.UIInputTextArea,{value:ea,onChange:function(e){return ec(e.target.value)},onKeyDown:function(e){"Enter"!==e.key||e.shiftKey||"running"===ey||eM.isLoading||(e.preventDefault(),e$())},placeholder:"Message...",autoSize:{minRows:2,maxRows:8},disabled:eJ,variant:"borderless",style:{resize:"none",padding:"10px 12px 4px",border:"none",boxShadow:"none",outline:"none"}}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 8px 8px"},children:[(0,r.jsxs)(s.UISpace,{size:6,children:[(0,r.jsx)(s.UISelect,{value:eA,onChange:function(e){return eO(e)},disabled:eJ,size:"small",variant:"borderless",style:{width:110},options:[{value:"execute",label:"Execute"},{value:"plan",label:"Plan"}]}),(0,r.jsx)(s.UISelect,{value:eb,onChange:function(e){return eS(e)},disabled:eJ,size:"small",variant:"borderless",style:{width:80},options:[{value:"auto",label:"Auto"},{value:"brief",label:"Brief"},{value:"deep",label:"Deep"}]}),(0,r.jsx)(s.UISelect,{value:ek,onChange:function(e){return eI(e)},disabled:eJ,size:"small",variant:"borderless",style:{width:100},options:[{value:"small",label:"Small"},{value:"medium",label:"Medium"},{value:"large",label:"Large"}]}),(0,r.jsxs)(s.UISpace,{size:4,align:"center",children:[(0,r.jsx)(s.UISwitch,{checked:eT,onChange:eC,disabled:eJ||"large"===ek,size:"small"}),(0,r.jsx)(s.UITypographyText,{type:"secondary",style:{fontSize:12},children:"Auto escalate"})]})]}),(0,r.jsx)("div",{children:eJ?(0,r.jsx)(s.UIButton,{danger:!0,size:"small",icon:eD.isLoading?(0,r.jsx)(s.UIIcon,{name:"LoadingOutlined"}):(0,r.jsx)(s.UIIcon,{name:"StopOutlined"}),onClick:eV,disabled:eD.isLoading,children:"Stop"}):(0,r.jsx)(s.UIButton,{variant:"primary",size:"small",icon:eM.isLoading?(0,r.jsx)(s.UIIcon,{name:"LoadingOutlined"}):(0,r.jsx)(s.UIIcon,{name:"SendOutlined"}),onClick:e$,disabled:!ea.trim()||eM.isLoading,children:"Send"})})]})]})})]})})}}}]);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "agentPlugin",
|
|
6
6
|
"globalName": "agentPlugin",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "2.
|
|
8
|
+
"buildVersion": "2.86.0",
|
|
9
9
|
"buildName": "@kb-labs/agent-entry"
|
|
10
10
|
},
|
|
11
11
|
"publicPath": "auto",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
{
|
|
28
28
|
"id": "agentPlugin:@kb-labs/studio-event-bus",
|
|
29
29
|
"name": "@kb-labs/studio-event-bus",
|
|
30
|
-
"version": "2.
|
|
30
|
+
"version": "2.86.0",
|
|
31
31
|
"singleton": true,
|
|
32
32
|
"requiredVersion": "^0.1.0",
|
|
33
33
|
"assets": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
{
|
|
48
48
|
"id": "agentPlugin:@kb-labs/studio-ui-core",
|
|
49
49
|
"name": "@kb-labs/studio-ui-core",
|
|
50
|
-
"version": "2.
|
|
50
|
+
"version": "2.86.0",
|
|
51
51
|
"singleton": true,
|
|
52
52
|
"requiredVersion": "^0.1.0",
|
|
53
53
|
"assets": {
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"assets": {
|
|
73
73
|
"js": {
|
|
74
74
|
"sync": [
|
|
75
|
-
"
|
|
76
|
-
"
|
|
75
|
+
"451.js",
|
|
76
|
+
"805.js"
|
|
77
77
|
],
|
|
78
78
|
"async": []
|
|
79
79
|
},
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
{
|
|
87
87
|
"id": "agentPlugin:@kb-labs/studio-hooks",
|
|
88
88
|
"name": "@kb-labs/studio-hooks",
|
|
89
|
-
"version": "2.
|
|
89
|
+
"version": "2.86.0",
|
|
90
90
|
"singleton": true,
|
|
91
91
|
"requiredVersion": "^0.1.0",
|
|
92
92
|
"assets": {
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
{
|
|
107
107
|
"id": "agentPlugin:@kb-labs/studio-ui-kit",
|
|
108
108
|
"name": "@kb-labs/studio-ui-kit",
|
|
109
|
-
"version": "2.
|
|
109
|
+
"version": "2.86.0",
|
|
110
110
|
"singleton": true,
|
|
111
111
|
"requiredVersion": "^0.1.0",
|
|
112
112
|
"assets": {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "agentPlugin",
|
|
6
6
|
"globalName": "agentPlugin",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "2.
|
|
8
|
+
"buildVersion": "2.86.0",
|
|
9
9
|
"buildName": "@kb-labs/agent-entry"
|
|
10
10
|
},
|
|
11
11
|
"publicPath": "auto",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
{
|
|
28
28
|
"id": "agentPlugin:@kb-labs/studio-event-bus",
|
|
29
29
|
"name": "@kb-labs/studio-event-bus",
|
|
30
|
-
"version": "2.
|
|
30
|
+
"version": "2.86.0",
|
|
31
31
|
"requiredVersion": "^0.1.0",
|
|
32
32
|
"singleton": true,
|
|
33
33
|
"assets": {
|
|
@@ -43,12 +43,13 @@
|
|
|
43
43
|
"async": []
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"usedIn": []
|
|
46
|
+
"usedIn": [],
|
|
47
|
+
"usedExports": []
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
"id": "agentPlugin:@kb-labs/studio-ui-core",
|
|
50
51
|
"name": "@kb-labs/studio-ui-core",
|
|
51
|
-
"version": "2.
|
|
52
|
+
"version": "2.86.0",
|
|
52
53
|
"requiredVersion": "^0.1.0",
|
|
53
54
|
"singleton": true,
|
|
54
55
|
"assets": {
|
|
@@ -63,7 +64,8 @@
|
|
|
63
64
|
"async": []
|
|
64
65
|
}
|
|
65
66
|
},
|
|
66
|
-
"usedIn": []
|
|
67
|
+
"usedIn": [],
|
|
68
|
+
"usedExports": []
|
|
67
69
|
},
|
|
68
70
|
{
|
|
69
71
|
"id": "agentPlugin:antd",
|
|
@@ -74,8 +76,8 @@
|
|
|
74
76
|
"assets": {
|
|
75
77
|
"js": {
|
|
76
78
|
"sync": [
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
+
"451.js",
|
|
80
|
+
"805.js"
|
|
79
81
|
],
|
|
80
82
|
"async": []
|
|
81
83
|
},
|
|
@@ -84,12 +86,13 @@
|
|
|
84
86
|
"async": []
|
|
85
87
|
}
|
|
86
88
|
},
|
|
87
|
-
"usedIn": []
|
|
89
|
+
"usedIn": [],
|
|
90
|
+
"usedExports": []
|
|
88
91
|
},
|
|
89
92
|
{
|
|
90
93
|
"id": "agentPlugin:@kb-labs/studio-hooks",
|
|
91
94
|
"name": "@kb-labs/studio-hooks",
|
|
92
|
-
"version": "2.
|
|
95
|
+
"version": "2.86.0",
|
|
93
96
|
"requiredVersion": "^0.1.0",
|
|
94
97
|
"singleton": true,
|
|
95
98
|
"assets": {
|
|
@@ -105,12 +108,13 @@
|
|
|
105
108
|
"async": []
|
|
106
109
|
}
|
|
107
110
|
},
|
|
108
|
-
"usedIn": []
|
|
111
|
+
"usedIn": [],
|
|
112
|
+
"usedExports": []
|
|
109
113
|
},
|
|
110
114
|
{
|
|
111
115
|
"id": "agentPlugin:@kb-labs/studio-ui-kit",
|
|
112
116
|
"name": "@kb-labs/studio-ui-kit",
|
|
113
|
-
"version": "2.
|
|
117
|
+
"version": "2.86.0",
|
|
114
118
|
"requiredVersion": "^0.1.0",
|
|
115
119
|
"singleton": true,
|
|
116
120
|
"assets": {
|
|
@@ -128,7 +132,8 @@
|
|
|
128
132
|
"async": []
|
|
129
133
|
}
|
|
130
134
|
},
|
|
131
|
-
"usedIn": []
|
|
135
|
+
"usedIn": [],
|
|
136
|
+
"usedExports": []
|
|
132
137
|
},
|
|
133
138
|
{
|
|
134
139
|
"id": "agentPlugin:react",
|
|
@@ -148,7 +153,10 @@
|
|
|
148
153
|
"async": []
|
|
149
154
|
}
|
|
150
155
|
},
|
|
151
|
-
"usedIn": [
|
|
156
|
+
"usedIn": [
|
|
157
|
+
"src/studio/pages/AgentsPage.tsx"
|
|
158
|
+
],
|
|
159
|
+
"usedExports": []
|
|
152
160
|
},
|
|
153
161
|
{
|
|
154
162
|
"id": "agentPlugin:react-dom",
|
|
@@ -169,7 +177,8 @@
|
|
|
169
177
|
"async": []
|
|
170
178
|
}
|
|
171
179
|
},
|
|
172
|
-
"usedIn": []
|
|
180
|
+
"usedIn": [],
|
|
181
|
+
"usedExports": []
|
|
173
182
|
},
|
|
174
183
|
{
|
|
175
184
|
"id": "agentPlugin:@tanstack/react-query",
|
|
@@ -190,7 +199,8 @@
|
|
|
190
199
|
"async": []
|
|
191
200
|
}
|
|
192
201
|
},
|
|
193
|
-
"usedIn": []
|
|
202
|
+
"usedIn": [],
|
|
203
|
+
"usedExports": []
|
|
194
204
|
},
|
|
195
205
|
{
|
|
196
206
|
"id": "agentPlugin:react-router-dom",
|
|
@@ -210,7 +220,10 @@
|
|
|
210
220
|
"async": []
|
|
211
221
|
}
|
|
212
222
|
},
|
|
213
|
-
"usedIn": [
|
|
223
|
+
"usedIn": [
|
|
224
|
+
"src/studio/pages/AgentsPage.tsx"
|
|
225
|
+
],
|
|
226
|
+
"usedExports": []
|
|
214
227
|
}
|
|
215
228
|
],
|
|
216
229
|
"remotes": [],
|
|
@@ -220,7 +233,10 @@
|
|
|
220
233
|
"file": "src/studio/pages/AgentsPage.tsx",
|
|
221
234
|
"id": "agentPlugin:AgentsPage",
|
|
222
235
|
"name": "AgentsPage",
|
|
223
|
-
"requires": [
|
|
236
|
+
"requires": [
|
|
237
|
+
"react-router-dom",
|
|
238
|
+
"react"
|
|
239
|
+
],
|
|
224
240
|
"assets": {
|
|
225
241
|
"js": {
|
|
226
242
|
"sync": [
|