@tencent-ai/codebuddy-code 0.0.1-beta.25 → 0.0.1-beta.26

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/CHANGELOG.md CHANGED
@@ -5,6 +5,41 @@ All notable changes to the agent-cli module will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.0.1-beta.26] - 2025-08-27
9
+
10
+ ### Added
11
+ - **任务工具支持**:新增 `TaskTool` 工具,支持在独立会话中执行复杂任务,实现任务隔离和状态管理
12
+ - 新增 `task` 代理配置,支持专门的任务执行上下文和工具集合
13
+ - 新增消息队列管理器 `MessageQueueManager`,提供队列操作和状态管理功能
14
+ - 新增 `InterruptionService`,提供中断处理和工具调用审批功能
15
+ - 增强 `PromptRenderer` 支持,提供上下文模板渲染功能
16
+
17
+ ### Changed
18
+ - 优化代理拦截器链路,增强用户输入处理和状态管理逻辑
19
+ - 改进会话管理器,添加函数调用结果处理器集成
20
+ - 优化工具管理器,增强权限检查和动态描述渲染
21
+ - 改进 UI 上下文管理,简化对话状态和消息发送逻辑
22
+ - 移除冗余的 hooks 文件,精简代码结构
23
+
24
+ ### Fixed
25
+ - **修复任务执行中断处理**:解决任务工具执行时的中断信号处理和资源清理问题
26
+ - 修复中断服务中的会话映射管理,确保映射关系的正确建立和清理
27
+ - 改进工具调用审批导航逻辑,优化用户交互体验
28
+ - 修复确认对话框状态管理和响应处理
29
+
30
+ ### Technical Details
31
+ - **InterruptionService 重构**:采用直接映射 `Map<RunToolApprovalItem, Session>` 架构,支持同步查找
32
+ - **TaskTool 实现**:独立会话管理,支持中断传播和使用量统计
33
+ - **MessageQueueManager**:基于 CellJS 依赖注入的队列管理服务
34
+ - **代理拦截器优化**:增强用户输入处理、环境设置和状态管理能力
35
+ - **UI 架构简化**:移除 `use-conversation-state.ts` 和 `use-message-queue.ts`,集中管理状态逻辑
36
+ - **工具权限增强**:动态描述渲染和权限检查机制优化
37
+ - **产品配置扩展**:支持 task 代理和相关工具配置
38
+
39
+ ### Breaking Changes
40
+ - `InterruptionService` 接口方法签名变更,需要传入 `RunToolApprovalItem` 而非 `Session`
41
+ - 移除部分 UI hooks,相关功能已集成到其他模块中
42
+
8
43
  ## [0.0.1-beta.25] - 2025-08-25
9
44
 
10
45
  ### Changed
@@ -1 +1 @@
1
- "use strict";exports.id=422,exports.ids=[422],exports.modules={7422:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.r(t),n.d(t,{LoginView:()=>LoginView});var l=n(80932),a=n(14083),o=n(96540),c=n(66814),i=n(14216),s=n(82101),u=n(34209),m=n(53829),E=n(49034),d=n(47693),g=n(83175),b=n(42790),y=e([a,i,s,m,E,d,b]);[a,i,s,m,E,d,b]=y.then?(await y)():y;const LoginView=()=>{const e=(0,c.i7)(m.Gb,(e=>e.staticKey));return o.createElement(o.Fragment,null,o.createElement(a.jC,{key:`login-view-${e}`,items:[o.createElement(LogoBox,{key:"logo-box"}),o.createElement(NewVersionBox,{key:"new-version-box"})]},(e=>e)),o.createElement(LoginBox,null))},LogoBox=()=>{const e=`Welcome to ${u.KR}`,t=e.length+8;return o.createElement(o.Fragment,null,o.createElement(a.az,{marginBottom:1,paddingLeft:1,borderStyle:"round",borderColor:g.Q.brand,width:t},o.createElement(a.EY,{color:g.Q.brand},"✻ ",e)),o.createElement(b.H,null))},NewVersionBox=()=>{const e="cyan",t=i.CW.getCurrentPackageJson(),n=t.version.includes("beta"),r=t.version.includes("alpha"),l=n?"@beta":r?"@alpha":"";return o.createElement(a.az,{paddingX:1,flexDirection:"column",borderStyle:"round",borderColor:e},o.createElement(a.EY,{color:e},"New Version Updated v",t.version," Release! Please visit ",u.KR," website to read changelog."),o.createElement(a.EY,{color:e},"Run npm install -g ",u.JP,l))},LoginBox=()=>{const{authSession:e,navigate:t}=(0,c.i7)(m.aO,(e=>({authSession:e.authSession,navigate:e.navigate}))),[n,r]=(0,o.useState)("idle"),[i,u]=(0,o.useState)(""),[b,y]=(0,o.useState)(""),h=(0,o.useRef)(new AbortController);return(0,o.useEffect)((()=>{const e=(0,d.bi)().urlSubject.subscribe(u);return()=>e.unsubscribe()}),[]),(0,a.Ge)(((l,a)=>{if(E.Om.RETURN(a)&&"idle"===n)try{r("loading"),y(""),(0,d.Yf)().login(h.current)}catch(e){r("error"),y(e instanceof Error?e.message:"Unknown error occurred")}else E.Om.ESCAPE(a)&&("loading"===n?(h.current.abort(),r("idle")):e&&t("/chat"))})),o.createElement(a.az,{paddingX:1,flexDirection:"column",gap:1,borderStyle:"round",borderColor:"grey"},"idle"===n?o.createElement(o.Fragment,null,o.createElement(a.az,null,o.createElement(a.EY,null,"Select login method:")),o.createElement(a.az,null,o.createElement(a.EY,{color:"green"},l.Ay.bullet," Login with Tencent Cloud CodeBuddy")),o.createElement(a.az,{justifyContent:"space-between"},o.createElement(a.EY,{color:"grey"},"(Press Enter to login)"))):"loading"===n?o.createElement(a.az,{paddingY:1,gap:1,flexDirection:"column"},o.createElement(a.az,null,o.createElement(a.EY,{color:"grey"},"Browser didn't open? User the url below to sign in:")),i&&o.createElement(a.az,null,o.createElement(a.EY,{color:"grey"},i)),o.createElement(a.az,{marginTop:1,gap:1},o.createElement(a.EY,{color:g.Q.brand},o.createElement(s.y$,{type:"star"})),o.createElement(a.EY,null,"Waiting for auth... (Press ESC to cancel)"))):"error"===n?o.createElement(o.Fragment,null,o.createElement(a.EY,{color:"red"},"Failed to login."),b&&o.createElement(a.EY,{color:"red"},"Message: ",b)):void 0)};r()}catch(e){r(e)}}))},42790:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.d(t,{H:()=>LogoText});var l=n(1597),a=n(14083),o=n(96540),c=n(83175),i=e([a]);a=(i.then?(await i)():i)[0];const LogoText=()=>{const e=(0,o.useRef)((0,l.Ay)(c.Q.GradientColors)),t=(0,o.useCallback)((t=>e.current.multiline(t)),[e]);return o.createElement(a.dL,{transform:t},o.createElement(a.EY,null,"\n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ ██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ ██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ ╚██████╗╚██████╔╝██████╔╝███████╗\n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\n \n\n . * . * . *\n /\\_/\\ \n ( o.o ) * . * \n > ^ < . \n"))};r()}catch(e){r(e)}}))}};
1
+ "use strict";exports.id=422,exports.ids=[422],exports.modules={7422:(e,n,t)=>{t.a(e,(async(e,r)=>{try{t.r(n),t.d(n,{LoginView:()=>LoginView});var l=t(80932),a=t(14083),o=t(96540),c=t(66814),i=t(14216),s=t(82101),u=t(34209),m=t(53829),E=t(49034),d=t(47693),g=t(83175),b=t(42790),y=e([a,i,s,m,E,d,b]);[a,i,s,m,E,d,b]=y.then?(await y)():y;const LoginView=()=>{const e=(0,c.i7)(m.Gb,(e=>e.staticKey));return o.createElement(o.Fragment,null,o.createElement(a.jC,{key:`login-view-${e}`,items:[o.createElement(LogoBox,{key:"logo-box"}),o.createElement(NewVersionBox,{key:"new-version-box"})]},(e=>e)),o.createElement(LoginBox,null))},LogoBox=()=>{const e=`Welcome to ${u.KR}`,n=e.length+8;return o.createElement(o.Fragment,null,o.createElement(a.az,{marginBottom:1,paddingLeft:1,borderStyle:"round",borderColor:g.Q.brand,width:n},o.createElement(a.EY,{color:g.Q.brand},"✻ ",e)),o.createElement(b.H,null))},NewVersionBox=()=>{const e="cyan",n=i.CW.getCurrentPackageJson(),t=n.version.includes("beta"),r=n.version.includes("alpha"),l=t?"@beta":r?"@alpha":"";return o.createElement(a.az,{paddingX:1,flexDirection:"column",borderStyle:"round",borderColor:e},o.createElement(a.EY,{color:e},"New Version Updated v",n.version," Release! Please visit ",u.KR," website to read changelog."),o.createElement(a.EY,{color:e},"Run npm install -g ",u.JP,l))},LoginBox=()=>{const{authSession:e,navigate:n}=(0,c.i7)(m.aO,(e=>({authSession:e.authSession,navigate:e.navigate}))),[t,r]=(0,o.useState)("idle"),[i,u]=(0,o.useState)(""),[b,y]=(0,o.useState)(""),h=(0,o.useRef)(new AbortController);return(0,o.useEffect)((()=>{const e=(0,d.bi)().urlSubject.subscribe(u);return()=>e.unsubscribe()}),[]),(0,a.Ge)(((l,a)=>{if(E.Om.RETURN(a)&&"idle"===t)try{r("loading"),y(""),(0,d.Yf)().login(h.current)}catch(e){r("error"),y(e instanceof Error?e.message:"Unknown error occurred")}else E.Om.ESCAPE(a)&&("loading"===t?(h.current.abort(),r("idle")):e&&n("/chat"))})),o.createElement(a.az,{paddingX:1,flexDirection:"column",gap:1,borderStyle:"round",borderColor:"grey"},"idle"===t?o.createElement(o.Fragment,null,o.createElement(a.az,null,o.createElement(a.EY,null,"Select login method:")),o.createElement(a.az,null,o.createElement(a.EY,{color:"green"},l.Ay.bullet," Login with Tencent Cloud CodeBuddy")),o.createElement(a.az,{justifyContent:"space-between"},o.createElement(a.EY,{color:"grey"},"(Press Enter to login)"))):"loading"===t?o.createElement(a.az,{paddingY:1,gap:1,flexDirection:"column"},o.createElement(a.az,null,o.createElement(a.EY,{color:"grey"},"Browser didn't open? User the url below to sign in:")),i&&o.createElement(a.az,null,o.createElement(a.EY,{color:"grey"},i)),o.createElement(a.az,{marginTop:1,gap:1},o.createElement(a.EY,{color:g.Q.brand},o.createElement(s.y$,{type:"star"})),o.createElement(a.EY,null,"Waiting for auth... (Press ESC to cancel)"))):"error"===t?o.createElement(o.Fragment,null,o.createElement(a.EY,{color:"red"},"Failed to login."),b&&o.createElement(a.EY,{color:"red"},"Message: ",b)):void 0)};r()}catch(e){r(e)}}))},42790:(e,n,t)=>{t.a(e,(async(e,r)=>{try{t.d(n,{H:()=>LogoText});var l=t(1597),a=t(14083),o=t(96540),c=t(66814),i=t(53829),s=t(83175),u=e([a,i]);[a,i]=u.then?(await u)():u;const LogoText=()=>{const e=(0,c.i7)(i.Gb,(e=>e.terminalWidth)),n=(0,o.useRef)((0,l.Ay)(s.Q.GradientColors)),t=(0,o.useCallback)((e=>n.current.multiline(e)),[n]),r=(0,o.useCallback)((()=>e>115?"\n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ ██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ ██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ ╚██████╗╚██████╔╝██████╔╝███████╗\n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\n \n\n . * . * . *\n /\\_/\\ \n ( o.o ) * . * \n > ^ < . \n":" \n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ \n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ \n \n ██████╗ ██████╗ ██████╗ ███████╗ \n██╔════╝██╔═══██╗██╔══██╗██╔════╝ \n██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗ \n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ \n "),[e]);return o.createElement(a.dL,{transform:t},o.createElement(a.EY,null,r()))};r()}catch(e){r(e)}}))}};
@@ -1 +1 @@
1
- "use strict";exports.id=566,exports.ids=[566],exports.modules={19250:(e,t,a)=>{a.a(e,(async(e,n)=>{try{a.d(t,{NH:()=>r.NH,pF:()=>m.pF});var l=a(77146),s=a(89536),c=a(70790),m=a(62875),r=a(82388),i=e([l,s,c,m,r]);[l,s,c,m,r]=i.then?(await i)():i,n()}catch(e){n(e)}}))},90566:(e,t,a)=>{a.a(e,(async(e,n)=>{try{a.r(t),a.d(t,{ChatView:()=>ChatView});var l=a(14083),s=a(96540),c=a(66814),m=a(26730),r=a(53829),i=a(59505),u=a(19250),o=a(66530),p=a(92709),g=e([l,m,r,i,u,o,p]);[l,m,r,i,u,o,p]=g.then?(await g)():g;const h=2,E=2,d=s.memo((({availableHeight:e})=>{const t=(0,c.i7)(r.Gb,(e=>e.staticKey)),a=(0,c.i7)(r.rZ,(e=>e.messageGroups)),n=(0,p.A)(a),[m,i]=(0,s.useState)([]),[u,g]=(0,s.useState)([]);(0,s.useEffect)((()=>{const e=[],t=[];for(const n of a){if("function_call_group"===n.type){if(!n.messages.find((e=>"function_call"===e.type&&e.status&&["completed","incomplete"].includes(e.status)))){t.push(...n.messages);continue}}e.push(...n.messages)}i(e),g(t)}),[a]);const E=s.useMemo((()=>[s.createElement(o.f,{key:"chat-header-box"}),...m.map((e=>s.createElement(p.h,{key:`message-item-${e.type}-${e.id}`,msg:e,expanded:n(e.id)})))]),[m,n]);return s.createElement(s.Fragment,null,s.createElement(l.jC,{key:t,items:E},(e=>e)),u.length?s.createElement(l.az,{flexDirection:"column",height:h},...u.map((e=>s.createElement(p.h,{key:`message-item-${e.type}-${e.id}`,msg:e,expanded:n(e.id)})))):s.createElement(s.Fragment,null))})),ChatContainer=()=>{const e=(0,c.i7)(r.Gb,(e=>e.terminalHeight)),[t,a]=(0,s.useState)(0);return(0,s.useEffect)((()=>{a(e-E)}),[e]),(0,m.o)(),(0,i.f)(),s.createElement(s.Fragment,null,s.createElement(d,{availableHeight:t}),s.createElement(l.az,{flexDirection:"column"},s.createElement(u.NH,null,s.createElement(u.pF,{availableHeight:t}))))},ChatView=()=>s.createElement(r.Fn,null,s.createElement(r.N7,null,s.createElement(r.Y5,null,s.createElement(ChatContainer,null))));n()}catch(e){n(e)}}))}};
1
+ "use strict";exports.id=566,exports.ids=[566],exports.modules={19250:(e,t,a)=>{a.a(e,(async(e,n)=>{try{a.d(t,{NH:()=>i.NH,pF:()=>m.pF});var l=a(77146),s=a(89536),c=a(70790),m=a(62875),i=a(82388),r=e([l,s,c,m,i]);[l,s,c,m,i]=r.then?(await r)():r,n()}catch(e){n(e)}}))},90566:(e,t,a)=>{a.a(e,(async(e,n)=>{try{a.r(t),a.d(t,{ChatView:()=>ChatView});var l=a(14083),s=a(96540),c=a(66814),m=a(26730),i=a(53829),r=a(59505),u=a(19250),o=a(66530),p=a(92709),g=e([l,m,i,r,u,o,p]);[l,m,i,r,u,o,p]=g.then?(await g)():g;const d=2,h=2,E=s.memo((({availableHeight:e})=>{const t=(0,c.i7)(i.Gb,(e=>e.staticKey)),a=(0,c.i7)(i.rZ,(e=>e.messageGroups)),n=(0,p.A)(a),[m,r]=(0,s.useState)([]),[u,g]=(0,s.useState)([]);(0,s.useEffect)((()=>{const e=[],t=[];for(const n of a){if("function_call_group"===n.type){if(!n.messages.find((e=>"function_call"===e.type&&e.status&&["completed","incomplete"].includes(e.status)))){t.push(...n.messages);continue}}e.push(...n.messages)}r(e),g(t)}),[a]);const h=s.useMemo((()=>[s.createElement(o.f,{key:"chat-header-box"}),...m.map((e=>s.createElement(p.h,{key:`message-item-${e.type}-${e.id}`,msg:e,expanded:n(e.id)})))]),[m,n]);return s.createElement(s.Fragment,null,s.createElement(l.jC,{key:t,items:h},(e=>e)),u.length?s.createElement(l.az,{flexDirection:"column",height:d},...u.map((e=>s.createElement(p.h,{key:`message-item-${e.id}-pending`,msg:e,expanded:n(e.id)})))):s.createElement(s.Fragment,null))})),ChatContainer=()=>{const e=(0,c.i7)(i.Gb,(e=>e.terminalHeight)),[t,a]=(0,s.useState)(0);return(0,s.useEffect)((()=>{a(e-h)}),[e]),(0,m.o)(),(0,r.f)(),s.createElement(s.Fragment,null,s.createElement(E,{availableHeight:t}),s.createElement(l.az,{flexDirection:"column"},s.createElement(u.NH,null,s.createElement(u.pF,{availableHeight:t}))))},ChatView=()=>s.createElement(i.N7,null,s.createElement(i.Y5,null,s.createElement(ChatContainer,null)));n()}catch(e){n(e)}}))}};