@codebolt/codeboltjs 2.0.3 → 2.0.5

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 (433) hide show
  1. package/Readme.md +47 -0
  2. package/{modules → dist}/agentlib/agent.js +4 -4
  3. package/{modules → dist}/agentlib/usermessage.js +3 -3
  4. package/dist/core/messageManager.d.ts +47 -0
  5. package/dist/core/messageManager.js +128 -0
  6. package/{modules → dist/core}/websocket.d.ts +5 -0
  7. package/{modules → dist/core}/websocket.js +13 -9
  8. package/{index.d.ts → dist/index.d.ts} +42 -53
  9. package/{index.js → dist/index.js} +49 -4
  10. package/dist/modules/agent.js +79 -0
  11. package/{modules → dist/modules}/browser.d.ts +7 -7
  12. package/dist/modules/browser.js +211 -0
  13. package/{modules → dist/modules}/chat.d.ts +8 -20
  14. package/dist/modules/chat.js +162 -0
  15. package/{modules → dist/modules}/codeutils.d.ts +1 -1
  16. package/dist/modules/codeutils.js +89 -0
  17. package/{modules → dist/modules}/crawler.d.ts +1 -16
  18. package/dist/modules/crawler.js +64 -0
  19. package/dist/modules/dbmemory.js +38 -0
  20. package/dist/modules/debug.js +48 -0
  21. package/{modules → dist/modules}/fs.d.ts +1 -1
  22. package/dist/modules/fs.js +184 -0
  23. package/dist/modules/git.js +152 -0
  24. package/{modules → dist/modules}/history.js +11 -27
  25. package/{modules → dist/modules}/llm.js +8 -16
  26. package/{modules → dist/modules}/project.d.ts +1 -1
  27. package/dist/modules/project.js +48 -0
  28. package/dist/modules/state.js +69 -0
  29. package/dist/modules/task.js +51 -0
  30. package/{modules → dist/modules}/terminal.d.ts +3 -2
  31. package/{modules → dist/modules}/terminal.js +36 -47
  32. package/dist/modules/tokenizer.js +40 -0
  33. package/{modules → dist/modules}/tools.d.ts +0 -6
  34. package/dist/modules/tools.js +117 -0
  35. package/dist/modules/utils.js +22 -0
  36. package/dist/modules/vectordb.js +71 -0
  37. package/dist/utils.d.ts +5 -0
  38. package/{utils.js → dist/utils.js} +5 -5
  39. package/package.json +17 -8
  40. package/.codebolt/chat.json +0 -1
  41. package/.codebolt/debug.json +0 -1
  42. package/.codebolt/projectState.json +0 -127
  43. package/.codebolt/tasks.json +0 -1
  44. package/.codeboltconfig.yaml +0 -0
  45. package/.github/workflows/publish-to-npm.yml +0 -20
  46. package/bkp/toolBox.bkp.ts +0 -1162
  47. package/docs/.nojekyll +0 -1
  48. package/docs/assets/highlight.css +0 -127
  49. package/docs/assets/icons.js +0 -15
  50. package/docs/assets/icons.svg +0 -1
  51. package/docs/assets/main.js +0 -59
  52. package/docs/assets/navigation.js +0 -1
  53. package/docs/assets/search.js +0 -1
  54. package/docs/assets/style.css +0 -1412
  55. package/docs/classes/_internal_.Agent.html +0 -318
  56. package/docs/classes/_internal_.AsyncResource.html +0 -44
  57. package/docs/classes/_internal_.Blob.html +0 -33
  58. package/docs/classes/_internal_.ClientRequest.html +0 -506
  59. package/docs/classes/_internal_.Codebolt.html +0 -315
  60. package/docs/classes/_internal_.CustomEventEmitter-1.html +0 -248
  61. package/docs/classes/_internal_.CustomEventEmitter.html +0 -248
  62. package/docs/classes/_internal_.Duplex.html +0 -690
  63. package/docs/classes/_internal_.EventEmitter-1.html +0 -254
  64. package/docs/classes/_internal_.EventEmitter.EventEmitterAsyncResource.html +0 -268
  65. package/docs/classes/_internal_.IncomingMessage.html +0 -661
  66. package/docs/classes/_internal_.KeyObject.html +0 -76
  67. package/docs/classes/_internal_.OutgoingMessage.html +0 -491
  68. package/docs/classes/_internal_.Readable.html +0 -551
  69. package/docs/classes/_internal_.ReadableBase.html +0 -551
  70. package/docs/classes/_internal_.Server-1.html +0 -416
  71. package/docs/classes/_internal_.Server-2.html +0 -326
  72. package/docs/classes/_internal_.Server-3.html +0 -353
  73. package/docs/classes/_internal_.Server.html +0 -390
  74. package/docs/classes/_internal_.ServerResponse.html +0 -569
  75. package/docs/classes/_internal_.Socket.html +0 -791
  76. package/docs/classes/_internal_.Stream.html +0 -256
  77. package/docs/classes/_internal_.TLSSocket.html +0 -947
  78. package/docs/classes/_internal_.URL.html +0 -140
  79. package/docs/classes/_internal_.URLSearchParams.html +0 -68
  80. package/docs/classes/_internal_.WebSocket-1.html +0 -297
  81. package/docs/classes/_internal_.WebSocket.Server.html +0 -261
  82. package/docs/classes/_internal_.Writable.html +0 -394
  83. package/docs/classes/_internal_.WritableBase.html +0 -394
  84. package/docs/classes/_internal_.X509Certificate.html +0 -144
  85. package/docs/classes/_internal_.internal-1.html +0 -256
  86. package/docs/classes/_internal_.internal.PassThrough.html +0 -686
  87. package/docs/classes/_internal_.internal.Transform.html +0 -693
  88. package/docs/enums/_internal_.logType.html +0 -4
  89. package/docs/functions/_internal_.WebSocket.createWebSocketStream.html +0 -1
  90. package/docs/functions/_internal_._node_stream_consumers_.arrayBuffer.html +0 -1
  91. package/docs/functions/_internal_._node_stream_consumers_.blob.html +0 -1
  92. package/docs/functions/_internal_._node_stream_consumers_.buffer.html +0 -1
  93. package/docs/functions/_internal_._node_stream_consumers_.json.html +0 -1
  94. package/docs/functions/_internal_._node_stream_consumers_.text.html +0 -1
  95. package/docs/functions/_internal_._node_stream_promises_.finished.html +0 -1
  96. package/docs/functions/_internal_._node_stream_promises_.pipeline.html +0 -1
  97. package/docs/functions/_internal_.internal.addAbortSignal.html +0 -17
  98. package/docs/functions/_internal_.internal.finished-1.html +0 -20
  99. package/docs/functions/_internal_.internal.finished.__promisify__.html +0 -1
  100. package/docs/functions/_internal_.internal.getDefaultHighWaterMark.html +0 -4
  101. package/docs/functions/_internal_.internal.isErrored.html +0 -3
  102. package/docs/functions/_internal_.internal.isReadable.html +0 -3
  103. package/docs/functions/_internal_.internal.pipeline-1.html +0 -24
  104. package/docs/functions/_internal_.internal.pipeline.__promisify__.html +0 -1
  105. package/docs/functions/_internal_.internal.setDefaultHighWaterMark.html +0 -4
  106. package/docs/hierarchy.html +0 -1
  107. package/docs/index.html +0 -12
  108. package/docs/interfaces/_internal_.AddToAgentStateResponse.html +0 -3
  109. package/docs/interfaces/_internal_.AddTokenResponse.html +0 -3
  110. package/docs/interfaces/_internal_.AddVectorItemResponse.html +0 -3
  111. package/docs/interfaces/_internal_.AddressInfo.html +0 -4
  112. package/docs/interfaces/_internal_.AgentOptions.html +0 -35
  113. package/docs/interfaces/_internal_.ApplicationState.html +0 -4
  114. package/docs/interfaces/_internal_.ArrayBufferView.html +0 -7
  115. package/docs/interfaces/_internal_.ArrayLike.html +0 -2
  116. package/docs/interfaces/_internal_.ArrayOptions.html +0 -7
  117. package/docs/interfaces/_internal_.AsymmetricKeyDetails.html +0 -15
  118. package/docs/interfaces/_internal_.AsyncGenerator.html +0 -5
  119. package/docs/interfaces/_internal_.AsyncGeneratorFunction.html +0 -12
  120. package/docs/interfaces/_internal_.AsyncIterable.html +0 -2
  121. package/docs/interfaces/_internal_.AsyncIterableIterator.html +0 -5
  122. package/docs/interfaces/_internal_.AsyncIterator.html +0 -4
  123. package/docs/interfaces/_internal_.AsyncResourceOptions.html +0 -12
  124. package/docs/interfaces/_internal_.BlobOptions.html +0 -8
  125. package/docs/interfaces/_internal_.Buffer.html +0 -760
  126. package/docs/interfaces/_internal_.BufferConstructor.html +0 -165
  127. package/docs/interfaces/_internal_.Certificate.html +0 -13
  128. package/docs/interfaces/_internal_.ChatMessage.html +0 -3
  129. package/docs/interfaces/_internal_.Choice.html +0 -5
  130. package/docs/interfaces/_internal_.CipherNameAndProtocol.html +0 -7
  131. package/docs/interfaces/_internal_.ClientRequestArgs.html +0 -28
  132. package/docs/interfaces/_internal_.CommandError.html +0 -3
  133. package/docs/interfaces/_internal_.CommonConnectionOptions.html +0 -29
  134. package/docs/interfaces/_internal_.ConnectOpts.html +0 -5
  135. package/docs/interfaces/_internal_.CreateFileResponse.html +0 -6
  136. package/docs/interfaces/_internal_.CreateFolderResponse.html +0 -6
  137. package/docs/interfaces/_internal_.CryptoKey.html +0 -26
  138. package/docs/interfaces/_internal_.DebugAddLogResponse.html +0 -4
  139. package/docs/interfaces/_internal_.DeleteFileResponse.html +0 -6
  140. package/docs/interfaces/_internal_.DeleteFolderResponse.html +0 -6
  141. package/docs/interfaces/_internal_.DetailedPeerCertificate.html +0 -53
  142. package/docs/interfaces/_internal_.Dict.html +0 -1
  143. package/docs/interfaces/_internal_.Disposable.html +0 -2
  144. package/docs/interfaces/_internal_.DropArgument.html +0 -7
  145. package/docs/interfaces/_internal_.DuplexOptions.html +0 -22
  146. package/docs/interfaces/_internal_.EphemeralKeyInfo.html +0 -7
  147. package/docs/interfaces/_internal_.ErrnoException.html +0 -8
  148. package/docs/interfaces/_internal_.Error.html +0 -4
  149. package/docs/interfaces/_internal_.EventEmitter-2.html +0 -130
  150. package/docs/interfaces/_internal_.EventEmitter.Abortable.html +0 -3
  151. package/docs/interfaces/_internal_.EventEmitter.EventEmitterAsyncResourceOptions.html +0 -19
  152. package/docs/interfaces/_internal_.EventEmitter.EventEmitterReferencingAsyncResource.html +0 -32
  153. package/docs/interfaces/_internal_.EventEmitterOptions.html +0 -3
  154. package/docs/interfaces/_internal_.ExtractTextResponse.html +0 -3
  155. package/docs/interfaces/_internal_.GetAgentStateResponse.html +0 -3
  156. package/docs/interfaces/_internal_.GetContentResponse.html +0 -3
  157. package/docs/interfaces/_internal_.GetMarkdownResponse.html +0 -3
  158. package/docs/interfaces/_internal_.GetMatcherListTreeResponse.html +0 -3
  159. package/docs/interfaces/_internal_.GetProjectPathResponse.html +0 -5
  160. package/docs/interfaces/_internal_.GetTokenResponse.html +0 -3
  161. package/docs/interfaces/_internal_.GetVectorResponse.html +0 -3
  162. package/docs/interfaces/_internal_.GoToPageResponse.html +0 -3
  163. package/docs/interfaces/_internal_.HtmlReceived.html +0 -3
  164. package/docs/interfaces/_internal_.IncomingHttpHeaders.html +0 -64
  165. package/docs/interfaces/_internal_.InformationEvent.html +0 -8
  166. package/docs/interfaces/_internal_.IpcSocketConnectOpts.html +0 -6
  167. package/docs/interfaces/_internal_.Iterable.html +0 -2
  168. package/docs/interfaces/_internal_.IterableIterator.html +0 -5
  169. package/docs/interfaces/_internal_.Iterator.html +0 -4
  170. package/docs/interfaces/_internal_.IteratorReturnResult.html +0 -3
  171. package/docs/interfaces/_internal_.IteratorYieldResult.html +0 -3
  172. package/docs/interfaces/_internal_.JsonWebKey.html +0 -14
  173. package/docs/interfaces/_internal_.JwkKeyExportOptions.html +0 -2
  174. package/docs/interfaces/_internal_.KeyAlgorithm.html +0 -2
  175. package/docs/interfaces/_internal_.KeyExportOptions.html +0 -5
  176. package/docs/interfaces/_internal_.KeyObject-1.html +0 -5
  177. package/docs/interfaces/_internal_.LLMResponse.html +0 -4
  178. package/docs/interfaces/_internal_.ListenOptions.html +0 -13
  179. package/docs/interfaces/_internal_.LookupAddress.html +0 -6
  180. package/docs/interfaces/_internal_.LookupOptions.html +0 -27
  181. package/docs/interfaces/_internal_.MatchProblemResponse.html +0 -3
  182. package/docs/interfaces/_internal_.MemoryGetResponse.html +0 -5
  183. package/docs/interfaces/_internal_.MemorySetResponse.html +0 -5
  184. package/docs/interfaces/_internal_.Message.html +0 -8
  185. package/docs/interfaces/_internal_.MessageContent.html +0 -3
  186. package/docs/interfaces/_internal_.Object.html +0 -18
  187. package/docs/interfaces/_internal_.OnReadOpts.html +0 -6
  188. package/docs/interfaces/_internal_.OpenDebugBrowserResponse.html +0 -4
  189. package/docs/interfaces/_internal_.OutgoingHttpHeaders.html +0 -80
  190. package/docs/interfaces/_internal_.PeerCertificate.html +0 -50
  191. package/docs/interfaces/_internal_.PromiseLike.html +0 -6
  192. package/docs/interfaces/_internal_.PxfObject.html +0 -5
  193. package/docs/interfaces/_internal_.QueryVectorItemResponse.html +0 -3
  194. package/docs/interfaces/_internal_.QueuingStrategy.html +0 -3
  195. package/docs/interfaces/_internal_.QueuingStrategySize.html +0 -1
  196. package/docs/interfaces/_internal_.ReadFileResponse.html +0 -7
  197. package/docs/interfaces/_internal_.ReadOnlyDict.html +0 -1
  198. package/docs/interfaces/_internal_.ReadWriteStream.html +0 -144
  199. package/docs/interfaces/_internal_.ReadableByteStreamController.html +0 -6
  200. package/docs/interfaces/_internal_.ReadableByteStreamControllerCallback.html +0 -1
  201. package/docs/interfaces/_internal_.ReadableOptions.html +0 -11
  202. package/docs/interfaces/_internal_.ReadableStream-1.html +0 -141
  203. package/docs/interfaces/_internal_.ReadableStream.html +0 -10
  204. package/docs/interfaces/_internal_.ReadableStreamBYOBReader.html +0 -5
  205. package/docs/interfaces/_internal_.ReadableStreamDefaultController.html +0 -5
  206. package/docs/interfaces/_internal_.ReadableStreamDefaultReadDoneResult.html +0 -3
  207. package/docs/interfaces/_internal_.ReadableStreamDefaultReadValueResult.html +0 -3
  208. package/docs/interfaces/_internal_.ReadableStreamDefaultReader.html +0 -5
  209. package/docs/interfaces/_internal_.ReadableStreamErrorCallback.html +0 -1
  210. package/docs/interfaces/_internal_.ReadableStreamGenericReader.html +0 -3
  211. package/docs/interfaces/_internal_.ReadableStreamReadDoneResult.html +0 -3
  212. package/docs/interfaces/_internal_.ReadableStreamReadValueResult.html +0 -3
  213. package/docs/interfaces/_internal_.ReadableWritablePair.html +0 -9
  214. package/docs/interfaces/_internal_.SecureContext.html +0 -2
  215. package/docs/interfaces/_internal_.SecureContextOptions.html +0 -121
  216. package/docs/interfaces/_internal_.Selection.html +0 -6
  217. package/docs/interfaces/_internal_.ServerOptions.html +0 -64
  218. package/docs/interfaces/_internal_.ServerOpts.html +0 -25
  219. package/docs/interfaces/_internal_.SharedArrayBuffer.html +0 -7
  220. package/docs/interfaces/_internal_.SharedArrayBufferConstructor.html +0 -3
  221. package/docs/interfaces/_internal_.SocketConstructorOpts.html +0 -6
  222. package/docs/interfaces/_internal_.StaticEventEmitterOptions.html +0 -15
  223. package/docs/interfaces/_internal_.StreamOptions.html +0 -9
  224. package/docs/interfaces/_internal_.StreamPipeOptions.html +0 -37
  225. package/docs/interfaces/_internal_.TLSSocketOptions.html +0 -160
  226. package/docs/interfaces/_internal_.TcpSocketConnectOpts.html +0 -19
  227. package/docs/interfaces/_internal_.TerminalInterruptResponse.html +0 -3
  228. package/docs/interfaces/_internal_.TlsOptions.html +0 -197
  229. package/docs/interfaces/_internal_.UnderlyingByteSource.html +0 -6
  230. package/docs/interfaces/_internal_.UnderlyingSink.html +0 -6
  231. package/docs/interfaces/_internal_.UnderlyingSinkAbortCallback.html +0 -1
  232. package/docs/interfaces/_internal_.UnderlyingSinkCloseCallback.html +0 -1
  233. package/docs/interfaces/_internal_.UnderlyingSinkStartCallback.html +0 -1
  234. package/docs/interfaces/_internal_.UnderlyingSinkWriteCallback.html +0 -1
  235. package/docs/interfaces/_internal_.UnderlyingSource.html +0 -5
  236. package/docs/interfaces/_internal_.UnderlyingSourceCancelCallback.html +0 -1
  237. package/docs/interfaces/_internal_.UnderlyingSourcePullCallback.html +0 -1
  238. package/docs/interfaces/_internal_.UnderlyingSourceStartCallback.html +0 -1
  239. package/docs/interfaces/_internal_.UpdateFileResponse.html +0 -6
  240. package/docs/interfaces/_internal_.UrlResponse.html +0 -3
  241. package/docs/interfaces/_internal_.Usage-1.html +0 -4
  242. package/docs/interfaces/_internal_.Usage.html +0 -4
  243. package/docs/interfaces/_internal_.UserMessage.html +0 -3
  244. package/docs/interfaces/_internal_.UserRequest.html +0 -7
  245. package/docs/interfaces/_internal_.WebSocket.AddressInfo.html +0 -4
  246. package/docs/interfaces/_internal_.WebSocket.ClientOptions.html +0 -138
  247. package/docs/interfaces/_internal_.WebSocket.CloseEvent.html +0 -6
  248. package/docs/interfaces/_internal_.WebSocket.ErrorEvent.html +0 -5
  249. package/docs/interfaces/_internal_.WebSocket.Event.html +0 -3
  250. package/docs/interfaces/_internal_.WebSocket.EventListenerOptions.html +0 -2
  251. package/docs/interfaces/_internal_.WebSocket.MessageEvent.html +0 -4
  252. package/docs/interfaces/_internal_.WebSocket.PerMessageDeflateOptions.html +0 -9
  253. package/docs/interfaces/_internal_.WebSocket.ServerOptions.html +0 -14
  254. package/docs/interfaces/_internal_.WebSocket.WebSocket.html +0 -172
  255. package/docs/interfaces/_internal_.WebSocket.WebSocketServer.html +0 -144
  256. package/docs/interfaces/_internal_.WebSocketAlias.html +0 -172
  257. package/docs/interfaces/_internal_.WritableOptions.html +0 -14
  258. package/docs/interfaces/_internal_.WritableStream-1.html +0 -8
  259. package/docs/interfaces/_internal_.WritableStream.html +0 -133
  260. package/docs/interfaces/_internal_.WritableStreamDefaultController.html +0 -6
  261. package/docs/interfaces/_internal_.WritableStreamDefaultWriter.html +0 -12
  262. package/docs/interfaces/_internal_.X509CheckOptions.html +0 -16
  263. package/docs/interfaces/_internal_.ZlibOptions.html +0 -21
  264. package/docs/interfaces/_internal_.getMatchDetail.html +0 -3
  265. package/docs/interfaces/_internal_.internal.FinishedOptions.html +0 -6
  266. package/docs/interfaces/_internal_.internal.Pipe.html +0 -5
  267. package/docs/interfaces/_internal_.internal.PipelineOptions.html +0 -3
  268. package/docs/interfaces/_internal_.internal.TransformOptions.html +0 -24
  269. package/docs/modules/_internal_.EventEmitter.html +0 -6
  270. package/docs/modules/_internal_.WebSocket.html +0 -21
  271. package/docs/modules/_internal_._node_stream_consumers_.html +0 -6
  272. package/docs/modules/_internal_._node_stream_promises_.html +0 -3
  273. package/docs/modules/_internal_.html +0 -228
  274. package/docs/modules/_internal_.internal.finished.html +0 -2
  275. package/docs/modules/_internal_.internal.html +0 -36
  276. package/docs/modules/_internal_.internal.pipeline.html +0 -2
  277. package/docs/modules.html +0 -3
  278. package/docs/types/_internal_.AnyRest.html +0 -1
  279. package/docs/types/_internal_.Args.html +0 -1
  280. package/docs/types/_internal_.ArrayBufferLike.html +0 -1
  281. package/docs/types/_internal_.ArrayBufferView-1.html +0 -1
  282. package/docs/types/_internal_.BinaryLike.html +0 -1
  283. package/docs/types/_internal_.BufferEncoding.html +0 -1
  284. package/docs/types/_internal_.BufferLike.html +0 -1
  285. package/docs/types/_internal_.ComposeFnParam.html +0 -1
  286. package/docs/types/_internal_.DefaultEventMap.html +0 -1
  287. package/docs/types/_internal_.EventMap.html +0 -1
  288. package/docs/types/_internal_.InstanceType.html +0 -2
  289. package/docs/types/_internal_.IteratorResult.html +0 -1
  290. package/docs/types/_internal_.Key.html +0 -1
  291. package/docs/types/_internal_.Key2.html +0 -1
  292. package/docs/types/_internal_.KeyFormat.html +0 -1
  293. package/docs/types/_internal_.KeyObjectType.html +0 -1
  294. package/docs/types/_internal_.KeyType-1.html +0 -1
  295. package/docs/types/_internal_.KeyType.html +0 -1
  296. package/docs/types/_internal_.KeyUsage.html +0 -1
  297. package/docs/types/_internal_.Listener.html +0 -1
  298. package/docs/types/_internal_.LookupFunction.html +0 -1
  299. package/docs/types/_internal_.OutgoingHttpHeader.html +0 -1
  300. package/docs/types/_internal_.Partial.html +0 -2
  301. package/docs/types/_internal_.Pick.html +0 -2
  302. package/docs/types/_internal_.PropertyKey.html +0 -1
  303. package/docs/types/_internal_.ReadableStreamController.html +0 -1
  304. package/docs/types/_internal_.ReadableStreamDefaultReadResult.html +0 -1
  305. package/docs/types/_internal_.ReadableStreamReadResult.html +0 -1
  306. package/docs/types/_internal_.Record.html +0 -2
  307. package/docs/types/_internal_.RequestListener.html +0 -1
  308. package/docs/types/_internal_.SecureVersion.html +0 -1
  309. package/docs/types/_internal_.ServerOptions-1.html +0 -1
  310. package/docs/types/_internal_.SocketConnectOpts.html +0 -1
  311. package/docs/types/_internal_.SocketReadyState.html +0 -1
  312. package/docs/types/_internal_.TypedArray.html +0 -1
  313. package/docs/types/_internal_.WebSocket.CertMeta.html +0 -2
  314. package/docs/types/_internal_.WebSocket.Data.html +0 -2
  315. package/docs/types/_internal_.WebSocket.RawData.html +0 -2
  316. package/docs/types/_internal_.WebSocket.VerifyClientCallbackAsync.html +0 -4
  317. package/docs/types/_internal_.WebSocket.VerifyClientCallbackSync.html +0 -4
  318. package/docs/types/_internal_.WithImplicitCoercion.html +0 -1
  319. package/docs/types/_internal_.internal.PipelineCallback.html +0 -1
  320. package/docs/types/_internal_.internal.PipelineDestination.html +0 -1
  321. package/docs/types/_internal_.internal.PipelineDestinationIterableFunction.html +0 -1
  322. package/docs/types/_internal_.internal.PipelineDestinationPromiseFunction.html +0 -1
  323. package/docs/types/_internal_.internal.PipelinePromise.html +0 -1
  324. package/docs/types/_internal_.internal.PipelineSource.html +0 -1
  325. package/docs/types/_internal_.internal.PipelineSourceFunction.html +0 -1
  326. package/docs/types/_internal_.internal.PipelineTransform.html +0 -1
  327. package/docs/types/_internal_.internal.PipelineTransformSource.html +0 -1
  328. package/docs/types/_internal_.internal.TransformCallback.html +0 -1
  329. package/docs/variables/_internal_.Buffer-1.html +0 -1
  330. package/docs/variables/_internal_.Error-1.html +0 -1
  331. package/docs/variables/_internal_.Object-1.html +0 -2
  332. package/docs/variables/_internal_.ReadableByteStreamController-1.html +0 -1
  333. package/docs/variables/_internal_.ReadableStream-2.html +0 -1
  334. package/docs/variables/_internal_.ReadableStreamBYOBReader-1.html +0 -1
  335. package/docs/variables/_internal_.ReadableStreamDefaultController-1.html +0 -1
  336. package/docs/variables/_internal_.ReadableStreamDefaultReader-1.html +0 -1
  337. package/docs/variables/_internal_.SharedArrayBuffer-1.html +0 -1
  338. package/docs/variables/_internal_.WebSocket.WebSocket-1.html +0 -1
  339. package/docs/variables/_internal_.WebSocket.WebSocketServer-1.html +0 -1
  340. package/docs/variables/_internal_.WebSocketAlias-1.html +0 -1
  341. package/docs/variables/_internal_.WritableStream-2.html +0 -1
  342. package/docs/variables/_internal_.WritableStreamDefaultController-1.html +0 -1
  343. package/docs/variables/_internal_.WritableStreamDefaultWriter-1.html +0 -1
  344. package/docs/variables/_internal_.internal.consumers.html +0 -1
  345. package/docs/variables/_internal_.internal.promises.html +0 -1
  346. package/docs/variables/default.html +0 -1
  347. package/modules/agent.js +0 -111
  348. package/modules/browser.js +0 -331
  349. package/modules/chat.js +0 -225
  350. package/modules/codeutils.js +0 -166
  351. package/modules/crawler.js +0 -123
  352. package/modules/dbmemory.js +0 -54
  353. package/modules/debug.js +0 -64
  354. package/modules/fs.js +0 -264
  355. package/modules/git.js +0 -240
  356. package/modules/project.js +0 -72
  357. package/modules/state.js +0 -109
  358. package/modules/task.js +0 -75
  359. package/modules/tokenizer.js +0 -56
  360. package/modules/tools.js +0 -255
  361. package/modules/vectordb.js +0 -103
  362. package/script/gen.js +0 -27
  363. package/src/index.ts +0 -108
  364. package/src/modules/agent.ts +0 -120
  365. package/src/modules/agentlib/agent.ts +0 -417
  366. package/src/modules/agentlib/systemprompt.ts +0 -55
  367. package/src/modules/agentlib/taskInstruction.ts +0 -105
  368. package/src/modules/agentlib/usermessage.ts +0 -188
  369. package/src/modules/browser.ts +0 -352
  370. package/src/modules/chat.ts +0 -229
  371. package/src/modules/codeparsers.ts +0 -28
  372. package/src/modules/codeutils.ts +0 -182
  373. package/src/modules/crawler.ts +0 -121
  374. package/src/modules/dbmemory.ts +0 -52
  375. package/src/modules/debug.ts +0 -68
  376. package/src/modules/docutils.ts +0 -18
  377. package/src/modules/fs.ts +0 -263
  378. package/src/modules/git.ts +0 -237
  379. package/src/modules/history.ts +0 -82
  380. package/src/modules/knowledge.ts +0 -5
  381. package/src/modules/llm.ts +0 -36
  382. package/src/modules/outputparsers.ts +0 -30
  383. package/src/modules/project.ts +0 -68
  384. package/src/modules/rag.ts +0 -27
  385. package/src/modules/search.ts +0 -32
  386. package/src/modules/state.ts +0 -115
  387. package/src/modules/task.ts +0 -73
  388. package/src/modules/terminal.ts +0 -113
  389. package/src/modules/tokenizer.ts +0 -56
  390. package/src/modules/toolBox.ts +0 -1384
  391. package/src/modules/tools.ts +0 -254
  392. package/src/modules/vectordb.ts +0 -102
  393. package/src/modules/websocket.ts +0 -97
  394. package/src/utils/editFile.ts +0 -30
  395. package/src/utils.ts +0 -5
  396. package/tests/chat.test.js +0 -0
  397. package/tests/fs.test.js +0 -89
  398. package/tests/index.test.js +0 -4
  399. package/tsconfig.json +0 -122
  400. package/utils/editFile.js +0 -30
  401. package/utils.d.ts +0 -5
  402. package/webpack.config.js +0 -25
  403. /package/{modules → dist}/agentlib/agent.d.ts +0 -0
  404. /package/{modules → dist}/agentlib/systemprompt.d.ts +0 -0
  405. /package/{modules → dist}/agentlib/systemprompt.js +0 -0
  406. /package/{modules → dist}/agentlib/taskInstruction.d.ts +0 -0
  407. /package/{modules → dist}/agentlib/taskInstruction.js +0 -0
  408. /package/{modules → dist}/agentlib/usermessage.d.ts +0 -0
  409. /package/{modules → dist/modules}/agent.d.ts +0 -0
  410. /package/{modules → dist/modules}/codeparsers.d.ts +0 -0
  411. /package/{modules → dist/modules}/codeparsers.js +0 -0
  412. /package/{modules → dist/modules}/dbmemory.d.ts +0 -0
  413. /package/{modules → dist/modules}/debug.d.ts +0 -0
  414. /package/{modules → dist/modules}/docutils.d.ts +0 -0
  415. /package/{modules → dist/modules}/docutils.js +0 -0
  416. /package/{modules → dist/modules}/git.d.ts +0 -0
  417. /package/{modules → dist/modules}/history.d.ts +0 -0
  418. /package/{modules → dist/modules}/knowledge.d.ts +0 -0
  419. /package/{modules → dist/modules}/knowledge.js +0 -0
  420. /package/{modules → dist/modules}/llm.d.ts +0 -0
  421. /package/{modules → dist/modules}/outputparsers.d.ts +0 -0
  422. /package/{modules → dist/modules}/outputparsers.js +0 -0
  423. /package/{modules → dist/modules}/rag.d.ts +0 -0
  424. /package/{modules → dist/modules}/rag.js +0 -0
  425. /package/{modules → dist/modules}/search.d.ts +0 -0
  426. /package/{modules → dist/modules}/search.js +0 -0
  427. /package/{modules → dist/modules}/state.d.ts +0 -0
  428. /package/{modules → dist/modules}/task.d.ts +0 -0
  429. /package/{modules → dist/modules}/tokenizer.d.ts +0 -0
  430. /package/{utils/editFile.d.ts → dist/modules/utils.d.ts} +0 -0
  431. /package/{modules → dist/modules}/vectordb.d.ts +0 -0
  432. /package/{modules → dist/utils}/toolBox.d.ts +0 -0
  433. /package/{modules → dist/utils}/toolBox.js +0 -0
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const websocket_1 = __importDefault(require("../core/websocket"));
7
+ /**
8
+ * A module for handling in-memory database operations via WebSocket.
9
+ */
10
+ const dbmemory = {
11
+ /**
12
+ * Adds a key-value pair to the in-memory database.
13
+ * @param {string} key - The key under which to store the value.
14
+ * @param {any} value - The value to be stored.
15
+ * @returns {Promise<MemorySetResponse>} A promise that resolves with the response from the memory set event.
16
+ */
17
+ addKnowledge: (key, value) => {
18
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
19
+ "type": "memoryEvent",
20
+ 'action': 'set',
21
+ key,
22
+ value
23
+ }, "memorySetResponse");
24
+ },
25
+ /**
26
+ * Retrieves a value from the in-memory database by key.
27
+ * @param {string} key - The key of the value to retrieve.
28
+ * @returns {Promise<MemoryGetResponse>} A promise that resolves with the response from the memory get event.
29
+ */
30
+ getKnowledge: (key) => {
31
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
32
+ "type": "memoryEvent",
33
+ 'action': 'get',
34
+ key
35
+ }, "memoryGetResponse");
36
+ }
37
+ };
38
+ exports.default = dbmemory;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.debug = exports.logType = void 0;
7
+ const websocket_1 = __importDefault(require("../core/websocket"));
8
+ var logType;
9
+ (function (logType) {
10
+ logType["info"] = "info";
11
+ logType["error"] = "error";
12
+ logType["warning"] = "warning";
13
+ })(logType || (exports.logType = logType = {}));
14
+ exports.debug = {
15
+ /**
16
+ * Sends a log message to the debug websocket and waits for a response.
17
+ * @param {string} log - The log message to send.
18
+ * @param {logType} type - The type of the log message (info, error, warning).
19
+ * @returns {Promise<DebugAddLogResponse>} A promise that resolves with the response from the debug event.
20
+ */
21
+ debug: (log, type) => {
22
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
23
+ "type": "debugEvent",
24
+ "action": "addLog",
25
+ message: {
26
+ log,
27
+ type
28
+ }
29
+ }, "debugEventResponse");
30
+ },
31
+ /**
32
+ * Requests to open a debug browser at the specified URL and port.
33
+ * @param {string} url - The URL where the debug browser should be opened.
34
+ * @param {number} port - The port on which the debug browser will listen.
35
+ * @returns {Promise<OpenDebugBrowserResponse>} A promise that resolves with the response from the open debug browser event.
36
+ */
37
+ openDebugBrowser: (url, port) => {
38
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
39
+ "type": "debugEvent",
40
+ "action": "openDebugBrowser",
41
+ message: {
42
+ url,
43
+ port
44
+ }
45
+ }, "openDebugBrowserResponse");
46
+ }
47
+ };
48
+ exports.default = exports.debug;
@@ -89,6 +89,6 @@ declare const cbfs: {
89
89
  * @param {string} newContent - The new content to write into the file.
90
90
  * @returns {Promise<{success: boolean, result: any}>} A promise that resolves with the write operation result.
91
91
  */
92
- writeToFile: (relPath: string, newContent: string) => Promise<unknown>;
92
+ writeToFile: (relPath: string, newContent: string) => Promise<any>;
93
93
  };
94
94
  export default cbfs;
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const websocket_1 = __importDefault(require("../core/websocket"));
7
+ /**
8
+ * @module cbfs
9
+ * @description This module provides functionality to interact with the filesystem.
10
+ */
11
+ const cbfs = {
12
+ /**
13
+ * @function createFile
14
+ * @description Creates a new file.
15
+ * @param {string} fileName - The name of the file to create.
16
+ * @param {string} source - The source content to write into the file.
17
+ * @param {string} filePath - The path where the file should be created.
18
+ * @returns {Promise<CreateFileResponse>} A promise that resolves with the server response.
19
+ */
20
+ createFile: (fileName, source, filePath) => {
21
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
22
+ "type": "fsEvent",
23
+ "action": "createFile",
24
+ "message": {
25
+ fileName,
26
+ source,
27
+ filePath
28
+ },
29
+ }, "createFileResponse");
30
+ },
31
+ /**
32
+ * @function createFolder
33
+ * @description Creates a new folder.
34
+ * @param {string} folderName - The name of the folder to create.
35
+ * @param {string} folderPath - The path where the folder should be created.
36
+ * @returns {Promise<CreateFolderResponse>} A promise that resolves with the server response.
37
+ */
38
+ createFolder: (folderName, folderPath) => {
39
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
40
+ "type": "fsEvent",
41
+ "action": "createFolder",
42
+ "message": {
43
+ folderName,
44
+ folderPath
45
+ },
46
+ }, "createFolderResponse");
47
+ },
48
+ /**
49
+ * @function readFile
50
+ * @description Reads the content of a file.
51
+ * @param {string} filename - The name of the file to read.
52
+ * @param {string} filePath - The path of the file to read.
53
+ * @returns {Promise<ReadFileResponse>} A promise that resolves with the server response.
54
+ */
55
+ readFile: (filePath) => {
56
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
57
+ "type": "fsEvent",
58
+ "action": "readFile",
59
+ "message": {
60
+ filePath
61
+ },
62
+ }, "readFileResponse");
63
+ },
64
+ /**
65
+ * @function updateFile
66
+ * @description Updates the content of a file.
67
+ * @param {string} filename - The name of the file to update.
68
+ * @param {string} filePath - The path of the file to update.
69
+ * @param {string} newContent - The new content to write into the file.
70
+ * @returns {Promise<UpdateFileResponse>} A promise that resolves with the server response.
71
+ */
72
+ updateFile: (filename, filePath, newContent) => {
73
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
74
+ "type": "fsEvent",
75
+ "action": "updateFile",
76
+ "message": {
77
+ filename,
78
+ filePath,
79
+ newContent
80
+ },
81
+ }, "commandOutput");
82
+ },
83
+ /**
84
+ * @function deleteFile
85
+ * @description Deletes a file.
86
+ * @param {string} filename - The name of the file to delete.
87
+ * @param {string} filePath - The path of the file to delete.
88
+ * @returns {Promise<DeleteFileResponse>} A promise that resolves with the server response.
89
+ */
90
+ deleteFile: (filename, filePath) => {
91
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
92
+ "type": "fsEvent",
93
+ "action": "deleteFile",
94
+ "message": {
95
+ filename,
96
+ filePath
97
+ },
98
+ }, "deleteFileResponse");
99
+ },
100
+ /**
101
+ * @function deleteFolder
102
+ * @description Deletes a folder.
103
+ * @param {string} foldername - The name of the folder to delete.
104
+ * @param {string} folderpath - The path of the folder to delete.
105
+ * @returns {Promise<DeleteFolderResponse>} A promise that resolves with the server response.
106
+ */
107
+ deleteFolder: (foldername, folderpath) => {
108
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
109
+ "type": "fsEvent",
110
+ "action": "deleteFolder",
111
+ "message": {
112
+ foldername,
113
+ folderpath
114
+ },
115
+ }, "deleteFolderResponse");
116
+ },
117
+ /**
118
+ * @function listFile
119
+ * @description Lists all files.
120
+ * @returns {Promise<FileListResponse>} A promise that resolves with the list of files.
121
+ */
122
+ listFile: (folderPath, isRecursive = false) => {
123
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
124
+ "type": "fsEvent",
125
+ "action": "fileList",
126
+ message: {
127
+ folderPath,
128
+ isRecursive
129
+ }
130
+ }, "fileListResponse");
131
+ },
132
+ /**
133
+ * @function listCodeDefinitionNames
134
+ * @description Lists all code definition names in a given path.
135
+ * @param {string} path - The path to search for code definitions.
136
+ * @returns {Promise<{success: boolean, result: any}>} A promise that resolves with the list of code definition names.
137
+ */
138
+ listCodeDefinitionNames: (path) => {
139
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
140
+ "type": "fsEvent",
141
+ "action": "listCodeDefinitionNames",
142
+ "message": {
143
+ path
144
+ }
145
+ }, "listCodeDefinitionNamesResponse");
146
+ },
147
+ /**
148
+ * @function searchFiles
149
+ * @description Searches files in a given path using a regex pattern.
150
+ * @param {string} path - The path to search within.
151
+ * @param {string} regex - The regex pattern to search for.
152
+ * @param {string} filePattern - The file pattern to match files.
153
+ * @returns {Promise<{success: boolean, result: any}>} A promise that resolves with the search results.
154
+ */
155
+ searchFiles: (path, regex, filePattern) => {
156
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
157
+ "type": "fsEvent",
158
+ "action": "searchFiles",
159
+ "message": {
160
+ path,
161
+ regex,
162
+ filePattern
163
+ }
164
+ }, "searchFilesResponse");
165
+ },
166
+ /**
167
+ * @function writeToFile
168
+ * @description Writes content to a file.
169
+ * @param {string} relPath - The relative path of the file to write to.
170
+ * @param {string} newContent - The new content to write into the file.
171
+ * @returns {Promise<{success: boolean, result: any}>} A promise that resolves with the write operation result.
172
+ */
173
+ writeToFile: (relPath, newContent) => {
174
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
175
+ "type": "fsEvent",
176
+ "action": "writeToFile",
177
+ "message": {
178
+ relPath,
179
+ newContent
180
+ }
181
+ }, "writeToFileResponse");
182
+ },
183
+ };
184
+ exports.default = cbfs;
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const websocket_1 = __importDefault(require("../core/websocket"));
7
+ /**
8
+ * A service for interacting with Git operations via WebSocket messages.
9
+ */
10
+ const gitService = {
11
+ /**
12
+ * Initializes a new Git repository at the given path.
13
+ * @param {string} path - The file system path where the Git repository should be initialized.
14
+ * @returns {Promise<any>} A promise that resolves with the response from the init event.
15
+ */
16
+ init: async (path) => {
17
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
18
+ "type": "gitEvent",
19
+ "action": "Init",
20
+ "path": path
21
+ }, "InitResponse");
22
+ },
23
+ /**
24
+ * Clones a Git repository from the given URL to the specified path.
25
+ * @param {string} url - The URL of the Git repository to clone.
26
+ * @param {string} path - The file system path where the repository should be cloned to.
27
+ * @returns {Promise<any>} A promise that resolves with the response from the clone event.
28
+ */
29
+ clone: async (url, path) => {
30
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
31
+ "type": "gitEvent",
32
+ "action": "Clone",
33
+ "url": url,
34
+ "path": path
35
+ }, "CloneResponse");
36
+ },
37
+ /**
38
+ * Pulls the latest changes from the remote repository to the local repository at the given path.
39
+ * @param {string} path - The file system path of the local Git repository.
40
+ * @returns {Promise<any>} A promise that resolves with the response from the pull event.
41
+ */
42
+ pull: async (path) => {
43
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
44
+ "type": "gitEvent",
45
+ "action": "Pull",
46
+ "path": path
47
+ }, "PullResponse");
48
+ },
49
+ /**
50
+ * Pushes local repository changes to the remote repository at the given path.
51
+ * @param {string} path - The file system path of the local Git repository.
52
+ * @returns {Promise<any>} A promise that resolves with the response from the push event.
53
+ */
54
+ push: async (path) => {
55
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
56
+ "type": "gitEvent",
57
+ "action": "Push",
58
+ "path": path
59
+ }, "PushResponse");
60
+ },
61
+ /**
62
+ * Retrieves the status of the local repository at the given path.
63
+ * @param {string} path - The file system path of the local Git repository.
64
+ * @returns {Promise<any>} A promise that resolves with the response from the status event.
65
+ */
66
+ status: async (path) => {
67
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
68
+ "type": "gitEvent",
69
+ "action": "Status",
70
+ "path": path
71
+ }, "StatusResponse");
72
+ },
73
+ /**
74
+ * Adds changes in the local repository to the staging area at the given path.
75
+ * @param {string} path - The file system path of the local Git repository.
76
+ * @returns {Promise<any>} A promise that resolves with the response from the add event.
77
+ */
78
+ add: async (path) => {
79
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
80
+ "type": "gitEvent",
81
+ "action": "Add",
82
+ "path": path
83
+ }, "AddResponse");
84
+ },
85
+ /**
86
+ * Commits the staged changes in the local repository with the given commit message.
87
+ * @param {string} message - The commit message to use for the commit.
88
+ * @returns {Promise<any>} A promise that resolves with the response from the commit event.
89
+ */
90
+ commit: async (message) => {
91
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
92
+ "type": "gitEvent",
93
+ "action": "Commit",
94
+ "message": message
95
+ }, "gitCommitResponse");
96
+ },
97
+ /**
98
+ * Checks out a branch or commit in the local repository at the given path.
99
+ * @param {string} path - The file system path of the local Git repository.
100
+ * @param {string} branch - The name of the branch or commit to check out.
101
+ * @returns {Promise<any>} A promise that resolves with the response from the checkout event.
102
+ */
103
+ checkout: async (path, branch) => {
104
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
105
+ "type": "gitEvent",
106
+ "action": "Checkout",
107
+ "path": path,
108
+ "branch": branch
109
+ }, "CheckoutResponse");
110
+ },
111
+ /**
112
+ * Creates a new branch in the local repository at the given path.
113
+ * @param {string} path - The file system path of the local Git repository.
114
+ * @param {string} branch - The name of the new branch to create.
115
+ * @returns {Promise<any>} A promise that resolves with the response from the branch event.
116
+ */
117
+ branch: async (path, branch) => {
118
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
119
+ "type": "gitEvent",
120
+ "action": "Branch",
121
+ "path": path,
122
+ "branch": branch
123
+ }, "BranchResponse");
124
+ },
125
+ /**
126
+ * Retrieves the commit logs for the local repository at the given path.
127
+ * @param {string} path - The file system path of the local Git repository.
128
+ * @returns {Promise<any>} A promise that resolves with the response from the logs event.
129
+ */
130
+ logs: async (path) => {
131
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
132
+ "type": "gitEvent",
133
+ "action": "Logs",
134
+ "path": path
135
+ }, "LogsResponse");
136
+ },
137
+ /**
138
+ * Retrieves the diff of changes for a specific commit in the local repository.
139
+ * @param {string} commitHash - The hash of the commit to retrieve the diff for.
140
+ * @param {string} path - The file system path of the local Git repository.
141
+ * @returns {Promise<any>} A promise that resolves with the response from the diff event.
142
+ */
143
+ diff: async (commitHash, path) => {
144
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
145
+ "type": "gitEvent",
146
+ "action": "Diff",
147
+ "path": path,
148
+ "commitHash": commitHash
149
+ }, "DiffResponse");
150
+ }
151
+ };
152
+ exports.default = gitService;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.chatSummary = exports.logType = void 0;
7
- const websocket_1 = __importDefault(require("./websocket"));
7
+ const websocket_1 = __importDefault(require("../core/websocket"));
8
8
  /**
9
9
  * Enum representing different types of log messages.
10
10
  */
@@ -28,18 +28,10 @@ exports.chatSummary = {
28
28
  * @returns Promise with an array of message objects containing role and content
29
29
  */
30
30
  summarizeAll: () => {
31
- return new Promise((resolve, reject) => {
32
- websocket_1.default.getWebsocket.send(JSON.stringify({
33
- "type": "chatSummaryEvent",
34
- "action": "summarizeAll",
35
- }));
36
- websocket_1.default.getWebsocket.on('message', (data) => {
37
- const response = JSON.parse(data);
38
- if (response.type === "getSummarizeAllResponse") {
39
- resolve(response.payload); // Resolve the Promise with the response data
40
- }
41
- });
42
- });
31
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
32
+ "type": "chatSummaryEvent",
33
+ "action": "summarizeAll",
34
+ }, "getSummarizeAllResponse");
43
35
  },
44
36
  /**
45
37
  * Summarizes a specific part of the chat history.
@@ -49,20 +41,12 @@ exports.chatSummary = {
49
41
  * @returns Promise with an array of summarized message objects
50
42
  */
51
43
  summarize: (messages, depth) => {
52
- return new Promise((resolve, reject) => {
53
- websocket_1.default.getWebsocket.send(JSON.stringify({
54
- "type": "chatSummaryEvent",
55
- "action": "summarize",
56
- messages,
57
- depth
58
- }));
59
- websocket_1.default.getWebsocket.on('message', (data) => {
60
- const response = JSON.parse(data);
61
- if (response.type === "getSummarizeResponse") {
62
- resolve(response.payload); // Resolve the Promise with the response data
63
- }
64
- });
65
- });
44
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
45
+ "type": "chatSummaryEvent",
46
+ "action": "summarize",
47
+ messages,
48
+ depth
49
+ }, "getSummarizeResponse");
66
50
  }
67
51
  };
68
52
  exports.default = exports.chatSummary;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const websocket_1 = __importDefault(require("./websocket"));
6
+ const websocket_1 = __importDefault(require("../core/websocket"));
7
7
  /**
8
8
  * A module for interacting with language learning models (LLMs) via WebSocket.
9
9
  */
@@ -19,21 +19,13 @@ const cbllm = {
19
19
  * @returns {Promise<LLMResponse>} A promise that resolves with the LLM's response.
20
20
  */
21
21
  inference: async (message, llmrole) => {
22
- return new Promise((resolve, reject) => {
23
- websocket_1.default.getWebsocket.send(JSON.stringify({
24
- "type": "inference",
25
- "message": {
26
- prompt: message,
27
- llmrole
28
- },
29
- }));
30
- websocket_1.default.getWebsocket.on('message', (data) => {
31
- const response = JSON.parse(data);
32
- if (response.type === "llmResponse") {
33
- resolve(response); // Resolve the Promise with the response data
34
- }
35
- });
36
- });
22
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
23
+ "type": "inference",
24
+ "message": {
25
+ prompt: message,
26
+ llmrole
27
+ },
28
+ }, "llmResponse");
37
29
  }
38
30
  };
39
31
  exports.default = cbllm;
@@ -16,6 +16,6 @@ declare const cbproject: {
16
16
  getProjectPath: () => Promise<GetProjectPathResponse>;
17
17
  getRepoMap: (message: any) => Promise<GetProjectPathResponse>;
18
18
  runProject: () => void;
19
- getEditorFileStatus: () => Promise<unknown>;
19
+ getEditorFileStatus: () => Promise<any>;
20
20
  };
21
21
  export default cbproject;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const websocket_1 = __importDefault(require("../core/websocket"));
7
+ /**
8
+ * A module for interacting with project settings and paths.
9
+ */
10
+ const cbproject = {
11
+ /**
12
+ * Placeholder for a method to get project settings.
13
+ * Currently, this method does not perform any operations.
14
+ * @param {any} output - The output where project settings would be stored.
15
+ */
16
+ getProjectSettings: (output) => {
17
+ // Implementation for getting project settings will be added here
18
+ },
19
+ /**
20
+ * Retrieves the path of the current project.
21
+ * @returns {Promise<GetProjectPathResponse>} A promise that resolves with the project path response.
22
+ */
23
+ getProjectPath: () => {
24
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
25
+ "type": "settingEvent",
26
+ "action": "getProjectPath"
27
+ }, "getProjectPathResponse");
28
+ },
29
+ getRepoMap: (message) => {
30
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
31
+ "type": "settingEvent",
32
+ "action": "getRepoMap",
33
+ message
34
+ }, "getRepoMapResponse");
35
+ },
36
+ runProject: () => {
37
+ websocket_1.default.messageManager.send({
38
+ "type": "runProject"
39
+ });
40
+ },
41
+ getEditorFileStatus: () => {
42
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
43
+ "type": "settingEvent",
44
+ "action": "getEditorFileStatus",
45
+ }, "getEditorFileStatusResponse");
46
+ }
47
+ };
48
+ exports.default = cbproject;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const websocket_1 = __importDefault(require("../core/websocket"));
7
+ const cbstate = {
8
+ /**
9
+ * Retrieves the current application state from the server via WebSocket.
10
+ * @returns {Promise<ApplicationState>} A promise that resolves with the application state.
11
+ */
12
+ getApplicationState: async () => {
13
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
14
+ "type": "projectStateEvent",
15
+ "action": "getAppState",
16
+ }, "getAppStateResponse");
17
+ },
18
+ /**
19
+ * Adds a key-value pair to the agent's state on the server via WebSocket.
20
+ * @param {string} key - The key to add to the agent's state.
21
+ * @param {string} value - The value associated with the key.
22
+ * @returns {Promise<AddToAgentStateResponse>} A promise that resolves with the response to the addition request.
23
+ */
24
+ addToAgentState: async (key, value) => {
25
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
26
+ "type": "agentStateEvent",
27
+ "action": "addToAgentState",
28
+ payload: {
29
+ key,
30
+ value
31
+ }
32
+ }, "addToAgentStateResponse");
33
+ },
34
+ /**
35
+ * Retrieves the current state of the agent from the server via WebSocket.
36
+ * @returns {Promise<GetAgentStateResponse>} A promise that resolves with the agent's state.
37
+ */
38
+ getAgentState: async () => {
39
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
40
+ "type": "agentStateEvent",
41
+ "action": "getAgentState",
42
+ }, "getAgentStateResponse");
43
+ },
44
+ /**
45
+ * Retrieves the current project state from the server via WebSocket.
46
+ * @returns {Promise<GetProjectStateResponse>} A promise that resolves with the project's state.
47
+ */
48
+ getProjectState: async () => {
49
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
50
+ "type": "projectStateEvent",
51
+ "action": "getProjectState",
52
+ }, "getProjectStateResponse");
53
+ },
54
+ /**
55
+ * Updates the project state on the server via WebSocket.
56
+ * @returns {Promise<UpdateProjectStateResponse>} A promise that resolves with the response to the update request.
57
+ */
58
+ updateProjectState: async (key, value) => {
59
+ return websocket_1.default.messageManager.sendAndWaitForResponse({
60
+ "type": "projectStateEvent",
61
+ "action": "updateProjectState",
62
+ payload: {
63
+ key,
64
+ value
65
+ }
66
+ }, "updateProjectStateResponse");
67
+ }
68
+ };
69
+ exports.default = cbstate;