@codebolt/codeboltjs 2.0.2 → 2.0.4

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