blade-code 0.10.71 → 0.10.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/blade.js +2 -2
- package/dist/{chunk-wfy851et.js → chunk-0hrj06t7.js} +1 -1
- package/dist/chunk-0qqzd0hq.js +1 -0
- package/dist/{chunk-jzntxp7f.js → chunk-1ava19kd.js} +2 -2
- package/dist/chunk-1cyy8wqj.js +10 -0
- package/dist/{chunk-97aywyzn.js → chunk-2wdxpdz3.js} +2 -2
- package/dist/chunk-3fzy7q6x.js +1 -0
- package/dist/chunk-3hv57n95.js +1635 -0
- package/dist/{chunk-bjqjdw34.js → chunk-3r0x2p7z.js} +2 -2
- package/dist/chunk-4cpgcm7q.js +44 -0
- package/dist/{chunk-m57w4p91.js → chunk-4ehgjdm0.js} +1 -1
- package/dist/{chunk-hat9v5c5.js → chunk-4khtsmrf.js} +1 -1
- package/dist/{chunk-axtzde5k.js → chunk-5d1gbm41.js} +2 -2
- package/dist/chunk-64jq6jcr.js +2 -0
- package/dist/{chunk-4ke8k0xw.js → chunk-67ddp3ns.js} +3 -3
- package/dist/{chunk-trn6r1g3.js → chunk-77hn7hf6.js} +1 -1
- package/dist/{chunk-ahg9vjb6.js → chunk-8fm3xamc.js} +1 -1
- package/dist/chunk-8h35w91f.js +1 -0
- package/dist/{chunk-2px6hzdc.js → chunk-948efzyp.js} +2 -2
- package/dist/{chunk-qgrq04hb.js → chunk-9cgsheg0.js} +2 -2
- package/dist/chunk-9e6dcbqq.js +160 -0
- package/dist/{chunk-gtcxybv5.js → chunk-a0ns74mh.js} +1 -1
- package/dist/{chunk-5te2jqt3.js → chunk-a37mn58w.js} +1 -1
- package/dist/{chunk-3hy06st1.js → chunk-a5e4sy4q.js} +2 -2
- package/dist/{chunk-k0pa8874.js → chunk-ah12xhh6.js} +1 -1
- package/dist/{chunk-j9q1wyxg.js → chunk-ax610gqh.js} +1 -1
- package/dist/chunk-b28zsp1t.js +166 -0
- package/dist/{chunk-rm9hbew3.js → chunk-b3413dtc.js} +1 -1
- package/dist/{chunk-1je1xw6v.js → chunk-bhhdvqe7.js} +18 -18
- package/dist/{chunk-0j22w4wh.js → chunk-c9e0fbyh.js} +1 -1
- package/dist/{chunk-fcv8b6ny.js → chunk-cvvtrvk6.js} +2 -2
- package/dist/chunk-fdmcef2p.js +2 -0
- package/dist/{chunk-x9tvjkjv.js → chunk-fgh6mjdp.js} +1 -1
- package/dist/chunk-hswyrd88.js +1 -0
- package/dist/chunk-jeazjp08.js +8 -0
- package/dist/{chunk-zvz2cnt4.js → chunk-jkh9s1ht.js} +1 -1
- package/dist/{chunk-yn51162x.js → chunk-js4vqnds.js} +1 -1
- package/dist/chunk-jsg7vmxp.js +1 -0
- package/dist/{chunk-v0rsz1rt.js → chunk-k82ff14t.js} +1 -1
- package/dist/chunk-kka51s0k.js +2 -0
- package/dist/{chunk-cff9gphh.js → chunk-meee1cbq.js} +1 -1
- package/dist/{chunk-r9d4mjxj.js → chunk-mefb27ch.js} +1 -1
- package/dist/{chunk-0vrgrw71.js → chunk-n1w40gq2.js} +2 -2
- package/dist/{chunk-t8xmh4w2.js → chunk-ne7vres8.js} +1 -1
- package/dist/chunk-p0qjjyex.js +22 -0
- package/dist/{chunk-h0ft81a3.js → chunk-p7y79y6c.js} +1 -1
- package/dist/{chunk-0tm20v38.js → chunk-q6ak67n8.js} +2 -2
- package/dist/{chunk-byqxaa9v.js → chunk-r5bpvfym.js} +1 -1
- package/dist/{chunk-th4jjfgm.js → chunk-r8wbvxn7.js} +1 -1
- package/dist/{chunk-0wxkymqv.js → chunk-skw3b17a.js} +1 -1
- package/dist/{chunk-dwb2nmms.js → chunk-sxjs66h6.js} +1 -1
- package/dist/{chunk-s77sbxr7.js → chunk-tmvg7taj.js} +1 -1
- package/dist/{chunk-1pjkgfez.js → chunk-traa01dd.js} +1 -1
- package/dist/{chunk-9hchc346.js → chunk-tvv3syt3.js} +1 -1
- package/dist/{chunk-t2wgf9tq.js → chunk-tzytnhbp.js} +2 -2
- package/dist/chunk-vhadycw2.js +2 -0
- package/dist/{chunk-s7jsadnc.js → chunk-vw0gg08s.js} +2 -2
- package/dist/chunk-vxd30mnx.js +1 -0
- package/dist/chunk-wbzvy99s.js +1 -0
- package/dist/chunk-wg3z2epq.js +1 -0
- package/dist/{chunk-mtphps19.js → chunk-wp0794r2.js} +2 -2
- package/dist/{chunk-azw0jckv.js → chunk-xjc0bthz.js} +2 -2
- package/dist/chunk-xkc6v9nb.js +1 -0
- package/dist/{chunk-be30r8an.js → chunk-xv92c582.js} +1 -1
- package/dist/chunk-y36rdy4v.js +5 -0
- package/dist/chunk-yg6c4xrs.js +1 -0
- package/dist/{chunk-cdy9efgm.js → chunk-yvnm25nb.js} +1 -1
- package/dist/chunk-yx82ang3.js +6 -0
- package/dist/chunk-z8a5ebep.js +1 -0
- package/dist/chunk-z95pw8nb.js +1 -0
- package/dist/chunk-zh2x0tcm.js +1 -0
- package/dist/chunk-zr1mg5kq.js +1 -0
- package/dist/{chunk-9q852bsc.js → chunk-zxn7f308.js} +2 -2
- package/dist/web/assets/ChatView-Dm-DMbOV.js +18 -0
- package/dist/web/assets/{CodeBlockHighlighter-Dy7QpAmC.js → CodeBlockHighlighter-XaY8h0vd.js} +1 -1
- package/dist/web/assets/{FilePreview-BI3nkxz1.js → FilePreview-CVHV6oga.js} +1 -1
- package/dist/web/assets/{KanbanBoard-D5dYOyPH.js → KanbanBoard-D1_61uZi.js} +1 -1
- package/dist/web/assets/{MarkdownRenderer-Da1vB81L.js → MarkdownRenderer-DUPwAzs4.js} +3 -3
- package/dist/web/assets/{SettingsModal-jcCFqLqS.js → SettingsModal-DHnU7uMN.js} +2 -2
- package/dist/web/assets/{TaskSwitcher-CQ--jOLB.js → TaskSwitcher-CpXhLtO5.js} +1 -1
- package/dist/web/assets/{TerminalPanel-CWzjEXOb.js → TerminalPanel-eYsA-A62.js} +1 -1
- package/dist/web/assets/index-8G4ejlcH.css +1 -0
- package/dist/web/assets/index-gjBOFzd1.js +11 -0
- package/dist/web/assets/{session-events-BvtUOaNG.js → session-events-Bgir_Gl_.js} +6 -6
- package/dist/web/assets/team-QZ9byb3E.js +1 -0
- package/dist/web/assets/teamService-Bb2kW8Hh.js +1 -0
- package/dist/web/assets/{vendor-icons-B63aW_OM.js → vendor-icons-DovdPN7M.js} +51 -41
- package/dist/web/index.html +4 -4
- package/package.json +1 -1
- package/dist/chunk-1w83z8j0.js +0 -1
- package/dist/chunk-2428hhvj.js +0 -6
- package/dist/chunk-3as0bkqy.js +0 -1
- package/dist/chunk-4pexpa3h.js +0 -160
- package/dist/chunk-6pyktfa4.js +0 -2
- package/dist/chunk-82htkvz8.js +0 -44
- package/dist/chunk-8j568nm6.js +0 -1
- package/dist/chunk-92x15fzx.js +0 -2
- package/dist/chunk-93tvxmqg.js +0 -8
- package/dist/chunk-ckqpt15b.js +0 -1
- package/dist/chunk-d3ttqmyt.js +0 -1620
- package/dist/chunk-fcmgwzrj.js +0 -10
- package/dist/chunk-gvbx0t4j.js +0 -1
- package/dist/chunk-j0p54tqt.js +0 -1
- package/dist/chunk-n827nys9.js +0 -1
- package/dist/chunk-nwzpnx7m.js +0 -22
- package/dist/chunk-nx31fkkf.js +0 -166
- package/dist/chunk-qnsvae10.js +0 -1
- package/dist/chunk-sp3bn8qh.js +0 -1
- package/dist/chunk-v7p533ff.js +0 -1
- package/dist/chunk-vthgpdbd.js +0 -1
- package/dist/chunk-wneeq8cr.js +0 -1
- package/dist/chunk-wrfay5r3.js +0 -2
- package/dist/chunk-xdz5zrjt.js +0 -1
- package/dist/chunk-xz6y0w4n.js +0 -2
- package/dist/chunk-xzz69esf.js +0 -1
- package/dist/chunk-zdnk7qtn.js +0 -5
- package/dist/web/assets/ChatView-BVrhnE2j.js +0 -18
- package/dist/web/assets/index-BOgOL4hG.js +0 -11
- package/dist/web/assets/index-DbWgTuT3.css +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var ye=Object.defineProperty;var Ce=(e,t,n)=>t in e?ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var K=(e,t,n)=>Ce(e,typeof t!="symbol"?t+"":t,n);function P(){return{timeline:[],textBefore:"",toolCalls:[],textAfter:"",thinkingContent:"",tasks:[],subagent:null,subagents:[],confirmation:null,question:null,elicitation:null}}function N(e){return e?e.subagents&&e.subagents.length>0?e.subagents:e.subagent?[e.subagent]:[]:[]}function U(e,t,n){const a=(n?t.find(o=>o.id===n||o.sessionId===n):void 0)??t[t.length-1]??null;return{...e,subagents:t,subagent:a}}function ue(e,t){const n=[...N(e)];let a=n.findIndex(s=>s.id===t.id||!!(s.sessionId&&t.sessionId&&s.sessionId===t.sessionId));if(a===-1&&t.sessionId&&(a=n.findIndex(s=>!s.sessionId&&s.status==="running"&&s.type===t.type&&s.description===t.description)),a===-1)return n.push(t),U(e,n,t.id);const o=n[a],u={...o,...t,id:o.id};return n[a]=u,U(e,n,u.id)}function H(e,t){return`${t}-${e.length}`}function be(e,t){if(!t)return e;const n=[..._(e)],a=n[n.length-1];return(a==null?void 0:a.type)==="text"?n[n.length-1]={...a,content:a.content+t}:n.push({id:H(n,"text"),type:"text",content:t}),{...e,timeline:n}}function ve(e,t){if(!t)return e;const n=[..._(e)],a=n[n.length-1];return(a==null?void 0:a.type)==="thinking"?n[n.length-1]={...a,content:a.content+t}:n.push({id:H(n,"thinking"),type:"thinking",content:t}),{...e,timeline:n}}function oe(e,t){const n=e.toolCalls.some(s=>s.toolCallId===t.toolCallId),a=n?e.toolCalls:[...e.toolCalls,t];if(n)return{...e,toolCalls:a};const o=[..._(e)],u=o[o.length-1];return(u==null?void 0:u.type)==="tool_group"?o[o.length-1]={...u,toolCallIds:[...u.toolCallIds,t.toolCallId]}:o.push({id:H(o,"tool_group"),type:"tool_group",toolCallIds:[t.toolCallId]}),{...e,timeline:o,toolCalls:a}}function _(e){if(e.timeline&&e.timeline.length>0)return e.timeline;const t=[];return e.thinkingContent&&t.push({id:"legacy-thinking",type:"thinking",content:e.thinkingContent}),e.textBefore&&t.push({id:"legacy-text-before",type:"text",content:e.textBefore}),e.toolCalls.length>0&&t.push({id:"legacy-tool-group",type:"tool_group",toolCallIds:e.toolCalls.map(n=>n.toolCallId)}),e.textAfter&&t.push({id:"legacy-text-after",type:"text",content:e.textAfter}),t}function Ae(e){return _(e).filter(t=>t.type==="text").map(t=>t.content).filter(Boolean).join(`
|
|
2
2
|
|
|
3
3
|
`)}const ke=2166136261,Te=16777619;function J(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?`[${e.map(t=>J(t)).join(",")}]`:typeof e=="object"?`{${Object.entries(e).sort(([n],[a])=>n.localeCompare(a)).map(([n,a])=>`${JSON.stringify(n)}:${J(a)}`).join(",")}}`:JSON.stringify(e)}function de(e){let t=ke>>>0;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,Te);return(t>>>0).toString(16)}function le(e){return typeof e=="string"?e:J(e??{})}function G(e){return e==="completed"?"completed":e==="failed"||e==="cancelled"?"failed":"running"}function L({explicitId:e,messageId:t,toolName:n,argumentsValue:a,toolKind:o,output:u}){if(e)return e;const s=[t||"unknown-message",n||"Unknown",le(a),o||"",u||""].join("|");return`tool-${de(s)}`}function q({explicitId:e,sessionId:t,messageId:n,agentType:a,description:o,summary:u}){if(e)return e;if(t)return t;const s=[n||"unknown-message",a||"subagent",o||"",u||""].join("|");return`subagent-${de(s)}`}const $e=(e,t)=>{if(!t||typeof t!="object")return null;const n=G(t.status),a=typeof t.summary=="string"?t.summary:void 0;return{id:q({explicitId:typeof t.subagentId=="string"?t.subagentId:void 0,sessionId:t.childSessionId,messageId:e,agentType:t.agentType,description:t.description,summary:t.summary}),type:t.agentType||"subagent",description:t.description||t.summary||"",status:n,startTime:Date.now(),sessionId:t.childSessionId,resumedFrom:t.resumedFrom,rootAgentId:t.rootAgentId,resumeDepth:typeof t.resumeDepth=="number"?t.resumeDepth:void 0,verificationVerdict:t.verificationVerdict==="pass"||t.verificationVerdict==="fail"||t.verificationVerdict==="partial"?t.verificationVerdict:void 0,output:n==="running"?void 0:a}},Ne=(e,t)=>!t||typeof t!="object"?[]:(Array.isArray(t.subtaskRefs)?t.subtaskRefs:t.subtaskRef&&typeof t.subtaskRef=="object"?[t.subtaskRef]:[]).map(a=>$e(e,a)).filter(a=>a!==null);function x(e){return typeof e=="string"?e:e.filter(t=>t.type==="text").map(t=>t.text).join(`
|
|
4
|
-
`)}function B(e){if(!e.agentContent)return e;let t=e.agentContent;for(const n of Ne(e.id,e.metadata))t=ue(t,n);return{...e,agentContent:t}}function Pe(e){var a,o,u;const t=[];let n=null;for(const s of e)if(s.role!=="system"){if(s.role==="user")n&&(t.push(B(n)),n=null),t.push({id:s.id,role:s.role,content:s.content,timestamp:s.timestamp||Date.now(),metadata:s.metadata});else if(s.role==="assistant"){n&&t.push(B(n));const i=s.metadata;let r=P();s.thinkingContent&&(r=ve(r,s.thinkingContent),r.thinkingContent=s.thinkingContent);const d=x(s.content);if(d&&(r=be(r,d),r.textBefore=d),s.tool_calls&&Array.isArray(s.tool_calls))for(const c of s.tool_calls){const l=((a=c.function)==null?void 0:a.name)||"Unknown",g=le((o=c.function)==null?void 0:o.arguments);if(l==="Task"){let m={};try{m=JSON.parse(g)}catch{}const S=typeof m.subagent_type=="string"?m.subagent_type:"subagent",y=typeof m.description=="string"?m.description:S;r=ue(r,{id:q({explicitId:c.id,sessionId:typeof m.subagent_session_id=="string"?m.subagent_session_id:void 0,messageId:s.id,agentType:S,description:y}),type:S,description:y,status:"running",startTime:Date.now(),sessionId:typeof m.subagent_session_id=="string"?m.subagent_session_id:void 0,resumedFrom:typeof m.resume_from=="string"?m.resume_from:typeof m.resume=="string"?m.resume:void 0});continue}const I={toolCallId:L({explicitId:c.id,messageId:s.id,toolName:l,argumentsValue:(u=c.function)==null?void 0:u.arguments}),toolName:l,arguments:g,status:"running",startTime:Date.now()};r=oe(r,I)}n={id:s.id,role:"assistant",content:x(s.content),timestamp:s.timestamp||Date.now(),metadata:i,agentContent:r}}else if(s.role==="tool"&&n&&n.agentContent){const i=s,r=s.metadata,d=i.tool_call_id||(r==null?void 0:r.toolCallId),c=i.name||(r==null?void 0:r.toolName)||"Tool",l=r!=null&&r.metadata&&typeof r.metadata=="object"&&!Array.isArray(r.metadata)?r.metadata:r,g=r!=null&&r.independentVerification&&typeof r.independentVerification=="object"&&!Array.isArray(r.independentVerification)?r.independentVerification:void 0,I=(r==null?void 0:r.status)==="failed"||(r==null?void 0:r.status)==="error"||typeof(r==null?void 0:r.error)=="string"&&r.error.length>0,m=N(n.agentContent),S=m.findIndex(h=>h.id===d);if(S>=0){const h=m[S],f=typeof(l==null?void 0:l.subagentStatus)=="string"?G(l.subagentStatus):I?"failed":"completed";m[S]={...h,sessionId:typeof(l==null?void 0:l.subagentSessionId)=="string"?l.subagentSessionId:h.sessionId,type:typeof(l==null?void 0:l.subagentType)=="string"?l.subagentType:h.type,status:f,resumedFrom:typeof(l==null?void 0:l.subagentResumedFrom)=="string"?l.subagentResumedFrom:h.resumedFrom,rootAgentId:typeof(l==null?void 0:l.subagentRootId)=="string"?l.subagentRootId:h.rootAgentId,resumeDepth:typeof(l==null?void 0:l.subagentResumeDepth)=="number"?l.subagentResumeDepth:h.resumeDepth,verificationVerdict:(l==null?void 0:l.verificationVerdict)==="pass"||(l==null?void 0:l.verificationVerdict)==="fail"||(l==null?void 0:l.verificationVerdict)==="partial"?l.verificationVerdict:(g==null?void 0:g.verificationVerdict)==="pass"||(g==null?void 0:g.verificationVerdict)==="fail"||(g==null?void 0:g.verificationVerdict)==="partial"?g.verificationVerdict:h.verificationVerdict,output:typeof(l==null?void 0:l.subagentSummary)=="string"?l.subagentSummary:x(s.content)||h.output},n.agentContent=U(n.agentContent,m,h.id);continue}const y=n.agentContent.toolCalls.find(h=>h.toolCallId===d);y?(y.output=x(s.content),y.status=I?"error":"success",y.metadata=l,y.summary=typeof(l==null?void 0:l.summary)=="string"?l.summary:y.summary,(!y.toolName||y.toolName==="Unknown")&&(y.toolName=c)):n.agentContent=oe(n.agentContent,{toolCallId:L({explicitId:d,messageId:n.id,toolName:c,output:x(s.content)}),toolName:c,output:x(s.content),status:I?"error":"success",startTime:Date.now(),metadata:l,summary:typeof(l==null?void 0:l.summary)=="string"?l.summary:void 0})}}return n&&t.push(B(n)),t}const ce={authentication:"task.failure.authentication",permission:"task.failure.permission",rate_limit:"task.failure.rateLimit",timeout:"task.failure.timeout",network:"task.failure.network",model_unavailable:"task.failure.modelUnavailable",context_limit:"task.failure.contextLimit",unsupported_input:"task.failure.unsupportedInput",capacity:"task.failure.capacity",runtime:"task.failure.runtime"},Me={authentication:!1,permission:!1,rate_limit:!0,timeout:!0,network:!0,model_unavailable:!0,context_limit:!1,unsupported_input:!1,capacity:!0,runtime:!0};function Re(e){if(typeof e=="string"&&Object.keys(ce).includes(e))return e}function Lt(e){return ce[e]}function Ht(e){return Me[e]}const xe={flushTimeout:80};class De{constructor(t){K(this,"config");K(this,"channels",new Map);this.config={...xe,...t}}append(t,n,a){let o=this.channels.get(t);o||(o={buffer:"",timer:null,flushFn:null},this.channels.set(t,o)),o.buffer+=n,o.flushFn=a,o.timer||(o.timer=setTimeout(()=>{this.flushChannel(t)},this.config.flushTimeout))}flushChannel(t){const n=this.channels.get(t);if(!n||!n.buffer)return;const a=n.buffer,o=n.flushFn;n.buffer="",n.timer&&(clearTimeout(n.timer),n.timer=null),o==null||o(a)}drainAll(){for(const[t]of this.channels)this.flushChannel(t);this.channels.clear()}drainAllExcept(t){for(const[n]of this.channels)n!==t&&this.flushChannel(n);for(const[n,a]of this.channels)n!==t&&!a.buffer&&this.channels.delete(n)}reset(){for(const[,t]of this.channels)t.timer&&clearTimeout(t.timer);this.channels.clear()}}const $=new De,we=100,b=(e,t,n)=>{if(t)for(const a of e){const o=N(a.agentContent).find(u=>u.id===t||u.sessionId===t);if(o)return{messageId:a.id,subagent:o}}if(n){const a=e.find(s=>s.id===n),o=N(a==null?void 0:a.agentContent),u=o.find(s=>s.status==="running")??o[o.length-1];if(u)return{messageId:n,subagent:u}}for(const a of[...e].reverse()){const o=N(a.agentContent),u=o.find(s=>s.status==="running")??o[o.length-1];if(u)return{messageId:a.id,subagent:u}}};function je(e,t,n){n(a=>{const o={...a.pendingSubagentCompletions??{}};if(o[e]===void 0&&Object.keys(o).length>=we){const u=Object.keys(o)[0];u&&delete o[u]}return o[e]={...t},{pendingSubagentCompletions:o}})}function Q(e,t,n){var u;if(!e)return;const a=(u=t().pendingSubagentCompletions)==null?void 0:u[e];!a||!b(t().messages,e,t().currentAssistantMessageId)||(W({...a,subagentSessionId:e,success:a.status==="completed"},t),n(s=>{const i={...s.pendingSubagentCompletions??{}};return delete i[e],{pendingSubagentCompletions:i}}))}const v=(e,t,n,a=!1)=>{const{currentAssistantMessageId:o,messages:u,addMessage:s,startAgentResponse:i}=e();if(n&&a){const l=u.find(I=>I.id===n&&I.role==="assistant");if(l)return i(l.id),l.id;const g={id:n,role:"assistant",content:"",timestamp:Date.now(),agentContent:P()};return s(g),i(n),n}if(o&&!o.startsWith("call_")&&u.some(l=>l.id===o&&l.role==="assistant"))return o;if(n){const l=u.find(g=>g.id===n&&g.role==="assistant");if(l)return i(l.id),l.id}const r=u[u.length-1];if((r==null?void 0:r.role)==="assistant")return r.id;const d=n||`assistant-${Date.now()}`,c={id:d,role:"assistant",content:"",timestamp:Date.now(),agentContent:P()};return s(c),i(d),t(l=>({messages:l.messages.map(g=>g.id===d?{...g,agentContent:{...g.agentContent||P()}}:g)})),d},_e=(e,t,n)=>{const{currentSessionId:a,addMessage:o,startAgentResponse:u,messages:s,updateMessage:i}=t();if(e.sessionId!==a)return;const r=e.messageId,d=e.role||"assistant",c=s.find(g=>g.id===r),l={id:r,role:d,content:e.content||"",timestamp:Date.now(),agentContent:d==="assistant"?P():void 0};c?i(r,{role:d,content:l.content,agentContent:d==="assistant"?{...c.agentContent||P()}:void 0}):o(l),d==="assistant"&&u(r)},qe=(e,t,n)=>{const{currentSessionId:a,appendDelta:o,currentAssistantMessageId:u,hasToolCalls:s,addMessage:i,startAgentResponse:r}=t();if(e.sessionId!==a)return;const d=e.messageId,c=e.delta;if(!u){const g={id:d,role:"assistant",content:"",timestamp:Date.now(),agentContent:P()};i(g),r(d),t().appendDelta(d,c,"before");return}o(u,c,s?"after":"before")},Fe=(e,t)=>{const{currentSessionId:n,updateMessage:a,messages:o}=t();if(e.sessionId!==n)return;const u=e.messageId,s=o.find(i=>i.id===u);s!=null&&s.agentContent&&a(u,{content:Ae(s.agentContent)})},Oe=(e,t,n)=>{var r;const{currentSessionId:a}=t();if(e.sessionId!==a)return;const o=e.output;if(!o||typeof o!="object"||Array.isArray(o))return;const u=v(t,n,e.messageId);if(!u)return;const s=t().messages.find(d=>d.id===u);if(!s)return;const i=JSON.stringify(o,null,2);t().updateMessage(u,{content:i,metadata:{...s.metadata,structuredOutput:{output:o,schemaDigest:e.schemaDigest}},agentContent:s.agentContent?{...s.agentContent,textBefore:"",textAfter:"",timeline:(r=s.agentContent.timeline)==null?void 0:r.filter(d=>d.type!=="text")}:void 0})},Ee=(e,t,n)=>{const{currentSessionId:a,appendThinking:o}=t();if(e.sessionId!==a)return;const u=v(t,n,e.messageId);u&&o(u,e.delta)},Ve=()=>{},ge=(e,t,n)=>{const{currentSessionId:a,appendToolCall:o,setHasToolCalls:u,setSubagent:s}=t();if(e.sessionId!==a)return;const i=v(t,n,e.messageId||e.toolCallId,typeof e.messageId=="string");if(!i)return;u(!0);const r=e.toolName||"Unknown",d=e.arguments;let c,l="",g,I;if(r==="Task")try{const S=JSON.parse(d);c=S.subagent_type,l=S.description||S.query||c||"",g=S.subagent_session_id,I=S.resume_from||S.resume}catch{}if(c){s(i,{id:q({explicitId:e.toolCallId,sessionId:g,messageId:i,agentType:c,description:l}),type:c,description:l,status:"running",startTime:Date.now(),sessionId:g,resumedFrom:I,output:"",thinking:""}),Q(g,t,n);return}const m={toolCallId:L({explicitId:e.toolCallId,messageId:i,toolName:r,argumentsValue:d,toolKind:e.toolKind}),toolName:r,arguments:d,toolKind:e.toolKind,status:"running",startTime:Date.now()};o(i,m)};function me(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(!(t.kind!=="readonly"&&t.kind!=="write"&&t.kind!=="execute")&&!(t.scope!=="global"&&t.scope!=="session")&&!(!Number.isSafeInteger(t.queuePosition)||t.queuePosition<=0||!Number.isSafeInteger(t.inFlight)||t.inFlight<0||!Number.isSafeInteger(t.limit)||t.limit<=0))return{kind:t.kind,scope:t.scope,queuePosition:t.queuePosition,inFlight:t.inFlight,limit:t.limit}}const fe=(e,t)=>{const{currentSessionId:n,updateToolCall:a,messages:o}=t();if(e.sessionId!==n)return;const u=e.toolCallId;if(!u)return;const s=o.find(i=>{var r;return(r=i.agentContent)==null?void 0:r.toolCalls.some(d=>d.toolCallId===u)});s&&a(s.id,u,{summary:e.message,progress:typeof e.progress=="number"?e.progress:void 0,progressTotal:typeof e.total=="number"?e.total:void 0,progressMessage:e.message,admission:me(e.admission)})},Ie=(e,t,n)=>{var se;const{currentSessionId:a,appendToolCall:o,setHasToolCalls:u,updateToolCall:s,updateSubagent:i,messages:r}=t();if(e.sessionId!==a)return;const d=e.toolCallId;if(!d)return;const c=r.find(A=>{var T;return(T=A.agentContent)==null?void 0:T.toolCalls.some(R=>R.toolCallId===d)}),l=r.find(A=>N(A.agentContent).some(T=>T.id===d)),g=(c==null?void 0:c.id)||(l==null?void 0:l.id)||v(t,n,e.messageId,!0);if(!g)return;const I=typeof e.output=="string"?e.output:"",m=e.success===!0||e.status==="completed",S=e.summary||(I&&I.trim()?I.trim().split(`
|
|
5
|
-
`)[0].slice(0,120):m?"执行成功":"执行失败"),y=(se=c==null?void 0:c.agentContent)==null?void 0:se.toolCalls.find(A=>A.toolCallId===d),h=typeof e.toolName=="string"?e.toolName:(y==null?void 0:y.toolName)??"Unknown",f=e.metadata;c?s(g,d,{status:m?"success":"error",summary:S,output:I,metadata:f}):l||(u(!0),o(g,{toolCallId:d,toolName:h,status:m?"success":"error",summary:S,output:I,startTime:Date.now(),metadata:f}));const F=t().messages.find(A=>A.id===g),k=N(F==null?void 0:F.agentContent).find(A=>A.id===d),M=f&&typeof f.subagentSessionId=="string"?f.subagentSessionId:void 0,D=f&&typeof f.subagentStatus=="string"?f.subagentStatus:void 0,
|
|
4
|
+
`)}function B(e){if(!e.agentContent)return e;let t=e.agentContent;for(const n of Ne(e.id,e.metadata))t=ue(t,n);return{...e,agentContent:t}}function Pe(e){var a,o,u;const t=[];let n=null;for(const s of e)if(s.role!=="system"){if(s.role==="user")n&&(t.push(B(n)),n=null),t.push({id:s.id,role:s.role,content:s.content,timestamp:s.timestamp||Date.now(),metadata:s.metadata});else if(s.role==="assistant"){n&&t.push(B(n));const i=s.metadata;let r=P();s.thinkingContent&&(r=ve(r,s.thinkingContent),r.thinkingContent=s.thinkingContent);const d=x(s.content);if(d&&(r=be(r,d),r.textBefore=d),s.tool_calls&&Array.isArray(s.tool_calls))for(const c of s.tool_calls){const l=((a=c.function)==null?void 0:a.name)||"Unknown",g=le((o=c.function)==null?void 0:o.arguments);if(l==="Task"){let m={};try{m=JSON.parse(g)}catch{}const S=typeof m.subagent_type=="string"?m.subagent_type:"subagent",y=typeof m.description=="string"?m.description:S;r=ue(r,{id:q({explicitId:c.id,sessionId:typeof m.subagent_session_id=="string"?m.subagent_session_id:void 0,messageId:s.id,agentType:S,description:y}),type:S,description:y,status:"running",startTime:Date.now(),sessionId:typeof m.subagent_session_id=="string"?m.subagent_session_id:void 0,resumedFrom:typeof m.resume_from=="string"?m.resume_from:typeof m.resume=="string"?m.resume:void 0});continue}const I={toolCallId:L({explicitId:c.id,messageId:s.id,toolName:l,argumentsValue:(u=c.function)==null?void 0:u.arguments}),toolName:l,arguments:g,status:"running",startTime:Date.now()};r=oe(r,I)}n={id:s.id,role:"assistant",content:x(s.content),timestamp:s.timestamp||Date.now(),metadata:i,agentContent:r}}else if(s.role==="tool"&&n&&n.agentContent){const i=s,r=s.metadata,d=i.tool_call_id||(r==null?void 0:r.toolCallId),c=i.name||(r==null?void 0:r.toolName)||"Tool",l=r!=null&&r.metadata&&typeof r.metadata=="object"&&!Array.isArray(r.metadata)?r.metadata:r,g=r!=null&&r.independentVerification&&typeof r.independentVerification=="object"&&!Array.isArray(r.independentVerification)?r.independentVerification:void 0,I=(r==null?void 0:r.status)==="failed"||(r==null?void 0:r.status)==="error"||typeof(r==null?void 0:r.error)=="string"&&r.error.length>0,m=N(n.agentContent),S=m.findIndex(h=>h.id===d);if(S>=0){const h=m[S],f=typeof(l==null?void 0:l.subagentStatus)=="string"?G(l.subagentStatus):I?"failed":"completed";m[S]={...h,sessionId:typeof(l==null?void 0:l.subagentSessionId)=="string"?l.subagentSessionId:h.sessionId,type:typeof(l==null?void 0:l.subagentType)=="string"?l.subagentType:h.type,status:f,resumedFrom:typeof(l==null?void 0:l.subagentResumedFrom)=="string"?l.subagentResumedFrom:h.resumedFrom,rootAgentId:typeof(l==null?void 0:l.subagentRootId)=="string"?l.subagentRootId:h.rootAgentId,resumeDepth:typeof(l==null?void 0:l.subagentResumeDepth)=="number"?l.subagentResumeDepth:h.resumeDepth,verificationVerdict:(l==null?void 0:l.verificationVerdict)==="pass"||(l==null?void 0:l.verificationVerdict)==="fail"||(l==null?void 0:l.verificationVerdict)==="partial"?l.verificationVerdict:(g==null?void 0:g.verificationVerdict)==="pass"||(g==null?void 0:g.verificationVerdict)==="fail"||(g==null?void 0:g.verificationVerdict)==="partial"?g.verificationVerdict:h.verificationVerdict,output:typeof(l==null?void 0:l.subagentSummary)=="string"?l.subagentSummary:x(s.content)||h.output},n.agentContent=U(n.agentContent,m,h.id);continue}const y=n.agentContent.toolCalls.find(h=>h.toolCallId===d);y?(y.output=x(s.content),y.status=I?"error":"success",y.metadata=l,y.summary=typeof(l==null?void 0:l.summary)=="string"?l.summary:y.summary,(!y.toolName||y.toolName==="Unknown")&&(y.toolName=c)):n.agentContent=oe(n.agentContent,{toolCallId:L({explicitId:d,messageId:n.id,toolName:c,output:x(s.content)}),toolName:c,output:x(s.content),status:I?"error":"success",startTime:Date.now(),metadata:l,summary:typeof(l==null?void 0:l.summary)=="string"?l.summary:void 0})}}return n&&t.push(B(n)),t}const ce={authentication:"task.failure.authentication",permission:"task.failure.permission",rate_limit:"task.failure.rateLimit",timeout:"task.failure.timeout",network:"task.failure.network",model_unavailable:"task.failure.modelUnavailable",context_limit:"task.failure.contextLimit",unsupported_input:"task.failure.unsupportedInput",capacity:"task.failure.capacity",runtime:"task.failure.runtime"},Me={authentication:!1,permission:!1,rate_limit:!0,timeout:!0,network:!0,model_unavailable:!0,context_limit:!1,unsupported_input:!1,capacity:!0,runtime:!0};function Re(e){if(typeof e=="string"&&Object.keys(ce).includes(e))return e}function Ht(e){return ce[e]}function Gt(e){return Me[e]}const xe={flushTimeout:80};class De{constructor(t){K(this,"config");K(this,"channels",new Map);this.config={...xe,...t}}append(t,n,a){let o=this.channels.get(t);o||(o={buffer:"",timer:null,flushFn:null},this.channels.set(t,o)),o.buffer+=n,o.flushFn=a,o.timer||(o.timer=setTimeout(()=>{this.flushChannel(t)},this.config.flushTimeout))}flushChannel(t){const n=this.channels.get(t);if(!n||!n.buffer)return;const a=n.buffer,o=n.flushFn;n.buffer="",n.timer&&(clearTimeout(n.timer),n.timer=null),o==null||o(a)}drainAll(){for(const[t]of this.channels)this.flushChannel(t);this.channels.clear()}drainAllExcept(t){for(const[n]of this.channels)n!==t&&this.flushChannel(n);for(const[n,a]of this.channels)n!==t&&!a.buffer&&this.channels.delete(n)}reset(){for(const[,t]of this.channels)t.timer&&clearTimeout(t.timer);this.channels.clear()}}const $=new De,we=100,b=(e,t,n)=>{if(t)for(const a of e){const o=N(a.agentContent).find(u=>u.id===t||u.sessionId===t);if(o)return{messageId:a.id,subagent:o}}if(n){const a=e.find(s=>s.id===n),o=N(a==null?void 0:a.agentContent),u=o.find(s=>s.status==="running")??o[o.length-1];if(u)return{messageId:n,subagent:u}}for(const a of[...e].reverse()){const o=N(a.agentContent),u=o.find(s=>s.status==="running")??o[o.length-1];if(u)return{messageId:a.id,subagent:u}}};function je(e,t,n){n(a=>{const o={...a.pendingSubagentCompletions??{}};if(o[e]===void 0&&Object.keys(o).length>=we){const u=Object.keys(o)[0];u&&delete o[u]}return o[e]={...t},{pendingSubagentCompletions:o}})}function Q(e,t,n){var u;if(!e)return;const a=(u=t().pendingSubagentCompletions)==null?void 0:u[e];!a||!b(t().messages,e,t().currentAssistantMessageId)||(z({...a,subagentSessionId:e,success:a.status==="completed"},t),n(s=>{const i={...s.pendingSubagentCompletions??{}};return delete i[e],{pendingSubagentCompletions:i}}))}const v=(e,t,n,a=!1)=>{const{currentAssistantMessageId:o,messages:u,addMessage:s,startAgentResponse:i}=e();if(n&&a){const l=u.find(I=>I.id===n&&I.role==="assistant");if(l)return i(l.id),l.id;const g={id:n,role:"assistant",content:"",timestamp:Date.now(),agentContent:P()};return s(g),i(n),n}if(o&&!o.startsWith("call_")&&u.some(l=>l.id===o&&l.role==="assistant"))return o;if(n){const l=u.find(g=>g.id===n&&g.role==="assistant");if(l)return i(l.id),l.id}const r=u[u.length-1];if((r==null?void 0:r.role)==="assistant")return r.id;const d=n||`assistant-${Date.now()}`,c={id:d,role:"assistant",content:"",timestamp:Date.now(),agentContent:P()};return s(c),i(d),t(l=>({messages:l.messages.map(g=>g.id===d?{...g,agentContent:{...g.agentContent||P()}}:g)})),d},_e=(e,t,n)=>{const{currentSessionId:a,addMessage:o,startAgentResponse:u,messages:s,updateMessage:i}=t();if(e.sessionId!==a)return;const r=e.messageId,d=e.role||"assistant",c=s.find(g=>g.id===r),l={id:r,role:d,content:e.content||"",timestamp:Date.now(),agentContent:d==="assistant"?P():void 0};c?i(r,{role:d,content:l.content,agentContent:d==="assistant"?{...c.agentContent||P()}:void 0}):o(l),d==="assistant"&&u(r)},qe=(e,t,n)=>{const{currentSessionId:a,appendDelta:o,currentAssistantMessageId:u,hasToolCalls:s,addMessage:i,startAgentResponse:r}=t();if(e.sessionId!==a)return;const d=e.messageId,c=e.delta;if(!u){const g={id:d,role:"assistant",content:"",timestamp:Date.now(),agentContent:P()};i(g),r(d),t().appendDelta(d,c,"before");return}o(u,c,s?"after":"before")},Fe=(e,t)=>{const{currentSessionId:n,updateMessage:a,messages:o}=t();if(e.sessionId!==n)return;const u=e.messageId,s=o.find(i=>i.id===u);s!=null&&s.agentContent&&a(u,{content:Ae(s.agentContent)})},Oe=(e,t,n)=>{var r;const{currentSessionId:a}=t();if(e.sessionId!==a)return;const o=e.output;if(!o||typeof o!="object"||Array.isArray(o))return;const u=v(t,n,e.messageId);if(!u)return;const s=t().messages.find(d=>d.id===u);if(!s)return;const i=JSON.stringify(o,null,2);t().updateMessage(u,{content:i,metadata:{...s.metadata,structuredOutput:{output:o,schemaDigest:e.schemaDigest}},agentContent:s.agentContent?{...s.agentContent,textBefore:"",textAfter:"",timeline:(r=s.agentContent.timeline)==null?void 0:r.filter(d=>d.type!=="text")}:void 0})},Ee=(e,t,n)=>{const{currentSessionId:a,appendThinking:o}=t();if(e.sessionId!==a)return;const u=v(t,n,e.messageId);u&&o(u,e.delta)},Ve=()=>{},ge=(e,t,n)=>{const{currentSessionId:a,appendToolCall:o,setHasToolCalls:u,setSubagent:s}=t();if(e.sessionId!==a)return;const i=v(t,n,e.messageId||e.toolCallId,typeof e.messageId=="string");if(!i)return;u(!0);const r=e.toolName||"Unknown",d=e.arguments;let c,l="",g,I;if(r==="Task")try{const S=JSON.parse(d);c=S.subagent_type,l=S.description||S.query||c||"",g=S.subagent_session_id,I=S.resume_from||S.resume}catch{}if(c){s(i,{id:q({explicitId:e.toolCallId,sessionId:g,messageId:i,agentType:c,description:l}),type:c,description:l,status:"running",startTime:Date.now(),sessionId:g,resumedFrom:I,output:"",thinking:""}),Q(g,t,n);return}const m={toolCallId:L({explicitId:e.toolCallId,messageId:i,toolName:r,argumentsValue:d,toolKind:e.toolKind}),toolName:r,arguments:d,toolKind:e.toolKind,status:"running",startTime:Date.now()};o(i,m)};function me(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(!(t.kind!=="readonly"&&t.kind!=="write"&&t.kind!=="execute")&&!(t.scope!=="global"&&t.scope!=="session")&&!(!Number.isSafeInteger(t.queuePosition)||t.queuePosition<=0||!Number.isSafeInteger(t.inFlight)||t.inFlight<0||!Number.isSafeInteger(t.limit)||t.limit<=0))return{kind:t.kind,scope:t.scope,queuePosition:t.queuePosition,inFlight:t.inFlight,limit:t.limit}}const fe=(e,t)=>{const{currentSessionId:n,updateToolCall:a,messages:o}=t();if(e.sessionId!==n)return;const u=e.toolCallId;if(!u)return;const s=o.find(i=>{var r;return(r=i.agentContent)==null?void 0:r.toolCalls.some(d=>d.toolCallId===u)});s&&a(s.id,u,{summary:e.message,progress:typeof e.progress=="number"?e.progress:void 0,progressTotal:typeof e.total=="number"?e.total:void 0,progressMessage:e.message,admission:me(e.admission)})},Ie=(e,t,n)=>{var se;const{currentSessionId:a,appendToolCall:o,setHasToolCalls:u,updateToolCall:s,updateSubagent:i,messages:r}=t();if(e.sessionId!==a)return;const d=e.toolCallId;if(!d)return;const c=r.find(A=>{var T;return(T=A.agentContent)==null?void 0:T.toolCalls.some(R=>R.toolCallId===d)}),l=r.find(A=>N(A.agentContent).some(T=>T.id===d)),g=(c==null?void 0:c.id)||(l==null?void 0:l.id)||v(t,n,e.messageId,!0);if(!g)return;const I=typeof e.output=="string"?e.output:"",m=e.success===!0||e.status==="completed",S=e.summary||(I&&I.trim()?I.trim().split(`
|
|
5
|
+
`)[0].slice(0,120):m?"执行成功":"执行失败"),y=(se=c==null?void 0:c.agentContent)==null?void 0:se.toolCalls.find(A=>A.toolCallId===d),h=typeof e.toolName=="string"?e.toolName:(y==null?void 0:y.toolName)??"Unknown",f=e.metadata;c?s(g,d,{status:m?"success":"error",summary:S,output:I,metadata:f}):l||(u(!0),o(g,{toolCallId:d,toolName:h,status:m?"success":"error",summary:S,output:I,startTime:Date.now(),metadata:f}));const F=t().messages.find(A=>A.id===g),k=N(F==null?void 0:F.agentContent).find(A=>A.id===d),M=f&&typeof f.subagentSessionId=="string"?f.subagentSessionId:void 0,D=f&&typeof f.subagentStatus=="string"?f.subagentStatus:void 0,p=f&&typeof f.subagentType=="string"?f.subagentType:void 0,X=f&&typeof f.subagentSummary=="string"?f.subagentSummary:void 0,Z=f&&typeof f.subagentResumedFrom=="string"?f.subagentResumedFrom:void 0,ee=f&&typeof f.subagentRootId=="string"?f.subagentRootId:void 0,te=f&&typeof f.subagentResumeDepth=="number"?f.subagentResumeDepth:void 0,ne=(f==null?void 0:f.verificationVerdict)==="pass"||(f==null?void 0:f.verificationVerdict)==="fail"||(f==null?void 0:f.verificationVerdict)==="partial"?f.verificationVerdict:void 0;if(k){const A=D?G(D):e.success?"completed":"failed",T=k.status!=="running"&&A==="running";i(g,k.id,{sessionId:k.sessionId||M,type:p||k.type,status:T?k.status:A,resumedFrom:Z||k.resumedFrom,rootAgentId:ee||k.rootAgentId,resumeDepth:te??k.resumeDepth,verificationVerdict:ne??k.verificationVerdict,output:T?k.output:X||k.output})}M&&D&&n(A=>({messages:A.messages.map(T=>{if(T.id!==g)return T;const R=T.metadata??{},O=Array.isArray(R.subtaskRefs)?R.subtaskRefs:[],w=O.findIndex(ie=>ie.childSessionId===M||ie.subagentId===d),C=w>=0?O[w]:R.subtaskRef??{},E={...C,subagentId:d,childSessionId:M,agentType:p||(typeof(C==null?void 0:C.agentType)=="string"?C.agentType:"subagent"),status:D,summary:X||(typeof(C==null?void 0:C.summary)=="string"?C.summary:""),resumedFrom:Z||(typeof(C==null?void 0:C.resumedFrom)=="string"?C.resumedFrom:void 0),rootAgentId:ee||(typeof(C==null?void 0:C.rootAgentId)=="string"?C.rootAgentId:M),resumeDepth:te??(typeof(C==null?void 0:C.resumeDepth)=="number"?C.resumeDepth:0),verificationVerdict:ne||(typeof(C==null?void 0:C.verificationVerdict)=="string"?C.verificationVerdict:void 0)},V=[...O];return w>=0?V[w]=E:V.push(E),{...T,metadata:{...R,subtaskRef:E,subtaskRefs:V}}})})),Q(M,t,n)},Ke=(e,t,n)=>{const{currentSessionId:a,appendToolCall:o}=t();if(e.sessionId!==a)return;const u=v(t,n,e.messageId||`mcp-catalog-${String(e.revision)}`);if(!u)return;const s=Array.isArray(e.added)?e.added.map(String):[],i=Array.isArray(e.removed)?e.removed.map(String):[],r=Array.isArray(e.updated)?e.updated.map(String):[],d=`MCP catalog r${String(e.revision)}: +${s.length} -${i.length} ~${r.length}`;o(u,{toolCallId:`mcp-catalog:${String(e.revision)}`,toolName:"MCP Catalog",arguments:JSON.stringify({serverName:e.serverName,added:s,removed:i,updated:r}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:d,output:[s.length>0?`Added: ${s.join(", ")}`:"",i.length>0?`Removed: ${i.join(", ")}`:"",r.length>0?`Updated: ${r.join(", ")}`:""].filter(Boolean).join(`
|
|
6
6
|
`)})},Be=(e,t,n)=>{const{currentSessionId:a,appendToolCall:o}=t();if(e.sessionId!==a)return;const u=v(t,n,e.messageId||`mcp-content-${String(e.revision)}`);if(!u)return;const s=Array.isArray(e.added)?e.added.map(String):[],i=Array.isArray(e.removed)?e.removed.map(String):[],r=Array.isArray(e.updated)?e.updated.map(String):[],d=`MCP ${String(e.contentKind)} r${String(e.revision)}: +${s.length} -${i.length} ~${r.length}`;o(u,{toolCallId:`mcp-content:${String(e.revision)}`,toolName:"MCP Content",arguments:JSON.stringify({serverName:e.serverName,contentKind:e.contentKind,added:s,removed:i,updated:r}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:d,output:[s.length>0?`Added: ${s.join(", ")}`:"",i.length>0?`Removed: ${i.join(", ")}`:"",r.length>0?`Updated: ${r.join(", ")}`:""].filter(Boolean).join(`
|
|
7
7
|
`)})},Ue=(e,t,n)=>{const{currentSessionId:a,appendToolCall:o}=t();if(e.sessionId!==a)return;const u=v(t,n,e.messageId||`mcp-resource-${String(e.revision)}`);u&&o(u,{toolCallId:`mcp-resource:${String(e.revision)}`,toolName:"MCP Resource",arguments:JSON.stringify({serverName:e.serverName,uri:e.uri}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:`MCP resource updated: ${String(e.uri)}`,output:`${String(e.serverName)} · revision ${String(e.revision)}`})},Je=(e,t,n)=>{const{currentSessionId:a,appendToolCall:o}=t();if(e.sessionId!==a)return;const u=v(t,n,e.messageId||`mcp-connection-${String(e.revision)}`);if(!u)return;const s=String(e.phase),i=`MCP ${String(e.serverName)} ${s}`+(s==="reconnecting"?` (${String(e.attempt)}/${String(e.maxAttempts)})`:"");o(u,{toolCallId:`mcp-connection:${String(e.revision)}`,toolName:"MCP Connection",arguments:JSON.stringify({serverName:e.serverName,phase:s,reason:e.reason,attempt:e.attempt,maxAttempts:e.maxAttempts}),toolKind:"readonly",status:s==="failed"?"error":"success",startTime:Date.now(),summary:i,output:[`Reason: ${String(e.reason)}`,e.error?`Error: ${String(e.error)}`:""].filter(Boolean).join(`
|
|
8
8
|
`)})},Le=(e,t,n)=>{const{currentSessionId:a,appendToolCall:o}=t();if(e.sessionId!==a)return;const u=v(t,n,e.messageId||`mcp-log-${String(e.revision)}`);if(!u)return;const s=String(e.level),i=typeof e.logger=="string"?e.logger:void 0,r=`MCP ${s} · ${String(e.serverName)}`+(i?` · ${i}`:"");o(u,{toolCallId:`mcp-log:${String(e.revision)}`,toolName:"MCP Log",arguments:JSON.stringify({serverName:e.serverName,level:s,logger:i}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:r,output:[String(e.message),`SHA-256: ${String(e.dataSha256)}`,e.truncated===!0?"Truncated":"",e.detailsOmitted===!0?"Details omitted by runtime policy":""].filter(Boolean).join(`
|
|
9
9
|
`)})},He=(e,t,n)=>{const{currentSessionId:a,appendToolCall:o}=t();if(e.sessionId!==a)return;const u=String(e.serverName),s=String(e.action),i=v(t,n,e.messageId||`mcp-instructions-${String(e.revision)}-${u}`);if(!i)return;const r=`MCP instructions ${s}: ${u}`+(e.truncated===!0?" (truncated)":"");o(i,{toolCallId:`mcp-instructions:${String(e.revision)}:${u}:${s}`,toolName:"MCP Instructions",arguments:JSON.stringify({serverName:u,action:s,reason:e.reason}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:r,output:[typeof e.text=="string"?e.text:"",e.sha256?`SHA-256: ${String(e.sha256)}`:"",e.detailsOmitted===!0?"Details omitted by runtime policy":""].filter(Boolean).join(`
|
|
10
10
|
`)})},Ge=(e,t,n)=>{var I,m;const{currentSessionId:a,appendToolCall:o,updateToolCall:u}=t();if(e.sessionId!==a)return;const s=String(e.taskId),i=String(e.status),r=`mcp-task:${s}`,d=v(t,n,e.messageId||`mcp-task-${s}`);if(!d)return;const c=`MCP task ${i}: ${s} · ${String(e.serverName)}/${String(e.toolName)}`,l={status:i==="failed"||i==="cancelled"?"error":i==="completed"?"success":"running",summary:c,output:[typeof e.statusMessage=="string"?e.statusMessage:"",e.hasResult===!0?"Result available via TaskOutput":"",typeof e.error=="string"?`Error: ${e.error}`:""].filter(Boolean).join(`
|
|
11
11
|
`)};if((m=(I=t().messages.find(S=>S.id===d))==null?void 0:I.agentContent)==null?void 0:m.toolCalls.some(S=>S.toolCallId===r)){u(d,r,l);return}o(d,{toolCallId:r,toolName:"MCP Task",arguments:JSON.stringify({taskId:s,serverName:e.serverName,toolName:e.toolName}),toolKind:"readonly",status:l.status,startTime:Number(e.createdAt)||Date.now(),summary:l.summary,output:l.output})},Qe=(e,t,n)=>{const{currentSessionId:a,appendToolCall:o}=t();if(e.sessionId!==a)return;const u=Array.isArray(e.files)?e.files.filter(d=>!!d&&typeof d=="object"&&!Array.isArray(d)):[],s=v(t,n,e.messageId||`project-rules-${Date.now()}`);if(!s)return;const i=e.blockedWrite===!0,r=`Project rules loaded: ${u.length}`+(i?" (write retry required)":"");o(s,{toolCallId:`project-rules:${u.map(d=>String(d.id)).join(",")}`,toolName:"Project Rules",arguments:JSON.stringify({triggerPaths:e.triggerPaths,blockedWrite:i}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:r,output:u.map(d=>`${String(d.relativePath)} ${String(d.source)} SHA-256: ${String(d.contentSha256)}`).join(`
|
|
12
|
-
`)})},
|
|
12
|
+
`)})},W=e=>`user-shell-${e}`,We=(e,t,n)=>{const{currentSessionId:a,addMessage:o,messages:u,updateMessage:s}=t();if(e.sessionId!==a||typeof e.executionId!="string"||typeof e.command!="string")return;const i=W(e.executionId),r={id:i,role:"user",content:`! ${e.command}`,timestamp:Date.now(),metadata:{userShellExecution:{executionId:e.executionId,command:e.command,status:"running",output:""}}};u.some(d=>d.id===i)?s(i,r):o(r),e.auxiliary!==!0&&n({isStreaming:!0,agentPhase:"running",error:null,errorContext:null})},ze=(e,t)=>{var d;const{currentSessionId:n,messages:a,updateMessage:o}=t();if(e.sessionId!==n||typeof e.executionId!="string"||typeof e.chunk!="string")return;const u=W(e.executionId),s=a.find(c=>c.id===u);if(!s)return;const i=(d=s.metadata)!=null&&d.userShellExecution&&typeof s.metadata.userShellExecution=="object"?s.metadata.userShellExecution:{},r=`${typeof i.output=="string"?i.output:""}${e.chunk}`;o(u,{content:`! ${String(i.command??"")}
|
|
13
13
|
${r}`,metadata:{...s.metadata,userShellExecution:{...i,output:r,streamTruncated:e.streamTruncated===!0}}})},Ye=(e,t,n)=>{const{currentSessionId:a,messages:o,addMessage:u,updateMessage:s}=t();if(e.sessionId!==a||typeof e.executionId!="string"||!e.record||typeof e.record!="object"||Array.isArray(e.record))return;const i=e.record,r=typeof i.command=="string"?i.command:"",d=typeof i.stdout=="string"?i.stdout:"",c=typeof i.stderr=="string"?i.stderr:"",l=[d,c?`stderr:
|
|
14
14
|
${c}`:""].filter(Boolean).join(`
|
|
15
|
-
`),g=
|
|
16
|
-
`),metadata:{userShellCommand:i}};o.some(m=>m.id===g)?s(g,I):u({id:g,...I,timestamp:Date.now()}),e.auxiliary!==!0&&n({isStreaming:!1,isStopping:!1,agentPhase:"idle"}),(e.delivery==="current_turn"||e.delivery==="next_turn")&&n({pendingSteeringCount:typeof e.queued=="number"?Math.max(0,e.queued):0,pendingInputDelivery:e.delivery==="current_turn"?"current_turn":"next_turn"})},
|
|
15
|
+
`),g=W(e.executionId),I={role:"user",content:[`! ${r}`,l||"(no output)"].join(`
|
|
16
|
+
`),metadata:{userShellCommand:i}};o.some(m=>m.id===g)?s(g,I):u({id:g,...I,timestamp:Date.now()}),e.auxiliary!==!0&&n({isStreaming:!1,isStopping:!1,agentPhase:"idle"}),(e.delivery==="current_turn"||e.delivery==="next_turn")&&n({pendingSteeringCount:typeof e.queued=="number"?Math.max(0,e.queued):0,pendingInputDelivery:e.delivery==="current_turn"?"current_turn":"next_turn"})},pe=(e,t)=>{const{currentSessionId:n,updateTokenUsage:a,setMaxContextTokens:o}=t();e.sessionId===n&&(a({inputTokens:e.inputTokens,outputTokens:e.outputTokens,totalTokens:e.totalTokens,cacheReadTokens:e.cacheReadTokens??0,cacheWriteTokens:e.cacheWriteTokens??0,...e.cacheBreak?{cacheBreak:e.cacheBreak}:{},costUsd:e.costUsd}),e.maxContextTokens&&o(e.maxContextTokens,!1))},Xe=(e,t)=>{const{currentSessionId:n,setTasks:a,currentAssistantMessageId:o}=t();if(e.sessionId!==n||!o)return;const u=e.tasks||[];a(o,u)},Ze=(e,t,n)=>{const{currentSessionId:a,setSubagent:o,currentAssistantMessageId:u}=t();if(e.sessionId!==a||!u)return;const s={id:q({explicitId:e.subagentId,sessionId:e.subagentSessionId,messageId:u,agentType:e.type,description:e.description}),type:e.type||"unknown",description:e.description||"",status:"running",startTime:Date.now(),sessionId:e.subagentSessionId,resumedFrom:e.resumedFrom,rootAgentId:e.rootAgentId,resumeDepth:typeof e.resumeDepth=="number"?e.resumeDepth:void 0};o(u,s),Q(s.sessionId,t,n)},et=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=e.subagentSessionId,i=b(o,s,a);i&&u(i.messageId,i.subagent.id,{sessionId:i.subagent.sessionId||s,currentTool:e.toolName})},tt=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=e.delta;if(!s)return;const i=e.subagentSessionId,r=b(o,i,a);r&&u(r.messageId,r.subagent.id,d=>({sessionId:d.sessionId||i,output:(d.output||"")+s}))},nt=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=e.delta;if(!s)return;const i=e.subagentSessionId,r=b(o,i,a);r&&u(r.messageId,r.subagent.id,d=>({sessionId:d.sessionId||i,thinking:(d.thinking||"")+s}))},z=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=e.subagentSessionId,i=b(o,s,a);if(!i)return;const r=e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.success?"completed":"failed";u(i.messageId,i.subagent.id,{sessionId:i.subagent.sessionId||s,type:typeof e.type=="string"?e.type:i.subagent.type,description:typeof e.description=="string"?e.description:i.subagent.description,status:r,currentTool:void 0,output:typeof e.summary=="string"?e.summary:i.subagent.output,resumedFrom:typeof e.resumedFrom=="string"?e.resumedFrom:i.subagent.resumedFrom,rootAgentId:typeof e.rootAgentId=="string"?e.rootAgentId:i.subagent.rootAgentId,resumeDepth:typeof e.resumeDepth=="number"?e.resumeDepth:i.subagent.resumeDepth,verificationVerdict:e.verificationVerdict==="pass"||e.verificationVerdict==="fail"||e.verificationVerdict==="partial"?e.verificationVerdict:i.subagent.verificationVerdict})},st=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=e.toolCallId,i=e.toolName;if(!s||!i)return;const r=e.subagentSessionId,d=b(o,r,a);if(!d)return;const c={toolCallId:s,toolName:i,arguments:e.arguments,toolKind:e.toolKind,status:"running",startTime:Date.now()};u(d.messageId,d.subagent.id,l=>{const g=l.toolCalls||[];return{sessionId:l.sessionId||r,currentTool:i,toolCalls:g.some(I=>I.toolCallId===s)?g:[...g,c]}})},it=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=e.toolCallId;if(!s)return;const i=e.toolName,r=e.subagentSessionId,d=b(o,r,a);if(!d)return;const c=e.output,l=e.success===!0,g=l?"success":"error",I=e.summary||(c&&c.trim()?c.trim().split(`
|
|
17
17
|
`)[0].slice(0,120):l?"执行成功":"执行失败");u(d.messageId,d.subagent.id,m=>({sessionId:m.sessionId||r,currentTool:m.currentTool===i?void 0:m.currentTool,toolCalls:(m.toolCalls||[]).map(S=>S.toolCallId===s?{...S,status:g,summary:I,output:c,metadata:e.metadata}:S)}))},ot=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=e.toolCallId;if(!s)return;const i=b(o,e.subagentSessionId,a);i&&u(i.messageId,i.subagent.id,r=>({toolCalls:(r.toolCalls||[]).map(d=>d.toolCallId===s?{...d,summary:e.message,progress:typeof e.progress=="number"?e.progress:void 0,progressTotal:typeof e.total=="number"?e.total:void 0,progressMessage:e.message,admission:me(e.admission)}:d)}))},at=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=b(o,e.subagentSessionId,a);if(!s)return;const i=Array.isArray(e.added)?e.added.map(String):[],r=Array.isArray(e.removed)?e.removed.map(String):[],d=Array.isArray(e.updated)?e.updated.map(String):[],c=`mcp-catalog:${String(e.revision)}`;u(s.messageId,s.subagent.id,l=>({toolCalls:[...(l.toolCalls||[]).filter(g=>g.toolCallId!==c),{toolCallId:c,toolName:"MCP Catalog",arguments:JSON.stringify({serverName:e.serverName,added:i,removed:r,updated:d}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:`MCP catalog r${String(e.revision)}: +${i.length} -${r.length} ~${d.length}`,output:[i.length>0?`Added: ${i.join(", ")}`:"",r.length>0?`Removed: ${r.join(", ")}`:"",d.length>0?`Updated: ${d.join(", ")}`:""].filter(Boolean).join(`
|
|
18
18
|
`)}]}))},rt=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=b(o,e.subagentSessionId,a);if(!s)return;const i=Array.isArray(e.added)?e.added.map(String):[],r=Array.isArray(e.removed)?e.removed.map(String):[],d=Array.isArray(e.updated)?e.updated.map(String):[],c=`mcp-content:${String(e.revision)}`;u(s.messageId,s.subagent.id,l=>({toolCalls:[...(l.toolCalls||[]).filter(g=>g.toolCallId!==c),{toolCallId:c,toolName:"MCP Content",arguments:JSON.stringify({serverName:e.serverName,contentKind:e.contentKind,added:i,removed:r,updated:d}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:`MCP ${String(e.contentKind)} r${String(e.revision)}: +${i.length} -${r.length} ~${d.length}`}]}))},ut=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=b(o,e.subagentSessionId,a);if(!s)return;const i=`mcp-resource:${String(e.revision)}`;u(s.messageId,s.subagent.id,r=>({toolCalls:[...(r.toolCalls||[]).filter(d=>d.toolCallId!==i),{toolCallId:i,toolName:"MCP Resource",arguments:JSON.stringify({serverName:e.serverName,uri:e.uri}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:`MCP resource updated: ${String(e.uri)}`}]}))},dt=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=b(o,e.subagentSessionId,a);if(!s)return;const i=String(e.phase),r=`mcp-connection:${String(e.revision)}`;u(s.messageId,s.subagent.id,d=>({toolCalls:[...(d.toolCalls||[]).filter(c=>c.toolCallId!==r),{toolCallId:r,toolName:"MCP Connection",arguments:JSON.stringify({serverName:e.serverName,phase:i,reason:e.reason,attempt:e.attempt,maxAttempts:e.maxAttempts}),toolKind:"readonly",status:i==="failed"?"error":"success",startTime:Date.now(),summary:`MCP ${String(e.serverName)} ${i}`+(i==="reconnecting"?` (${String(e.attempt)}/${String(e.maxAttempts)})`:""),output:e.error?`Error: ${String(e.error)}`:void 0}]}))},lt=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=b(o,e.subagentSessionId,a);if(!s)return;const i=String(e.level),r=typeof e.logger=="string"?e.logger:void 0,d=`mcp-log:${String(e.revision)}`;u(s.messageId,s.subagent.id,c=>({toolCalls:[...(c.toolCalls||[]).filter(l=>l.toolCallId!==d),{toolCallId:d,toolName:"MCP Log",arguments:JSON.stringify({serverName:e.serverName,level:i,logger:r}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:`MCP ${i} · ${String(e.serverName)}`+(r?` · ${r}`:""),output:[String(e.message),`SHA-256: ${String(e.dataSha256)}`,e.truncated===!0?"Truncated":"",e.detailsOmitted===!0?"Details omitted by runtime policy":""].filter(Boolean).join(`
|
|
19
19
|
`)}]}))},ct=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=b(o,e.subagentSessionId,a);if(!s)return;const i=String(e.serverName),r=String(e.action),d=`mcp-instructions:${String(e.revision)}:${i}:${r}`;u(s.messageId,s.subagent.id,c=>({toolCalls:[...(c.toolCalls||[]).filter(l=>l.toolCallId!==d),{toolCallId:d,toolName:"MCP Instructions",arguments:JSON.stringify({serverName:i,action:r,reason:e.reason}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:`MCP instructions ${r}: ${i}`+(e.truncated===!0?" (truncated)":""),output:[typeof e.text=="string"?e.text:"",e.sha256?`SHA-256: ${String(e.sha256)}`:"",e.detailsOmitted===!0?"Details omitted by runtime policy":""].filter(Boolean).join(`
|
|
20
20
|
`)}]}))},gt=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=b(o,e.subagentSessionId,a);if(!s)return;const i=String(e.taskId),r=String(e.status),d=`mcp-task:${i}`;u(s.messageId,s.subagent.id,c=>({toolCalls:[...(c.toolCalls||[]).filter(l=>l.toolCallId!==d),{toolCallId:d,toolName:"MCP Task",arguments:JSON.stringify({taskId:i,serverName:e.serverName,toolName:e.toolName}),toolKind:"readonly",status:r==="failed"||r==="cancelled"?"error":r==="completed"?"success":"running",startTime:Number(e.createdAt)||Date.now(),summary:`MCP task ${r}: ${i} · ${String(e.serverName)}/${String(e.toolName)}`,output:[typeof e.statusMessage=="string"?e.statusMessage:"",e.hasResult===!0?"Result available via TaskOutput":"",typeof e.error=="string"?`Error: ${e.error}`:""].filter(Boolean).join(`
|
|
21
21
|
`)}]}))},mt=(e,t)=>{const{currentSessionId:n,currentAssistantMessageId:a,messages:o,updateSubagent:u}=t();if(e.sessionId!==n)return;const s=b(o,e.subagentSessionId,a);if(!s)return;const i=Array.isArray(e.files)?e.files.filter(d=>!!d&&typeof d=="object"&&!Array.isArray(d)):[],r=`project-rules:${i.map(d=>String(d.id)).join(",")}`;u(s.messageId,s.subagent.id,d=>({toolCalls:[...(d.toolCalls||[]).filter(c=>c.toolCallId!==r),{toolCallId:r,toolName:"Project Rules",arguments:JSON.stringify({triggerPaths:e.triggerPaths,blockedWrite:e.blockedWrite}),toolKind:"readonly",status:"success",startTime:Date.now(),summary:`Project rules loaded: ${i.length}`,output:i.map(c=>`${String(c.relativePath)} ${String(c.source)} SHA-256: ${String(c.contentSha256)}`).join(`
|
|
22
|
-
`)}]}))},ft=(e,t,n)=>{const{currentSessionId:a,setConfirmation:o}=t();if(e.sessionId!==a)return;const u=e.requestId||"",s=v(t,n,u?`assistant-permission-${u}`:void 0);if(!s)return;const i=e.details,r=e.toolName||(i==null?void 0:i.toolName)||"Tool";o(s,{toolCallId:u,toolName:r,description:e.description,diff:(i==null?void 0:i.details)||(i==null?void 0:i.diff)||"",allowRemember:(i==null?void 0:i.type)!=="mcpSampling",status:"pending"}),n(d=>({agentPhase:"waiting_permission",isStreaming:!0,sessions:d.sessions.map(c=>c.sessionId===e.sessionId&&c.projectPath===e.projectPath?{...c,pendingInteraction:{type:"permission",requestId:u}}:c)}))},It=(e,t,n)=>{var I,m;const{currentSessionId:a,currentSessionRef:o,messages:u,setConfirmation:s,setElicitation:i}=t();if(e.sessionId!==a)return;const r=e.requestId,d=u.find(S=>{var y,h;return((h=(y=S.agentContent)==null?void 0:y.confirmation)==null?void 0:h.toolCallId)===r}),c=(I=d==null?void 0:d.agentContent)==null?void 0:I.confirmation;d&&(c==null?void 0:c.status)==="pending"&&s(d.id,{...c,status:"denied"});const l=u.find(S=>{var y,h;return((h=(y=S.agentContent)==null?void 0:y.elicitation)==null?void 0:h.toolCallId)===r}),g=(m=l==null?void 0:l.agentContent)==null?void 0:m.elicitation;l&&(g==null?void 0:g.status)==="pending"&&i(l.id,{...g,status:"cancelled"}),n({agentPhase:"running",error:"Permission request timed out",errorContext:{kind:"interaction",...o?{sessionRef:o}:{}}})},ae=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",isStreaming:!0})},St=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:e.reason==="context_limit"?"recovering_context":"compacting"})},ht=(e,t,n)=>{e.sessionId===t().currentSessionId&&(t().resetContextUsage(),n({agentPhase:"running"}))},yt=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"switching_model",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null})},Ct=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",providerAdmission:e.phase==="queued"?e:null})},bt=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",providerCircuit:e.phase==="closed"?null:e})},vt=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",providerRetry:e.phase==="recovered"?null:e})},At=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",providerStall:e.phase==="detected"?e:null})},kt=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",actionStationarity:e.phase==="recovered"?null:e})},Tt=(e,t,n)=>{const{currentSessionId:a,setQuestion:o}=t();if(e.sessionId!==a)return;const u=e.requestId||e.toolCallId||"",s=v(t,n,u?`assistant-question-${u}`:void 0);s&&(o(s,{toolCallId:u,questions:e.questions,status:"pending"}),n(i=>({agentPhase:"waiting_permission",isStreaming:!0,sessions:i.sessions.map(r=>r.sessionId===e.sessionId&&r.projectPath===e.projectPath?{...r,pendingInteraction:{type:"question",requestId:u}}:r)})))},$t=(e,t,n)=>{const{currentSessionId:a,setElicitation:o}=t();if(e.sessionId!==a)return;const u=e.requestId||e.toolCallId||"",s=v(t,n,u?`assistant-elicitation-${u}`:void 0),i=e.elicitation;!s||!i||(o(s,{toolCallId:u,details:i,status:"pending"}),n(r=>({agentPhase:"waiting_permission",isStreaming:!0,sessions:r.sessions.map(d=>d.sessionId===e.sessionId&&d.projectPath===e.projectPath?{...d,pendingInteraction:{type:"elicitation",requestId:u}}:d)})))},Nt=(e,t,n)=>{const{currentSessionId:a}=t();if(e.sessionId!==a)return;const o=e.requestId;n(u=>({agentPhase:"running",sessions:u.sessions.map(s=>{var i;return s.sessionId===e.sessionId&&s.projectPath===e.projectPath&&((i=s.pendingInteraction)==null?void 0:i.requestId)===o?{...s,pendingInteraction:void 0}:s})}))},Y=(e,t)=>{const n=t().currentSessionRef;n&&e.sessionId===n.sessionId&&e.projectPath===n.projectPath&&t().resyncSessionMessages(n)},Pt=(e,t)=>{const{currentSessionId:n,currentSessionRef:a,endAgentResponse:o}=t();e.sessionId!==n||!a||e.projectPath!==a.projectPath||(o(),Y(e,t))},re=(e,t)=>{const n=t().currentSessionRef;!n||e.sessionId!==n.sessionId||e.projectPath!==n.projectPath||t().endAgentResponse()},Mt=(e,t,n)=>{const{currentSessionId:a,currentSessionRef:o,endAgentResponse:u}=t();if(e.sessionId!==a)return;const s=e.taskFailure&&typeof e.taskFailure=="object"&&!Array.isArray(e.taskFailure)?e.taskFailure:void 0,i=Re(s==null?void 0:s.code);n({agentPhase:"error",error:e.error||"An error occurred",errorContext:{kind:"execution",...o?{sessionRef:o}:{},...i?{failureCode:i}:{}}}),u(),Y(e,t)},Rt=(e,t,n)=>{const{currentSessionId:a}=t();if(e.sessionId===a)if(e.status==="idle")n({isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0});else if(e.status==="queued"||e.status==="running"||e.status==="waiting_permission"){const o=typeof e.queued=="number"?Math.max(0,e.queued):0;n({isStreaming:!0,agentPhase:e.status==="waiting_permission"?"waiting_permission":"running",currentRunId:typeof e.runId=="string"?e.runId:t().currentRunId,pendingSteeringCount:o,pendingInputDelivery:o>0&&(e.pendingInputDelivery==="current_turn"||e.pendingInputDelivery==="next_turn")?e.pendingInputDelivery:null,recoveredSteeringCount:typeof e.recovered=="number"?Math.max(0,e.recovered):t().recoveredSteeringCount})}else e.status==="error"&&n({isStreaming:!1,isStopping:!1,agentPhase:"error",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null})},xt=(e,t,n)=>{const{currentSessionId:a,endAgentResponse:o,messages:u,updateSubagent:s}=t();if(e.sessionId===a){n(i=>({isStreaming:!1,agentPhase:"idle",messages:i.messages.map(r=>{var c;const d=(c=r.agentContent)==null?void 0:c.elicitation;return(d==null?void 0:d.status)!=="pending"||!r.agentContent?r:{...r,agentContent:{...r.agentContent,elicitation:{...d,status:"cancelled"}}}})}));for(const i of u)for(const r of N(i.agentContent))r.status==="running"&&s(i.id,r.id,{status:"failed"});o(),Y(e,t)}},Se=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({pendingSteeringCount:typeof e.queued=="number"?Math.max(0,e.queued):1,pendingInputDelivery:"current_turn"})},he=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({pendingSteeringCount:typeof e.queued=="number"?Math.max(0,e.queued):1,pendingInputDelivery:"next_turn"})},Dt=(e,t,n)=>{if(typeof e.childSessionId=="string"){const a={...e,subagentSessionId:e.childSessionId,success:e.status==="completed"};b(t().messages,e.childSessionId,t().currentAssistantMessageId)?W(a,t):je(e.childSessionId,a,n)}e.delivery==="current_turn"?Se(e,t,n):he(e,t,n)},wt=(e,t,n)=>{if(e.sessionId!==t().currentSessionId)return;const a=typeof e.queued=="number"?Math.max(0,e.queued):0;n({pendingSteeringCount:a,pendingInputDelivery:a>0?t().pendingInputDelivery:null,recoveredSteeringCount:typeof e.recovered=="number"?Math.max(0,e.recovered):t().recoveredSteeringCount})},jt=(e,t,n)=>{if(e.sessionId!==t().currentSessionId)return;const a=typeof e.queued=="number"?Math.max(0,e.queued):0;n({agentPhase:"running",pendingSteeringCount:a,pendingInputDelivery:a>0?"current_turn":null,recoveredSteeringCount:typeof e.recovered=="number"?Math.max(0,e.recovered):t().recoveredSteeringCount})},_t=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({goal:e.goal??null})},qt=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({goal:null})},Ft=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({goal:e.goal??t().goal,isStreaming:!0,agentPhase:"running"})},Ot=(e,t,n)=>{if(e.sessionId!==t().currentSessionId||!Array.isArray(e.messages))return;const a=Date.now(),o=e.messages.flatMap((u,s)=>{if(typeof u!="object"||u===null)return[];const i=u;return!["user","assistant","system","tool"].includes(String(i.role))||!Array.isArray(i.content)&&typeof i.content!="string"?[]:[{id:`rewind-${s}-${a}`,role:i.role,content:i.content,timestamp:a+s,metadata:typeof i.metadata=="object"&&i.metadata!==null?i.metadata:void 0,thinkingContent:typeof i.thinkingContent=="string"?i.thinkingContent:typeof i.reasoningContent=="string"?i.reasoningContent:void 0,tool_call_id:typeof i.tool_call_id=="string"?i.tool_call_id:void 0,name:typeof i.name=="string"?i.name:void 0,tool_calls:i.tool_calls}]});n({messages:Pe(o),isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,currentAssistantMessageId:null,hasToolCalls:!1})},Et=(e,t,n)=>{const a=t().currentSessionRef;if(!a||e.sessionId!==a.sessionId||e.projectPath!==a.projectPath)return;const o=e.status,u=o==="completed"||o==="stale"?"completed":o==="aborted"?"cancelled":o==="interrupted"?"interrupted":"failed";n(s=>({sessions:s.sessions.map(i=>i.sessionId===a.sessionId&&i.projectPath===a.projectPath?{...i,taskStatus:u,taskStatusReason:void 0,taskFailure:void 0,taskCompletedAt:new Date().toISOString()}:i)})),t().selectSession(a)},Vt=(e,t,n)=>{ge({...e,messageId:`review-${String(e.reviewId??"active")}`,arguments:"{}"},t,n)},Kt=(e,t,n)=>{fe(e,t)},Bt=(e,t,n)=>{Ie(e,t,n)},j={"message.created":_e,"message.delta":qe,"message.complete":Fe,"structured.output":Oe,"thinking.delta":Ee,"thinking.completed":Ve,"tool.start":ge,"tool.progress":fe,"tool.result":Ie,"mcp.catalog.changed":Ke,"mcp.content.changed":Be,"mcp.resource.updated":Ue,"mcp.connection.changed":Je,"mcp.log":Le,"mcp.instructions.changed":He,"mcp.task.changed":Ge,"project.rules.loaded":Qe,"user.shell.started":ze,"user.shell.output":We,"user.shell.completed":Ye,"token.usage":Xe,"task.updated":Ze,"subagent.start":pe,"subagent.update":et,"subagent.delta":tt,"subagent.thinking.delta":nt,"subagent.tool.start":st,"subagent.tool.progress":ot,"subagent.tool.result":it,"subagent.mcp.catalog.changed":at,"subagent.mcp.content.changed":rt,"subagent.mcp.resource.updated":ut,"subagent.mcp.connection.changed":dt,"subagent.mcp.log":lt,"subagent.mcp.instructions.changed":ct,"subagent.mcp.task.changed":gt,"subagent.project.rules.loaded":mt,"subagent.complete":W,"subagent.completion.queued":Dt,"permission.asked":ft,"permission.timeout":It,"turn.started":ae,"committed.turn_started":ae,"committed.turn_completed":re,"committed.turn_aborted":re,"provider.admission":Ct,"provider.circuit":bt,"provider.retry":vt,"provider.stall":At,"action.stationarity":kt,"compaction.started":St,"compaction.completed":ht,"model.fallback":yt,"question.required":Tt,"elicitation.required":$t,"interaction.resolved":Nt,"session.completed":Pt,"session.error":Mt,"session.status":Rt,"run.cancelled":xt,"steering.queued":Se,"follow_up.queued":he,"follow_up.started":jt,"steering.applied":wt,"goal.updated":_t,"goal.cleared":qt,"goal.continuation.started":Ft,"session.rewound":Ot,"review.tool.started":Vt,"review.tool.progress":Kt,"review.tool.completed":Bt,"review.completed":Et},Ut=new Set(["message.complete","thinking.completed","session.completed","session.error","run.cancelled","committed.turn_completed","committed.turn_aborted"]),Gt=(e,t)=>n=>{const a=e().currentSessionRef,o=n.properties;if(!a||o.sessionId!==a.sessionId||o.projectPath!==a.projectPath)return;if(Ut.has(n.type)){$.drainAll();const s=j[n.type];s&&s(n.properties,e,t);return}if(n.type==="tool.start"&&$.drainAll(),n.type==="message.delta"){const{currentSessionId:s,currentAssistantMessageId:i,hasToolCalls:r}=e();if(o.sessionId!==s)return;const d=o.messageId||i,c=o.delta;if(!i){const I=j["message.delta"];I&&I(o,e,t);return}const l=r?"after":"before",g=`content:${d}:${l}`;$.drainAllExcept(g),$.append(g,c,I=>{const{appendDelta:m}=e();d&&m(d,I,l)});return}if(n.type==="thinking.delta"){const{currentSessionId:s,currentAssistantMessageId:i}=e();if(o.sessionId!==s)return;if(!i){const l=j["thinking.delta"];l&&l(o,e,t);return}const r=o.delta,d=o.messageId||i,c=`thinking:${d}`;$.drainAllExcept(c),$.append(c,r,l=>{const{appendThinking:g}=e();d&&g(d,l)});return}if(n.type==="subagent.delta"){const{currentSessionId:s}=e();if(o.sessionId!==s)return;const i=o.delta;if(!i)return;const r=o.subagentSessionId||"",d=`subagent:${r}`,{currentAssistantMessageId:c,messages:l}=e(),g=b(l,r||void 0,c);$.append(d,i,I=>{const{currentAssistantMessageId:m,messages:S,updateSubagent:y}=e(),h=g||b(S,r||void 0,m);h&&y(h.messageId,h.subagent.id,f=>({sessionId:f.sessionId||r,output:(f.output||"")+I}))});return}if(n.type==="subagent.thinking.delta"){const{currentSessionId:s}=e();if(o.sessionId!==s)return;const i=o.delta;if(!i)return;const r=o.subagentSessionId||"",d=`subagent-thinking:${r}`,{currentAssistantMessageId:c,messages:l}=e(),g=b(l,r||void 0,c);$.append(d,i,I=>{const{currentAssistantMessageId:m,messages:S,updateSubagent:y}=e(),h=g||b(S,r||void 0,m);h&&y(h.messageId,h.subagent.id,f=>({sessionId:f.sessionId||r,thinking:(f.thinking||"")+I}))});return}const u=j[n.type];u&&u(n.properties,e,t)};export{ve as a,oe as b,P as c,be as d,Pe as e,Gt as f,N as g,$ as h,Re as i,Ht as j,Ae as k,_ as l,Lt as t,ue as u,U as w};
|
|
22
|
+
`)}]}))},ft=(e,t,n)=>{const{currentSessionId:a,setConfirmation:o}=t();if(e.sessionId!==a)return;const u=e.requestId||"",s=v(t,n,u?`assistant-permission-${u}`:void 0);if(!s)return;const i=e.details,r=e.toolName||(i==null?void 0:i.toolName)||"Tool";o(s,{toolCallId:u,toolName:r,description:e.description,diff:(i==null?void 0:i.details)||(i==null?void 0:i.diff)||"",allowRemember:(i==null?void 0:i.type)!=="mcpSampling",status:"pending"}),n(d=>({agentPhase:"waiting_permission",isStreaming:!0,sessions:d.sessions.map(c=>c.sessionId===e.sessionId&&c.projectPath===e.projectPath?{...c,pendingInteraction:{type:"permission",requestId:u}}:c)}))},It=(e,t,n)=>{var I,m;const{currentSessionId:a,currentSessionRef:o,messages:u,setConfirmation:s,setElicitation:i}=t();if(e.sessionId!==a)return;const r=e.requestId,d=u.find(S=>{var y,h;return((h=(y=S.agentContent)==null?void 0:y.confirmation)==null?void 0:h.toolCallId)===r}),c=(I=d==null?void 0:d.agentContent)==null?void 0:I.confirmation;d&&(c==null?void 0:c.status)==="pending"&&s(d.id,{...c,status:"denied"});const l=u.find(S=>{var y,h;return((h=(y=S.agentContent)==null?void 0:y.elicitation)==null?void 0:h.toolCallId)===r}),g=(m=l==null?void 0:l.agentContent)==null?void 0:m.elicitation;l&&(g==null?void 0:g.status)==="pending"&&i(l.id,{...g,status:"cancelled"}),n({agentPhase:"running",error:"Permission request timed out",errorContext:{kind:"interaction",...o?{sessionRef:o}:{}}})},ae=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",isStreaming:!0})},St=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:e.reason==="context_limit"?"recovering_context":"compacting"})},ht=(e,t,n)=>{e.sessionId===t().currentSessionId&&(t().resetContextUsage(),n({agentPhase:"running"}))},yt=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"switching_model",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null})},Ct=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",providerAdmission:e.phase==="queued"?e:null})},bt=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",providerCircuit:e.phase==="closed"?null:e})},vt=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",providerRetry:e.phase==="recovered"?null:e})},At=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",providerStall:e.phase==="detected"?e:null})},kt=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({agentPhase:"running",actionStationarity:e.phase==="recovered"?null:e})},Tt=(e,t,n)=>{const{currentSessionId:a,setQuestion:o}=t();if(e.sessionId!==a)return;const u=e.requestId||e.toolCallId||"",s=v(t,n,u?`assistant-question-${u}`:void 0);s&&(o(s,{toolCallId:u,questions:e.questions,status:"pending"}),n(i=>({agentPhase:"waiting_permission",isStreaming:!0,sessions:i.sessions.map(r=>r.sessionId===e.sessionId&&r.projectPath===e.projectPath?{...r,pendingInteraction:{type:"question",requestId:u}}:r)})))},$t=(e,t,n)=>{const{currentSessionId:a,setElicitation:o}=t();if(e.sessionId!==a)return;const u=e.requestId||e.toolCallId||"",s=v(t,n,u?`assistant-elicitation-${u}`:void 0),i=e.elicitation;!s||!i||(o(s,{toolCallId:u,details:i,status:"pending"}),n(r=>({agentPhase:"waiting_permission",isStreaming:!0,sessions:r.sessions.map(d=>d.sessionId===e.sessionId&&d.projectPath===e.projectPath?{...d,pendingInteraction:{type:"elicitation",requestId:u}}:d)})))},Nt=(e,t,n)=>{const{currentSessionId:a}=t();if(e.sessionId!==a)return;const o=e.requestId;n(u=>({agentPhase:"running",sessions:u.sessions.map(s=>{var i;return s.sessionId===e.sessionId&&s.projectPath===e.projectPath&&((i=s.pendingInteraction)==null?void 0:i.requestId)===o?{...s,pendingInteraction:void 0}:s})}))},Y=(e,t)=>{const n=t().currentSessionRef;n&&e.sessionId===n.sessionId&&e.projectPath===n.projectPath&&t().resyncSessionMessages(n)},Pt=(e,t)=>{const{currentSessionId:n,currentSessionRef:a,endAgentResponse:o}=t();e.sessionId!==n||!a||e.projectPath!==a.projectPath||(o(),Y(e,t))},re=(e,t)=>{const n=t().currentSessionRef;!n||e.sessionId!==n.sessionId||e.projectPath!==n.projectPath||t().endAgentResponse()},Mt=(e,t,n)=>{const{currentSessionId:a,currentSessionRef:o,endAgentResponse:u}=t();if(e.sessionId!==a)return;const s=e.taskFailure&&typeof e.taskFailure=="object"&&!Array.isArray(e.taskFailure)?e.taskFailure:void 0,i=Re(s==null?void 0:s.code);n({agentPhase:"error",error:e.error||"An error occurred",errorContext:{kind:"execution",...o?{sessionRef:o}:{},...i?{failureCode:i}:{}}}),u(),Y(e,t)},Rt=(e,t,n)=>{const{currentSessionId:a}=t();if(e.sessionId===a)if(e.status==="idle")n({isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0});else if(e.status==="queued"||e.status==="running"||e.status==="waiting_permission"){const o=typeof e.queued=="number"?Math.max(0,e.queued):0;n({isStreaming:!0,agentPhase:e.status==="waiting_permission"?"waiting_permission":"running",currentRunId:typeof e.runId=="string"?e.runId:t().currentRunId,pendingSteeringCount:o,pendingInputDelivery:o>0&&(e.pendingInputDelivery==="current_turn"||e.pendingInputDelivery==="next_turn")?e.pendingInputDelivery:null,recoveredSteeringCount:typeof e.recovered=="number"?Math.max(0,e.recovered):t().recoveredSteeringCount})}else e.status==="error"&&n({isStreaming:!1,isStopping:!1,agentPhase:"error",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null})},xt=(e,t,n)=>{const{currentSessionId:a,endAgentResponse:o,messages:u,updateSubagent:s}=t();if(e.sessionId===a){n(i=>({isStreaming:!1,agentPhase:"idle",messages:i.messages.map(r=>{var c;const d=(c=r.agentContent)==null?void 0:c.elicitation;return(d==null?void 0:d.status)!=="pending"||!r.agentContent?r:{...r,agentContent:{...r.agentContent,elicitation:{...d,status:"cancelled"}}}})}));for(const i of u)for(const r of N(i.agentContent))r.status==="running"&&s(i.id,r.id,{status:"failed"});o(),Y(e,t)}},Se=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({pendingSteeringCount:typeof e.queued=="number"?Math.max(0,e.queued):1,pendingInputDelivery:"current_turn"})},he=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({pendingSteeringCount:typeof e.queued=="number"?Math.max(0,e.queued):1,pendingInputDelivery:"next_turn"})},Dt=(e,t,n)=>{if(typeof e.childSessionId=="string"){const a={...e,subagentSessionId:e.childSessionId,success:e.status==="completed"};b(t().messages,e.childSessionId,t().currentAssistantMessageId)?z(a,t):je(e.childSessionId,a,n)}e.delivery==="current_turn"?Se(e,t,n):he(e,t,n)},wt=(e,t,n)=>{if(e.sessionId!==t().currentSessionId)return;const a=typeof e.queued=="number"?Math.max(0,e.queued):0;n({pendingSteeringCount:a,pendingInputDelivery:a>0?t().pendingInputDelivery:null,recoveredSteeringCount:typeof e.recovered=="number"?Math.max(0,e.recovered):t().recoveredSteeringCount})},jt=(e,t,n)=>{if(e.sessionId!==t().currentSessionId)return;const a=typeof e.queued=="number"?Math.max(0,e.queued):0;n({agentPhase:"running",pendingSteeringCount:a,pendingInputDelivery:a>0?"current_turn":null,recoveredSteeringCount:typeof e.recovered=="number"?Math.max(0,e.recovered):t().recoveredSteeringCount})},_t=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({goal:e.goal??null})},qt=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({goal:null})},Ft=(e,t,n)=>{e.sessionId===t().currentSessionId&&n({goal:e.goal??t().goal,isStreaming:!0,agentPhase:"running"})},Ot=(e,t,n)=>{if(e.sessionId!==t().currentSessionId||!Array.isArray(e.messages))return;const a=Date.now(),o=e.messages.flatMap((u,s)=>{if(typeof u!="object"||u===null)return[];const i=u;return!["user","assistant","system","tool"].includes(String(i.role))||!Array.isArray(i.content)&&typeof i.content!="string"?[]:[{id:`rewind-${s}-${a}`,role:i.role,content:i.content,timestamp:a+s,metadata:typeof i.metadata=="object"&&i.metadata!==null?i.metadata:void 0,thinkingContent:typeof i.thinkingContent=="string"?i.thinkingContent:typeof i.reasoningContent=="string"?i.reasoningContent:void 0,tool_call_id:typeof i.tool_call_id=="string"?i.tool_call_id:void 0,name:typeof i.name=="string"?i.name:void 0,tool_calls:i.tool_calls}]});n({messages:Pe(o),isStreaming:!1,isStopping:!1,agentPhase:"idle",providerAdmission:null,providerCircuit:null,providerRetry:null,providerStall:null,actionStationarity:null,currentRunId:null,pendingSteeringCount:0,pendingInputDelivery:null,recoveredSteeringCount:0,currentAssistantMessageId:null,hasToolCalls:!1})},Et=(e,t,n)=>{const a=t().currentSessionRef;if(!a||e.sessionId!==a.sessionId||e.projectPath!==a.projectPath)return;const o=e.status,u=o==="completed"||o==="stale"?"completed":o==="aborted"?"cancelled":o==="interrupted"?"interrupted":"failed";n(s=>({sessions:s.sessions.map(i=>i.sessionId===a.sessionId&&i.projectPath===a.projectPath?{...i,taskStatus:u,taskStatusReason:void 0,taskFailure:void 0,taskCompletedAt:new Date().toISOString()}:i)})),t().selectSession(a)},Vt=(e,t,n)=>{ge({...e,messageId:`review-${String(e.reviewId??"active")}`,arguments:"{}"},t,n)},Kt=(e,t,n)=>{fe(e,t)},Bt=(e,t,n)=>{Ie(e,t,n)},Ut=(e,t)=>{const n=t().currentSessionRef;n&&queueMicrotask(()=>void t().loadTeams(n))},j={"message.created":_e,"message.delta":qe,"message.complete":Fe,"structured.output":Oe,"thinking.delta":Ee,"thinking.completed":Ve,"tool.start":ge,"tool.progress":fe,"tool.result":Ie,"mcp.catalog.changed":Ke,"mcp.content.changed":Be,"mcp.resource.updated":Ue,"mcp.connection.changed":Je,"mcp.log":Le,"mcp.instructions.changed":He,"mcp.task.changed":Ge,"project.rules.loaded":Qe,"user.shell.started":We,"user.shell.output":ze,"user.shell.completed":Ye,"token.usage":pe,"task.updated":Xe,"subagent.start":Ze,"subagent.update":et,"subagent.delta":tt,"subagent.thinking.delta":nt,"subagent.tool.start":st,"subagent.tool.progress":ot,"subagent.tool.result":it,"subagent.mcp.catalog.changed":at,"subagent.mcp.content.changed":rt,"subagent.mcp.resource.updated":ut,"subagent.mcp.connection.changed":dt,"subagent.mcp.log":lt,"subagent.mcp.instructions.changed":ct,"subagent.mcp.task.changed":gt,"subagent.project.rules.loaded":mt,"subagent.complete":z,"subagent.completion.queued":Dt,"permission.asked":ft,"permission.timeout":It,"turn.started":ae,"committed.turn_started":ae,"committed.turn_completed":re,"committed.turn_aborted":re,"provider.admission":Ct,"provider.circuit":bt,"provider.retry":vt,"provider.stall":At,"action.stationarity":kt,"compaction.started":St,"compaction.completed":ht,"model.fallback":yt,"question.required":Tt,"elicitation.required":$t,"interaction.resolved":Nt,"session.completed":Pt,"session.error":Mt,"session.status":Rt,"run.cancelled":xt,"steering.queued":Se,"follow_up.queued":he,"follow_up.started":jt,"steering.applied":wt,"goal.updated":_t,"goal.cleared":qt,"goal.continuation.started":Ft,"session.rewound":Ot,"review.tool.started":Vt,"review.tool.progress":Kt,"review.tool.completed":Bt,"review.completed":Et},Jt=new Set(["message.complete","thinking.completed","session.completed","session.error","run.cancelled","committed.turn_completed","committed.turn_aborted"]),Qt=(e,t)=>n=>{const a=e().currentSessionRef,o=n.properties;if(!a||o.sessionId!==a.sessionId||o.projectPath!==a.projectPath)return;if(n.type.startsWith("team.")){Ut(o,e);return}if(Jt.has(n.type)){$.drainAll();const s=j[n.type];s&&s(n.properties,e,t);return}if(n.type==="tool.start"&&$.drainAll(),n.type==="message.delta"){const{currentSessionId:s,currentAssistantMessageId:i,hasToolCalls:r}=e();if(o.sessionId!==s)return;const d=o.messageId||i,c=o.delta;if(!i){const I=j["message.delta"];I&&I(o,e,t);return}const l=r?"after":"before",g=`content:${d}:${l}`;$.drainAllExcept(g),$.append(g,c,I=>{const{appendDelta:m}=e();d&&m(d,I,l)});return}if(n.type==="thinking.delta"){const{currentSessionId:s,currentAssistantMessageId:i}=e();if(o.sessionId!==s)return;if(!i){const l=j["thinking.delta"];l&&l(o,e,t);return}const r=o.delta,d=o.messageId||i,c=`thinking:${d}`;$.drainAllExcept(c),$.append(c,r,l=>{const{appendThinking:g}=e();d&&g(d,l)});return}if(n.type==="subagent.delta"){const{currentSessionId:s}=e();if(o.sessionId!==s)return;const i=o.delta;if(!i)return;const r=o.subagentSessionId||"",d=`subagent:${r}`,{currentAssistantMessageId:c,messages:l}=e(),g=b(l,r||void 0,c);$.append(d,i,I=>{const{currentAssistantMessageId:m,messages:S,updateSubagent:y}=e(),h=g||b(S,r||void 0,m);h&&y(h.messageId,h.subagent.id,f=>({sessionId:f.sessionId||r,output:(f.output||"")+I}))});return}if(n.type==="subagent.thinking.delta"){const{currentSessionId:s}=e();if(o.sessionId!==s)return;const i=o.delta;if(!i)return;const r=o.subagentSessionId||"",d=`subagent-thinking:${r}`,{currentAssistantMessageId:c,messages:l}=e(),g=b(l,r||void 0,c);$.append(d,i,I=>{const{currentAssistantMessageId:m,messages:S,updateSubagent:y}=e(),h=g||b(S,r||void 0,m);h&&y(h.messageId,h.subagent.id,f=>({sessionId:f.sessionId||r,thinking:(f.thinking||"")+I}))});return}const u=j[n.type];u&&u(n.properties,e,t)};export{ve as a,oe as b,P as c,be as d,Pe as e,Qt as f,N as g,$ as h,Re as i,Gt as j,Ae as k,_ as l,Ht as t,ue as u,U as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const s={title:"Agent team",members:"members",tasks:"tasks",noTasks:"No tasks",expand:"Expand team",collapse:"Collapse team",delete:"Delete team",worktree:"Isolated worktree",recipient:"Message recipient",broadcast:"Everyone",messagePlaceholder:"Message teammate...",send:"Send team message",actionFailed:"Team action failed",settingsTitle:"Agent Teams",settingsHint:"Enable shared task graphs, teammate worktrees, and peer messaging"},a={en:s,zh:{title:"智能体团队",members:"成员",tasks:"任务",noTasks:"暂无任务",expand:"展开团队",collapse:"收起团队",delete:"删除团队",worktree:"隔离工作树",recipient:"消息收件人",broadcast:"所有成员",messagePlaceholder:"发送团队消息…",send:"发送团队消息",actionFailed:"团队操作失败",settingsTitle:"Agent Teams",settingsHint:"启用共享任务图、成员 worktree 与点对点消息"}};function n(e,t){return a[e][t]}export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as e,T as t,U as r,x as s,V as m}from"./index-gjBOFzd1.js";import"./vendor-react-DG5dkZ_t.js";import"./vendor-radix-DXRuAJHH.js";import"./vendor-icons-DovdPN7M.js";import"./session-events-Bgir_Gl_.js";const p=e(t.Object({id:t.String(),name:t.String(),subagentType:t.String(),description:t.String(),agentId:t.Optional(t.String()),status:r(["leader","running","completed","failed","cancelled","unknown"]),result:t.Optional(t.Unknown()),stats:t.Optional(t.Unknown()),worktreePath:t.Optional(t.String())})),d=e(t.Object({id:t.String(),subject:t.String(),description:t.String(),status:r(["pending","blocked","running","completed"]),owner:t.Optional(t.String()),priority:r(["high","medium","low"]),dependsOn:t.Array(t.String()),blocks:t.Array(t.String()),result:t.Optional(t.String()),createdAt:t.String(),startedAt:t.Optional(t.String()),completedAt:t.Optional(t.String())})),o=e(t.Object({name:t.String(),description:t.Optional(t.String()),status:r(["idle","running","completed","failed","deleted"]),leadAgentId:t.String(),leadSessionId:t.Optional(t.String()),workspaceRoot:t.Optional(t.String()),peerMessagingEnabled:t.Boolean(),createdAt:t.Number(),updatedAt:t.Number(),deletedAt:t.Optional(t.Number()),members:t.Array(p),tasks:t.Array(d)}));e(t.Object({sessionId:t.String({minLength:1}),projectPath:t.String({minLength:1}),name:t.String({minLength:1}),description:t.Optional(t.String()),leadAgentType:t.Optional(t.String()),peerMessagingEnabled:t.Optional(t.Boolean()),members:t.Array(t.Object({name:t.String({minLength:1}),subagentType:t.String({minLength:1}),description:t.Optional(t.String()),prompt:t.String({minLength:10,maxLength:32*1024})}),{maxItems:32}),tasks:t.Optional(t.Array(t.Object({subject:t.String({minLength:1}),description:t.String({minLength:1}),dependsOn:t.Optional(t.Array(t.String())),assignedTo:t.Optional(t.String()),priority:t.Optional(r(["high","medium","low"]))}),{maxItems:256}))}));e(t.Object({sessionId:t.String({minLength:1}),projectPath:t.String({minLength:1}),to:t.String({minLength:1}),message:t.String({minLength:1,maxLength:32*1024})}));e(t.Object({sessionId:t.String({minLength:1}),projectPath:t.String({minLength:1}),memberId:t.String({minLength:1})}));const S=t.Array(o),b={list:async n=>{const i=new URLSearchParams({sessionId:n.sessionId,projectPath:n.projectPath});return m(S,await s(`/teams?${i.toString()}`))},sendMessage:async(n,i,a,g)=>{await s(`/teams/${encodeURIComponent(i)}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n.sessionId,projectPath:n.projectPath,to:a,message:g})})},delete:async(n,i)=>{const a=new URLSearchParams({sessionId:n.sessionId,projectPath:n.projectPath});return o.parse(await s(`/teams/${encodeURIComponent(i)}?${a.toString()}`,{method:"DELETE"}))}};export{b as teamService};
|
|
@@ -3,12 +3,12 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/var
|
|
6
|
+
*/var M={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
7
7
|
* @license lucide-react v0.300.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const
|
|
11
|
+
*/const x=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),e=(a,r)=>{const c=h.forwardRef(({color:s="currentColor",size:t=24,strokeWidth:k=2,absoluteStrokeWidth:d,className:p="",children:y,...i},l)=>h.createElement("svg",{ref:l,...M,width:t,height:t,stroke:s,strokeWidth:d?Number(k)*24/Number(t):k,className:["lucide",`lucide-${x(a)}`,p].join(" "),...i},[...r.map(([n,o])=>h.createElement(n,o)),...Array.isArray(y)?y:[y]]));return c.displayName=`${a}`,c};/**
|
|
12
12
|
* @license lucide-react v0.300.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
@@ -28,22 +28,22 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const u=e("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
|
|
32
32
|
* @license lucide-react v0.300.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const f=e("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
37
37
|
* @license lucide-react v0.300.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const
|
|
41
|
+
*/const C=e("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
42
42
|
* @license lucide-react v0.300.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const
|
|
46
|
+
*/const q=e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
47
47
|
* @license lucide-react v0.300.0 - ISC
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
@@ -58,12 +58,12 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
58
58
|
*
|
|
59
59
|
* This source code is licensed under the ISC license.
|
|
60
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const
|
|
61
|
+
*/const H=e("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
62
62
|
* @license lucide-react v0.300.0 - ISC
|
|
63
63
|
*
|
|
64
64
|
* This source code is licensed under the ISC license.
|
|
65
65
|
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const
|
|
66
|
+
*/const j=e("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/**
|
|
67
67
|
* @license lucide-react v0.300.0 - ISC
|
|
68
68
|
*
|
|
69
69
|
* This source code is licensed under the ISC license.
|
|
@@ -128,22 +128,22 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const
|
|
131
|
+
*/const U=e("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
132
132
|
* @license lucide-react v0.300.0 - ISC
|
|
133
133
|
*
|
|
134
134
|
* This source code is licensed under the ISC license.
|
|
135
135
|
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const
|
|
136
|
+
*/const B=e("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
137
137
|
* @license lucide-react v0.300.0 - ISC
|
|
138
138
|
*
|
|
139
139
|
* This source code is licensed under the ISC license.
|
|
140
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const
|
|
141
|
+
*/const W=e("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
142
142
|
* @license lucide-react v0.300.0 - ISC
|
|
143
143
|
*
|
|
144
144
|
* This source code is licensed under the ISC license.
|
|
145
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const
|
|
146
|
+
*/const O=e("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/**
|
|
147
147
|
* @license lucide-react v0.300.0 - ISC
|
|
148
148
|
*
|
|
149
149
|
* This source code is licensed under the ISC license.
|
|
@@ -168,17 +168,17 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
168
168
|
*
|
|
169
169
|
* This source code is licensed under the ISC license.
|
|
170
170
|
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const
|
|
171
|
+
*/const Q=e("FileDiff",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);/**
|
|
172
172
|
* @license lucide-react v0.300.0 - ISC
|
|
173
173
|
*
|
|
174
174
|
* This source code is licensed under the ISC license.
|
|
175
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const
|
|
176
|
+
*/const X=e("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
|
|
177
177
|
* @license lucide-react v0.300.0 - ISC
|
|
178
178
|
*
|
|
179
179
|
* This source code is licensed under the ISC license.
|
|
180
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const
|
|
181
|
+
*/const J=e("Files",[["path",{d:"M15.5 2H8.6c-.4 0-.8.2-1.1.5-.3.3-.5.7-.5 1.1v12.8c0 .4.2.8.5 1.1.3.3.7.5 1.1.5h9.8c.4 0 .8-.2 1.1-.5.3-.3.5-.7.5-1.1V6.5L15.5 2z",key:"cennsq"}],["path",{d:"M3 7.6v12.8c0 .4.2.8.5 1.1.3.3.7.5 1.1.5h9.8",key:"ms809a"}],["path",{d:"M15 2v5h5",key:"qq6kwv"}]]);/**
|
|
182
182
|
* @license lucide-react v0.300.0 - ISC
|
|
183
183
|
*
|
|
184
184
|
* This source code is licensed under the ISC license.
|
|
@@ -268,32 +268,37 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
268
268
|
*
|
|
269
269
|
* This source code is licensed under the ISC license.
|
|
270
270
|
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const
|
|
271
|
+
*/const M2=e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
272
272
|
* @license lucide-react v0.300.0 - ISC
|
|
273
273
|
*
|
|
274
274
|
* This source code is licensed under the ISC license.
|
|
275
275
|
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const
|
|
276
|
+
*/const x2=e("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
277
277
|
* @license lucide-react v0.300.0 - ISC
|
|
278
278
|
*
|
|
279
279
|
* This source code is licensed under the ISC license.
|
|
280
280
|
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const v2=e("
|
|
281
|
+
*/const v2=e("MessageSquareWarning",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v2",key:"stiyo7"}],["path",{d:"M12 13h.01",key:"y0uutt"}]]);/**
|
|
282
282
|
* @license lucide-react v0.300.0 - ISC
|
|
283
283
|
*
|
|
284
284
|
* This source code is licensed under the ISC license.
|
|
285
285
|
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const m2=e("
|
|
286
|
+
*/const m2=e("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
287
287
|
* @license lucide-react v0.300.0 - ISC
|
|
288
288
|
*
|
|
289
289
|
* This source code is licensed under the ISC license.
|
|
290
290
|
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const g2=e("
|
|
291
|
+
*/const g2=e("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
292
292
|
* @license lucide-react v0.300.0 - ISC
|
|
293
293
|
*
|
|
294
294
|
* This source code is licensed under the ISC license.
|
|
295
295
|
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const w2=e("
|
|
296
|
+
*/const w2=e("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
297
|
+
* @license lucide-react v0.300.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const u2=e("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"9",x2:"9",y1:"3",y2:"21",key:"13tij5"}]]);/**
|
|
297
302
|
* @license lucide-react v0.300.0 - ISC
|
|
298
303
|
*
|
|
299
304
|
* This source code is licensed under the ISC license.
|
|
@@ -303,7 +308,7 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
303
308
|
*
|
|
304
309
|
* This source code is licensed under the ISC license.
|
|
305
310
|
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const
|
|
311
|
+
*/const C2=e("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
|
|
307
312
|
* @license lucide-react v0.300.0 - ISC
|
|
308
313
|
*
|
|
309
314
|
* This source code is licensed under the ISC license.
|
|
@@ -313,17 +318,17 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
313
318
|
*
|
|
314
319
|
* This source code is licensed under the ISC license.
|
|
315
320
|
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const
|
|
321
|
+
*/const z2=e("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
|
|
317
322
|
* @license lucide-react v0.300.0 - ISC
|
|
318
323
|
*
|
|
319
324
|
* This source code is licensed under the ISC license.
|
|
320
325
|
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const
|
|
326
|
+
*/const b2=e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
322
327
|
* @license lucide-react v0.300.0 - ISC
|
|
323
328
|
*
|
|
324
329
|
* This source code is licensed under the ISC license.
|
|
325
330
|
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const
|
|
331
|
+
*/const H2=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
327
332
|
* @license lucide-react v0.300.0 - ISC
|
|
328
333
|
*
|
|
329
334
|
* This source code is licensed under the ISC license.
|
|
@@ -333,67 +338,67 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
333
338
|
*
|
|
334
339
|
* This source code is licensed under the ISC license.
|
|
335
340
|
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/const
|
|
341
|
+
*/const A2=e("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
|
|
337
342
|
* @license lucide-react v0.300.0 - ISC
|
|
338
343
|
*
|
|
339
344
|
* This source code is licensed under the ISC license.
|
|
340
345
|
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/const
|
|
346
|
+
*/const L2=e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
342
347
|
* @license lucide-react v0.300.0 - ISC
|
|
343
348
|
*
|
|
344
349
|
* This source code is licensed under the ISC license.
|
|
345
350
|
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const
|
|
351
|
+
*/const V2=e("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
347
352
|
* @license lucide-react v0.300.0 - ISC
|
|
348
353
|
*
|
|
349
354
|
* This source code is licensed under the ISC license.
|
|
350
355
|
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/const
|
|
356
|
+
*/const S2=e("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
352
357
|
* @license lucide-react v0.300.0 - ISC
|
|
353
358
|
*
|
|
354
359
|
* This source code is licensed under the ISC license.
|
|
355
360
|
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const
|
|
361
|
+
*/const F2=e("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
357
362
|
* @license lucide-react v0.300.0 - ISC
|
|
358
363
|
*
|
|
359
364
|
* This source code is licensed under the ISC license.
|
|
360
365
|
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const
|
|
366
|
+
*/const D2=e("ShieldAlert",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
362
367
|
* @license lucide-react v0.300.0 - ISC
|
|
363
368
|
*
|
|
364
369
|
* This source code is licensed under the ISC license.
|
|
365
370
|
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const
|
|
371
|
+
*/const P2=e("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
367
372
|
* @license lucide-react v0.300.0 - ISC
|
|
368
373
|
*
|
|
369
374
|
* This source code is licensed under the ISC license.
|
|
370
375
|
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const
|
|
376
|
+
*/const T2=e("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
|
372
377
|
* @license lucide-react v0.300.0 - ISC
|
|
373
378
|
*
|
|
374
379
|
* This source code is licensed under the ISC license.
|
|
375
380
|
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const
|
|
381
|
+
*/const R2=e("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
377
382
|
* @license lucide-react v0.300.0 - ISC
|
|
378
383
|
*
|
|
379
384
|
* This source code is licensed under the ISC license.
|
|
380
385
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const
|
|
386
|
+
*/const Z2=e("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2v0a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12v0a2 2 0 0 1-2-2V7",key:"jon5kx"}]]);/**
|
|
382
387
|
* @license lucide-react v0.300.0 - ISC
|
|
383
388
|
*
|
|
384
389
|
* This source code is licensed under the ISC license.
|
|
385
390
|
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/const
|
|
391
|
+
*/const G2=e("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]);/**
|
|
387
392
|
* @license lucide-react v0.300.0 - ISC
|
|
388
393
|
*
|
|
389
394
|
* This source code is licensed under the ISC license.
|
|
390
395
|
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/const
|
|
396
|
+
*/const E2=e("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
392
397
|
* @license lucide-react v0.300.0 - ISC
|
|
393
398
|
*
|
|
394
399
|
* This source code is licensed under the ISC license.
|
|
395
400
|
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
-
*/const
|
|
401
|
+
*/const U2=e("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
397
402
|
* @license lucide-react v0.300.0 - ISC
|
|
398
403
|
*
|
|
399
404
|
* This source code is licensed under the ISC license.
|
|
@@ -408,14 +413,19 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
408
413
|
*
|
|
409
414
|
* This source code is licensed under the ISC license.
|
|
410
415
|
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
-
*/const O2=e("
|
|
416
|
+
*/const O2=e("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
417
|
+
* @license lucide-react v0.300.0 - ISC
|
|
418
|
+
*
|
|
419
|
+
* This source code is licensed under the ISC license.
|
|
420
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
+
*/const $2=e("WifiOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 4.17-2.65",key:"11utq1"}],["path",{d:"M10.66 5c4.01-.36 8.14.9 11.34 3.76",key:"hxefdu"}],["path",{d:"M16.85 11.25a10 10 0 0 1 2.22 1.68",key:"q734kn"}],["path",{d:"M5 13a10 10 0 0 1 5.24-2.76",key:"piq4yl"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
|
|
412
422
|
* @license lucide-react v0.300.0 - ISC
|
|
413
423
|
*
|
|
414
424
|
* This source code is licensed under the ISC license.
|
|
415
425
|
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/const
|
|
426
|
+
*/const I2=e("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
417
427
|
* @license lucide-react v0.300.0 - ISC
|
|
418
428
|
*
|
|
419
429
|
* This source code is licensed under the ISC license.
|
|
420
430
|
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/const
|
|
431
|
+
*/const K2=e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);export{O as $,f as A,j as B,V as C,W as D,V2 as E,K as F,y2 as G,p2 as H,i2 as I,b as J,k2 as K,o2 as L,g2 as M,A2 as N,I2 as O,q2 as P,w2 as Q,j2 as R,R2 as S,W2 as T,s2 as U,L as V,$2 as W,K2 as X,H as Y,J as Z,w as _,H2 as a,U as a0,C as a1,E2 as a2,C2 as a3,z2 as a4,T as a5,t2 as a6,B2 as a7,x2 as a8,G as a9,d2 as aa,O2 as ab,A as ac,v2 as ad,Q as ae,G2 as af,$ as ag,I as ah,Z2 as ai,q as aj,m as ak,z as al,B as am,l2 as an,S2 as ao,u2 as ap,R as aq,a2 as ar,P as as,m2 as at,u as b,e2 as c,_ as d,Y as e,g as f,h2 as g,F2 as h,b2 as i,n2 as j,U2 as k,L2 as l,c2 as m,D as n,F as o,T2 as p,M2 as q,N as r,E as s,X as t,r2 as u,P2 as v,D2 as w,Z as x,f2 as y,S as z};
|
package/dist/web/index.html
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>BladeCode</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-gjBOFzd1.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DG5dkZ_t.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/vendor-radix-DXRuAJHH.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-icons-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/session-events-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-icons-DovdPN7M.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/session-events-Bgir_Gl_.js">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-8G4ejlcH.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|