@tencent-ai/agent-sdk 0.0.13 → 0.1.0-next.989

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.
Files changed (282) hide show
  1. package/README.md +1 -9
  2. package/dist/agent-sdk.js +1 -7
  3. package/lib/common/application-utils.d.ts.map +1 -1
  4. package/lib/common/application-utils.js +2 -7
  5. package/lib/common/application-utils.js.map +1 -1
  6. package/lib/common/index.d.ts +0 -1
  7. package/lib/common/index.d.ts.map +1 -1
  8. package/lib/common/index.js +0 -1
  9. package/lib/common/index.js.map +1 -1
  10. package/lib/common/services.d.ts +8 -0
  11. package/lib/common/services.d.ts.map +1 -0
  12. package/lib/common/services.js +21 -0
  13. package/lib/common/services.js.map +1 -0
  14. package/package.json +3 -6
  15. package/lib/common/services/agent.d.ts +0 -12
  16. package/lib/common/services/agent.d.ts.map +0 -1
  17. package/lib/common/services/agent.js +0 -28
  18. package/lib/common/services/agent.js.map +0 -1
  19. package/lib/common/services/auth.d.ts +0 -53
  20. package/lib/common/services/auth.d.ts.map +0 -1
  21. package/lib/common/services/auth.js +0 -83
  22. package/lib/common/services/auth.js.map +0 -1
  23. package/lib/common/services/codebase.d.ts +0 -44
  24. package/lib/common/services/codebase.d.ts.map +0 -1
  25. package/lib/common/services/codebase.js +0 -87
  26. package/lib/common/services/codebase.js.map +0 -1
  27. package/lib/common/services/event.d.ts +0 -8
  28. package/lib/common/services/event.d.ts.map +0 -1
  29. package/lib/common/services/event.js +0 -18
  30. package/lib/common/services/event.js.map +0 -1
  31. package/lib/common/services/filepath.d.ts +0 -7
  32. package/lib/common/services/filepath.d.ts.map +0 -1
  33. package/lib/common/services/filepath.js +0 -16
  34. package/lib/common/services/filepath.js.map +0 -1
  35. package/lib/common/services/http.d.ts +0 -5
  36. package/lib/common/services/http.d.ts.map +0 -1
  37. package/lib/common/services/http.js +0 -12
  38. package/lib/common/services/http.js.map +0 -1
  39. package/lib/common/services/index.d.ts +0 -10
  40. package/lib/common/services/index.d.ts.map +0 -1
  41. package/lib/common/services/index.js +0 -26
  42. package/lib/common/services/index.js.map +0 -1
  43. package/lib/common/services/logger.d.ts +0 -7
  44. package/lib/common/services/logger.d.ts.map +0 -1
  45. package/lib/common/services/logger.js +0 -17
  46. package/lib/common/services/logger.js.map +0 -1
  47. package/lib/common/services/product.d.ts +0 -10
  48. package/lib/common/services/product.d.ts.map +0 -1
  49. package/lib/common/services/product.js +0 -26
  50. package/lib/common/services/product.js.map +0 -1
  51. package/lib/common/services/tracing.d.ts +0 -9
  52. package/lib/common/services/tracing.d.ts.map +0 -1
  53. package/lib/common/services/tracing.js +0 -25
  54. package/lib/common/services/tracing.js.map +0 -1
  55. package/lib/common/types/agents/agent.d.ts +0 -49
  56. package/lib/common/types/agents/agent.d.ts.map +0 -1
  57. package/lib/common/types/agents/agent.js +0 -9
  58. package/lib/common/types/agents/agent.js.map +0 -1
  59. package/lib/common/types/agents/ai.d.ts +0 -96
  60. package/lib/common/types/agents/ai.d.ts.map +0 -1
  61. package/lib/common/types/agents/ai.js +0 -3
  62. package/lib/common/types/agents/ai.js.map +0 -1
  63. package/lib/common/types/agents/completion.d.ts +0 -192
  64. package/lib/common/types/agents/completion.d.ts.map +0 -1
  65. package/lib/common/types/agents/completion.js +0 -4
  66. package/lib/common/types/agents/completion.js.map +0 -1
  67. package/lib/common/types/agents/conversation-manager.d.ts +0 -256
  68. package/lib/common/types/agents/conversation-manager.d.ts.map +0 -1
  69. package/lib/common/types/agents/conversation-manager.js +0 -3
  70. package/lib/common/types/agents/conversation-manager.js.map +0 -1
  71. package/lib/common/types/agents/craft-history.d.ts +0 -111
  72. package/lib/common/types/agents/craft-history.d.ts.map +0 -1
  73. package/lib/common/types/agents/craft-history.js +0 -3
  74. package/lib/common/types/agents/craft-history.js.map +0 -1
  75. package/lib/common/types/agents/craft.d.ts +0 -17
  76. package/lib/common/types/agents/craft.d.ts.map +0 -1
  77. package/lib/common/types/agents/craft.js +0 -3
  78. package/lib/common/types/agents/craft.js.map +0 -1
  79. package/lib/common/types/agents/file-tree.d.ts +0 -169
  80. package/lib/common/types/agents/file-tree.d.ts.map +0 -1
  81. package/lib/common/types/agents/file-tree.js +0 -17
  82. package/lib/common/types/agents/file-tree.js.map +0 -1
  83. package/lib/common/types/agents/index.d.ts +0 -10
  84. package/lib/common/types/agents/index.d.ts.map +0 -1
  85. package/lib/common/types/agents/index.js +0 -26
  86. package/lib/common/types/agents/index.js.map +0 -1
  87. package/lib/common/types/agents/run.d.ts +0 -133
  88. package/lib/common/types/agents/run.d.ts.map +0 -1
  89. package/lib/common/types/agents/run.js +0 -27
  90. package/lib/common/types/agents/run.js.map +0 -1
  91. package/lib/common/types/agents/tools.d.ts +0 -336
  92. package/lib/common/types/agents/tools.d.ts.map +0 -1
  93. package/lib/common/types/agents/tools.js +0 -59
  94. package/lib/common/types/agents/tools.js.map +0 -1
  95. package/lib/common/types/agents/user-reference.d.ts +0 -78
  96. package/lib/common/types/agents/user-reference.d.ts.map +0 -1
  97. package/lib/common/types/agents/user-reference.js +0 -3
  98. package/lib/common/types/agents/user-reference.js.map +0 -1
  99. package/lib/common/types/auth.d.ts +0 -59
  100. package/lib/common/types/auth.d.ts.map +0 -1
  101. package/lib/common/types/auth.js +0 -3
  102. package/lib/common/types/auth.js.map +0 -1
  103. package/lib/common/types/codebase.d.ts +0 -69
  104. package/lib/common/types/codebase.d.ts.map +0 -1
  105. package/lib/common/types/codebase.js +0 -3
  106. package/lib/common/types/codebase.js.map +0 -1
  107. package/lib/common/types/event/activity.d.ts +0 -5
  108. package/lib/common/types/event/activity.d.ts.map +0 -1
  109. package/lib/common/types/event/activity.js +0 -3
  110. package/lib/common/types/event/activity.js.map +0 -1
  111. package/lib/common/types/event/authentication.d.ts +0 -9
  112. package/lib/common/types/event/authentication.d.ts.map +0 -1
  113. package/lib/common/types/event/authentication.js +0 -9
  114. package/lib/common/types/event/authentication.js.map +0 -1
  115. package/lib/common/types/event/chat.d.ts +0 -38
  116. package/lib/common/types/event/chat.d.ts.map +0 -1
  117. package/lib/common/types/event/chat.js +0 -3
  118. package/lib/common/types/event/chat.js.map +0 -1
  119. package/lib/common/types/event/check-point.d.ts +0 -13
  120. package/lib/common/types/event/check-point.d.ts.map +0 -1
  121. package/lib/common/types/event/check-point.js +0 -3
  122. package/lib/common/types/event/check-point.js.map +0 -1
  123. package/lib/common/types/event/code.d.ts +0 -19
  124. package/lib/common/types/event/code.d.ts.map +0 -1
  125. package/lib/common/types/event/code.js +0 -11
  126. package/lib/common/types/event/code.js.map +0 -1
  127. package/lib/common/types/event/commit-message.d.ts +0 -25
  128. package/lib/common/types/event/commit-message.d.ts.map +0 -1
  129. package/lib/common/types/event/commit-message.js +0 -3
  130. package/lib/common/types/event/commit-message.js.map +0 -1
  131. package/lib/common/types/event/completion.d.ts +0 -276
  132. package/lib/common/types/event/completion.d.ts.map +0 -1
  133. package/lib/common/types/event/completion.js +0 -38
  134. package/lib/common/types/event/completion.js.map +0 -1
  135. package/lib/common/types/event/craft.d.ts +0 -218
  136. package/lib/common/types/event/craft.d.ts.map +0 -1
  137. package/lib/common/types/event/craft.js +0 -3
  138. package/lib/common/types/event/craft.js.map +0 -1
  139. package/lib/common/types/event/events.d.ts +0 -114
  140. package/lib/common/types/event/events.d.ts.map +0 -1
  141. package/lib/common/types/event/events.js +0 -79
  142. package/lib/common/types/event/events.js.map +0 -1
  143. package/lib/common/types/event/ide-event.d.ts +0 -44
  144. package/lib/common/types/event/ide-event.d.ts.map +0 -1
  145. package/lib/common/types/event/ide-event.js +0 -15
  146. package/lib/common/types/event/ide-event.js.map +0 -1
  147. package/lib/common/types/event/index.d.ts +0 -12
  148. package/lib/common/types/event/index.d.ts.map +0 -1
  149. package/lib/common/types/event/index.js +0 -28
  150. package/lib/common/types/event/index.js.map +0 -1
  151. package/lib/common/types/event/legacy-completion.d.ts +0 -196
  152. package/lib/common/types/event/legacy-completion.d.ts.map +0 -1
  153. package/lib/common/types/event/legacy-completion.js +0 -38
  154. package/lib/common/types/event/legacy-completion.js.map +0 -1
  155. package/lib/common/types/event/mcp.d.ts +0 -20
  156. package/lib/common/types/event/mcp.d.ts.map +0 -1
  157. package/lib/common/types/event/mcp.js +0 -3
  158. package/lib/common/types/event/mcp.js.map +0 -1
  159. package/lib/common/types/event/plugin-status.d.ts +0 -7
  160. package/lib/common/types/event/plugin-status.d.ts.map +0 -1
  161. package/lib/common/types/event/plugin-status.js +0 -3
  162. package/lib/common/types/event/plugin-status.js.map +0 -1
  163. package/lib/common/types/event/protocol.d.ts +0 -24
  164. package/lib/common/types/event/protocol.d.ts.map +0 -1
  165. package/lib/common/types/event/protocol.js +0 -3
  166. package/lib/common/types/event/protocol.js.map +0 -1
  167. package/lib/common/types/filepath.d.ts +0 -35
  168. package/lib/common/types/filepath.d.ts.map +0 -1
  169. package/lib/common/types/filepath.js +0 -3
  170. package/lib/common/types/filepath.js.map +0 -1
  171. package/lib/common/types/http.d.ts +0 -3
  172. package/lib/common/types/http.d.ts.map +0 -1
  173. package/lib/common/types/http.js +0 -3
  174. package/lib/common/types/http.js.map +0 -1
  175. package/lib/common/types/index.d.ts +0 -11
  176. package/lib/common/types/index.d.ts.map +0 -1
  177. package/lib/common/types/index.js +0 -27
  178. package/lib/common/types/index.js.map +0 -1
  179. package/lib/common/types/logger.d.ts +0 -10
  180. package/lib/common/types/logger.d.ts.map +0 -1
  181. package/lib/common/types/logger.js +0 -3
  182. package/lib/common/types/logger.js.map +0 -1
  183. package/lib/common/types/product/activities.d.ts +0 -5
  184. package/lib/common/types/product/activities.d.ts.map +0 -1
  185. package/lib/common/types/product/activities.js +0 -3
  186. package/lib/common/types/product/activities.js.map +0 -1
  187. package/lib/common/types/product/agent-tools.d.ts +0 -5
  188. package/lib/common/types/product/agent-tools.d.ts.map +0 -1
  189. package/lib/common/types/product/agent-tools.js +0 -3
  190. package/lib/common/types/product/agent-tools.js.map +0 -1
  191. package/lib/common/types/product/agent.d.ts +0 -38
  192. package/lib/common/types/product/agent.d.ts.map +0 -1
  193. package/lib/common/types/product/agent.js +0 -10
  194. package/lib/common/types/product/agent.js.map +0 -1
  195. package/lib/common/types/product/authentication.d.ts +0 -84
  196. package/lib/common/types/product/authentication.d.ts.map +0 -1
  197. package/lib/common/types/product/authentication.js +0 -40
  198. package/lib/common/types/product/authentication.js.map +0 -1
  199. package/lib/common/types/product/codebase.d.ts +0 -40
  200. package/lib/common/types/product/codebase.d.ts.map +0 -1
  201. package/lib/common/types/product/codebase.js +0 -3
  202. package/lib/common/types/product/codebase.js.map +0 -1
  203. package/lib/common/types/product/commit-message.d.ts +0 -7
  204. package/lib/common/types/product/commit-message.d.ts.map +0 -1
  205. package/lib/common/types/product/commit-message.js +0 -3
  206. package/lib/common/types/product/commit-message.js.map +0 -1
  207. package/lib/common/types/product/completion.d.ts +0 -8
  208. package/lib/common/types/product/completion.d.ts.map +0 -1
  209. package/lib/common/types/product/completion.js +0 -3
  210. package/lib/common/types/product/completion.js.map +0 -1
  211. package/lib/common/types/product/config.d.ts +0 -6
  212. package/lib/common/types/product/config.d.ts.map +0 -1
  213. package/lib/common/types/product/config.js +0 -3
  214. package/lib/common/types/product/config.js.map +0 -1
  215. package/lib/common/types/product/features.d.ts +0 -149
  216. package/lib/common/types/product/features.d.ts.map +0 -1
  217. package/lib/common/types/product/features.js +0 -154
  218. package/lib/common/types/product/features.js.map +0 -1
  219. package/lib/common/types/product/index.d.ts +0 -23
  220. package/lib/common/types/product/index.d.ts.map +0 -1
  221. package/lib/common/types/product/index.js +0 -39
  222. package/lib/common/types/product/index.js.map +0 -1
  223. package/lib/common/types/product/inline-chat.d.ts +0 -15
  224. package/lib/common/types/product/inline-chat.d.ts.map +0 -1
  225. package/lib/common/types/product/inline-chat.js +0 -3
  226. package/lib/common/types/product/inline-chat.js.map +0 -1
  227. package/lib/common/types/product/knowledge-base.d.ts +0 -16
  228. package/lib/common/types/product/knowledge-base.d.ts.map +0 -1
  229. package/lib/common/types/product/knowledge-base.js +0 -3
  230. package/lib/common/types/product/knowledge-base.js.map +0 -1
  231. package/lib/common/types/product/language-model.d.ts +0 -38
  232. package/lib/common/types/product/language-model.d.ts.map +0 -1
  233. package/lib/common/types/product/language-model.js +0 -3
  234. package/lib/common/types/product/language-model.js.map +0 -1
  235. package/lib/common/types/product/links.d.ts +0 -20
  236. package/lib/common/types/product/links.d.ts.map +0 -1
  237. package/lib/common/types/product/links.js +0 -3
  238. package/lib/common/types/product/links.js.map +0 -1
  239. package/lib/common/types/product/log.d.ts +0 -39
  240. package/lib/common/types/product/log.d.ts.map +0 -1
  241. package/lib/common/types/product/log.js +0 -12
  242. package/lib/common/types/product/log.js.map +0 -1
  243. package/lib/common/types/product/product-provider.d.ts +0 -12
  244. package/lib/common/types/product/product-provider.d.ts.map +0 -1
  245. package/lib/common/types/product/product-provider.js +0 -5
  246. package/lib/common/types/product/product-provider.js.map +0 -1
  247. package/lib/common/types/product/product.d.ts +0 -179
  248. package/lib/common/types/product/product.d.ts.map +0 -1
  249. package/lib/common/types/product/product.js +0 -3
  250. package/lib/common/types/product/product.js.map +0 -1
  251. package/lib/common/types/product/prompt-template.d.ts +0 -6
  252. package/lib/common/types/product/prompt-template.d.ts.map +0 -1
  253. package/lib/common/types/product/prompt-template.js +0 -3
  254. package/lib/common/types/product/prompt-template.js.map +0 -1
  255. package/lib/common/types/product/remote-agent.d.ts +0 -20
  256. package/lib/common/types/product/remote-agent.d.ts.map +0 -1
  257. package/lib/common/types/product/remote-agent.js +0 -3
  258. package/lib/common/types/product/remote-agent.js.map +0 -1
  259. package/lib/common/types/product/replacement.d.ts +0 -38
  260. package/lib/common/types/product/replacement.d.ts.map +0 -1
  261. package/lib/common/types/product/replacement.js +0 -18
  262. package/lib/common/types/product/replacement.js.map +0 -1
  263. package/lib/common/types/product/telemetry.d.ts +0 -18
  264. package/lib/common/types/product/telemetry.d.ts.map +0 -1
  265. package/lib/common/types/product/telemetry.js +0 -3
  266. package/lib/common/types/product/telemetry.js.map +0 -1
  267. package/lib/common/types/product/updates.d.ts +0 -17
  268. package/lib/common/types/product/updates.d.ts.map +0 -1
  269. package/lib/common/types/product/updates.js +0 -8
  270. package/lib/common/types/product/updates.js.map +0 -1
  271. package/lib/common/types/protocol.d.ts +0 -9
  272. package/lib/common/types/protocol.d.ts.map +0 -1
  273. package/lib/common/types/protocol.js +0 -10
  274. package/lib/common/types/protocol.js.map +0 -1
  275. package/lib/common/types/tracing.d.ts +0 -74
  276. package/lib/common/types/tracing.d.ts.map +0 -1
  277. package/lib/common/types/tracing.js +0 -3
  278. package/lib/common/types/tracing.js.map +0 -1
  279. package/lib/common/utils.d.ts +0 -3
  280. package/lib/common/utils.d.ts.map +0 -1
  281. package/lib/common/utils.js +0 -10
  282. package/lib/common/utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"application-utils.d.ts","sourceRoot":"","sources":["../../src/common/application-utils.ts"],"names":[],"mappings":"AAIA,8BAAsB,gBAAgB;IAClC,MAAM,CAAC,OAAO,UAAS;WACV,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAYtC"}
1
+ {"version":3,"file":"application-utils.d.ts","sourceRoot":"","sources":["../../src/common/application-utils.ts"],"names":[],"mappings":"AAIA,8BAAsB,gBAAgB;IAClC,MAAM,CAAC,OAAO,UAAS;WACV,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAQtC"}
@@ -9,13 +9,8 @@ class ApplicationUtils {
9
9
  return;
10
10
  }
11
11
  this.started = true;
12
- try {
13
- const application = await component_registry_1.ComponentRegistry.get(core_1.Application);
14
- await application.start();
15
- }
16
- catch (error) {
17
- this.started = false;
18
- }
12
+ const application = await component_registry_1.ComponentRegistry.get(core_1.Application);
13
+ await application.start();
19
14
  }
20
15
  }
21
16
  exports.ApplicationUtils = ApplicationUtils;
@@ -1 +1 @@
1
- {"version":3,"file":"application-utils.js","sourceRoot":"","sources":["../../src/common/application-utils.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAE3C,6DAAyD;AAEzD,MAAsB,gBAAgB;IAElC,MAAM,CAAC,KAAK,CAAC,KAAK;QACd,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,OAAO;QACX,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC;YACD,MAAM,WAAW,GAAG,MAAM,sCAAiB,CAAC,GAAG,CAAc,kBAAW,CAAC,CAAC;YAC1E,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACzB,CAAC;IACL,CAAC;;AAbL,4CAcC;AAbU,wBAAO,GAAG,KAAK,CAAC"}
1
+ {"version":3,"file":"application-utils.js","sourceRoot":"","sources":["../../src/common/application-utils.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAE3C,6DAAyD;AAEzD,MAAsB,gBAAgB;IAElC,MAAM,CAAC,KAAK,CAAC,KAAK;QACd,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,OAAO;QACX,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,MAAM,WAAW,GAAG,MAAM,sCAAiB,CAAC,GAAG,CAAc,kBAAW,CAAC,CAAC;QAC1E,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;;AATL,4CAUC;AATU,wBAAO,GAAG,KAAK,CAAC"}
@@ -1,5 +1,4 @@
1
1
  export * from './application-utils';
2
2
  export * from './component-registry';
3
3
  export * from './services';
4
- export * from './types';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC"}
@@ -17,5 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./application-utils"), exports);
18
18
  __exportStar(require("./component-registry"), exports);
19
19
  __exportStar(require("./services"), exports);
20
- __exportStar(require("./types"), exports);
21
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC;AACrC,6CAA2B;AAC3B,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC;AACrC,6CAA2B"}
@@ -0,0 +1,8 @@
1
+ import { ComponentId, Logger } from '@celljs/core';
2
+ import { ProductManager } from '@genie/product';
3
+ export declare abstract class Services {
4
+ protected static doGet<T>(id: ComponentId): Promise<T>;
5
+ static getLogger(): Promise<Logger>;
6
+ static getProductManager(): Promise<ProductManager>;
7
+ }
8
+ //# sourceMappingURL=services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/common/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKhD,8BAAsB,QAAQ;qBACH,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAK5D,MAAM,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC,MAAM,CAAC,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC;CAGtD"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Services = void 0;
4
+ const core_1 = require("@celljs/core");
5
+ const product_1 = require("@genie/product");
6
+ const application_utils_1 = require("./application-utils");
7
+ const component_registry_1 = require("./component-registry");
8
+ class Services {
9
+ static async doGet(id) {
10
+ await application_utils_1.ApplicationUtils.start();
11
+ return component_registry_1.ComponentRegistry.get(id);
12
+ }
13
+ static getLogger() {
14
+ return this.doGet(core_1.Logger);
15
+ }
16
+ static getProductManager() {
17
+ return this.doGet(product_1.ProductManager);
18
+ }
19
+ }
20
+ exports.Services = Services;
21
+ //# sourceMappingURL=services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/common/services.ts"],"names":[],"mappings":";;;AAAA,uCAAmD;AACnD,4CAAgD;AAEhD,2DAAuD;AACvD,6DAAyD;AAEzD,MAAsB,QAAQ;IAChB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAI,EAAe;QAC3C,MAAM,oCAAgB,CAAC,KAAK,EAAE,CAAC;QAC/B,OAAO,sCAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,SAAS;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,aAAM,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,iBAAiB;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,wBAAc,CAAC,CAAC;IACtC,CAAC;CACJ;AAbD,4BAaC"}
package/package.json CHANGED
@@ -1,14 +1,11 @@
1
1
  {
2
2
  "name": "@tencent-ai/agent-sdk",
3
- "version": "0.0.13",
3
+ "version": "0.1.0-next.989+c4bdd849",
4
4
  "description": "Tencent AI Agent SDK",
5
5
  "main": "./dist/agent-sdk.js",
6
6
  "typings": "lib/common/index.d.ts",
7
7
  "license": "MIT",
8
- "dependencies": {
9
- "axios": "^1.8.2",
10
- "rxjs": "^6.6.0"
11
- },
8
+ "dependencies": {},
12
9
  "publishConfig": {
13
10
  "access": "public"
14
11
  },
@@ -21,5 +18,5 @@
21
18
  ],
22
19
  "scripts": {},
23
20
  "devDependencies": {},
24
- "gitHead": "37ea19db9c246b9656da491092ce2aa2cb98f4f6"
21
+ "gitHead": "c4bdd849e7a9160d1c3ece61216ebda888f3c117"
25
22
  }
@@ -1,12 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { FileTreeService, RunResult } from '../types/agents';
3
- import { AgentContext, CompletionAgentCallRequest } from '../types/agents/agent';
4
- import { CodeCompletionResponse } from '../types/agents/completion';
5
- import { HistoryService } from '../types/agents/craft-history';
6
- export declare abstract class Agents {
7
- static dispatchCraftAgent(context: AgentContext): Promise<RunResult>;
8
- static dispatchCompletionAgent(request: CompletionAgentCallRequest): Promise<Observable<CodeCompletionResponse>>;
9
- static getCraftHistoryService(): Promise<HistoryService>;
10
- static getCraftFileTreeService(): Promise<FileTreeService>;
11
- }
12
- //# sourceMappingURL=agent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/common/services/agent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D,8BAAsB,MAAM;WACX,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC;WAQ7D,uBAAuB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;WAKzG,sBAAsB,IAAI,OAAO,CAAC,cAAc,CAAC;WAIjD,uBAAuB,IAAI,OAAO,CAAC,eAAe,CAAC;CAGnE"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Agents = void 0;
4
- const agent_core_1 = require("@genie/agent-core");
5
- const agent_craft_1 = require("@genie/agent-craft");
6
- const component_registry_1 = require("../component-registry");
7
- const utils_1 = require("../utils");
8
- class Agents {
9
- static async dispatchCraftAgent(context) {
10
- const dispatcher = await (0, utils_1.doGet)(agent_core_1.AgentDispatcher);
11
- return dispatcher.dispatch({
12
- agent: 'craft',
13
- agentContext: context
14
- });
15
- }
16
- static async dispatchCompletionAgent(request) {
17
- const dispatcher = await (0, utils_1.doGet)(agent_core_1.AgentDispatcher);
18
- return dispatcher.dispatch(request);
19
- }
20
- static async getCraftHistoryService() {
21
- return component_registry_1.ComponentRegistry.get(agent_craft_1.HistoryService);
22
- }
23
- static async getCraftFileTreeService() {
24
- return component_registry_1.ComponentRegistry.get(agent_core_1.FileTreeService);
25
- }
26
- }
27
- exports.Agents = Agents;
28
- //# sourceMappingURL=agent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/common/services/agent.ts"],"names":[],"mappings":";;;AAAA,kDAA2F;AAC3F,oDAAyE;AAGzE,8DAA0D;AAK1D,oCAAiC;AAEjC,MAAsB,MAAM;IACxB,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAqB;QACjD,MAAM,UAAU,GAAG,MAAM,IAAA,aAAK,EAAkB,4BAAe,CAAC,CAAC;QACjE,OAAO,UAAU,CAAC,QAAQ,CAAC;YACvB,KAAK,EAAE,OAAO;YACd,YAAY,EAAE,OAAO;SACxB,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAmC;QACpE,MAAM,UAAU,GAAG,MAAM,IAAA,aAAK,EAAkB,4BAAe,CAAC,CAAC;QACjE,OAAO,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,sBAAsB;QAC/B,OAAO,sCAAiB,CAAC,GAAG,CAAiB,4BAAiB,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,uBAAuB;QAChC,OAAO,sCAAiB,CAAC,GAAG,CAAkB,4BAAkB,CAAC,CAAC;IACtE,CAAC;CACJ;AArBD,wBAqBC"}
@@ -1,53 +0,0 @@
1
- import { BehaviorSubject } from 'rxjs';
2
- import { Account, AuthenticationProvider, AuthenticationStorage, AuthSession, ExternalUriOpener } from '../types/auth';
3
- import { Newable } from '../types/protocol';
4
- export declare abstract class Auth {
5
- /**
6
- * 获取当前认证会话。
7
- * @returns {Promise<AuthSession>} 当前的认证会话。
8
- */
9
- static getSession(): Promise<AuthSession>;
10
- /**
11
- * 获取当前认证会话的 BehaviorSubject,可用于订阅会话变化。
12
- * @returns {Promise<BehaviorSubject<AuthSession | undefined>>} 认证会话的可观察对象。
13
- */
14
- static getSession$(): Promise<BehaviorSubject<AuthSession | undefined>>;
15
- /**
16
- * 执行登录操作。
17
- * @returns {Promise<void>} 登录完成后返回。
18
- */
19
- static login(): Promise<void>;
20
- /**
21
- * 执行登出操作。
22
- * @returns {Promise<void>} 登出完成后返回。
23
- */
24
- static logout(): Promise<void>;
25
- /**
26
- * 刷新当前认证会话。
27
- * @returns {Promise<void>} 刷新完成后返回。
28
- */
29
- static refreshSession(): Promise<void>;
30
- /**
31
- * 切换账号。
32
- * @returns {Promise<void>} 切换完成后返回。
33
- */
34
- static switchAccount(account: Account): Promise<void>;
35
- /**
36
- * 注册自定义认证提供者。
37
- * @param constructor 认证提供者的构造函数。
38
- * @returns {Promise<void>} 注册完成后返回。
39
- */
40
- static registerAuthenticationProvider(constructor: Newable<AuthenticationProvider>): Promise<void>;
41
- /**
42
- * 注册自定义认证存储。
43
- * @param constructor 认证存储的构造函数。
44
- * @returns {Promise<void>} 注册完成后返回。
45
- */
46
- static registerAuthenticationStorage(constructor: Newable<AuthenticationStorage>): Promise<void>;
47
- /**
48
- * 注册自定义外部 URI 打开器。 默认通过外链方式发起登录,打开外链会调用当前注册的外部 URI 打开器。
49
- * @param constructor 外部 URI 打开器的构造函数。
50
- */
51
- static registerExternalUriOpener(constructor: Newable<ExternalUriOpener>): Promise<void>;
52
- }
53
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/common/services/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,8BAAsB,IAAI;IACtB;;;OAGG;WACU,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC;IAM/C;;;OAGG;WACU,WAAW,IAAI,OAAO,CAAC,eAAe,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAK7E;;;OAGG;WACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKnC;;;OAGG;WACU,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKpC;;;OAGG;WACU,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5C;;;OAGG;WACU,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3D;;;;OAIG;WACU,8BAA8B,CAAC,WAAW,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxG;;;;OAIG;WACU,6BAA6B,CAAC,WAAW,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAItG;;;OAGG;WACU,yBAAyB,CAAC,WAAW,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGjG"}
@@ -1,83 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Auth = void 0;
4
- const authentication_1 = require("@genie/authentication");
5
- const runtime_1 = require("@genie/runtime");
6
- const component_registry_1 = require("../component-registry");
7
- const utils_1 = require("../utils");
8
- class Auth {
9
- /**
10
- * 获取当前认证会话。
11
- * @returns {Promise<AuthSession>} 当前的认证会话。
12
- */
13
- static async getSession() {
14
- const manager = await (0, utils_1.doGet)(authentication_1.AuthenticationManager);
15
- const session = await manager.waitAuthSession();
16
- return session;
17
- }
18
- /**
19
- * 获取当前认证会话的 BehaviorSubject,可用于订阅会话变化。
20
- * @returns {Promise<BehaviorSubject<AuthSession | undefined>>} 认证会话的可观察对象。
21
- */
22
- static async getSession$() {
23
- const manager = await (0, utils_1.doGet)(authentication_1.AuthenticationManager);
24
- return manager.currentSessionSubject;
25
- }
26
- /**
27
- * 执行登录操作。
28
- * @returns {Promise<void>} 登录完成后返回。
29
- */
30
- static async login() {
31
- const manager = await (0, utils_1.doGet)(authentication_1.AuthenticationManager);
32
- return manager.login();
33
- }
34
- /**
35
- * 执行登出操作。
36
- * @returns {Promise<void>} 登出完成后返回。
37
- */
38
- static async logout() {
39
- const manager = await (0, utils_1.doGet)(authentication_1.AuthenticationManager);
40
- return manager.logout();
41
- }
42
- /**
43
- * 刷新当前认证会话。
44
- * @returns {Promise<void>} 刷新完成后返回。
45
- */
46
- static async refreshSession() {
47
- const manager = await (0, utils_1.doGet)(authentication_1.AuthenticationManager);
48
- return manager.refreshSession();
49
- }
50
- /**
51
- * 切换账号。
52
- * @returns {Promise<void>} 切换完成后返回。
53
- */
54
- static async switchAccount(account) {
55
- const manager = await (0, utils_1.doGet)(authentication_1.AuthenticationManager);
56
- return manager.switchAccount(account);
57
- }
58
- /**
59
- * 注册自定义认证提供者。
60
- * @param constructor 认证提供者的构造函数。
61
- * @returns {Promise<void>} 注册完成后返回。
62
- */
63
- static async registerAuthenticationProvider(constructor) {
64
- await component_registry_1.ComponentRegistry.bind(authentication_1.AuthenticationProvider, constructor);
65
- }
66
- /**
67
- * 注册自定义认证存储。
68
- * @param constructor 认证存储的构造函数。
69
- * @returns {Promise<void>} 注册完成后返回。
70
- */
71
- static async registerAuthenticationStorage(constructor) {
72
- await component_registry_1.ComponentRegistry.bind(authentication_1.AuthenticationStorage, constructor);
73
- }
74
- /**
75
- * 注册自定义外部 URI 打开器。 默认通过外链方式发起登录,打开外链会调用当前注册的外部 URI 打开器。
76
- * @param constructor 外部 URI 打开器的构造函数。
77
- */
78
- static async registerExternalUriOpener(constructor) {
79
- await component_registry_1.ComponentRegistry.rebind(runtime_1.ExternalUriOpener, constructor);
80
- }
81
- }
82
- exports.Auth = Auth;
83
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/common/services/auth.ts"],"names":[],"mappings":";;;AAAA,0DAAsK;AACtK,4CAA2E;AAG3E,8DAA0D;AAG1D,oCAAiC;AAEjC,MAAsB,IAAI;IACtB;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,UAAU;QACnB,MAAM,OAAO,GAAG,MAAM,IAAA,aAAK,EAAwB,sCAAqB,CAAC,CAAC;QAC1E,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,eAAe,EAAE,CAAC;QAChD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW;QACpB,MAAM,OAAO,GAAG,MAAM,IAAA,aAAK,EAAwB,sCAAqB,CAAC,CAAC;QAC1E,OAAO,OAAO,CAAC,qBAAqB,CAAC;IACzC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,KAAK;QACd,MAAM,OAAO,GAAG,MAAM,IAAA,aAAK,EAAwB,sCAAqB,CAAC,CAAC;QAC1E,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM;QACf,MAAM,OAAO,GAAG,MAAM,IAAA,aAAK,EAAwB,sCAAqB,CAAC,CAAC;QAC1E,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,cAAc;QACvB,MAAM,OAAO,GAAG,MAAM,IAAA,aAAK,EAAwB,sCAAqB,CAAC,CAAC;QAC1E,OAAO,OAAO,CAAC,cAAc,EAAE,CAAC;IACpC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,OAAgB;QACvC,MAAM,OAAO,GAAG,MAAM,IAAA,aAAK,EAAwB,sCAAqB,CAAC,CAAC;QAC1E,OAAO,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,WAA4C;QACpF,MAAM,sCAAiB,CAAC,IAAI,CAAC,uCAAyB,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,WAA2C;QAClF,MAAM,sCAAiB,CAAC,IAAI,CAAC,sCAAwB,EAAE,WAAW,CAAC,CAAC;IACxE,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,WAAuC;QAC1E,MAAM,sCAAiB,CAAC,MAAM,CAAC,2BAAoB,EAAE,WAAW,CAAC,CAAC;IACtE,CAAC;CACJ;AAjFD,oBAiFC"}
@@ -1,44 +0,0 @@
1
- import { BehaviorSubject } from 'rxjs';
2
- import { Newable } from '../types';
3
- import { CodebaseBuildIndexOptions, CodebaseFileUploader, CodebaseRecalledItem, CodebaseRecallOptions } from '../types/codebase';
4
- export declare abstract class Codebase {
5
- /**
6
- * 获取最新的 codebase id 的 BehaviorSubject,需要在本地做持久化存储。下一次构建索引时带上,以做到增量构建。
7
- * @returns {BehaviorSubject<string>} - codebase id 的 BehaviorSubject
8
- */
9
- static getCodebaseId$(): Promise<BehaviorSubject<string>>;
10
- /**
11
- * 获取上传进度的 BehaviorSubject,用于 UI 展示等
12
- * @returns {BehaviorSubject<number>} - 上传进度的 BehaviorSubject
13
- */
14
- static getUploadProgress$(): Promise<BehaviorSubject<number>>;
15
- /**
16
- * 获取索引进度的 BehaviorSubject,用于 UI 展示等
17
- * @returns {BehaviorSubject<number>} - 索引进度的 BehaviorSubject
18
- */
19
- static getIndexingProgress$(): Promise<BehaviorSubject<number>>;
20
- /**
21
- * 初始化 Codebase,需要在模块使用前需要执行
22
- */
23
- static init(fileUploader?: CodebaseFileUploader): Promise<void>;
24
- /**
25
- * 删除 codebase
26
- * @param id {string} - codebase id
27
- */
28
- static deleteCodebase(id: string, signal: AbortSignal): Promise<void>;
29
- /**
30
- * 构建索引。
31
- * @param {string} rootPath - 代码库的根路径。
32
- * @param {CodebaseBuildIndexOptions} options - 索引构建的选项。
33
- */
34
- static buildIndex(rootPath: string, options: CodebaseBuildIndexOptions): Promise<string | undefined>;
35
- /**
36
- * 使用给定的查询召回代码片段。
37
- * @param {string} id - codebase id。
38
- * @param {CodebaseRecallOptions} options - 召回操作的选项。
39
- * @returns {Promise<CodebaseRecalledItem[]>} 召回的条目。
40
- */
41
- static recall(id: string, options: CodebaseRecallOptions): Promise<CodebaseRecalledItem[]>;
42
- static registerFileUploader(constructor: Newable<CodebaseFileUploader>): Promise<void>;
43
- }
44
- //# sourceMappingURL=codebase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codebase.d.ts","sourceRoot":"","sources":["../../../src/common/services/codebase.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAA8B,oBAAoB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAI7J,8BAAsB,QAAQ;IAE1B;;;OAGG;WACU,cAAc,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAK/D;;;OAGG;WACU,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAKnE;;;OAGG;WACU,oBAAoB,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAKrE;;OAEG;WACU,IAAI,CAAC,YAAY,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBrE;;;OAGG;WACU,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3E;;;;OAIG;WACU,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAK1G;;;;;OAKG;WACU,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;WAKnF,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/F"}
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Codebase = void 0;
4
- const codebase_1 = require("@genie/codebase");
5
- const component_registry_1 = require("../component-registry");
6
- const utils_1 = require("../utils");
7
- const product_1 = require("./product");
8
- class Codebase {
9
- /**
10
- * 获取最新的 codebase id 的 BehaviorSubject,需要在本地做持久化存储。下一次构建索引时带上,以做到增量构建。
11
- * @returns {BehaviorSubject<string>} - codebase id 的 BehaviorSubject
12
- */
13
- static async getCodebaseId$() {
14
- const codebaseService = await (0, utils_1.doGet)(codebase_1.CodebaseService);
15
- return codebaseService.codebaseId$;
16
- }
17
- /**
18
- * 获取上传进度的 BehaviorSubject,用于 UI 展示等
19
- * @returns {BehaviorSubject<number>} - 上传进度的 BehaviorSubject
20
- */
21
- static async getUploadProgress$() {
22
- const codebaseService = await (0, utils_1.doGet)(codebase_1.CodebaseService);
23
- return codebaseService.uploadProgress$;
24
- }
25
- /**
26
- * 获取索引进度的 BehaviorSubject,用于 UI 展示等
27
- * @returns {BehaviorSubject<number>} - 索引进度的 BehaviorSubject
28
- */
29
- static async getIndexingProgress$() {
30
- const codebaseService = await (0, utils_1.doGet)(codebase_1.CodebaseService);
31
- return codebaseService.indexingProgress$;
32
- }
33
- /**
34
- * 初始化 Codebase,需要在模块使用前需要执行
35
- */
36
- static async init(fileUploader) {
37
- var _a;
38
- const configuration = await product_1.Product.waitConfiguration();
39
- const codebaseConfiguration = configuration.codebase;
40
- const endpoint = (_a = codebaseConfiguration === null || codebaseConfiguration === void 0 ? void 0 : codebaseConfiguration.endpoint) !== null && _a !== void 0 ? _a : configuration === null || configuration === void 0 ? void 0 : configuration.endpoint;
41
- if (!endpoint) {
42
- throw new Error('Codebase endpoint is not configured');
43
- }
44
- const configurationInput = {
45
- endpoint,
46
- fileUploader,
47
- maxUploadConcurrency: codebaseConfiguration === null || codebaseConfiguration === void 0 ? void 0 : codebaseConfiguration.maxUploadConcurrency,
48
- syncInterval: codebaseConfiguration === null || codebaseConfiguration === void 0 ? void 0 : codebaseConfiguration.syncInterval,
49
- timeout: codebaseConfiguration === null || codebaseConfiguration === void 0 ? void 0 : codebaseConfiguration.timeout,
50
- COSBucket: codebaseConfiguration === null || codebaseConfiguration === void 0 ? void 0 : codebaseConfiguration.COSBucket,
51
- };
52
- const codebaseService = await (0, utils_1.doGet)(codebase_1.CodebaseService);
53
- codebaseService.setConfiguration(configurationInput);
54
- }
55
- /**
56
- * 删除 codebase
57
- * @param id {string} - codebase id
58
- */
59
- static async deleteCodebase(id, signal) {
60
- const codebaseService = await (0, utils_1.doGet)(codebase_1.CodebaseService);
61
- await codebaseService.deleteCodebase(id, signal);
62
- }
63
- /**
64
- * 构建索引。
65
- * @param {string} rootPath - 代码库的根路径。
66
- * @param {CodebaseBuildIndexOptions} options - 索引构建的选项。
67
- */
68
- static async buildIndex(rootPath, options) {
69
- const codebaseService = await (0, utils_1.doGet)(codebase_1.CodebaseService);
70
- return codebaseService.buildIndex(rootPath, options);
71
- }
72
- /**
73
- * 使用给定的查询召回代码片段。
74
- * @param {string} id - codebase id。
75
- * @param {CodebaseRecallOptions} options - 召回操作的选项。
76
- * @returns {Promise<CodebaseRecalledItem[]>} 召回的条目。
77
- */
78
- static async recall(id, options) {
79
- const codebaseService = await (0, utils_1.doGet)(codebase_1.CodebaseService);
80
- return codebaseService.recall(id, options);
81
- }
82
- static async registerFileUploader(constructor) {
83
- await component_registry_1.ComponentRegistry.bind(codebase_1.CodebaseFileUploader, constructor);
84
- }
85
- }
86
- exports.Codebase = Codebase;
87
- //# sourceMappingURL=codebase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codebase.js","sourceRoot":"","sources":["../../../src/common/services/codebase.ts"],"names":[],"mappings":";;;AAAA,8CAAmG;AAGnG,8DAA0D;AAG1D,oCAAiC;AACjC,uCAAoC;AAEpC,MAAsB,QAAQ;IAE1B;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,cAAc;QACvB,MAAM,eAAe,GAAG,MAAM,IAAA,aAAK,EAAkB,0BAAe,CAAC,CAAC;QACtE,OAAO,eAAe,CAAC,WAAW,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,kBAAkB;QAC3B,MAAM,eAAe,GAAG,MAAM,IAAA,aAAK,EAAkB,0BAAe,CAAC,CAAC;QACtE,OAAO,eAAe,CAAC,eAAe,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,oBAAoB;QAC7B,MAAM,eAAe,GAAG,MAAM,IAAA,aAAK,EAAkB,0BAAe,CAAC,CAAC;QACtE,OAAO,eAAe,CAAC,iBAAiB,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,YAAmC;;QACjD,MAAM,aAAa,GAAG,MAAM,iBAAO,CAAC,iBAAiB,EAAE,CAAC;QACxD,MAAM,qBAAqB,GAAG,aAAa,CAAC,QAAQ,CAAC;QACrD,MAAM,QAAQ,GAAG,MAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,QAAQ,mCAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,CAAC;QAE5E,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,kBAAkB,GAA+B;YACnD,QAAQ;YACR,YAAY;YACZ,oBAAoB,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,oBAAoB;YACjE,YAAY,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,YAAY;YACjD,OAAO,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,OAAO;YACvC,SAAS,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,SAAS;SAC9C,CAAC;QAEF,MAAM,eAAe,GAAG,MAAM,IAAA,aAAK,EAAkB,0BAAe,CAAC,CAAC;QACtE,eAAe,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;IACzD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,EAAU,EAAE,MAAmB;QACvD,MAAM,eAAe,GAAG,MAAM,IAAA,aAAK,EAAkB,0BAAe,CAAC,CAAC;QACtE,MAAM,eAAe,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,QAAgB,EAAE,OAAkC;QACxE,MAAM,eAAe,GAAG,MAAM,IAAA,aAAK,EAAkB,0BAAe,CAAC,CAAC;QACtE,OAAO,eAAe,CAAC,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAA8B;QAC1D,MAAM,eAAe,GAAG,MAAM,IAAA,aAAK,EAAkB,0BAAe,CAAC,CAAC;QACtE,OAAO,eAAe,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,WAA0C;QACxE,MAAM,sCAAiB,CAAC,IAAI,CAAC,+BAAuB,EAAE,WAAW,CAAC,CAAC;IACvE,CAAC;CACJ;AAvFD,4BAuFC"}
@@ -1,8 +0,0 @@
1
- import { EventPayloadMapping } from '../types/event/events';
2
- import { EventOptions, EventProcessor } from '../types/event/protocol';
3
- import { Newable } from '../types/protocol';
4
- export declare abstract class Event {
5
- static report<K extends keyof EventPayloadMapping>(code: K, event: EventPayloadMapping[K], options?: EventOptions): Promise<void>;
6
- static registerEventProcessor(constructor: Newable<EventProcessor>): Promise<void>;
7
- }
8
- //# sourceMappingURL=event.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/common/services/event.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,8BAAsB,KAAK;WAEV,MAAM,CAAC,CAAC,SAAS,MAAM,mBAAmB,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;WAM1H,sBAAsB,CAAC,WAAW,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3F"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Event = void 0;
4
- const telemetry_1 = require("@genie/telemetry");
5
- const component_registry_1 = require("../component-registry");
6
- const utils_1 = require("../utils");
7
- class Event {
8
- static async report(code, event, options) {
9
- const eventService = await (0, utils_1.doGet)(telemetry_1.EventService);
10
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
- await eventService.report(code, event, options);
12
- }
13
- static async registerEventProcessor(constructor) {
14
- await component_registry_1.ComponentRegistry.bind(telemetry_1.EventProcessor, constructor);
15
- }
16
- }
17
- exports.Event = Event;
18
- //# sourceMappingURL=event.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/common/services/event.ts"],"names":[],"mappings":";;;AAAA,gDAAqF;AAErF,8DAA0D;AAI1D,oCAAiC;AAEjC,MAAsB,KAAK;IAEvB,MAAM,CAAC,KAAK,CAAC,MAAM,CAAsC,IAAO,EAAE,KAA6B,EAAE,OAAsB;QACnH,MAAM,YAAY,GAAG,MAAM,IAAA,aAAK,EAAe,wBAAY,CAAC,CAAC;QAC7D,8DAA8D;QAC9D,MAAM,YAAY,CAAC,MAAM,CAAC,IAAW,EAAE,KAAY,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,WAAoC;QACpE,MAAM,sCAAiB,CAAC,IAAI,CAAC,0BAAiB,EAAE,WAAW,CAAC,CAAC;IACjE,CAAC;CACJ;AAXD,sBAWC"}
@@ -1,7 +0,0 @@
1
- import { FilePathService } from '../types/filepath';
2
- import { Newable } from '../types/protocol';
3
- export declare abstract class FilePath {
4
- static getInstance(): Promise<FilePathService>;
5
- static registerFilePathService(service: Newable<FilePathService>): Promise<void>;
6
- }
7
- //# sourceMappingURL=filepath.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filepath.d.ts","sourceRoot":"","sources":["../../../src/common/services/filepath.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,8BAAsB,QAAQ;WACb,WAAW,IAAI,OAAO,CAAC,eAAe,CAAC;WAIvC,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzF"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FilePath = void 0;
4
- const core_1 = require("@genie/core");
5
- const component_registry_1 = require("../component-registry");
6
- const utils_1 = require("../utils");
7
- class FilePath {
8
- static async getInstance() {
9
- return (0, utils_1.doGet)(core_1.FilePathService);
10
- }
11
- static async registerFilePathService(service) {
12
- await component_registry_1.ComponentRegistry.bind(core_1.FilePathService, service);
13
- }
14
- }
15
- exports.FilePath = FilePath;
16
- //# sourceMappingURL=filepath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filepath.js","sourceRoot":"","sources":["../../../src/common/services/filepath.ts"],"names":[],"mappings":";;;AACA,sCAAoE;AAEpE,8DAA0D;AAG1D,oCAAiC;AAEjC,MAAsB,QAAQ;IAC1B,MAAM,CAAC,KAAK,CAAC,WAAW;QACpB,OAAO,IAAA,aAAK,EAAC,sBAAkB,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAiC;QAClE,MAAM,sCAAiB,CAAC,IAAI,CAAC,sBAAkB,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACJ;AARD,4BAQC"}
@@ -1,5 +0,0 @@
1
- import { RestOperations } from '../types/http';
2
- export declare abstract class Http {
3
- static getInstance(): Promise<RestOperations>;
4
- }
5
- //# sourceMappingURL=http.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/common/services/http.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,8BAAsB,IAAI;WAET,WAAW,IAAI,OAAO,CAAC,cAAc,CAAC;CAGtD"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Http = void 0;
4
- const http_1 = require("@celljs/http");
5
- const utils_1 = require("../utils");
6
- class Http {
7
- static async getInstance() {
8
- return (0, utils_1.doGet)(http_1.RestOperations);
9
- }
10
- }
11
- exports.Http = Http;
12
- //# sourceMappingURL=http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/common/services/http.ts"],"names":[],"mappings":";;;AAAA,uCAAmE;AAGnE,oCAAiC;AAEjC,MAAsB,IAAI;IAEtB,MAAM,CAAC,KAAK,CAAC,WAAW;QACpB,OAAO,IAAA,aAAK,EAAiB,qBAAiB,CAAC,CAAC;IACpD,CAAC;CACJ;AALD,oBAKC"}
@@ -1,10 +0,0 @@
1
- export * from './event';
2
- export * from './logger';
3
- export * from './product';
4
- export * from './tracing';
5
- export * from './http';
6
- export * from './agent';
7
- export * from './codebase';
8
- export * from './filepath';
9
- export * from './auth';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./event"), exports);
18
- __exportStar(require("./logger"), exports);
19
- __exportStar(require("./product"), exports);
20
- __exportStar(require("./tracing"), exports);
21
- __exportStar(require("./http"), exports);
22
- __exportStar(require("./agent"), exports);
23
- __exportStar(require("./codebase"), exports);
24
- __exportStar(require("./filepath"), exports);
25
- __exportStar(require("./auth"), exports);
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,6CAA2B;AAC3B,6CAA2B;AAC3B,yCAAuB"}
@@ -1,7 +0,0 @@
1
- import { Logger } from '../types/logger';
2
- import { Newable } from '../types/protocol';
3
- export declare abstract class Log {
4
- static getLogger(): Promise<Logger>;
5
- static registerLogger(constructor: Newable<Logger>): Promise<void>;
6
- }
7
- //# sourceMappingURL=logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/common/services/logger.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAS,MAAM,mBAAmB,CAAC;AAGnD,8BAAsB,GAAG;WAER,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;WAI5B,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3E"}