@codebolt/codeboltjs 1.1.30 → 1.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/.github/workflows/publish-to-npm.yml +1 -0
  2. package/docs/.nojekyll +1 -0
  3. package/docs/assets/highlight.css +127 -0
  4. package/docs/assets/icons.js +15 -0
  5. package/docs/assets/icons.svg +1 -0
  6. package/docs/assets/main.js +59 -0
  7. package/docs/assets/navigation.js +1 -0
  8. package/docs/assets/search.js +1 -0
  9. package/docs/assets/style.css +1412 -0
  10. package/docs/classes/_internal_.Agent.html +314 -0
  11. package/docs/classes/_internal_.AsyncResource.html +44 -0
  12. package/docs/classes/_internal_.Blob.html +33 -0
  13. package/docs/classes/_internal_.ClientRequest.html +506 -0
  14. package/docs/classes/_internal_.Codebolt.html +281 -0
  15. package/docs/classes/_internal_.CustomEventEmitter-1.html +248 -0
  16. package/docs/classes/_internal_.CustomEventEmitter.html +248 -0
  17. package/docs/classes/_internal_.Duplex.html +690 -0
  18. package/docs/classes/_internal_.EventEmitter-1.html +254 -0
  19. package/docs/classes/_internal_.EventEmitter.EventEmitterAsyncResource.html +268 -0
  20. package/docs/classes/_internal_.IncomingMessage.html +659 -0
  21. package/docs/classes/_internal_.KeyObject.html +76 -0
  22. package/docs/classes/_internal_.OutgoingMessage.html +491 -0
  23. package/docs/classes/_internal_.Readable.html +551 -0
  24. package/docs/classes/_internal_.ReadableBase.html +551 -0
  25. package/docs/classes/_internal_.Server-1.html +416 -0
  26. package/docs/classes/_internal_.Server-2.html +326 -0
  27. package/docs/classes/_internal_.Server-3.html +353 -0
  28. package/docs/classes/_internal_.Server.html +390 -0
  29. package/docs/classes/_internal_.ServerResponse.html +569 -0
  30. package/docs/classes/_internal_.Socket.html +791 -0
  31. package/docs/classes/_internal_.Stream.html +256 -0
  32. package/docs/classes/_internal_.TLSSocket.html +947 -0
  33. package/docs/classes/_internal_.URL.html +140 -0
  34. package/docs/classes/_internal_.URLSearchParams.html +68 -0
  35. package/docs/classes/_internal_.WebSocket-1.html +297 -0
  36. package/docs/classes/_internal_.WebSocket.Server.html +261 -0
  37. package/docs/classes/_internal_.Writable.html +394 -0
  38. package/docs/classes/_internal_.WritableBase.html +394 -0
  39. package/docs/classes/_internal_.X509Certificate.html +144 -0
  40. package/docs/classes/_internal_.internal-1.html +256 -0
  41. package/docs/classes/_internal_.internal.PassThrough.html +686 -0
  42. package/docs/classes/_internal_.internal.Transform.html +693 -0
  43. package/docs/enums/_internal_.logType.html +4 -0
  44. package/docs/functions/_internal_.WebSocket.createWebSocketStream.html +1 -0
  45. package/docs/functions/_internal_._node_stream_consumers_.arrayBuffer.html +1 -0
  46. package/docs/functions/_internal_._node_stream_consumers_.blob.html +1 -0
  47. package/docs/functions/_internal_._node_stream_consumers_.buffer.html +1 -0
  48. package/docs/functions/_internal_._node_stream_consumers_.json.html +1 -0
  49. package/docs/functions/_internal_._node_stream_consumers_.text.html +1 -0
  50. package/docs/functions/_internal_._node_stream_promises_.finished.html +1 -0
  51. package/docs/functions/_internal_._node_stream_promises_.pipeline.html +1 -0
  52. package/docs/functions/_internal_.internal.addAbortSignal.html +17 -0
  53. package/docs/functions/_internal_.internal.finished-1.html +20 -0
  54. package/docs/functions/_internal_.internal.finished.__promisify__.html +1 -0
  55. package/docs/functions/_internal_.internal.getDefaultHighWaterMark.html +4 -0
  56. package/docs/functions/_internal_.internal.isErrored.html +3 -0
  57. package/docs/functions/_internal_.internal.isReadable.html +3 -0
  58. package/docs/functions/_internal_.internal.pipeline-1.html +24 -0
  59. package/docs/functions/_internal_.internal.pipeline.__promisify__.html +1 -0
  60. package/docs/functions/_internal_.internal.setDefaultHighWaterMark.html +4 -0
  61. package/docs/hierarchy.html +1 -0
  62. package/docs/index.html +12 -0
  63. package/docs/interfaces/_internal_.AddToAgentStateResponse.html +3 -0
  64. package/docs/interfaces/_internal_.AddTokenResponse.html +3 -0
  65. package/docs/interfaces/_internal_.AddVectorItemResponse.html +3 -0
  66. package/docs/interfaces/_internal_.AddressInfo.html +4 -0
  67. package/docs/interfaces/_internal_.AgentOptions.html +35 -0
  68. package/docs/interfaces/_internal_.ApplicationState.html +4 -0
  69. package/docs/interfaces/_internal_.ArrayBufferView.html +7 -0
  70. package/docs/interfaces/_internal_.ArrayLike.html +2 -0
  71. package/docs/interfaces/_internal_.ArrayOptions.html +7 -0
  72. package/docs/interfaces/_internal_.AsymmetricKeyDetails.html +15 -0
  73. package/docs/interfaces/_internal_.AsyncGenerator.html +5 -0
  74. package/docs/interfaces/_internal_.AsyncGeneratorFunction.html +12 -0
  75. package/docs/interfaces/_internal_.AsyncIterable.html +2 -0
  76. package/docs/interfaces/_internal_.AsyncIterableIterator.html +5 -0
  77. package/docs/interfaces/_internal_.AsyncIterator.html +4 -0
  78. package/docs/interfaces/_internal_.AsyncResourceOptions.html +12 -0
  79. package/docs/interfaces/_internal_.BlobOptions.html +8 -0
  80. package/docs/interfaces/_internal_.Buffer.html +760 -0
  81. package/docs/interfaces/_internal_.BufferConstructor.html +165 -0
  82. package/docs/interfaces/_internal_.Certificate.html +13 -0
  83. package/docs/interfaces/_internal_.ChatMessage.html +3 -0
  84. package/docs/interfaces/_internal_.Choice.html +5 -0
  85. package/docs/interfaces/_internal_.CipherNameAndProtocol.html +7 -0
  86. package/docs/interfaces/_internal_.ClientRequestArgs.html +28 -0
  87. package/docs/interfaces/_internal_.CommandError.html +3 -0
  88. package/docs/interfaces/_internal_.CommandOutput.html +3 -0
  89. package/docs/interfaces/_internal_.CommonConnectionOptions.html +29 -0
  90. package/docs/interfaces/_internal_.ConnectOpts.html +5 -0
  91. package/docs/interfaces/_internal_.CreateFileResponse.html +6 -0
  92. package/docs/interfaces/_internal_.CreateFolderResponse.html +6 -0
  93. package/docs/interfaces/_internal_.CryptoKey.html +26 -0
  94. package/docs/interfaces/_internal_.DebugAddLogResponse.html +4 -0
  95. package/docs/interfaces/_internal_.DeleteFileResponse.html +6 -0
  96. package/docs/interfaces/_internal_.DeleteFolderResponse.html +6 -0
  97. package/docs/interfaces/_internal_.DetailedPeerCertificate.html +53 -0
  98. package/docs/interfaces/_internal_.Dict.html +1 -0
  99. package/docs/interfaces/_internal_.Disposable.html +2 -0
  100. package/docs/interfaces/_internal_.DropArgument.html +7 -0
  101. package/docs/interfaces/_internal_.DuplexOptions.html +22 -0
  102. package/docs/interfaces/_internal_.EphemeralKeyInfo.html +7 -0
  103. package/docs/interfaces/_internal_.ErrnoException.html +8 -0
  104. package/docs/interfaces/_internal_.Error.html +4 -0
  105. package/docs/interfaces/_internal_.EventEmitter-2.html +130 -0
  106. package/docs/interfaces/_internal_.EventEmitter.Abortable.html +3 -0
  107. package/docs/interfaces/_internal_.EventEmitter.EventEmitterAsyncResourceOptions.html +19 -0
  108. package/docs/interfaces/_internal_.EventEmitter.EventEmitterReferencingAsyncResource.html +32 -0
  109. package/docs/interfaces/_internal_.EventEmitterOptions.html +3 -0
  110. package/docs/interfaces/_internal_.GetAgentStateResponse.html +3 -0
  111. package/docs/interfaces/_internal_.GetJsTreeResponse.html +3 -0
  112. package/docs/interfaces/_internal_.GetMarkdownResponse.html +3 -0
  113. package/docs/interfaces/_internal_.GetMatcherListTreeResponse.html +3 -0
  114. package/docs/interfaces/_internal_.GetProjectPathResponse.html +5 -0
  115. package/docs/interfaces/_internal_.GetTokenResponse.html +3 -0
  116. package/docs/interfaces/_internal_.GetVectorResponse.html +3 -0
  117. package/docs/interfaces/_internal_.GoToPageResponse.html +3 -0
  118. package/docs/interfaces/_internal_.HtmlReceived.html +3 -0
  119. package/docs/interfaces/_internal_.IncomingHttpHeaders.html +64 -0
  120. package/docs/interfaces/_internal_.InformationEvent.html +8 -0
  121. package/docs/interfaces/_internal_.IpcSocketConnectOpts.html +6 -0
  122. package/docs/interfaces/_internal_.Iterable.html +2 -0
  123. package/docs/interfaces/_internal_.IterableIterator.html +5 -0
  124. package/docs/interfaces/_internal_.Iterator.html +4 -0
  125. package/docs/interfaces/_internal_.IteratorReturnResult.html +3 -0
  126. package/docs/interfaces/_internal_.IteratorYieldResult.html +3 -0
  127. package/docs/interfaces/_internal_.JsonWebKey.html +14 -0
  128. package/docs/interfaces/_internal_.JwkKeyExportOptions.html +2 -0
  129. package/docs/interfaces/_internal_.KeyAlgorithm.html +2 -0
  130. package/docs/interfaces/_internal_.KeyExportOptions.html +5 -0
  131. package/docs/interfaces/_internal_.KeyObject-1.html +5 -0
  132. package/docs/interfaces/_internal_.LLMResponse.html +4 -0
  133. package/docs/interfaces/_internal_.ListenOptions.html +13 -0
  134. package/docs/interfaces/_internal_.LookupAddress.html +6 -0
  135. package/docs/interfaces/_internal_.LookupOptions.html +20 -0
  136. package/docs/interfaces/_internal_.MatchProblemResponse.html +3 -0
  137. package/docs/interfaces/_internal_.MemoryGetResponse.html +5 -0
  138. package/docs/interfaces/_internal_.MemorySetResponse.html +5 -0
  139. package/docs/interfaces/_internal_.Message.html +8 -0
  140. package/docs/interfaces/_internal_.MessageContent.html +3 -0
  141. package/docs/interfaces/_internal_.Object.html +18 -0
  142. package/docs/interfaces/_internal_.OnReadOpts.html +6 -0
  143. package/docs/interfaces/_internal_.OpenDebugBrowserResponse.html +4 -0
  144. package/docs/interfaces/_internal_.OutgoingHttpHeaders.html +80 -0
  145. package/docs/interfaces/_internal_.PeerCertificate.html +50 -0
  146. package/docs/interfaces/_internal_.PromiseLike.html +6 -0
  147. package/docs/interfaces/_internal_.PxfObject.html +5 -0
  148. package/docs/interfaces/_internal_.QueryVectorItemResponse.html +3 -0
  149. package/docs/interfaces/_internal_.QueuingStrategy.html +3 -0
  150. package/docs/interfaces/_internal_.QueuingStrategySize.html +1 -0
  151. package/docs/interfaces/_internal_.ReadFileResponse.html +7 -0
  152. package/docs/interfaces/_internal_.ReadOnlyDict.html +1 -0
  153. package/docs/interfaces/_internal_.ReadWriteStream.html +144 -0
  154. package/docs/interfaces/_internal_.ReadableByteStreamController.html +6 -0
  155. package/docs/interfaces/_internal_.ReadableByteStreamControllerCallback.html +1 -0
  156. package/docs/interfaces/_internal_.ReadableOptions.html +11 -0
  157. package/docs/interfaces/_internal_.ReadableStream-1.html +141 -0
  158. package/docs/interfaces/_internal_.ReadableStream.html +10 -0
  159. package/docs/interfaces/_internal_.ReadableStreamBYOBReader.html +5 -0
  160. package/docs/interfaces/_internal_.ReadableStreamDefaultController.html +5 -0
  161. package/docs/interfaces/_internal_.ReadableStreamDefaultReadDoneResult.html +3 -0
  162. package/docs/interfaces/_internal_.ReadableStreamDefaultReadValueResult.html +3 -0
  163. package/docs/interfaces/_internal_.ReadableStreamDefaultReader.html +5 -0
  164. package/docs/interfaces/_internal_.ReadableStreamErrorCallback.html +1 -0
  165. package/docs/interfaces/_internal_.ReadableStreamGenericReader.html +3 -0
  166. package/docs/interfaces/_internal_.ReadableStreamReadDoneResult.html +3 -0
  167. package/docs/interfaces/_internal_.ReadableStreamReadValueResult.html +3 -0
  168. package/docs/interfaces/_internal_.ReadableWritablePair.html +9 -0
  169. package/docs/interfaces/_internal_.SecureContext.html +2 -0
  170. package/docs/interfaces/_internal_.SecureContextOptions.html +121 -0
  171. package/docs/interfaces/_internal_.ServerOptions.html +65 -0
  172. package/docs/interfaces/_internal_.ServerOpts.html +25 -0
  173. package/docs/interfaces/_internal_.SharedArrayBuffer.html +7 -0
  174. package/docs/interfaces/_internal_.SharedArrayBufferConstructor.html +3 -0
  175. package/docs/interfaces/_internal_.SocketConstructorOpts.html +6 -0
  176. package/docs/interfaces/_internal_.StaticEventEmitterOptions.html +2 -0
  177. package/docs/interfaces/_internal_.StreamOptions.html +9 -0
  178. package/docs/interfaces/_internal_.StreamPipeOptions.html +37 -0
  179. package/docs/interfaces/_internal_.TLSSocketOptions.html +160 -0
  180. package/docs/interfaces/_internal_.TcpSocketConnectOpts.html +19 -0
  181. package/docs/interfaces/_internal_.TerminalInterruptResponse.html +3 -0
  182. package/docs/interfaces/_internal_.TlsOptions.html +197 -0
  183. package/docs/interfaces/_internal_.UnderlyingByteSource.html +6 -0
  184. package/docs/interfaces/_internal_.UnderlyingSink.html +6 -0
  185. package/docs/interfaces/_internal_.UnderlyingSinkAbortCallback.html +1 -0
  186. package/docs/interfaces/_internal_.UnderlyingSinkCloseCallback.html +1 -0
  187. package/docs/interfaces/_internal_.UnderlyingSinkStartCallback.html +1 -0
  188. package/docs/interfaces/_internal_.UnderlyingSinkWriteCallback.html +1 -0
  189. package/docs/interfaces/_internal_.UnderlyingSource.html +5 -0
  190. package/docs/interfaces/_internal_.UnderlyingSourceCancelCallback.html +1 -0
  191. package/docs/interfaces/_internal_.UnderlyingSourcePullCallback.html +1 -0
  192. package/docs/interfaces/_internal_.UnderlyingSourceStartCallback.html +1 -0
  193. package/docs/interfaces/_internal_.UpdateFileResponse.html +6 -0
  194. package/docs/interfaces/_internal_.UrlResponse.html +3 -0
  195. package/docs/interfaces/_internal_.Usage-1.html +4 -0
  196. package/docs/interfaces/_internal_.Usage.html +4 -0
  197. package/docs/interfaces/_internal_.WebSocket.AddressInfo.html +4 -0
  198. package/docs/interfaces/_internal_.WebSocket.ClientOptions.html +138 -0
  199. package/docs/interfaces/_internal_.WebSocket.CloseEvent.html +6 -0
  200. package/docs/interfaces/_internal_.WebSocket.ErrorEvent.html +5 -0
  201. package/docs/interfaces/_internal_.WebSocket.Event.html +3 -0
  202. package/docs/interfaces/_internal_.WebSocket.EventListenerOptions.html +2 -0
  203. package/docs/interfaces/_internal_.WebSocket.MessageEvent.html +4 -0
  204. package/docs/interfaces/_internal_.WebSocket.PerMessageDeflateOptions.html +9 -0
  205. package/docs/interfaces/_internal_.WebSocket.ServerOptions.html +14 -0
  206. package/docs/interfaces/_internal_.WebSocket.WebSocket.html +172 -0
  207. package/docs/interfaces/_internal_.WebSocket.WebSocketServer.html +144 -0
  208. package/docs/interfaces/_internal_.WebSocketAlias.html +172 -0
  209. package/docs/interfaces/_internal_.WritableOptions.html +14 -0
  210. package/docs/interfaces/_internal_.WritableStream-1.html +8 -0
  211. package/docs/interfaces/_internal_.WritableStream.html +133 -0
  212. package/docs/interfaces/_internal_.WritableStreamDefaultController.html +6 -0
  213. package/docs/interfaces/_internal_.WritableStreamDefaultWriter.html +12 -0
  214. package/docs/interfaces/_internal_.X509CheckOptions.html +16 -0
  215. package/docs/interfaces/_internal_.ZlibOptions.html +21 -0
  216. package/docs/interfaces/_internal_.getMatchDetail.html +3 -0
  217. package/docs/interfaces/_internal_.internal.FinishedOptions.html +6 -0
  218. package/docs/interfaces/_internal_.internal.Pipe.html +5 -0
  219. package/docs/interfaces/_internal_.internal.PipelineOptions.html +3 -0
  220. package/docs/interfaces/_internal_.internal.TransformOptions.html +24 -0
  221. package/docs/modules/_internal_.EventEmitter.html +6 -0
  222. package/docs/modules/_internal_.WebSocket.html +21 -0
  223. package/docs/modules/_internal_._node_stream_consumers_.html +6 -0
  224. package/docs/modules/_internal_._node_stream_promises_.html +3 -0
  225. package/docs/modules/_internal_.html +225 -0
  226. package/docs/modules/_internal_.internal.finished.html +2 -0
  227. package/docs/modules/_internal_.internal.html +36 -0
  228. package/docs/modules/_internal_.internal.pipeline.html +2 -0
  229. package/docs/modules.html +3 -0
  230. package/docs/types/_internal_.AnyRest.html +1 -0
  231. package/docs/types/_internal_.Args.html +1 -0
  232. package/docs/types/_internal_.ArrayBufferLike.html +1 -0
  233. package/docs/types/_internal_.ArrayBufferView-1.html +1 -0
  234. package/docs/types/_internal_.BinaryLike.html +1 -0
  235. package/docs/types/_internal_.BufferEncoding.html +1 -0
  236. package/docs/types/_internal_.BufferLike.html +1 -0
  237. package/docs/types/_internal_.ComposeFnParam.html +1 -0
  238. package/docs/types/_internal_.DefaultEventMap.html +1 -0
  239. package/docs/types/_internal_.EventMap.html +1 -0
  240. package/docs/types/_internal_.InstanceType.html +2 -0
  241. package/docs/types/_internal_.IteratorResult.html +1 -0
  242. package/docs/types/_internal_.Key.html +1 -0
  243. package/docs/types/_internal_.Key2.html +1 -0
  244. package/docs/types/_internal_.KeyFormat.html +1 -0
  245. package/docs/types/_internal_.KeyObjectType.html +1 -0
  246. package/docs/types/_internal_.KeyType-1.html +1 -0
  247. package/docs/types/_internal_.KeyType.html +1 -0
  248. package/docs/types/_internal_.KeyUsage.html +1 -0
  249. package/docs/types/_internal_.Listener.html +1 -0
  250. package/docs/types/_internal_.LookupFunction.html +1 -0
  251. package/docs/types/_internal_.OutgoingHttpHeader.html +1 -0
  252. package/docs/types/_internal_.Partial.html +2 -0
  253. package/docs/types/_internal_.Pick.html +2 -0
  254. package/docs/types/_internal_.PropertyKey.html +1 -0
  255. package/docs/types/_internal_.ReadableStreamController.html +1 -0
  256. package/docs/types/_internal_.ReadableStreamDefaultReadResult.html +1 -0
  257. package/docs/types/_internal_.ReadableStreamReadResult.html +1 -0
  258. package/docs/types/_internal_.Record.html +2 -0
  259. package/docs/types/_internal_.RequestListener.html +1 -0
  260. package/docs/types/_internal_.SecureVersion.html +1 -0
  261. package/docs/types/_internal_.ServerOptions-1.html +1 -0
  262. package/docs/types/_internal_.SocketConnectOpts.html +1 -0
  263. package/docs/types/_internal_.SocketReadyState.html +1 -0
  264. package/docs/types/_internal_.TypedArray.html +1 -0
  265. package/docs/types/_internal_.WebSocket.CertMeta.html +2 -0
  266. package/docs/types/_internal_.WebSocket.Data.html +2 -0
  267. package/docs/types/_internal_.WebSocket.RawData.html +2 -0
  268. package/docs/types/_internal_.WebSocket.VerifyClientCallbackAsync.html +4 -0
  269. package/docs/types/_internal_.WebSocket.VerifyClientCallbackSync.html +4 -0
  270. package/docs/types/_internal_.WithImplicitCoercion.html +1 -0
  271. package/docs/types/_internal_.internal.PipelineCallback.html +1 -0
  272. package/docs/types/_internal_.internal.PipelineDestination.html +1 -0
  273. package/docs/types/_internal_.internal.PipelineDestinationIterableFunction.html +1 -0
  274. package/docs/types/_internal_.internal.PipelineDestinationPromiseFunction.html +1 -0
  275. package/docs/types/_internal_.internal.PipelinePromise.html +1 -0
  276. package/docs/types/_internal_.internal.PipelineSource.html +1 -0
  277. package/docs/types/_internal_.internal.PipelineSourceFunction.html +1 -0
  278. package/docs/types/_internal_.internal.PipelineTransform.html +1 -0
  279. package/docs/types/_internal_.internal.PipelineTransformSource.html +1 -0
  280. package/docs/types/_internal_.internal.TransformCallback.html +1 -0
  281. package/docs/variables/_internal_.Buffer-1.html +1 -0
  282. package/docs/variables/_internal_.Error-1.html +1 -0
  283. package/docs/variables/_internal_.Object-1.html +2 -0
  284. package/docs/variables/_internal_.ReadableByteStreamController-1.html +1 -0
  285. package/docs/variables/_internal_.ReadableStream-2.html +1 -0
  286. package/docs/variables/_internal_.ReadableStreamBYOBReader-1.html +1 -0
  287. package/docs/variables/_internal_.ReadableStreamDefaultController-1.html +1 -0
  288. package/docs/variables/_internal_.ReadableStreamDefaultReader-1.html +1 -0
  289. package/docs/variables/_internal_.SharedArrayBuffer-1.html +1 -0
  290. package/docs/variables/_internal_.WebSocket.WebSocket-1.html +1 -0
  291. package/docs/variables/_internal_.WebSocket.WebSocketServer-1.html +1 -0
  292. package/docs/variables/_internal_.WebSocketAlias-1.html +1 -0
  293. package/docs/variables/_internal_.WritableStream-2.html +1 -0
  294. package/docs/variables/_internal_.WritableStreamDefaultController-1.html +1 -0
  295. package/docs/variables/_internal_.WritableStreamDefaultWriter-1.html +1 -0
  296. package/docs/variables/_internal_.internal.consumers.html +1 -0
  297. package/docs/variables/_internal_.internal.promises.html +1 -0
  298. package/docs/variables/default.html +1 -0
  299. package/index.d.ts +95 -57
  300. package/index.js +0 -32
  301. package/modules/browser.d.ts +15 -8
  302. package/modules/browser.js +10 -4
  303. package/modules/chat.d.ts +20 -7
  304. package/modules/chat.js +31 -10
  305. package/modules/codeutils.d.ts +31 -6
  306. package/modules/codeutils.js +30 -19
  307. package/modules/dbmemory.d.ts +5 -4
  308. package/modules/dbmemory.js +2 -2
  309. package/modules/debug.d.ts +15 -2
  310. package/modules/debug.js +14 -2
  311. package/modules/fs.d.ts +19 -13
  312. package/modules/fs.js +24 -7
  313. package/modules/llm.d.ts +3 -2
  314. package/modules/llm.js +1 -1
  315. package/modules/project.d.ts +3 -2
  316. package/modules/project.js +1 -1
  317. package/modules/state.d.ts +18 -7
  318. package/modules/state.js +14 -4
  319. package/modules/task.d.ts +3 -3
  320. package/modules/task.js +4 -3
  321. package/modules/terminal.d.ts +10 -9
  322. package/modules/terminal.js +4 -6
  323. package/modules/tokenizer.d.ts +11 -4
  324. package/modules/tokenizer.js +25 -3
  325. package/modules/vectordb.d.ts +7 -6
  326. package/modules/vectordb.js +3 -3
  327. package/package.json +4 -1
  328. package/script/gen.js +27 -0
  329. package/src/index.ts +1 -27
  330. package/src/modules/browser.ts +18 -9
  331. package/src/modules/chat.ts +34 -11
  332. package/src/modules/codeutils.ts +40 -27
  333. package/src/modules/dbmemory.ts +5 -4
  334. package/src/modules/debug.ts +15 -3
  335. package/src/modules/fs.ts +32 -15
  336. package/src/modules/llm.ts +3 -3
  337. package/src/modules/project.ts +3 -3
  338. package/src/modules/state.ts +18 -7
  339. package/src/modules/task.ts +4 -4
  340. package/src/modules/terminal.ts +10 -10
  341. package/src/modules/tokenizer.ts +28 -4
  342. package/src/modules/vectordb.ts +7 -7
@@ -8,20 +8,11 @@ const websocket_1 = __importDefault(require("./websocket"));
8
8
  * A utility module for working with code.
9
9
  */
10
10
  const cbcodeutils = {
11
- getCodeTree: () => {
12
- return new Promise((resolve, reject) => {
13
- websocket_1.default.getWebsocket.send(JSON.stringify({
14
- "type": "codeEvent",
15
- "action": "getCodeTree"
16
- }));
17
- websocket_1.default.getWebsocket.on('message', (data) => {
18
- const response = JSON.parse(data);
19
- if (response.type === "getCodeTreeResponse") {
20
- resolve(response.markdown); // Resolve the Promise with the response data
21
- }
22
- });
23
- });
24
- },
11
+ /**
12
+ * Retrieves a JavaScript tree structure for a given file path.
13
+ * @param {string} filePath - The path of the file to retrieve the JS tree for.
14
+ * @returns {Promise<GetJsTreeResponse>} A promise that resolves with the JS tree response.
15
+ */
25
16
  getJsTree: (filePath) => {
26
17
  return new Promise((resolve, reject) => {
27
18
  websocket_1.default.getWebsocket.send(JSON.stringify({
@@ -34,11 +25,15 @@ const cbcodeutils = {
34
25
  websocket_1.default.getWebsocket.on('message', (data) => {
35
26
  const response = JSON.parse(data);
36
27
  if (response.type === "getJsTreeResponse") {
37
- resolve(resolve); // Resolve the Promise with the response data
28
+ resolve(response); // Resolve the Promise with the response data
38
29
  }
39
30
  });
40
31
  });
41
32
  },
33
+ /**
34
+ * Retrieves all files as Markdown.
35
+ * @returns {Promise<string>} A promise that resolves with the Markdown content of all files.
36
+ */
42
37
  getAllFilesAsMarkDown: () => {
43
38
  return new Promise((resolve, reject) => {
44
39
  websocket_1.default.getWebsocket.send(JSON.stringify({
@@ -48,11 +43,18 @@ const cbcodeutils = {
48
43
  websocket_1.default.getWebsocket.on('message', (data) => {
49
44
  const response = JSON.parse(data);
50
45
  if (response.type === "getAllFilesMarkdownResponse") {
51
- resolve(response.markdown); // Resolve the Promise with the response data
46
+ resolve(response); // Resolve the Promise with the response data
52
47
  }
53
48
  });
54
49
  });
55
50
  },
51
+ /**
52
+ * Performs a matching operation based on the provided matcher definition and problem patterns.
53
+ * @param {object} matcherDefinition - The definition of the matcher.
54
+ * @param {Array} problemPatterns - The patterns to match against.
55
+ * @param {Array} problems - The list of problems.
56
+ * @returns {Promise<MatchProblemResponse>} A promise that resolves with the matching problem response.
57
+ */
56
58
  performMatch: (matcherDefinition, problemPatterns, problems) => {
57
59
  return new Promise((resolve, reject) => {
58
60
  websocket_1.default.getWebsocket.send(JSON.stringify({
@@ -66,11 +68,15 @@ const cbcodeutils = {
66
68
  websocket_1.default.getWebsocket.on('message', (data) => {
67
69
  const response = JSON.parse(data);
68
70
  if (response.type === "getgetJsTreeResponse") {
69
- resolve(resolve); // Resolve the Promise with the response data
71
+ resolve(response); // Resolve the Promise with the response data
70
72
  }
71
73
  });
72
74
  });
73
75
  },
76
+ /**
77
+ * Retrieves the list of matchers.
78
+ * @returns {Promise<GetMatcherListTreeResponse>} A promise that resolves with the list of matchers response.
79
+ */
74
80
  getMatcherList: () => {
75
81
  return new Promise((resolve, reject) => {
76
82
  websocket_1.default.getWebsocket.send(JSON.stringify({
@@ -80,11 +86,16 @@ const cbcodeutils = {
80
86
  websocket_1.default.getWebsocket.on('message', (data) => {
81
87
  const response = JSON.parse(data);
82
88
  if (response.type === "getMatcherListTreeResponse") {
83
- resolve(resolve); // Resolve the Promise with the response data
89
+ resolve(response); // Resolve the Promise with the response data
84
90
  }
85
91
  });
86
92
  });
87
93
  },
94
+ /**
95
+ * Retrieves details of a match.
96
+ * @param {string} matcher - The matcher to retrieve details for.
97
+ * @returns {Promise<getMatchDetail>} A promise that resolves with the match detail response.
98
+ */
88
99
  matchDetail: (matcher) => {
89
100
  return new Promise((resolve, reject) => {
90
101
  websocket_1.default.getWebsocket.send(JSON.stringify({
@@ -97,7 +108,7 @@ const cbcodeutils = {
97
108
  websocket_1.default.getWebsocket.on('message', (data) => {
98
109
  const response = JSON.parse(data);
99
110
  if (response.type === "matchDetailTreeResponse") {
100
- resolve(resolve); // Resolve the Promise with the response data
111
+ resolve(response); // Resolve the Promise with the response data
101
112
  }
102
113
  });
103
114
  });
@@ -1,3 +1,4 @@
1
+ import { MemorySetResponse, MemoryGetResponse } from '@codebolt/types';
1
2
  /**
2
3
  * A module for handling in-memory database operations via WebSocket.
3
4
  */
@@ -6,14 +7,14 @@ declare const dbmemory: {
6
7
  * Adds a key-value pair to the in-memory database.
7
8
  * @param {string} key - The key under which to store the value.
8
9
  * @param {any} value - The value to be stored.
9
- * @returns {Promise<any>} A promise that resolves with the response from the memory set event.
10
+ * @returns {Promise<MemorySetResponse>} A promise that resolves with the response from the memory set event.
10
11
  */
11
- addKnowledge: (key: string, value: any) => Promise<any>;
12
+ addKnowledge: (key: string, value: any) => Promise<MemorySetResponse>;
12
13
  /**
13
14
  * Retrieves a value from the in-memory database by key.
14
15
  * @param {string} key - The key of the value to retrieve.
15
- * @returns {Promise<any>} A promise that resolves with the response from the memory get event.
16
+ * @returns {Promise<MemoryGetResponse>} A promise that resolves with the response from the memory get event.
16
17
  */
17
- getKnowledge: (key: string) => Promise<any>;
18
+ getKnowledge: (key: string) => Promise<MemoryGetResponse>;
18
19
  };
19
20
  export default dbmemory;
@@ -12,7 +12,7 @@ const dbmemory = {
12
12
  * Adds a key-value pair to the in-memory database.
13
13
  * @param {string} key - The key under which to store the value.
14
14
  * @param {any} value - The value to be stored.
15
- * @returns {Promise<any>} A promise that resolves with the response from the memory set event.
15
+ * @returns {Promise<MemorySetResponse>} A promise that resolves with the response from the memory set event.
16
16
  */
17
17
  addKnowledge: (key, value) => {
18
18
  return new Promise((resolve, reject) => {
@@ -33,7 +33,7 @@ const dbmemory = {
33
33
  /**
34
34
  * Retrieves a value from the in-memory database by key.
35
35
  * @param {string} key - The key of the value to retrieve.
36
- * @returns {Promise<any>} A promise that resolves with the response from the memory get event.
36
+ * @returns {Promise<MemoryGetResponse>} A promise that resolves with the response from the memory get event.
37
37
  */
38
38
  getKnowledge: (key) => {
39
39
  return new Promise((resolve, reject) => {
@@ -1,10 +1,23 @@
1
+ import { DebugAddLogResponse, OpenDebugBrowserResponse } from '@codebolt/types';
1
2
  export declare enum logType {
2
3
  info = "info",
3
4
  error = "error",
4
5
  warning = "warning"
5
6
  }
6
7
  export declare const debug: {
7
- debug(log: string, type: logType): Promise<unknown>;
8
- openDebugBrowser(url: string, port: number): Promise<unknown>;
8
+ /**
9
+ * Sends a log message to the debug websocket and waits for a response.
10
+ * @param {string} log - The log message to send.
11
+ * @param {logType} type - The type of the log message (info, error, warning).
12
+ * @returns {Promise<DebugAddLogResponse>} A promise that resolves with the response from the debug event.
13
+ */
14
+ debug: (log: string, type: logType) => Promise<DebugAddLogResponse>;
15
+ /**
16
+ * Requests to open a debug browser at the specified URL and port.
17
+ * @param {string} url - The URL where the debug browser should be opened.
18
+ * @param {number} port - The port on which the debug browser will listen.
19
+ * @returns {Promise<OpenDebugBrowserResponse>} A promise that resolves with the response from the open debug browser event.
20
+ */
21
+ openDebugBrowser: (url: string, port: number) => Promise<OpenDebugBrowserResponse>;
9
22
  };
10
23
  export default debug;
package/modules/debug.js CHANGED
@@ -12,7 +12,13 @@ var logType;
12
12
  logType["warning"] = "warning";
13
13
  })(logType || (exports.logType = logType = {}));
14
14
  exports.debug = {
15
- debug(log, type) {
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) => {
16
22
  return new Promise((resolve, reject) => {
17
23
  websocket_1.default.getWebsocket.send(JSON.stringify({
18
24
  "type": "debugEvent",
@@ -30,7 +36,13 @@ exports.debug = {
30
36
  });
31
37
  });
32
38
  },
33
- openDebugBrowser(url, port) {
39
+ /**
40
+ * Requests to open a debug browser at the specified URL and port.
41
+ * @param {string} url - The URL where the debug browser should be opened.
42
+ * @param {number} port - The port on which the debug browser will listen.
43
+ * @returns {Promise<OpenDebugBrowserResponse>} A promise that resolves with the response from the open debug browser event.
44
+ */
45
+ openDebugBrowser: (url, port) => {
34
46
  return new Promise((resolve, reject) => {
35
47
  websocket_1.default.getWebsocket.send(JSON.stringify({
36
48
  "type": "debugEvent",
package/modules/fs.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { CreateFileResponse, CreateFolderResponse, ReadFileResponse, UpdateFileResponse, DeleteFileResponse, DeleteFolderResponse } from '@codebolt/types';
1
2
  /**
2
3
  * @module cbfs
3
4
  * @description This module provides functionality to interact with the filesystem.
@@ -9,50 +10,55 @@ declare const cbfs: {
9
10
  * @param {string} fileName - The name of the file to create.
10
11
  * @param {string} source - The source content to write into the file.
11
12
  * @param {string} filePath - The path where the file should be created.
12
- * @returns {Promise<any>} A promise that resolves with the server response.
13
+ * @returns {Promise<CreateFileResponse>} A promise that resolves with the server response.
13
14
  */
14
- createFile: (fileName: string, source: string, filePath: string) => Promise<any>;
15
+ createFile: (fileName: string, source: string, filePath: string) => Promise<CreateFileResponse>;
15
16
  /**
16
17
  * @function createFolder
17
18
  * @description Creates a new folder.
18
19
  * @param {string} folderName - The name of the folder to create.
19
20
  * @param {string} folderPath - The path where the folder should be created.
20
- * @returns {Promise<any>} A promise that resolves with the server response.
21
+ * @returns {Promise<CreateFolderResponse>} A promise that resolves with the server response.
21
22
  */
22
- createFolder: (folderName: string, folderPath: string) => Promise<any>;
23
+ createFolder: (folderName: string, folderPath: string) => Promise<CreateFolderResponse>;
23
24
  /**
24
25
  * @function readFile
25
26
  * @description Reads the content of a file.
26
27
  * @param {string} filename - The name of the file to read.
27
28
  * @param {string} filePath - The path of the file to read.
28
- * @returns {Promise<any>} A promise that resolves with the server response.
29
+ * @returns {Promise<ReadFileResponse>} A promise that resolves with the server response.
29
30
  */
30
- readFile: (filename: string, filePath: string) => Promise<any>;
31
+ readFile: (filename: string, filePath: string) => Promise<ReadFileResponse>;
31
32
  /**
32
33
  * @function updateFile
33
34
  * @description Updates the content of a file.
34
35
  * @param {string} filename - The name of the file to update.
35
36
  * @param {string} filePath - The path of the file to update.
36
37
  * @param {string} newContent - The new content to write into the file.
37
- * @returns {Promise<any>} A promise that resolves with the server response.
38
+ * @returns {Promise<UpdateFileResponse>} A promise that resolves with the server response.
38
39
  */
39
- updateFile: (filename: string, filePath: string, newContent: string) => Promise<any>;
40
+ updateFile: (filename: string, filePath: string, newContent: string) => Promise<UpdateFileResponse>;
40
41
  /**
41
42
  * @function deleteFile
42
43
  * @description Deletes a file.
43
44
  * @param {string} filename - The name of the file to delete.
44
45
  * @param {string} filePath - The path of the file to delete.
45
- * @returns {Promise<any>} A promise that resolves with the server response.
46
+ * @returns {Promise<DeleteFileResponse>} A promise that resolves with the server response.
46
47
  */
47
- deleteFile: (filename: string, filePath: string) => Promise<any>;
48
+ deleteFile: (filename: string, filePath: string) => Promise<DeleteFileResponse>;
48
49
  /**
49
50
  * @function deleteFolder
50
51
  * @description Deletes a folder.
51
52
  * @param {string} foldername - The name of the folder to delete.
52
53
  * @param {string} folderpath - The path of the folder to delete.
53
- * @returns {Promise<any>} A promise that resolves with the server response.
54
+ * @returns {Promise<DeleteFolderResponse>} A promise that resolves with the server response.
54
55
  */
55
- deleteFolder: (foldername: string, folderpath: string) => Promise<any>;
56
- listFile: (folderPath?: string) => void;
56
+ deleteFolder: (foldername: string, folderpath: string) => Promise<DeleteFolderResponse>;
57
+ /**
58
+ * @function listFile
59
+ * @description Lists all files.
60
+ * @returns {Promise<FileListResponse>} A promise that resolves with the list of files.
61
+ */
62
+ listFile: (filePath: string) => Promise<unknown>;
57
63
  };
58
64
  export default cbfs;
package/modules/fs.js CHANGED
@@ -15,7 +15,7 @@ const cbfs = {
15
15
  * @param {string} fileName - The name of the file to create.
16
16
  * @param {string} source - The source content to write into the file.
17
17
  * @param {string} filePath - The path where the file should be created.
18
- * @returns {Promise<any>} A promise that resolves with the server response.
18
+ * @returns {Promise<CreateFileResponse>} A promise that resolves with the server response.
19
19
  */
20
20
  createFile: (fileName, source, filePath) => {
21
21
  return new Promise((resolve, reject) => {
@@ -41,7 +41,7 @@ const cbfs = {
41
41
  * @description Creates a new folder.
42
42
  * @param {string} folderName - The name of the folder to create.
43
43
  * @param {string} folderPath - The path where the folder should be created.
44
- * @returns {Promise<any>} A promise that resolves with the server response.
44
+ * @returns {Promise<CreateFolderResponse>} A promise that resolves with the server response.
45
45
  */
46
46
  createFolder: (folderName, folderPath) => {
47
47
  return new Promise((resolve, reject) => {
@@ -66,7 +66,7 @@ const cbfs = {
66
66
  * @description Reads the content of a file.
67
67
  * @param {string} filename - The name of the file to read.
68
68
  * @param {string} filePath - The path of the file to read.
69
- * @returns {Promise<any>} A promise that resolves with the server response.
69
+ * @returns {Promise<ReadFileResponse>} A promise that resolves with the server response.
70
70
  */
71
71
  readFile: (filename, filePath) => {
72
72
  return new Promise((resolve, reject) => {
@@ -92,7 +92,7 @@ const cbfs = {
92
92
  * @param {string} filename - The name of the file to update.
93
93
  * @param {string} filePath - The path of the file to update.
94
94
  * @param {string} newContent - The new content to write into the file.
95
- * @returns {Promise<any>} A promise that resolves with the server response.
95
+ * @returns {Promise<UpdateFileResponse>} A promise that resolves with the server response.
96
96
  */
97
97
  updateFile: (filename, filePath, newContent) => {
98
98
  return new Promise((resolve, reject) => {
@@ -118,7 +118,7 @@ const cbfs = {
118
118
  * @description Deletes a file.
119
119
  * @param {string} filename - The name of the file to delete.
120
120
  * @param {string} filePath - The path of the file to delete.
121
- * @returns {Promise<any>} A promise that resolves with the server response.
121
+ * @returns {Promise<DeleteFileResponse>} A promise that resolves with the server response.
122
122
  */
123
123
  deleteFile: (filename, filePath) => {
124
124
  return new Promise((resolve, reject) => {
@@ -143,7 +143,7 @@ const cbfs = {
143
143
  * @description Deletes a folder.
144
144
  * @param {string} foldername - The name of the folder to delete.
145
145
  * @param {string} folderpath - The path of the folder to delete.
146
- * @returns {Promise<any>} A promise that resolves with the server response.
146
+ * @returns {Promise<DeleteFolderResponse>} A promise that resolves with the server response.
147
147
  */
148
148
  deleteFolder: (foldername, folderpath) => {
149
149
  return new Promise((resolve, reject) => {
@@ -163,7 +163,24 @@ const cbfs = {
163
163
  });
164
164
  });
165
165
  },
166
- listFile: (folderPath) => {
166
+ /**
167
+ * @function listFile
168
+ * @description Lists all files.
169
+ * @returns {Promise<FileListResponse>} A promise that resolves with the list of files.
170
+ */
171
+ listFile: (filePath) => {
172
+ return new Promise((resolve, reject) => {
173
+ websocket_1.default.getWebsocket.send(JSON.stringify({
174
+ "type": "fsEvent",
175
+ "action": "fileList",
176
+ }));
177
+ websocket_1.default.getWebsocket.on('message', (data) => {
178
+ const response = JSON.parse(data);
179
+ if (response.type === "fileListResponse") {
180
+ resolve(response);
181
+ }
182
+ });
183
+ });
167
184
  },
168
185
  };
169
186
  exports.default = cbfs;
package/modules/llm.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { LLMResponse } from '@codebolt/types';
1
2
  /**
2
3
  * A module for interacting with language learning models (LLMs) via WebSocket.
3
4
  */
@@ -10,8 +11,8 @@ declare const cbllm: {
10
11
  *
11
12
  * @param {string} message - The input message or prompt to be sent to the LLM.
12
13
  * @param {string} llmrole - The role of the LLM to determine which model to use.
13
- * @returns {Promise<any>} A promise that resolves with the LLM's response.
14
+ * @returns {Promise<LLMResponse>} A promise that resolves with the LLM's response.
14
15
  */
15
- inference: (message: string, llmrole: string) => Promise<any>;
16
+ inference: (message: string, llmrole: string) => Promise<LLMResponse>;
16
17
  };
17
18
  export default cbllm;
package/modules/llm.js CHANGED
@@ -16,7 +16,7 @@ const cbllm = {
16
16
  *
17
17
  * @param {string} message - The input message or prompt to be sent to the LLM.
18
18
  * @param {string} llmrole - The role of the LLM to determine which model to use.
19
- * @returns {Promise<any>} A promise that resolves with the LLM's response.
19
+ * @returns {Promise<LLMResponse>} A promise that resolves with the LLM's response.
20
20
  */
21
21
  inference: async (message, llmrole) => {
22
22
  return new Promise((resolve, reject) => {
@@ -1,3 +1,4 @@
1
+ import { GetProjectPathResponse } from '@codebolt/types';
1
2
  /**
2
3
  * A module for interacting with project settings and paths.
3
4
  */
@@ -10,8 +11,8 @@ declare const cbproject: {
10
11
  getProjectSettings: (output: any) => void;
11
12
  /**
12
13
  * Retrieves the path of the current project.
13
- * @returns {Promise<any>} A promise that resolves with the project path response.
14
+ * @returns {Promise<GetProjectPathResponse>} A promise that resolves with the project path response.
14
15
  */
15
- getProjectPath: () => Promise<any>;
16
+ getProjectPath: () => Promise<GetProjectPathResponse>;
16
17
  };
17
18
  export default cbproject;
@@ -18,7 +18,7 @@ const cbproject = {
18
18
  },
19
19
  /**
20
20
  * Retrieves the path of the current project.
21
- * @returns {Promise<any>} A promise that resolves with the project path response.
21
+ * @returns {Promise<GetProjectPathResponse>} A promise that resolves with the project path response.
22
22
  */
23
23
  getProjectPath: () => {
24
24
  return new Promise((resolve, reject) => {
@@ -1,10 +1,21 @@
1
- /**
2
- * Retrieves the application state asynchronously.
3
- * @returns {Promise<any>} A promise that resolves with the application state.
4
- */
1
+ import { ApplicationState, AddToAgentStateResponse, GetAgentStateResponse } from '@codebolt/types';
5
2
  declare const cbstate: {
6
- getApplicationState: () => Promise<any>;
7
- addToAgentState: (key: string, value: string) => Promise<void>;
8
- getAgentState: () => Promise<any>;
3
+ /**
4
+ * Retrieves the current application state from the server via WebSocket.
5
+ * @returns {Promise<ApplicationState>} A promise that resolves with the application state.
6
+ */
7
+ getApplicationState: () => Promise<ApplicationState>;
8
+ /**
9
+ * Adds a key-value pair to the agent's state on the server via WebSocket.
10
+ * @param {string} key - The key to add to the agent's state.
11
+ * @param {string} value - The value associated with the key.
12
+ * @returns {Promise<AddToAgentStateResponse>} A promise that resolves with the response to the addition request.
13
+ */
14
+ addToAgentState: (key: string, value: string) => Promise<AddToAgentStateResponse>;
15
+ /**
16
+ * Retrieves the current state of the agent from the server via WebSocket.
17
+ * @returns {Promise<GetAgentStateResponse>} A promise that resolves with the agent's state.
18
+ */
19
+ getAgentState: () => Promise<GetAgentStateResponse>;
9
20
  };
10
21
  export default cbstate;
package/modules/state.js CHANGED
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const websocket_1 = __importDefault(require("./websocket"));
7
- /**
8
- * Retrieves the application state asynchronously.
9
- * @returns {Promise<any>} A promise that resolves with the application state.
10
- */
11
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
12
  getApplicationState: async () => {
13
13
  return new Promise((resolve, reject) => {
14
14
  websocket_1.default.getWebsocket.send(JSON.stringify({
@@ -22,6 +22,12 @@ const cbstate = {
22
22
  });
23
23
  });
24
24
  },
25
+ /**
26
+ * Adds a key-value pair to the agent's state on the server via WebSocket.
27
+ * @param {string} key - The key to add to the agent's state.
28
+ * @param {string} value - The value associated with the key.
29
+ * @returns {Promise<AddToAgentStateResponse>} A promise that resolves with the response to the addition request.
30
+ */
25
31
  addToAgentState: async (key, value) => {
26
32
  return new Promise((resolve, reject) => {
27
33
  websocket_1.default.getWebsocket.send(JSON.stringify({
@@ -40,6 +46,10 @@ const cbstate = {
40
46
  });
41
47
  });
42
48
  },
49
+ /**
50
+ * Retrieves the current state of the agent from the server via WebSocket.
51
+ * @returns {Promise<GetAgentStateResponse>} A promise that resolves with the agent's state.
52
+ */
43
53
  getAgentState: async () => {
44
54
  return new Promise((resolve, reject) => {
45
55
  websocket_1.default.getWebsocket.send(JSON.stringify({
package/modules/task.d.ts CHANGED
@@ -5,18 +5,18 @@ declare const taskplaner: {
5
5
  /**
6
6
  * Adds a task using a WebSocket message.
7
7
  * @param {string} task - The task to be added.
8
- * @returns {Promise<any>} A promise that resolves with the response from the add task event.
8
+ * @returns {Promise<AddTaskResponse>} A promise that resolves with the response from the add task event.
9
9
  */
10
10
  addTask: (task: string) => Promise<any>;
11
11
  /**
12
12
  * Retrieves all tasks using a WebSocket message.
13
- * @returns {Promise<any>} A promise that resolves with the response from the get tasks event.
13
+ * @returns {Promise<GetTasksResponse>} A promise that resolves with the response from the get tasks event.
14
14
  */
15
15
  getTasks: () => Promise<any>;
16
16
  /**
17
17
  * Updates an existing task using a WebSocket message.
18
18
  * @param {string} task - The updated task information.
19
- * @returns {Promise<any>} A promise that resolves with the response from the update task event.
19
+ * @returns {Promise<UpdateTasksResponse>} A promise that resolves with the response from the update task event.
20
20
  */
21
21
  updateTask: (task: string) => Promise<any>;
22
22
  };
package/modules/task.js CHANGED
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const websocket_1 = __importDefault(require("./websocket"));
7
+ // import {AddTaskResponse,GetTasksResponse,UpdateTasksResponse } from '@codebolt/types';
7
8
  /**
8
9
  * Manages task operations via WebSocket communication.
9
10
  */
@@ -11,7 +12,7 @@ const taskplaner = {
11
12
  /**
12
13
  * Adds a task using a WebSocket message.
13
14
  * @param {string} task - The task to be added.
14
- * @returns {Promise<any>} A promise that resolves with the response from the add task event.
15
+ * @returns {Promise<AddTaskResponse>} A promise that resolves with the response from the add task event.
15
16
  */
16
17
  addTask: async (task) => {
17
18
  return new Promise((resolve, reject) => {
@@ -32,7 +33,7 @@ const taskplaner = {
32
33
  },
33
34
  /**
34
35
  * Retrieves all tasks using a WebSocket message.
35
- * @returns {Promise<any>} A promise that resolves with the response from the get tasks event.
36
+ * @returns {Promise<GetTasksResponse>} A promise that resolves with the response from the get tasks event.
36
37
  */
37
38
  getTasks: async () => {
38
39
  return new Promise((resolve, reject) => {
@@ -51,7 +52,7 @@ const taskplaner = {
51
52
  /**
52
53
  * Updates an existing task using a WebSocket message.
53
54
  * @param {string} task - The updated task information.
54
- * @returns {Promise<any>} A promise that resolves with the response from the update task event.
55
+ * @returns {Promise<UpdateTasksResponse>} A promise that resolves with the response from the update task event.
55
56
  */
56
57
  updateTask: async (task) => {
57
58
  return new Promise((resolve, reject) => {
@@ -1,9 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
+ import { CommandError, CommandOutput, TerminalInterruptResponse } from '@codebolt/types';
3
4
  /**
4
5
  * CustomEventEmitter class that extends the Node.js EventEmitter class.
5
6
  */
6
- export declare class CustomEventEmitter extends EventEmitter {
7
+ declare class CustomEventEmitter extends EventEmitter {
7
8
  }
8
9
  /**
9
10
  * A module for executing commands in a terminal-like environment via WebSocket.
@@ -16,30 +17,30 @@ declare const cbterminal: {
16
17
  * of the executed command and resolves the promise accordingly.
17
18
  *
18
19
  * @param {string} command - The command to be executed.
19
- * @returns {Promise<any>} A promise that resolves with the command's output, error, or finish signal.
20
+ * @returns {Promise<CommandOutput|CommandError>} A promise that resolves with the command's output, error, or finish signal.
20
21
  */
21
- executeCommand: (command: string) => Promise<any>;
22
+ executeCommand: (command: string) => Promise<CommandOutput | CommandError>;
22
23
  /**
23
24
  * Executes a given command and keeps running until an error occurs.
24
25
  * Listens for messages from the WebSocket and resolves the promise when an error is encountered.
25
26
  *
26
27
  * @param {string} command - The command to be executed.
27
- * @returns {Promise<any>} A promise that resolves when an error occurs during command execution.
28
+ * @returns {Promise<CommandError>} A promise that resolves when an error occurs during command execution.
28
29
  */
29
- executeCommandRunUntilError: (command: string) => Promise<any>;
30
+ executeCommandRunUntilError: (command: string) => Promise<CommandError>;
30
31
  /**
31
32
  * Sends a manual interrupt signal to the terminal.
32
33
  *
33
- * @returns {void}
34
+ * @returns {Promise<TerminalInterruptResponse>}
34
35
  */
35
- sendManualInterrupt(): Promise<any>;
36
+ sendManualInterrupt(): Promise<TerminalInterruptResponse>;
36
37
  /**
37
38
  * Executes a given command and streams the output.
38
39
  * Listens for messages from the WebSocket and streams the output data.
39
40
  *
40
41
  * @param {string} command - The command to be executed.
41
- * @returns {Promise<any>} A promise that streams the output data during command execution.
42
+ * @returns {EventEmitter} A promise that streams the output data during command execution.
42
43
  */
43
- executeCommandWithStream(command: string): CustomEventEmitter;
44
+ executeCommandWithStream(command: string): EventEmitter;
44
45
  };
45
46
  export default cbterminal;
@@ -3,7 +3,6 @@ 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
- exports.CustomEventEmitter = void 0;
7
6
  const websocket_1 = __importDefault(require("./websocket"));
8
7
  const events_1 = require("events");
9
8
  /**
@@ -11,7 +10,6 @@ const events_1 = require("events");
11
10
  */
12
11
  class CustomEventEmitter extends events_1.EventEmitter {
13
12
  }
14
- exports.CustomEventEmitter = CustomEventEmitter;
15
13
  /**
16
14
  * A module for executing commands in a terminal-like environment via WebSocket.
17
15
  */
@@ -23,7 +21,7 @@ const cbterminal = {
23
21
  * of the executed command and resolves the promise accordingly.
24
22
  *
25
23
  * @param {string} command - The command to be executed.
26
- * @returns {Promise<any>} A promise that resolves with the command's output, error, or finish signal.
24
+ * @returns {Promise<CommandOutput|CommandError>} A promise that resolves with the command's output, error, or finish signal.
27
25
  */
28
26
  executeCommand: async (command) => {
29
27
  return new Promise((resolve, reject) => {
@@ -44,7 +42,7 @@ const cbterminal = {
44
42
  * Listens for messages from the WebSocket and resolves the promise when an error is encountered.
45
43
  *
46
44
  * @param {string} command - The command to be executed.
47
- * @returns {Promise<any>} A promise that resolves when an error occurs during command execution.
45
+ * @returns {Promise<CommandError>} A promise that resolves when an error occurs during command execution.
48
46
  */
49
47
  executeCommandRunUntilError: async (command) => {
50
48
  return new Promise((resolve, reject) => {
@@ -63,7 +61,7 @@ const cbterminal = {
63
61
  /**
64
62
  * Sends a manual interrupt signal to the terminal.
65
63
  *
66
- * @returns {void}
64
+ * @returns {Promise<TerminalInterruptResponse>}
67
65
  */
68
66
  sendManualInterrupt() {
69
67
  return new Promise((resolve, reject) => {
@@ -83,7 +81,7 @@ const cbterminal = {
83
81
  * Listens for messages from the WebSocket and streams the output data.
84
82
  *
85
83
  * @param {string} command - The command to be executed.
86
- * @returns {Promise<any>} A promise that streams the output data during command execution.
84
+ * @returns {EventEmitter} A promise that streams the output data during command execution.
87
85
  */
88
86
  executeCommandWithStream(command) {
89
87
  // Send the process started message