@tencent-ai/codebuddy-code 0.0.1-beta.30 → 0.0.1-beta.32

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,39 @@ 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.32] - 2025-09-04
9
+
10
+ ### Fixed
11
+ - **修复登出和rebuildAgent的问题**:解决Agent管理器中登出流程和重构Agent时的异常处理,提升系统稳定性和用户体验
12
+ - **修复切换环境账号后模型匹配问题**:解决用户在切换不同环境(内网/外网)账号后,模型配置无法正确匹配的问题,确保模型服务正常工作
13
+
14
+ ### Added
15
+ - **新增程序启动后模型消耗和文件变化统计**:实现对程序运行期间的模型使用量、token消耗和文件变化的统计功能,提供使用情况监控和分析
16
+ - **支持从环境变量或脚本运行获取认证token**:新增灵活的认证方式,支持通过环境变量或自定义脚本获取API密钥,提升部署和集成的便利性
17
+
18
+ ### Technical Details
19
+ - **Agent管理器优化**:重构登出流程和Agent重建逻辑,移除冗余的模型切换监听器,简化状态管理
20
+ - **环境认证提供器**:重命名并优化认证提供器,支持多环境账号切换和模型配置匹配
21
+ - **成本统计服务**:新增CostService和相关协议,实现模型消耗、文件变化的实时统计和上报
22
+ - **API密钥助手**:实现ApiKeyHelperProductProvider,支持从环境变量和脚本获取认证信息
23
+ - **遥测服务增强**:扩展遥测服务功能,集成成本统计和使用量监控
24
+ - **产品环境服务**:优化产品环境管理,支持动态环境切换和配置更新
25
+
26
+ ## [0.0.1-beta.31] - 2025-09-03
27
+
28
+ ### Fixed
29
+ - **修复输入框读取流截断问题**:修改输入框的useInput为useStdin,解决由于读取流截断导致在nvim下的吞字和多行丢失问题,提升终端兼容性和输入稳定性
30
+ - **修复 iOA 登录地址跳转不正确问题**:解决登录流程中地址跳转异常,确保用户能够正确完成认证流程
31
+
32
+ ### Changed
33
+ - **优化输入处理逻辑**:重构输入流处理机制,改进对复杂终端环境的适配,特别是在Neovim等编辑器中的表现
34
+
35
+ ### Technical Details
36
+ - 输入系统重构:将useInput替换为useStdin,解决流截断导致的字符丢失问题
37
+ - 终端兼容性:增强对nvim等编辑器环境的支持,确保多行输入的完整性
38
+ - 登录系统:修复iOA登录地址跳转逻辑,改进认证流程的稳定性
39
+ - 文档完善:添加相关注释和逻辑文档,便于后续维护和理解
40
+
8
41
  ## [0.0.1-beta.30] - 2025-09-02
9
42
 
10
43
  ### Fixed
package/README.md CHANGED
@@ -13,14 +13,14 @@
13
13
  codebuddy
14
14
  ```
15
15
 
16
- ## 反馈与支持
17
- - 使用 `/bug` 命令直接反馈问题
18
- - 或在 [GitHub Issues](https://github.com/tencent-cloud/codebuddy-code/issues) 提交
16
+ ## 反馈问题
17
+ - [Issues 页面](https://cnb.cool/codebuddy/codebuddy-code/-/issues) 中提交详细问题报告
18
+ - 通过官方渠道联系技术支持(codebuddy@tencent.com
19
19
 
20
20
  ## 隐私与数据收集
21
21
  - 用户反馈仅用于产品改进,不用于模型训练
22
22
  - 反馈数据保存 30 天,隐私有保障
23
23
 
24
24
  ## 相关链接
25
- - [官方文档](https://cloud.tencent.com/document/product/1749)
26
- - [产品主页](https://github.com/tencent-cloud/codebuddy-code)
25
+ - [官方文档](https://cnb.cool/codebuddy/codebuddy-code/-/blob/main/docs)
26
+ - [产品主页](https://cnb.cool/codebuddy/codebuddy-code)
@@ -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(80699),a=n(80932),o=n(14083),c=n(96540),i=n(66814),s=n(14822),u=n(78681),E=n(82101),m=n(34209),d=n(53829),g=n(49034),b=n(47693),h=n(83175),y=n(42790),p=e([o,E,d,g,y]);[o,E,d,g,y]=p.then?(await p)():p;const LoginView=()=>{const e=(0,i.i7)(d.Gb,(e=>e.staticKey));return c.createElement(c.Fragment,null,c.createElement(o.jC,{key:`login-view-${e}`,items:[c.createElement(LogoBox,{key:"logo-box"}),c.createElement(NewVersionBox,{key:"new-version-box"})]},(e=>e)),c.createElement(LoginBox,null))},LogoBox=()=>{const e=`Welcome to ${m.KR}`,t=e.length+8;return c.createElement(c.Fragment,null,c.createElement(o.az,{marginBottom:1,paddingLeft:1,borderStyle:"round",borderColor:h.Q.brand,width:t},c.createElement(o.EY,{color:h.Q.brand},"✻ ",e)),c.createElement(y.H,null))},NewVersionBox=()=>{const e="cyan",t=u.CW.getCurrentPackageJson(),n=t.version.includes("beta"),r=t.version.includes("alpha"),l=n?"@beta":r?"@alpha":"";return c.createElement(o.az,{paddingX:1,flexDirection:"column",borderStyle:"round",borderColor:e},c.createElement(o.EY,{color:e},"New Version Updated v",t.version," Release! Please visit ",m.KR," website to read changelog."),c.createElement(o.EY,{color:e},"Run npm install -g ",m.JP,l))},C={iOA:"internal",WeChat:"internal",Google:"external",Github:"external"},LoginBox=()=>{const{authSession:e,navigate:t}=(0,i.i7)(d.aO,(e=>({authSession:e.authSession,navigate:e.navigate}))),[n,r]=(0,c.useState)("idle"),[m,y]=(0,c.useState)(""),[p,f]=(0,c.useState)(""),[w,G]=(0,c.useState)("iOA"),[S,Y]=(0,c.useState)(!1),v=(0,c.useRef)(new AbortController);(0,c.useEffect)((()=>{const e=(0,b.bi)().urlSubject.subscribe(y);return()=>e.unsubscribe()}),[]),(0,c.useEffect)((()=>{m&&u.E.copyToClipboard(m)}),[m]),(0,c.useEffect)((()=>{(async()=>{try{const e=l.ContainerUtil.get(s.Oc),t=await e.isIntranet();Y(t),t||"iOA"!==w||G("Google")}catch(e){Y(!1),"iOA"===w&&G("Google")}})()}),[w]),(0,o.Ge)(((l,a)=>{if("idle"===n){if(g.Om.RETURN(a))try{r("loading"),f(""),(0,b.Yf)().login({type:C[w],abortController:v.current})}catch(e){r("error"),f(e instanceof Error?e.message:"Unknown error occurred")}else if(a.upArrow||a.downArrow){const e=S?["iOA","Google","Github","WeChat"]:["Google","Github","WeChat"],t=e.indexOf(w);let n;n=a.upArrow?t<=0?e.length-1:t-1:t>=e.length-1?0:t+1,G(e[n])}}else g.Om.ESCAPE(a)&&("loading"===n?(v.current.abort(),r("idle")):e&&t("/chat"))}));const A=S?["iOA","Google","Github","WeChat"]:["Google","Github","WeChat"];return c.createElement(o.az,{paddingX:1,flexDirection:"column",gap:1,borderStyle:"round",borderColor:"grey"},"idle"===n?c.createElement(c.Fragment,null,c.createElement(o.az,null,c.createElement(o.EY,null,"Select login method:")),A.map((e=>c.createElement(o.az,{key:e},c.createElement(o.EY,{color:w===e?"green":"grey"},w===e?a.Ay.bullet:" "," Login with ",e)))),c.createElement(o.az,{justifyContent:"space-between"},c.createElement(o.EY,{color:"grey"},"(Use ↑↓ to select, Enter to login)"))):"loading"===n?c.createElement(o.az,{paddingY:1,gap:1,flexDirection:"column"},c.createElement(o.az,null,c.createElement(o.EY,{color:"grey"},"Browser didn't open? Use the url below to sign in: (Copied link to clipboard)")),m&&c.createElement(o.az,null,c.createElement(o.EY,{color:"grey"},m)),c.createElement(o.az,{marginTop:1,gap:1},c.createElement(o.EY,{color:h.Q.brand},c.createElement(E.y$,{type:"star"})),c.createElement(o.EY,null,"Waiting for auth... (Press ESC to cancel)"))):"error"===n?c.createElement(c.Fragment,null,c.createElement(o.EY,{color:"red"},"Failed to login."),p&&c.createElement(o.EY,{color:"red"},"Message: ",p)):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(66814),i=n(53829),s=n(83175),u=e([a,i]);[a,i]=u.then?(await u)():u;const LogoText=()=>{const e=(0,c.i7)(i.Gb,(e=>e.terminalWidth)),t=(0,o.useRef)((0,l.Ay)(s.Q.GradientColors)),n=(0,o.useCallback)((e=>t.current.multiline(e)),[t]),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:n},o.createElement(a.EY,null,r()))};r()}catch(e){r(e)}}))}};
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(80699),a=n(80932),o=n(14083),c=n(96540),i=n(66814),s=n(79413),u=n(78681),E=n(82101),m=n(34209),d=n(53829),g=n(49034),b=n(47693),h=n(83175),y=n(42790),p=e([o,E,d,g,y]);[o,E,d,g,y]=p.then?(await p)():p;const LoginView=()=>{const e=(0,i.i7)(d.Gb,(e=>e.staticKey));return c.createElement(c.Fragment,null,c.createElement(o.jC,{key:`login-view-${e}`,items:[c.createElement(LogoBox,{key:"logo-box"}),c.createElement(NewVersionBox,{key:"new-version-box"})]},(e=>e)),c.createElement(LoginBox,null))},LogoBox=()=>{const e=`Welcome to ${m.KR}`,t=e.length+8;return c.createElement(c.Fragment,null,c.createElement(o.az,{marginBottom:1,paddingLeft:1,borderStyle:"round",borderColor:h.Q.brand,width:t},c.createElement(o.EY,{color:h.Q.brand},"✻ ",e)),c.createElement(y.H,null))},NewVersionBox=()=>{const e="cyan",t=u.CW.getCurrentPackageJson(),n=t.version.includes("beta"),r=t.version.includes("alpha"),l=n?"@beta":r?"@alpha":"";return c.createElement(o.az,{paddingX:1,flexDirection:"column",borderStyle:"round",borderColor:e},c.createElement(o.EY,{color:e},"New Version Updated v",t.version," Release! Please visit ",m.KR," website to read changelog."),c.createElement(o.EY,{color:e},"Run npm install -g ",m.JP,l))},C={iOA:"iOA",WeChat:"internal",Google:"external",Github:"external"},LoginBox=()=>{const{authSession:e,navigate:t}=(0,i.i7)(d.aO,(e=>({authSession:e.authSession,navigate:e.navigate}))),[n,r]=(0,c.useState)("idle"),[m,y]=(0,c.useState)(""),[p,f]=(0,c.useState)(""),[w,G]=(0,c.useState)("iOA"),[S,Y]=(0,c.useState)(!1),A=(0,c.useRef)(new AbortController);(0,c.useEffect)((()=>{const e=(0,b.bi)().urlSubject.subscribe(y);return()=>e.unsubscribe()}),[]),(0,c.useEffect)((()=>{m&&u.E.copyToClipboard(m)}),[m]),(0,c.useEffect)((()=>{(async()=>{try{const e=l.ContainerUtil.get(s.Oc),t=await e.isIntranet();Y(t),t||"iOA"!==w||G("Google")}catch(e){Y(!1),"iOA"===w&&G("Google")}})()}),[w]),(0,o.Ge)(((l,a)=>{if("idle"===n){if(g.Om.RETURN(a))try{r("loading"),f(""),(0,b.Yf)().login({type:C[w],abortController:A.current})}catch(e){r("error"),f(e instanceof Error?e.message:"Unknown error occurred")}else if(a.upArrow||a.downArrow){const e=S?["iOA","Google","Github","WeChat"]:["Google","Github","WeChat"],t=e.indexOf(w);let n;n=a.upArrow?t<=0?e.length-1:t-1:t>=e.length-1?0:t+1,G(e[n])}}else g.Om.ESCAPE(a)&&("loading"===n?(A.current.abort(),r("idle")):e&&t("/chat"))}));const v=S?["iOA","Google","Github","WeChat"]:["Google","Github","WeChat"];return c.createElement(o.az,{paddingX:1,flexDirection:"column",gap:1,borderStyle:"round",borderColor:"grey"},"idle"===n?c.createElement(c.Fragment,null,c.createElement(o.az,null,c.createElement(o.EY,null,"Select login method:")),v.map((e=>c.createElement(o.az,{key:e},c.createElement(o.EY,{color:w===e?"green":"grey"},w===e?a.Ay.bullet:" "," Login with ",e)))),c.createElement(o.az,{justifyContent:"space-between"},c.createElement(o.EY,{color:"grey"},"(Use ↑↓ to select, Enter to login)"))):"loading"===n?c.createElement(o.az,{paddingY:1,gap:1,flexDirection:"column"},c.createElement(o.az,null,c.createElement(o.EY,{color:"grey"},"Browser didn't open? Use the url below to sign in: (Copied link to clipboard)")),m&&c.createElement(o.az,null,c.createElement(o.EY,{color:"grey"},m)),c.createElement(o.az,{marginTop:1,gap:1},c.createElement(o.EY,{color:h.Q.brand},c.createElement(E.y$,{type:"star"})),c.createElement(o.EY,null,"Waiting for auth... (Press ESC to cancel)"))):"error"===n?c.createElement(c.Fragment,null,c.createElement(o.EY,{color:"red"},"Failed to login."),p&&c.createElement(o.EY,{color:"red"},"Message: ",p)):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(66814),i=n(53829),s=n(83175),u=e([a,i]);[a,i]=u.then?(await u)():u;const LogoText=()=>{const e=(0,c.i7)(i.Gb,(e=>e.terminalWidth)),t=(0,o.useRef)((0,l.Ay)(s.Q.GradientColors)),n=(0,o.useCallback)((e=>t.current.multiline(e)),[t]),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:n},o.createElement(a.EY,null,r()))};r()}catch(e){r(e)}}))}};