blade-code 0.10.34 → 0.10.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blade.js +2 -2
- package/dist/chunk-09qkatb5.js +10 -0
- package/dist/{chunk-jdms602t.js → chunk-0dj2qm8a.js} +1 -1
- package/dist/{chunk-5knt529c.js → chunk-0evyrnx0.js} +2 -2
- package/dist/chunk-0m4s8r87.js +1612 -0
- package/dist/{chunk-sgyk3gq1.js → chunk-1raz6s2b.js} +2 -2
- package/dist/{chunk-64f79ce5.js → chunk-1t8ebwsp.js} +2 -2
- package/dist/{chunk-58gk92k3.js → chunk-250vpvr5.js} +1 -1
- package/dist/{chunk-pnjftj8t.js → chunk-2mvp3rqw.js} +2 -2
- package/dist/chunk-3pxn6gcj.js +1 -0
- package/dist/{chunk-b9y9mc7f.js → chunk-3rjmkaey.js} +1 -1
- package/dist/{chunk-1qj0qms6.js → chunk-4bbnytq5.js} +1 -1
- package/dist/chunk-4f1g8f6q.js +1 -0
- package/dist/{chunk-sexhm0r5.js → chunk-4s0c6tkd.js} +1 -1
- package/dist/{chunk-y9a1jwnv.js → chunk-4vq34v09.js} +2 -2
- package/dist/chunk-515mkr66.js +44 -0
- package/dist/chunk-5c5qh3ab.js +1 -0
- package/dist/{chunk-pgy1mtgw.js → chunk-5cgyevqj.js} +1 -1
- package/dist/chunk-5vkxcjn1.js +1 -0
- package/dist/chunk-5xc50n8e.js +1 -0
- package/dist/{chunk-dvf4cfye.js → chunk-6360fg4j.js} +1 -1
- package/dist/{chunk-16449n3m.js → chunk-6gcmfvfj.js} +2 -2
- package/dist/{chunk-dsxjgty6.js → chunk-6jpspf3v.js} +2 -2
- package/dist/chunk-738a282r.js +1 -0
- package/dist/{chunk-ag0z1q2q.js → chunk-7c5tnz4y.js} +1 -1
- package/dist/{chunk-vfecv6cv.js → chunk-8ft7j7aw.js} +1 -1
- package/dist/chunk-8m87dnk2.js +1 -0
- package/dist/{chunk-c23bewtt.js → chunk-93jx06kq.js} +1 -1
- package/dist/{chunk-00gwp388.js → chunk-95k17p11.js} +1 -1
- package/dist/{chunk-7a8k7ck4.js → chunk-95n8g52h.js} +1 -1
- package/dist/{chunk-v6x80gdg.js → chunk-99ywfge1.js} +1 -1
- package/dist/{chunk-3j6bsp1q.js → chunk-9g6rzbcv.js} +2 -2
- package/dist/{chunk-1ep6bcpc.js → chunk-a7pvtxvz.js} +1 -1
- package/dist/{chunk-fjbptkh2.js → chunk-acw8q8w9.js} +2 -2
- package/dist/{chunk-d90tnjst.js → chunk-atsw605q.js} +1 -1
- package/dist/{chunk-d3gx05ph.js → chunk-cc7dmst6.js} +3 -3
- package/dist/{chunk-p01t6c78.js → chunk-ck5tvxkj.js} +2 -2
- package/dist/{chunk-ysr3frmw.js → chunk-ckfc7j7m.js} +1 -1
- package/dist/chunk-cnctwxqn.js +1 -0
- package/dist/{chunk-2gca6fvf.js → chunk-e23sz81n.js} +2 -2
- package/dist/chunk-e5yage6p.js +1 -0
- package/dist/{chunk-ba2dky3s.js → chunk-ekzck3x7.js} +1 -1
- package/dist/{chunk-nq1wqpsx.js → chunk-g510tpqt.js} +1 -1
- package/dist/{chunk-fb80q06q.js → chunk-gy8esxaa.js} +2 -2
- package/dist/chunk-hh158y4e.js +6 -0
- package/dist/{chunk-t1z46fqz.js → chunk-hq18c6r9.js} +1 -1
- package/dist/{chunk-qd7r2w39.js → chunk-hq1wrf1g.js} +1 -1
- package/dist/chunk-j2tmdkmw.js +1 -0
- package/dist/{chunk-crwa61tq.js → chunk-m2w03hpc.js} +1 -1
- package/dist/{chunk-0kqp5z4v.js → chunk-m6dh31kb.js} +2 -2
- package/dist/{chunk-rjg5rq90.js → chunk-n4555gej.js} +1 -1
- package/dist/{chunk-2sdbj0zz.js → chunk-phgqzja3.js} +2 -2
- package/dist/chunk-psgt2pq7.js +6 -0
- package/dist/{chunk-fw1fm9cn.js → chunk-q15qd9x4.js} +1 -1
- package/dist/chunk-q3r0zfec.js +1 -0
- package/dist/chunk-qgez5vw6.js +2 -0
- package/dist/{chunk-5v642sh3.js → chunk-qggnvzkc.js} +2 -2
- package/dist/{chunk-7ryqs453.js → chunk-qvdcesry.js} +2 -2
- package/dist/{chunk-mr0xs5t4.js → chunk-qwrdss51.js} +1 -1
- package/dist/{chunk-h34g9v9z.js → chunk-qxvk42rf.js} +1 -1
- package/dist/{chunk-wz6atg87.js → chunk-rshbnfr8.js} +4 -4
- package/dist/chunk-rv6kca90.js +1 -0
- package/dist/{chunk-7afbvxqt.js → chunk-s4enbe93.js} +2 -2
- package/dist/chunk-thstqcg3.js +2 -0
- package/dist/{chunk-bx99mx3k.js → chunk-v11r4ahz.js} +1 -1
- package/dist/chunk-ve7kp9rr.js +1 -0
- package/dist/chunk-xf2kjb9a.js +1 -0
- package/dist/{chunk-vqqxjgf2.js → chunk-xrhtwcd0.js} +1 -1
- package/dist/chunk-y990fa4r.js +204 -0
- package/dist/{chunk-95jjpdh9.js → chunk-y9nq48st.js} +2 -2
- package/dist/{chunk-prqgpq92.js → chunk-zwt7f9ab.js} +1 -1
- package/dist/web/assets/{ChatView-B7_Um8KR.js → ChatView-Dx9j7CGg.js} +2 -2
- package/dist/web/assets/{CodeBlockHighlighter-JzE91vkT.js → CodeBlockHighlighter-CZADKR6S.js} +1 -1
- package/dist/web/assets/{FilePreview-BTbtoUBJ.js → FilePreview-BOIDa_oJ.js} +1 -1
- package/dist/web/assets/{MarkdownRenderer-IaPtOh2w.js → MarkdownRenderer-DXsfHVUX.js} +3 -3
- package/dist/web/assets/{SettingsModal-CPgWPfZ2.js → SettingsModal-lQveNhC6.js} +1 -1
- package/dist/web/assets/{TaskSwitcher-D4RZxQKp.js → TaskSwitcher-BSrmpJ2u.js} +1 -1
- package/dist/web/assets/{TerminalPanel-yWbQfbYa.js → TerminalPanel-BFre9Shc.js} +1 -1
- package/dist/web/assets/{index-BnCT8SxR.js → index-DGZjm9wT.js} +4 -4
- package/dist/web/assets/{session-events-BZao_jMQ.js → session-events-Dk20sSDo.js} +19 -19
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-1142vwqa.js +0 -6
- package/dist/chunk-2c8d4q3y.js +0 -1
- package/dist/chunk-3ctcv013.js +0 -44
- package/dist/chunk-5f956qbf.js +0 -1
- package/dist/chunk-87ge6dkk.js +0 -2
- package/dist/chunk-958rac3y.js +0 -1
- package/dist/chunk-ap5qpeh4.js +0 -1
- package/dist/chunk-c6fq52m9.js +0 -1
- package/dist/chunk-dvyv53nz.js +0 -1
- package/dist/chunk-ecsj4njh.js +0 -1
- package/dist/chunk-epyys9aw.js +0 -6
- package/dist/chunk-g0gqxn3c.js +0 -2
- package/dist/chunk-h3cvnbah.js +0 -1
- package/dist/chunk-jh6b81rb.js +0 -10
- package/dist/chunk-mxffhqe5.js +0 -1610
- package/dist/chunk-qr8j2mr6.js +0 -1
- package/dist/chunk-s1j86hhh.js +0 -204
- package/dist/chunk-s3sv04hf.js +0 -1
- package/dist/chunk-sjc7bm23.js +0 -1
- package/dist/chunk-tvrxzsna.js +0 -1
- package/dist/chunk-vhpvt5v8.js +0 -1
- package/dist/chunk-zp9p9tk6.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as a,g as i,h as l,i as m}from"./chunk-rshbnfr8.js";import"./chunk-qxvk42rf.js";import"./chunk-4bbnytq5.js";import"./chunk-95n8g52h.js";import"./chunk-q15qd9x4.js";import"./chunk-0m4s8r87.js";import"./chunk-7c5tnz4y.js";import"./chunk-95k17p11.js";import"./chunk-y990fa4r.js";import"./chunk-5cgyevqj.js";import"./chunk-6gcmfvfj.js";import"./chunk-qgez5vw6.js";import"./chunk-phgqzja3.js";import{$c as n}from"./chunk-ck5tvxkj.js";import"./chunk-0evyrnx0.js";import{vd as s}from"./chunk-e23sz81n.js";import"./chunk-v508x7cg.js";import"./chunk-atsw605q.js";import"./chunk-4vq34v09.js";import"./chunk-6jpspf3v.js";import"./chunk-3rjmkaey.js";import"./chunk-acw8q8w9.js";import"./chunk-9g6rzbcv.js";import"./chunk-hq18c6r9.js";import"./chunk-zwt7f9ab.js";import"./chunk-ckfc7j7m.js";import"./chunk-cc7dmst6.js";import"./chunk-v11r4ahz.js";import"./chunk-515mkr66.js";import"./chunk-a7pvtxvz.js";import"./chunk-93jx06kq.js";import"./chunk-thstqcg3.js";import"./chunk-6360fg4j.js";import"./chunk-qvdcesry.js";import"./chunk-2mvp3rqw.js";import"./chunk-g510tpqt.js";import"./chunk-gy8esxaa.js";import"./chunk-m6dh31kb.js";import"./chunk-0dj2qm8a.js";import"./chunk-y9nq48st.js";import"./chunk-4s0c6tkd.js";import v from"chalk";var C={command:"serve",describe:"Start a headless Blade server (no browser)",builder:a,handler:async(p)=>{let r=i(p);if(await s(),!process.env.BLADE_SERVER_PASSWORD)console.log(v.yellow("Warning: BLADE_SERVER_PASSWORD is not set; server is unsecured."));let e=await m.listenAsync(r);if(console.log(`Blade server listening on http://${e.hostname}:${e.port}`),r.hostname==="0.0.0.0"){let o=l();for(let g of o)console.log(` Network: http://${g}:${e.port}`)}let t,c=new Promise((o)=>{t=o}),d=n(async()=>{await e.stop(),t()});try{await c}finally{d(),await e.stop()}}};export{C as serveCommand};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{b as iJ,c as oJ,d as nJ}from"./chunk-
|
|
1
|
+
import{b as iJ,c as oJ,d as nJ}from"./chunk-8ft7j7aw.js";import{j as ZJ,k as XJ}from"./chunk-qxvk42rf.js";import{s as c8}from"./chunk-95n8g52h.js";import{B as qY,D as s2,E as a2,F as Z6,L as j1,N as f4,O as k4,S as Y8,T as AJ,U as PJ,X as RJ,Y as yJ,ba as y6,ca as M6,da as UY,ea as p4,ga as c4,ia as F6,z as N6}from"./chunk-0m4s8r87.js";import{ma as S9,na as D9,oa as V9,ra as KY}from"./chunk-7c5tnz4y.js";import"./chunk-95k17p11.js";import{Ua as a4,Va as i4,ib as o4,rb as u2}from"./chunk-y990fa4r.js";import{Ab as G8}from"./chunk-5cgyevqj.js";import{Tb as x4,Yb as I4,bc as T4,ic as D4,jc as x2,kc as V4,mc as V8,uc as J8,xc as P0}from"./chunk-6gcmfvfj.js";import"./chunk-qgez5vw6.js";import"./chunk-phgqzja3.js";import{Zc as rJ}from"./chunk-qggnvzkc.js";import{$c as x8,_c as K8,bd as T1}from"./chunk-ck5tvxkj.js";import"./chunk-0evyrnx0.js";import{Fd as g0,fd as I$,gd as d0,hd as Q$,id as yQ,jd as D$,kd as j8,ld as $9,md as uQ,nd as n9,od as Q9,pd as k$,qd as $1,rd as XY,sd as r0,td as dJ,ud as P2,vd as Z8,yd as g4}from"./chunk-e23sz81n.js";import"./chunk-v508x7cg.js";import"./chunk-atsw605q.js";import"./chunk-4vq34v09.js";import{Qd as lQ}from"./chunk-6jpspf3v.js";import"./chunk-3rjmkaey.js";import"./chunk-acw8q8w9.js";import{$d as A6,ce as jJ,ie as bJ,oe as GY}from"./chunk-9g6rzbcv.js";import"./chunk-hq18c6r9.js";import"./chunk-zwt7f9ab.js";import"./chunk-ckfc7j7m.js";import{Ce as IQ,Ee as O1}from"./chunk-cc7dmst6.js";import"./chunk-v11r4ahz.js";import{nf as YY,yf as wJ,zf as ZY}from"./chunk-515mkr66.js";import"./chunk-a7pvtxvz.js";import"./chunk-93jx06kq.js";import{Hf as V$,If as h8,Jf as TQ}from"./chunk-thstqcg3.js";import{Nf as u0}from"./chunk-6360fg4j.js";import{Of as JY,Rf as e1}from"./chunk-qvdcesry.js";import{Tf as QJ,Uf as JJ,Xf as h1}from"./chunk-2mvp3rqw.js";import"./chunk-g510tpqt.js";import{hg as u9}from"./chunk-gy8esxaa.js";import{ig as sQ}from"./chunk-m6dh31kb.js";import"./chunk-0dj2qm8a.js";import"./chunk-y9nq48st.js";import{ug as CQ}from"./chunk-4s0c6tkd.js";import{useMemoizedFn as S2}from"ahooks";import{useEffect as pX,useState as D2}from"react";import{useMemoizedFn as n0}from"ahooks";import{Box as z$}from"ink";import{useEffect as _$,useMemo as DX,useRef as f2}from"react";import{useShallow as zY}from"zustand/react/shallow";import{useStore as OY}from"zustand";function s($){return OY(k$,$)}var _Y=[],v$=()=>s(($)=>$.session.sessionId),I1=()=>s(($)=>$.session.workspaceRoot),eQ=()=>s(($)=>$.session.messages),$4=()=>s(($)=>$.session.clearCount),Q4=()=>s(($)=>$.session.isCompacting),J4=()=>s(($)=>$.session.tokenUsage.estimatedCostUsd),Y4=()=>s(($)=>$.session.providerRetry),Z4=()=>s(($)=>$.session.providerStall),X4=()=>s(($)=>$.session.actionStationarity),n1=()=>s(($)=>$.session.actions),G4=()=>s(($)=>{let{inputTokens:Q,maxContextTokens:Y}=$.session.tokenUsage;if(Y<=0)return 100;let J=Math.max(0,100-Q/Y*100);return Math.round(J)}),K4=()=>s(($)=>$.app.initializationStatus),q4=()=>s(($)=>$.app.initializationError),R8=()=>s(($)=>$.app.activeModal),U4=()=>s(($)=>$.app.tasks),O4=()=>s(($)=>$.app.modelEditorTarget),z4=()=>s(($)=>$.app.sessionSelectorData),_4=()=>s(($)=>$.app.awaitingSecondCtrlC),t1=()=>s(($)=>$.app.actions),y8=()=>s(($)=>$.app.initializationStatus==="ready"),N4=()=>s(($)=>$.app.tasks.length>0),S$=()=>s(($)=>$.config.config?.permissionMode||"default"),F4=()=>s(($)=>$.config.config?.models??_Y),M8=()=>s(($)=>{let Q=$.config.config;if(!Q)return;let Y=Q.currentModelId;return Q.models.find((Z)=>Z.id===Y)??Q.models[0]}),C8=()=>s(($)=>$.config.config?.currentModelId),A0=()=>s(($)=>{return d0.getTheme()}),H4=()=>s(($)=>$.config.config?.codeTheme??"default"),e0=()=>s(($)=>$.focus.currentFocus),W4=()=>s(($)=>$.focus.actions),s1=()=>s(($)=>$.command.isProcessing),L4=()=>s(($)=>$.command.actions),I8=()=>s(($)=>$.command.pendingCommands),B4=()=>s(($)=>$.command.recoveredSteeringCount),T8=()=>s(($)=>$.app.thinkingModeEnabled),f8=()=>s(($)=>$.app.reasoningEffort),k8=()=>s(($)=>$.app.serviceTier),v8=()=>s(($)=>$.app.responseVerbosity),S8=()=>s(($)=>$.app.communicationStyle),w4=()=>s(($)=>$.session.currentThinkingContent),b4=()=>s(($)=>$.session.thinkingExpanded),A4=()=>s(($)=>$.session.currentStreamingMessageId),P4=()=>s(zY(($)=>({lines:$.session.currentStreamingLines,tail:$.session.currentStreamingTail,lineCount:$.session.currentStreamingLineCount,version:$.session.currentStreamingVersion}))),R4=()=>s(($)=>$.session.finalizingStreamingMessageId),y4=()=>s(($)=>$.session.historyExpanded),M4=()=>s(($)=>$.session.expandedMessageCount);import{useMemoizedFn as h$}from"ahooks";import{useEffect as l8,useRef as r4}from"react";function NY($){if(!($ instanceof Error))return"未知错误";let J=$.lastError??$;if(J.responseBody)try{let G=JSON.parse(J.responseBody)?.error?.message;if(G){let q=J.statusCode?` (HTTP ${J.statusCode})`:"";return`${G}${q}`}}catch{}let Z=$.message.match(/Last error:\s*(.+)$/);if(Z)return Z[1];return $.message}function FY($){if(!($ instanceof Error))return!1;return $.name==="AbortError"||$.message.includes("aborted")}function HY($){if(!($ instanceof Error))return!1;let Q=$.message;return Q.includes("can only concatenate str")||Q.includes("image_url")||Q.includes("multimodal")||Q.includes("vision")||Q.includes("does not support images")}function D8($){let Q=FY($),Y=HY($),J;if(Y)J="当前模型不支持图片理解功能。请切换到支持视觉能力的模型(如 Claude 4.5、GPT-5.2、Gemini 3 Pro、Qwen3-VL-Plus 等)后重试。";else J=NY($);return{displayMessage:J,isAbort:Q,isVisionNotSupported:Y}}import{appendFileSync as WY,mkdirSync as LY,writeFileSync as BY}from"node:fs";import wY from"node:os";import h2 from"node:path";var C4=null;function bY(){let $=process.env.BLADE_STORAGE_ROOT||h2.join(wY.homedir(),".blade");return h2.join($,"logs","stream-debug.log")}function AY($){if(C4===$)return;let Q=h2.dirname($);LY(Q,{recursive:!0,mode:493}),BY($,`=== Stream Debug Log Started: ${new Date().toISOString()} ===
|
|
2
2
|
`),C4=$}function E2($,Q,Y){try{let J=bY();AY(J);let Z=new Date().toISOString(),X=Y?` | ${JSON.stringify(Y)}`:"",G=`[${Z}] [${$}] ${Q}${X}
|
|
3
|
-
`;WY(J,G)}catch{}}var Q8=e1("UI");function v4($,Q){let Y=!1;return(J)=>{switch(J.kind){case"content_delta":if(Y||$.signal.aborted)break;Q.contentDeltaCount++,Q.contentDeltaTotalLen+=J.delta.length,E2("loopEventHandler","onContentDelta",{callCount:Q.contentDeltaCount,deltaLen:J.delta.length,totalLen:Q.contentDeltaTotalLen}),$.streamingBuffer.batchAppendContent(J.delta);break;case"thinking_delta":if(Y||$.signal.aborted)break;if($.thinkingModeEnabled)$.streamingBuffer.batchAppendThinking(J.delta);break;case"stream_end":{if($.sessionActions.setProviderRetry(null),$.sessionActions.setProviderStall(null),Q8.debug("[loopEventHandler] stream_end",{contentDeltaCount:Q.contentDeltaCount,contentDeltaTotalLen:Q.contentDeltaTotalLen,streamFinalized:Y,signalAborted:$.signal.aborted}),E2("loopEventHandler","onStreamEnd",{contentDeltaCallCount:Q.contentDeltaCount,contentDeltaTotalLen:Q.contentDeltaTotalLen,streamFinalized:Y,signalAborted:$.signal.aborted}),Y||$.signal.aborted){Y=!0;break}let{extraContent:Z,extraThinking:X}=$.streamingBuffer.drainPendingBuffers(),G=$.getStreamingMessageId();if(G){if(Z)D$(G,Z);j8(G)}$.sessionActions.finalizeStreamingMessage(Z,X),Y=!0;break}case"model_fallback":Y=!0,$.sessionActions.setProviderRetry(null),$.sessionActions.setProviderStall(null),$.streamingBuffer.resetStreamingBuffers(),$.sessionActions.discardStreamingMessage(),$.sessionActions.setCurrentThinkingContent(null);break;case"provider_retry":{let{kind:Z,...X}=J;$.sessionActions.setProviderRetry(J.phase==="scheduled"||J.phase==="attempt"?X:null);break}case"provider_stall":{let{kind:Z,...X}=J;$.sessionActions.setProviderStall(J.phase==="detected"?X:null);break}case"action_stationarity":{let{kind:Z,...X}=J;$.sessionActions.setActionStationarity(J.phase==="recovered"?null:X);break}case"tool_start":{let Z=J.toolCall;if(!("function"in Z))break;if(Z.function.name===V8)break;if(Q8.debug("[loopEventHandler] tool_start",{toolName:Z.function.name,toolKind:J.toolKind}),["TaskCreate","TaskUpdate","TaskList"].includes(Z.function.name))break;try{let X=JSON.parse(Z.function.arguments),G=f4(Z.function.name,X);$.sessionActions.addToolMessage(G,{toolCallId:Z.id,toolName:Z.function.name,phase:"start",summary:G,params:X})}catch(X){Q8.error("[loopEventHandler] onToolStart error:",X)}break}case"tool_progress":{let Z=J.toolCall;if(!("function"in Z))break;if(Z.function.name===V8)break;let X=J.update.total!==void 0?` ${Math.max(0,Math.min(100,Math.round((J.update.progress??0)/J.update.total*100)))}%`:"",G=`${Z.function.name}${X}: ${J.update.message}`;$.sessionActions.addToolMessage(G,{toolCallId:Z.id,toolName:Z.function.name,phase:"progress",summary:G});break}case"tool_result":{let Z=J.toolCall;if(!("function"in Z))break;if(Z.function.name===V8)break;Q8.debug("[loopEventHandler] tool_result",{toolName:Z.function.name,success:J.result.success});let X=T4(k4(Z.function.name,J.result),I4);$.sessionActions.addToolMessage(X.summary,{toolCallId:Z.id,toolName:Z.function.name,phase:"complete",summary:X.summary,detail:X.detail});break}case"structured_output":$.sessionActions.replaceLastAssistantMessage(JSON.stringify(J.output,null,2));break;case"token_usage":$.sessionActions.updateTokenUsage(J.usage);break;case"compaction":if($.sessionActions.setCompacting(J.phase==="start"),J.phase==="end"){if($.sessionActions.resetContextUsage(),J.outcome!=="failed")Q.compactionCount=(Q.compactionCount??0)+1}break;case"turn_start":Q8.debug("[loopEventHandler] turn_start",{turn:J.turn,maxTurns:J.maxTurns}),$.sessionActions.updateTokenUsage({turnCount:J.turn}),$.sessionActions.setProviderRetry(null),$.sessionActions.setProviderStall(null),Y=!1;break;case"task_update":$.appActions.setTasks(J.tasks);break;case"mcp_catalog_changed":{let Z=`MCP catalog r${J.revision}: +${J.added.length} -${J.removed.length} ~${J.updated.length}`;$.sessionActions.addToolMessage(Z,{toolName:"MCP Catalog",phase:"complete",summary:Z,detail:[J.added.length>0?`Added: ${J.added.join(", ")}`:"",J.removed.length>0?`Removed: ${J.removed.join(", ")}`:"",J.updated.length>0?`Updated: ${J.updated.join(", ")}`:""].filter(Boolean).join(`
|
|
3
|
+
`;WY(J,G)}catch{}}var Q8=e1("UI");function v4($,Q){let Y=!1;return(J)=>{switch(J.kind){case"content_delta":if(Y||$.signal.aborted)break;Q.contentDeltaCount++,Q.contentDeltaTotalLen+=J.delta.length,E2("loopEventHandler","onContentDelta",{callCount:Q.contentDeltaCount,deltaLen:J.delta.length,totalLen:Q.contentDeltaTotalLen}),$.streamingBuffer.batchAppendContent(J.delta);break;case"thinking_delta":if(Y||$.signal.aborted)break;if($.thinkingModeEnabled)$.streamingBuffer.batchAppendThinking(J.delta);break;case"stream_end":{if($.sessionActions.setProviderRetry(null),$.sessionActions.setProviderStall(null),Q8.debug("[loopEventHandler] stream_end",{contentDeltaCount:Q.contentDeltaCount,contentDeltaTotalLen:Q.contentDeltaTotalLen,streamFinalized:Y,signalAborted:$.signal.aborted}),E2("loopEventHandler","onStreamEnd",{contentDeltaCallCount:Q.contentDeltaCount,contentDeltaTotalLen:Q.contentDeltaTotalLen,streamFinalized:Y,signalAborted:$.signal.aborted}),Y||$.signal.aborted){Y=!0;break}let{extraContent:Z,extraThinking:X}=$.streamingBuffer.drainPendingBuffers(),G=$.getStreamingMessageId();if(G){if(Z)D$(G,Z);j8(G)}$.sessionActions.finalizeStreamingMessage(Z,X),Y=!0;break}case"model_fallback":Y=!0,$.sessionActions.setProviderRetry(null),$.sessionActions.setProviderStall(null),$.streamingBuffer.resetStreamingBuffers(),$.sessionActions.discardStreamingMessage(),$.sessionActions.setCurrentThinkingContent(null);break;case"provider_retry":{let{kind:Z,...X}=J;$.sessionActions.setProviderRetry(J.phase==="scheduled"||J.phase==="attempt"?X:null);break}case"provider_stall":{let{kind:Z,...X}=J;$.sessionActions.setProviderStall(J.phase==="detected"?X:null);break}case"action_stationarity":{let{kind:Z,...X}=J;$.sessionActions.setActionStationarity(J.phase==="recovered"?null:X);break}case"tool_start":{let Z=J.toolCall;if(!("function"in Z))break;if(Z.function.name===V8)break;if(Q8.debug("[loopEventHandler] tool_start",{toolName:Z.function.name,toolKind:J.toolKind}),["TaskCreate","TaskUpdate","TaskList"].includes(Z.function.name))break;try{let X=JSON.parse(Z.function.arguments),G=f4(Z.function.name,X);$.sessionActions.addToolMessage(G,{toolCallId:Z.id,toolName:Z.function.name,phase:"start",summary:G,params:X})}catch(X){Q8.error("[loopEventHandler] onToolStart error:",X)}break}case"tool_progress":{let Z=J.toolCall;if(!("function"in Z))break;if(Z.function.name===V8)break;let X=J.update.total!==void 0?` ${Math.max(0,Math.min(100,Math.round((J.update.progress??0)/J.update.total*100)))}%`:"",G=`${Z.function.name}${X}: ${J.update.message}`;$.sessionActions.addToolMessage(G,{toolCallId:Z.id,toolName:Z.function.name,phase:"progress",summary:G,...J.update.admission?{admission:J.update.admission}:{}});break}case"tool_result":{let Z=J.toolCall;if(!("function"in Z))break;if(Z.function.name===V8)break;Q8.debug("[loopEventHandler] tool_result",{toolName:Z.function.name,success:J.result.success});let X=T4(k4(Z.function.name,J.result),I4);$.sessionActions.addToolMessage(X.summary,{toolCallId:Z.id,toolName:Z.function.name,phase:"complete",summary:X.summary,detail:X.detail});break}case"structured_output":$.sessionActions.replaceLastAssistantMessage(JSON.stringify(J.output,null,2));break;case"token_usage":$.sessionActions.updateTokenUsage(J.usage);break;case"compaction":if($.sessionActions.setCompacting(J.phase==="start"),J.phase==="end"){if($.sessionActions.resetContextUsage(),J.outcome!=="failed")Q.compactionCount=(Q.compactionCount??0)+1}break;case"turn_start":Q8.debug("[loopEventHandler] turn_start",{turn:J.turn,maxTurns:J.maxTurns}),$.sessionActions.updateTokenUsage({turnCount:J.turn}),$.sessionActions.setProviderRetry(null),$.sessionActions.setProviderStall(null),Y=!1;break;case"task_update":$.appActions.setTasks(J.tasks);break;case"mcp_catalog_changed":{let Z=`MCP catalog r${J.revision}: +${J.added.length} -${J.removed.length} ~${J.updated.length}`;$.sessionActions.addToolMessage(Z,{toolName:"MCP Catalog",phase:"complete",summary:Z,detail:[J.added.length>0?`Added: ${J.added.join(", ")}`:"",J.removed.length>0?`Removed: ${J.removed.join(", ")}`:"",J.updated.length>0?`Updated: ${J.updated.join(", ")}`:""].filter(Boolean).join(`
|
|
4
4
|
`)});break}case"mcp_content_changed":{let Z=`MCP ${J.contentKind} r${J.revision}: +${J.added.length} -${J.removed.length} ~${J.updated.length}`;$.sessionActions.addToolMessage(Z,{toolName:"MCP Content",phase:"complete",summary:Z,detail:[J.added.length>0?`Added: ${J.added.join(", ")}`:"",J.removed.length>0?`Removed: ${J.removed.join(", ")}`:"",J.updated.length>0?`Updated: ${J.updated.join(", ")}`:""].filter(Boolean).join(`
|
|
5
5
|
`)});break}case"mcp_resource_updated":{let Z=`MCP resource updated: ${J.uri}`;$.sessionActions.addToolMessage(Z,{toolName:"MCP Resource",phase:"progress",summary:Z,detail:`${J.serverName} · revision ${J.revision}`});break}case"mcp_connection_changed":{let Z=J.phase==="reconnecting"?"recovering":J.phase==="recovered"?"recovered":"recovery failed",X=`MCP ${J.serverName} ${Z}`+(J.phase==="reconnecting"?` (${J.attempt}/${J.maxAttempts})`:"");$.sessionActions.addToolMessage(X,{toolName:"MCP Connection",phase:"complete",summary:X,detail:[`reason: ${J.reason}`,`revision: ${J.revision}`,J.error?`error: ${J.error}`:""].filter(Boolean).join(`
|
|
6
6
|
`)});break}case"mcp_log":{let Z=J.logger?`${J.serverName} · ${J.logger}`:J.serverName,X=`MCP ${J.level} · ${Z}`;$.sessionActions.addToolMessage(X,{toolName:"MCP Log",phase:"complete",summary:X,detail:[J.message,`revision: ${J.revision}`,`sha256: ${J.dataSha256}`,J.truncated?"truncated: true":"",J.detailsOmitted?"details omitted by runtime policy":""].filter(Boolean).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{spawn as I}from"node:child_process";var X=500;function x(j){return new Promise((q)=>setTimeout(q,j))}function Z(j){return j&&typeof j==="object"&&"code"in j?String(j.code):void 0}function L(j){return j()||j()}function G(j,q=process.platform,y=process.kill.bind(process)){if(q==="win32"||!Number.isInteger(j)||j<=1||j===process.pid)return!1;try{return y(-j,0),!0}catch(z){let B=Z(z);if(B==="ESRCH")return!1;if(B==="EPERM")return!0;throw z}}function N(j,q){return new Promise((y)=>{let z=["/PID",String(j),"/T"];if(q)z.push("/F");let B=I("taskkill",z,{stdio:"ignore",windowsHide:!0}),K=!1,J=(H)=>{if(K)return;K=!0,y(H)};B.once("error",()=>J(!1)),B.once("close",(H)=>J(H===0))})}async function F(j,q={}){if(!Number.isInteger(j)||j<=1||j===process.pid)return{success:!1,alreadyExited:!1,forced:!1};let y=q.platform??process.platform,z=q.gracePeriodMs??X,B=q.killProcess??process.kill.bind(process),K=q.taskkill??N,J=q.wait??x,H=q.validatePidOwnership??(()=>!0);if(!L(H))return{success:!1,alreadyExited:!1,forced:!1};if(y==="win32"){let V=await K(j,!1);if(await J(z),!H())return{success:V,alreadyExited:!1,forced:!1};let Y=await K(j,!0);return{success:V||Y,alreadyExited:!V&&!Y,forced:Y}}let Q=(V,Y)=>{try{return B(V,Y)}catch(D){return Z(D)==="ESRCH"}},W=Q(-j,"SIGTERM")||Q(j,"SIGTERM");if(await J(z),!H())return{success:W,alreadyExited:!1,forced:!1};let $=Q(-j,"SIGKILL")||Q(j,"SIGKILL");return{success:W||$,alreadyExited:!1,forced:$}}async function R(j,q={}){if(!Number.isInteger(j)||j<=1||j===process.pid)return{success:!1,alreadyExited:!1,forced:!1};if((q.platform??process.platform)==="win32")return{success:!1,alreadyExited:!1,forced:!1};let z=q.gracePeriodMs??X,B=q.killProcess??process.kill.bind(process),K=q.wait??x,J=q.validatePidOwnership??(()=>!0);if(!J())return{success:!1,alreadyExited:!1,forced:!1};let H=($)=>{try{return B(-j,$),"sent"}catch(V){return Z(V)==="ESRCH"?"missing":"failed"}},Q=H("SIGTERM");if(Q==="missing")return{success:!0,alreadyExited:!0,forced:!1};if(Q==="failed")return{success:!1,alreadyExited:!1,forced:!1};if(await K(z),!J())return{success:!1,alreadyExited:!1,forced:!1};let W=H("SIGKILL");return{success:W!=="failed",alreadyExited:W==="missing",forced:W==="sent"}}class b{child;state="owned";terminationPromise;terminationResult;platform;gracePeriodMs;killProcess;taskkill;wait;constructor(j,q={}){this.child=j;if(this.platform=q.platform??process.platform,this.gracePeriodMs=q.gracePeriodMs??X,this.killProcess=q.killProcess??process.kill.bind(process),this.taskkill=q.taskkill??N,this.wait=q.wait??x,q.releaseOnExit!==!1){let y=()=>{if(this.state==="owned")this.state="released"};j.once("close",y),j.once("error",y)}}release(){if(this.state==="owned")this.state="released"}terminate(){if(this.terminationPromise)return this.terminationPromise;if(this.terminationResult)return Promise.resolve(this.terminationResult);if(this.state==="released")return this.terminationResult={success:!0,alreadyExited:!0,forced:!1},Promise.resolve(this.terminationResult);return this.state="terminating",this.terminationPromise=this.terminateOwnedTree().then((j)=>{return this.state="released",this.terminationResult=j,j}),this.terminationPromise}async terminateOwnedTree(){let j=this.child.pid;if(!j)return{success:!1,alreadyExited:!0,forced:!1};if(this.platform==="win32"){let z=await this.taskkill(j,!1);await this.wait(this.gracePeriodMs);let B=await this.taskkill(j,!0);if(!z&&!B)return{success:this.signalDirectChild("SIGKILL"),alreadyExited:!1,forced:!0};return{success:!0,alreadyExited:!1,forced:!0}}let q=this.signalPosixTree(j,"SIGTERM");await this.wait(this.gracePeriodMs);let y=this.signalPosixTree(j,"SIGKILL");return{success:q||y,alreadyExited:!1,forced:y}}signalPosixTree(j,q){if(j<=1||j===process.pid)return this.signalDirectChild(q);try{return this.killProcess(-j,q)}catch(y){if(Z(y)==="ESRCH")return!0;return this.signalDirectChild(q)}}signalDirectChild(j){try{return this.child.kill(j)}catch(q){return Z(q)==="ESRCH"}}}function v(j,q,y={},z={}){let B=I(j,q,{...y,detached:process.platform==="win32"?y.detached:!0,windowsHide:y.windowsHide??!0});return{child:B,processTree:new b(B,z)}}
|
|
2
|
-
export{G as
|
|
2
|
+
export{G as Fe,F as Ge,R as He,v as Ie};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$a as a,ab as b,cb as c,gb as d,hb as e,ib as f,jb as g,kb as h,lb as i,mb as j,nb as k,sb as l,tb as m,ub as n,vb as o,xb as p,yb as q,zb as r}from"./chunk-y990fa4r.js";import"./chunk-5cgyevqj.js";import"./chunk-6gcmfvfj.js";import"./chunk-qgez5vw6.js";import"./chunk-phgqzja3.js";import"./chunk-atsw605q.js";import"./chunk-4vq34v09.js";import"./chunk-3rjmkaey.js";import"./chunk-hq18c6r9.js";import"./chunk-zwt7f9ab.js";import"./chunk-cc7dmst6.js";import"./chunk-v11r4ahz.js";import"./chunk-a7pvtxvz.js";import"./chunk-93jx06kq.js";import"./chunk-thstqcg3.js";import"./chunk-6360fg4j.js";import"./chunk-qvdcesry.js";import"./chunk-2mvp3rqw.js";import"./chunk-g510tpqt.js";import"./chunk-gy8esxaa.js";import"./chunk-0dj2qm8a.js";import"./chunk-y9nq48st.js";import"./chunk-4s0c6tkd.js";export{g as saveUserMessage,i as saveToolUse,j as saveToolResult,k as saveCompaction,h as saveAssistantMessage,d as isRootSystemPrompt,m as handleTaskListUpdate,n as handleSkillActivation,o as extractModelSwitch,r as executeLoopGenerator,f as drainLoop,c as checkStopHook,a as checkOutputRecovery,b as checkIncompleteIntent,q as checkAndCompactInLoop,p as applyToolDomainEffects,l as StreamingToolExecutor,e as ConversationState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Wc as a,Xc as b,Yc as c}from"./chunk-hh158y4e.js";import"./chunk-qggnvzkc.js";import"./chunk-e23sz81n.js";import"./chunk-v508x7cg.js";import"./chunk-atsw605q.js";import"./chunk-ckfc7j7m.js";import"./chunk-515mkr66.js";import"./chunk-a7pvtxvz.js";import"./chunk-93jx06kq.js";import"./chunk-thstqcg3.js";import"./chunk-6360fg4j.js";import"./chunk-qvdcesry.js";import"./chunk-2mvp3rqw.js";import"./chunk-g510tpqt.js";import"./chunk-gy8esxaa.js";import"./chunk-m6dh31kb.js";import"./chunk-0dj2qm8a.js";import"./chunk-y9nq48st.js";import"./chunk-4s0c6tkd.js";export{a as validatePermissions,c as validateOutput,b as loadConfiguration};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{l as i}from"./chunk-
|
|
1
|
+
import{l as i}from"./chunk-4bbnytq5.js";import{Nf as s}from"./chunk-6360fg4j.js";import"./chunk-y9nq48st.js";import"./chunk-4s0c6tkd.js";import m from"node:path";var r={registry:i,currentWorkspace:s,inputCwd:()=>process.cwd(),write:console.log};function c(t,e){return m.resolve(e.inputCwd(),t)}function p(t){return t.map((e)=>{let o=e.isCurrent?"*":" ",n=e.gitBranch?` · ${e.gitBranch}`:"",d=e.available?"":" · unavailable";return`${o} ${e.name}${n}${d}
|
|
2
2
|
${e.path}`}).join(`
|
|
3
3
|
`)}async function l(t,e=r){let o=await e.registry.list(e.currentWorkspace());return e.write(t.json?JSON.stringify(o,null,2):p(o)),o}async function u(t,e=r){let o=await e.registry.bind(c(t.path,e),e.currentWorkspace());return e.write(t.json?JSON.stringify(o,null,2):`Bound project: ${o.path}`),o}async function j(t,e=r){let o=c(t.path,e),n=await e.registry.unbind(o);return e.write(t.json?JSON.stringify({path:o,removed:n},null,2):n?`Unbound project: ${o}`:`Project was not bound: ${o}`),n}var a={type:"boolean",default:!1,describe:"Print machine-readable JSON"},P={command:"list",aliases:["ls"],describe:"List bound projects",builder:(t)=>t.option("json",a),handler:async(t)=>{await l(t)}},b={command:"add <path>",aliases:["bind"],describe:"Bind a project folder",builder:(t)=>t.positional("path",{type:"string",demandOption:!0,describe:"Absolute or relative project folder"}).option("json",a),handler:async(t)=>{await u(t)}},h={command:"remove <path>",aliases:["rm","unbind"],describe:"Unbind a project folder",builder:(t)=>t.positional("path",{type:"string",demandOption:!0,describe:"Absolute or relative project folder"}).option("json",a),handler:async(t)=>{await j(t)}},y={command:"projects",aliases:["project"],describe:"Manage project bindings shared with Blade Web",builder:(t)=>t.command(P).command(b).command(h).demandCommand(1,"Choose list, add, or remove"),handler:()=>{return}};export{j as runProjectsRemove,l as runProjectsList,u as runProjectsAdd,y as projectsCommands,p as formatProjectList};
|