onbuzz 3.3.0

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 (506) hide show
  1. package/LICENSE +267 -0
  2. package/README.md +425 -0
  3. package/bin/cli.js +556 -0
  4. package/bin/loxia-terminal-v2.js +162 -0
  5. package/bin/loxia-terminal.js +90 -0
  6. package/bin/start-with-terminal.js +200 -0
  7. package/node_modules/@isaacs/balanced-match/LICENSE.md +23 -0
  8. package/node_modules/@isaacs/balanced-match/README.md +60 -0
  9. package/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts +9 -0
  10. package/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts.map +1 -0
  11. package/node_modules/@isaacs/balanced-match/dist/commonjs/index.js +59 -0
  12. package/node_modules/@isaacs/balanced-match/dist/commonjs/index.js.map +1 -0
  13. package/node_modules/@isaacs/balanced-match/dist/commonjs/package.json +3 -0
  14. package/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts +9 -0
  15. package/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts.map +1 -0
  16. package/node_modules/@isaacs/balanced-match/dist/esm/index.js +54 -0
  17. package/node_modules/@isaacs/balanced-match/dist/esm/index.js.map +1 -0
  18. package/node_modules/@isaacs/balanced-match/dist/esm/package.json +3 -0
  19. package/node_modules/@isaacs/balanced-match/package.json +79 -0
  20. package/node_modules/@isaacs/brace-expansion/LICENSE +23 -0
  21. package/node_modules/@isaacs/brace-expansion/README.md +97 -0
  22. package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts +6 -0
  23. package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
  24. package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +199 -0
  25. package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js.map +1 -0
  26. package/node_modules/@isaacs/brace-expansion/dist/commonjs/package.json +3 -0
  27. package/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts +6 -0
  28. package/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts.map +1 -0
  29. package/node_modules/@isaacs/brace-expansion/dist/esm/index.js +195 -0
  30. package/node_modules/@isaacs/brace-expansion/dist/esm/index.js.map +1 -0
  31. package/node_modules/@isaacs/brace-expansion/dist/esm/package.json +3 -0
  32. package/node_modules/@isaacs/brace-expansion/package.json +60 -0
  33. package/node_modules/glob/LICENSE.md +63 -0
  34. package/node_modules/glob/README.md +1177 -0
  35. package/node_modules/glob/dist/commonjs/glob.d.ts +388 -0
  36. package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -0
  37. package/node_modules/glob/dist/commonjs/glob.js +247 -0
  38. package/node_modules/glob/dist/commonjs/glob.js.map +1 -0
  39. package/node_modules/glob/dist/commonjs/has-magic.d.ts +14 -0
  40. package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -0
  41. package/node_modules/glob/dist/commonjs/has-magic.js +27 -0
  42. package/node_modules/glob/dist/commonjs/has-magic.js.map +1 -0
  43. package/node_modules/glob/dist/commonjs/ignore.d.ts +24 -0
  44. package/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -0
  45. package/node_modules/glob/dist/commonjs/ignore.js +119 -0
  46. package/node_modules/glob/dist/commonjs/ignore.js.map +1 -0
  47. package/node_modules/glob/dist/commonjs/index.d.ts +97 -0
  48. package/node_modules/glob/dist/commonjs/index.d.ts.map +1 -0
  49. package/node_modules/glob/dist/commonjs/index.js +68 -0
  50. package/node_modules/glob/dist/commonjs/index.js.map +1 -0
  51. package/node_modules/glob/dist/commonjs/index.min.js +4 -0
  52. package/node_modules/glob/dist/commonjs/index.min.js.map +7 -0
  53. package/node_modules/glob/dist/commonjs/package.json +3 -0
  54. package/node_modules/glob/dist/commonjs/pattern.d.ts +76 -0
  55. package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -0
  56. package/node_modules/glob/dist/commonjs/pattern.js +219 -0
  57. package/node_modules/glob/dist/commonjs/pattern.js.map +1 -0
  58. package/node_modules/glob/dist/commonjs/processor.d.ts +59 -0
  59. package/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -0
  60. package/node_modules/glob/dist/commonjs/processor.js +301 -0
  61. package/node_modules/glob/dist/commonjs/processor.js.map +1 -0
  62. package/node_modules/glob/dist/commonjs/walker.d.ts +97 -0
  63. package/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -0
  64. package/node_modules/glob/dist/commonjs/walker.js +387 -0
  65. package/node_modules/glob/dist/commonjs/walker.js.map +1 -0
  66. package/node_modules/glob/dist/esm/glob.d.ts +388 -0
  67. package/node_modules/glob/dist/esm/glob.d.ts.map +1 -0
  68. package/node_modules/glob/dist/esm/glob.js +243 -0
  69. package/node_modules/glob/dist/esm/glob.js.map +1 -0
  70. package/node_modules/glob/dist/esm/has-magic.d.ts +14 -0
  71. package/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -0
  72. package/node_modules/glob/dist/esm/has-magic.js +23 -0
  73. package/node_modules/glob/dist/esm/has-magic.js.map +1 -0
  74. package/node_modules/glob/dist/esm/ignore.d.ts +24 -0
  75. package/node_modules/glob/dist/esm/ignore.d.ts.map +1 -0
  76. package/node_modules/glob/dist/esm/ignore.js +115 -0
  77. package/node_modules/glob/dist/esm/ignore.js.map +1 -0
  78. package/node_modules/glob/dist/esm/index.d.ts +97 -0
  79. package/node_modules/glob/dist/esm/index.d.ts.map +1 -0
  80. package/node_modules/glob/dist/esm/index.js +55 -0
  81. package/node_modules/glob/dist/esm/index.js.map +1 -0
  82. package/node_modules/glob/dist/esm/index.min.js +4 -0
  83. package/node_modules/glob/dist/esm/index.min.js.map +7 -0
  84. package/node_modules/glob/dist/esm/package.json +3 -0
  85. package/node_modules/glob/dist/esm/pattern.d.ts +76 -0
  86. package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -0
  87. package/node_modules/glob/dist/esm/pattern.js +215 -0
  88. package/node_modules/glob/dist/esm/pattern.js.map +1 -0
  89. package/node_modules/glob/dist/esm/processor.d.ts +59 -0
  90. package/node_modules/glob/dist/esm/processor.d.ts.map +1 -0
  91. package/node_modules/glob/dist/esm/processor.js +294 -0
  92. package/node_modules/glob/dist/esm/processor.js.map +1 -0
  93. package/node_modules/glob/dist/esm/walker.d.ts +97 -0
  94. package/node_modules/glob/dist/esm/walker.d.ts.map +1 -0
  95. package/node_modules/glob/dist/esm/walker.js +381 -0
  96. package/node_modules/glob/dist/esm/walker.js.map +1 -0
  97. package/node_modules/glob/node_modules/minimatch/LICENSE.md +55 -0
  98. package/node_modules/glob/node_modules/minimatch/README.md +453 -0
  99. package/node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
  100. package/node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
  101. package/node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  102. package/node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
  103. package/node_modules/glob/node_modules/minimatch/dist/commonjs/ast.d.ts +20 -0
  104. package/node_modules/glob/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
  105. package/node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js +591 -0
  106. package/node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
  107. package/node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
  108. package/node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
  109. package/node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
  110. package/node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
  111. package/node_modules/glob/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
  112. package/node_modules/glob/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
  113. package/node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js +30 -0
  114. package/node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
  115. package/node_modules/glob/node_modules/minimatch/dist/commonjs/index.d.ts +94 -0
  116. package/node_modules/glob/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
  117. package/node_modules/glob/node_modules/minimatch/dist/commonjs/index.js +1029 -0
  118. package/node_modules/glob/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
  119. package/node_modules/glob/node_modules/minimatch/dist/commonjs/package.json +3 -0
  120. package/node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
  121. package/node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
  122. package/node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
  123. package/node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
  124. package/node_modules/glob/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
  125. package/node_modules/glob/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
  126. package/node_modules/glob/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  127. package/node_modules/glob/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
  128. package/node_modules/glob/node_modules/minimatch/dist/esm/ast.d.ts +20 -0
  129. package/node_modules/glob/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
  130. package/node_modules/glob/node_modules/minimatch/dist/esm/ast.js +587 -0
  131. package/node_modules/glob/node_modules/minimatch/dist/esm/ast.js.map +1 -0
  132. package/node_modules/glob/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
  133. package/node_modules/glob/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
  134. package/node_modules/glob/node_modules/minimatch/dist/esm/brace-expressions.js +148 -0
  135. package/node_modules/glob/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
  136. package/node_modules/glob/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
  137. package/node_modules/glob/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
  138. package/node_modules/glob/node_modules/minimatch/dist/esm/escape.js +26 -0
  139. package/node_modules/glob/node_modules/minimatch/dist/esm/escape.js.map +1 -0
  140. package/node_modules/glob/node_modules/minimatch/dist/esm/index.d.ts +94 -0
  141. package/node_modules/glob/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
  142. package/node_modules/glob/node_modules/minimatch/dist/esm/index.js +1016 -0
  143. package/node_modules/glob/node_modules/minimatch/dist/esm/index.js.map +1 -0
  144. package/node_modules/glob/node_modules/minimatch/dist/esm/package.json +3 -0
  145. package/node_modules/glob/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
  146. package/node_modules/glob/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
  147. package/node_modules/glob/node_modules/minimatch/dist/esm/unescape.js +34 -0
  148. package/node_modules/glob/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
  149. package/node_modules/glob/node_modules/minimatch/package.json +67 -0
  150. package/node_modules/glob/package.json +101 -0
  151. package/node_modules/minipass/LICENSE +15 -0
  152. package/node_modules/minipass/README.md +825 -0
  153. package/node_modules/minipass/dist/commonjs/index.d.ts +549 -0
  154. package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
  155. package/node_modules/minipass/dist/commonjs/index.js +1028 -0
  156. package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
  157. package/node_modules/minipass/dist/commonjs/package.json +3 -0
  158. package/node_modules/minipass/dist/esm/index.d.ts +549 -0
  159. package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
  160. package/node_modules/minipass/dist/esm/index.js +1018 -0
  161. package/node_modules/minipass/dist/esm/index.js.map +1 -0
  162. package/node_modules/minipass/dist/esm/package.json +3 -0
  163. package/node_modules/minipass/package.json +82 -0
  164. package/node_modules/package-json-from-dist/LICENSE.md +63 -0
  165. package/node_modules/package-json-from-dist/README.md +110 -0
  166. package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts +89 -0
  167. package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map +1 -0
  168. package/node_modules/package-json-from-dist/dist/commonjs/index.js +134 -0
  169. package/node_modules/package-json-from-dist/dist/commonjs/index.js.map +1 -0
  170. package/node_modules/package-json-from-dist/dist/commonjs/package.json +3 -0
  171. package/node_modules/package-json-from-dist/dist/esm/index.d.ts +89 -0
  172. package/node_modules/package-json-from-dist/dist/esm/index.d.ts.map +1 -0
  173. package/node_modules/package-json-from-dist/dist/esm/index.js +129 -0
  174. package/node_modules/package-json-from-dist/dist/esm/index.js.map +1 -0
  175. package/node_modules/package-json-from-dist/dist/esm/package.json +3 -0
  176. package/node_modules/package-json-from-dist/package.json +68 -0
  177. package/node_modules/path-scurry/LICENSE.md +55 -0
  178. package/node_modules/path-scurry/README.md +636 -0
  179. package/node_modules/path-scurry/dist/commonjs/index.d.ts +1115 -0
  180. package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +1 -0
  181. package/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
  182. package/node_modules/path-scurry/dist/commonjs/index.js.map +1 -0
  183. package/node_modules/path-scurry/dist/commonjs/package.json +3 -0
  184. package/node_modules/path-scurry/dist/esm/index.d.ts +1115 -0
  185. package/node_modules/path-scurry/dist/esm/index.d.ts.map +1 -0
  186. package/node_modules/path-scurry/dist/esm/index.js +1983 -0
  187. package/node_modules/path-scurry/dist/esm/index.js.map +1 -0
  188. package/node_modules/path-scurry/dist/esm/package.json +3 -0
  189. package/node_modules/path-scurry/node_modules/lru-cache/LICENSE.md +55 -0
  190. package/node_modules/path-scurry/node_modules/lru-cache/README.md +383 -0
  191. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts +1323 -0
  192. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
  193. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js +1589 -0
  194. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
  195. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
  196. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
  197. package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  198. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts +1323 -0
  199. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
  200. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js +1585 -0
  201. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js.map +1 -0
  202. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js +2 -0
  203. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
  204. package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json +3 -0
  205. package/node_modules/path-scurry/node_modules/lru-cache/package.json +101 -0
  206. package/node_modules/path-scurry/package.json +88 -0
  207. package/node_modules/rimraf/LICENSE.md +55 -0
  208. package/node_modules/rimraf/README.md +226 -0
  209. package/node_modules/rimraf/dist/commonjs/default-tmp.d.ts +3 -0
  210. package/node_modules/rimraf/dist/commonjs/default-tmp.d.ts.map +1 -0
  211. package/node_modules/rimraf/dist/commonjs/default-tmp.js +58 -0
  212. package/node_modules/rimraf/dist/commonjs/default-tmp.js.map +1 -0
  213. package/node_modules/rimraf/dist/commonjs/error.d.ts +6 -0
  214. package/node_modules/rimraf/dist/commonjs/error.d.ts.map +1 -0
  215. package/node_modules/rimraf/dist/commonjs/error.js +10 -0
  216. package/node_modules/rimraf/dist/commonjs/error.js.map +1 -0
  217. package/node_modules/rimraf/dist/commonjs/fix-eperm.d.ts +3 -0
  218. package/node_modules/rimraf/dist/commonjs/fix-eperm.d.ts.map +1 -0
  219. package/node_modules/rimraf/dist/commonjs/fix-eperm.js +38 -0
  220. package/node_modules/rimraf/dist/commonjs/fix-eperm.js.map +1 -0
  221. package/node_modules/rimraf/dist/commonjs/fs.d.ts +15 -0
  222. package/node_modules/rimraf/dist/commonjs/fs.d.ts.map +1 -0
  223. package/node_modules/rimraf/dist/commonjs/fs.js +33 -0
  224. package/node_modules/rimraf/dist/commonjs/fs.js.map +1 -0
  225. package/node_modules/rimraf/dist/commonjs/ignore-enoent.d.ts +3 -0
  226. package/node_modules/rimraf/dist/commonjs/ignore-enoent.d.ts.map +1 -0
  227. package/node_modules/rimraf/dist/commonjs/ignore-enoent.js +24 -0
  228. package/node_modules/rimraf/dist/commonjs/ignore-enoent.js.map +1 -0
  229. package/node_modules/rimraf/dist/commonjs/index.d.ts +50 -0
  230. package/node_modules/rimraf/dist/commonjs/index.d.ts.map +1 -0
  231. package/node_modules/rimraf/dist/commonjs/index.js +78 -0
  232. package/node_modules/rimraf/dist/commonjs/index.js.map +1 -0
  233. package/node_modules/rimraf/dist/commonjs/opt-arg.d.ts +34 -0
  234. package/node_modules/rimraf/dist/commonjs/opt-arg.d.ts.map +1 -0
  235. package/node_modules/rimraf/dist/commonjs/opt-arg.js +53 -0
  236. package/node_modules/rimraf/dist/commonjs/opt-arg.js.map +1 -0
  237. package/node_modules/rimraf/dist/commonjs/package.json +3 -0
  238. package/node_modules/rimraf/dist/commonjs/path-arg.d.ts +4 -0
  239. package/node_modules/rimraf/dist/commonjs/path-arg.d.ts.map +1 -0
  240. package/node_modules/rimraf/dist/commonjs/path-arg.js +48 -0
  241. package/node_modules/rimraf/dist/commonjs/path-arg.js.map +1 -0
  242. package/node_modules/rimraf/dist/commonjs/readdir-or-error.d.ts +3 -0
  243. package/node_modules/rimraf/dist/commonjs/readdir-or-error.d.ts.map +1 -0
  244. package/node_modules/rimraf/dist/commonjs/readdir-or-error.js +19 -0
  245. package/node_modules/rimraf/dist/commonjs/readdir-or-error.js.map +1 -0
  246. package/node_modules/rimraf/dist/commonjs/retry-busy.d.ts +8 -0
  247. package/node_modules/rimraf/dist/commonjs/retry-busy.d.ts.map +1 -0
  248. package/node_modules/rimraf/dist/commonjs/retry-busy.js +65 -0
  249. package/node_modules/rimraf/dist/commonjs/retry-busy.js.map +1 -0
  250. package/node_modules/rimraf/dist/commonjs/rimraf-manual.d.ts +3 -0
  251. package/node_modules/rimraf/dist/commonjs/rimraf-manual.d.ts.map +1 -0
  252. package/node_modules/rimraf/dist/commonjs/rimraf-manual.js +8 -0
  253. package/node_modules/rimraf/dist/commonjs/rimraf-manual.js.map +1 -0
  254. package/node_modules/rimraf/dist/commonjs/rimraf-move-remove.d.ts +4 -0
  255. package/node_modules/rimraf/dist/commonjs/rimraf-move-remove.d.ts.map +1 -0
  256. package/node_modules/rimraf/dist/commonjs/rimraf-move-remove.js +138 -0
  257. package/node_modules/rimraf/dist/commonjs/rimraf-move-remove.js.map +1 -0
  258. package/node_modules/rimraf/dist/commonjs/rimraf-native.d.ts +4 -0
  259. package/node_modules/rimraf/dist/commonjs/rimraf-native.d.ts.map +1 -0
  260. package/node_modules/rimraf/dist/commonjs/rimraf-native.js +24 -0
  261. package/node_modules/rimraf/dist/commonjs/rimraf-native.js.map +1 -0
  262. package/node_modules/rimraf/dist/commonjs/rimraf-posix.d.ts +4 -0
  263. package/node_modules/rimraf/dist/commonjs/rimraf-posix.d.ts.map +1 -0
  264. package/node_modules/rimraf/dist/commonjs/rimraf-posix.js +103 -0
  265. package/node_modules/rimraf/dist/commonjs/rimraf-posix.js.map +1 -0
  266. package/node_modules/rimraf/dist/commonjs/rimraf-windows.d.ts +4 -0
  267. package/node_modules/rimraf/dist/commonjs/rimraf-windows.d.ts.map +1 -0
  268. package/node_modules/rimraf/dist/commonjs/rimraf-windows.js +159 -0
  269. package/node_modules/rimraf/dist/commonjs/rimraf-windows.js.map +1 -0
  270. package/node_modules/rimraf/dist/commonjs/use-native.d.ts +4 -0
  271. package/node_modules/rimraf/dist/commonjs/use-native.d.ts.map +1 -0
  272. package/node_modules/rimraf/dist/commonjs/use-native.js +18 -0
  273. package/node_modules/rimraf/dist/commonjs/use-native.js.map +1 -0
  274. package/node_modules/rimraf/dist/esm/bin.d.mts +3 -0
  275. package/node_modules/rimraf/dist/esm/bin.d.mts.map +1 -0
  276. package/node_modules/rimraf/dist/esm/bin.mjs +250 -0
  277. package/node_modules/rimraf/dist/esm/bin.mjs.map +1 -0
  278. package/node_modules/rimraf/dist/esm/default-tmp.d.ts +3 -0
  279. package/node_modules/rimraf/dist/esm/default-tmp.d.ts.map +1 -0
  280. package/node_modules/rimraf/dist/esm/default-tmp.js +55 -0
  281. package/node_modules/rimraf/dist/esm/default-tmp.js.map +1 -0
  282. package/node_modules/rimraf/dist/esm/error.d.ts +6 -0
  283. package/node_modules/rimraf/dist/esm/error.d.ts.map +1 -0
  284. package/node_modules/rimraf/dist/esm/error.js +5 -0
  285. package/node_modules/rimraf/dist/esm/error.js.map +1 -0
  286. package/node_modules/rimraf/dist/esm/fix-eperm.d.ts +3 -0
  287. package/node_modules/rimraf/dist/esm/fix-eperm.d.ts.map +1 -0
  288. package/node_modules/rimraf/dist/esm/fix-eperm.js +33 -0
  289. package/node_modules/rimraf/dist/esm/fix-eperm.js.map +1 -0
  290. package/node_modules/rimraf/dist/esm/fs.d.ts +15 -0
  291. package/node_modules/rimraf/dist/esm/fs.d.ts.map +1 -0
  292. package/node_modules/rimraf/dist/esm/fs.js +18 -0
  293. package/node_modules/rimraf/dist/esm/fs.js.map +1 -0
  294. package/node_modules/rimraf/dist/esm/ignore-enoent.d.ts +3 -0
  295. package/node_modules/rimraf/dist/esm/ignore-enoent.d.ts.map +1 -0
  296. package/node_modules/rimraf/dist/esm/ignore-enoent.js +19 -0
  297. package/node_modules/rimraf/dist/esm/ignore-enoent.js.map +1 -0
  298. package/node_modules/rimraf/dist/esm/index.d.ts +50 -0
  299. package/node_modules/rimraf/dist/esm/index.d.ts.map +1 -0
  300. package/node_modules/rimraf/dist/esm/index.js +70 -0
  301. package/node_modules/rimraf/dist/esm/index.js.map +1 -0
  302. package/node_modules/rimraf/dist/esm/opt-arg.d.ts +34 -0
  303. package/node_modules/rimraf/dist/esm/opt-arg.d.ts.map +1 -0
  304. package/node_modules/rimraf/dist/esm/opt-arg.js +46 -0
  305. package/node_modules/rimraf/dist/esm/opt-arg.js.map +1 -0
  306. package/node_modules/rimraf/dist/esm/package.json +3 -0
  307. package/node_modules/rimraf/dist/esm/path-arg.d.ts +4 -0
  308. package/node_modules/rimraf/dist/esm/path-arg.d.ts.map +1 -0
  309. package/node_modules/rimraf/dist/esm/path-arg.js +46 -0
  310. package/node_modules/rimraf/dist/esm/path-arg.js.map +1 -0
  311. package/node_modules/rimraf/dist/esm/readdir-or-error.d.ts +3 -0
  312. package/node_modules/rimraf/dist/esm/readdir-or-error.d.ts.map +1 -0
  313. package/node_modules/rimraf/dist/esm/readdir-or-error.js +14 -0
  314. package/node_modules/rimraf/dist/esm/readdir-or-error.js.map +1 -0
  315. package/node_modules/rimraf/dist/esm/retry-busy.d.ts +8 -0
  316. package/node_modules/rimraf/dist/esm/retry-busy.d.ts.map +1 -0
  317. package/node_modules/rimraf/dist/esm/retry-busy.js +60 -0
  318. package/node_modules/rimraf/dist/esm/retry-busy.js.map +1 -0
  319. package/node_modules/rimraf/dist/esm/rimraf-manual.d.ts +3 -0
  320. package/node_modules/rimraf/dist/esm/rimraf-manual.d.ts.map +1 -0
  321. package/node_modules/rimraf/dist/esm/rimraf-manual.js +5 -0
  322. package/node_modules/rimraf/dist/esm/rimraf-manual.js.map +1 -0
  323. package/node_modules/rimraf/dist/esm/rimraf-move-remove.d.ts +4 -0
  324. package/node_modules/rimraf/dist/esm/rimraf-move-remove.d.ts.map +1 -0
  325. package/node_modules/rimraf/dist/esm/rimraf-move-remove.js +133 -0
  326. package/node_modules/rimraf/dist/esm/rimraf-move-remove.js.map +1 -0
  327. package/node_modules/rimraf/dist/esm/rimraf-native.d.ts +4 -0
  328. package/node_modules/rimraf/dist/esm/rimraf-native.d.ts.map +1 -0
  329. package/node_modules/rimraf/dist/esm/rimraf-native.js +19 -0
  330. package/node_modules/rimraf/dist/esm/rimraf-native.js.map +1 -0
  331. package/node_modules/rimraf/dist/esm/rimraf-posix.d.ts +4 -0
  332. package/node_modules/rimraf/dist/esm/rimraf-posix.d.ts.map +1 -0
  333. package/node_modules/rimraf/dist/esm/rimraf-posix.js +98 -0
  334. package/node_modules/rimraf/dist/esm/rimraf-posix.js.map +1 -0
  335. package/node_modules/rimraf/dist/esm/rimraf-windows.d.ts +4 -0
  336. package/node_modules/rimraf/dist/esm/rimraf-windows.d.ts.map +1 -0
  337. package/node_modules/rimraf/dist/esm/rimraf-windows.js +154 -0
  338. package/node_modules/rimraf/dist/esm/rimraf-windows.js.map +1 -0
  339. package/node_modules/rimraf/dist/esm/use-native.d.ts +4 -0
  340. package/node_modules/rimraf/dist/esm/use-native.d.ts.map +1 -0
  341. package/node_modules/rimraf/dist/esm/use-native.js +15 -0
  342. package/node_modules/rimraf/dist/esm/use-native.js.map +1 -0
  343. package/node_modules/rimraf/package.json +92 -0
  344. package/package.json +152 -0
  345. package/scripts/install-scanners.js +258 -0
  346. package/scripts/watchdog.js +147 -0
  347. package/src/analyzers/CSSAnalyzer.js +297 -0
  348. package/src/analyzers/ConfigValidator.js +690 -0
  349. package/src/analyzers/ESLintAnalyzer.js +320 -0
  350. package/src/analyzers/JavaScriptAnalyzer.js +261 -0
  351. package/src/analyzers/PrettierFormatter.js +247 -0
  352. package/src/analyzers/PythonAnalyzer.js +283 -0
  353. package/src/analyzers/SecurityAnalyzer.js +729 -0
  354. package/src/analyzers/SparrowAnalyzer.js +341 -0
  355. package/src/analyzers/TypeScriptAnalyzer.js +247 -0
  356. package/src/analyzers/codeCloneDetector/analyzer.js +344 -0
  357. package/src/analyzers/codeCloneDetector/detector.js +250 -0
  358. package/src/analyzers/codeCloneDetector/index.js +192 -0
  359. package/src/analyzers/codeCloneDetector/parser.js +199 -0
  360. package/src/analyzers/codeCloneDetector/reporter.js +148 -0
  361. package/src/analyzers/codeCloneDetector/scanner.js +88 -0
  362. package/src/core/agentPool.js +1957 -0
  363. package/src/core/agentScheduler.js +3212 -0
  364. package/src/core/contextManager.js +709 -0
  365. package/src/core/flowExecutor.js +928 -0
  366. package/src/core/messageProcessor.js +808 -0
  367. package/src/core/orchestrator.js +584 -0
  368. package/src/core/stateManager.js +1500 -0
  369. package/src/index.js +972 -0
  370. package/src/interfaces/cli.js +553 -0
  371. package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +208 -0
  372. package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +236 -0
  373. package/src/interfaces/terminal/__tests__/smoke/agents.test.js +138 -0
  374. package/src/interfaces/terminal/__tests__/smoke/components.test.js +137 -0
  375. package/src/interfaces/terminal/__tests__/smoke/connection.test.js +350 -0
  376. package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +156 -0
  377. package/src/interfaces/terminal/__tests__/smoke/imports.test.js +332 -0
  378. package/src/interfaces/terminal/__tests__/smoke/messages.test.js +256 -0
  379. package/src/interfaces/terminal/__tests__/smoke/tools.test.js +388 -0
  380. package/src/interfaces/terminal/api/apiClient.js +299 -0
  381. package/src/interfaces/terminal/api/messageRouter.js +262 -0
  382. package/src/interfaces/terminal/api/session.js +266 -0
  383. package/src/interfaces/terminal/api/websocket.js +497 -0
  384. package/src/interfaces/terminal/components/AgentCreator.js +705 -0
  385. package/src/interfaces/terminal/components/AgentEditor.js +678 -0
  386. package/src/interfaces/terminal/components/AgentSwitcher.js +330 -0
  387. package/src/interfaces/terminal/components/ErrorBoundary.js +92 -0
  388. package/src/interfaces/terminal/components/ErrorPanel.js +264 -0
  389. package/src/interfaces/terminal/components/Header.js +28 -0
  390. package/src/interfaces/terminal/components/HelpPanel.js +231 -0
  391. package/src/interfaces/terminal/components/InputBox.js +118 -0
  392. package/src/interfaces/terminal/components/Layout.js +603 -0
  393. package/src/interfaces/terminal/components/LoadingSpinner.js +71 -0
  394. package/src/interfaces/terminal/components/MessageList.js +281 -0
  395. package/src/interfaces/terminal/components/MultilineTextInput.js +251 -0
  396. package/src/interfaces/terminal/components/SearchPanel.js +265 -0
  397. package/src/interfaces/terminal/components/SettingsPanel.js +415 -0
  398. package/src/interfaces/terminal/components/StatusBar.js +65 -0
  399. package/src/interfaces/terminal/components/TextInput.js +127 -0
  400. package/src/interfaces/terminal/config/agentEditorConstants.js +227 -0
  401. package/src/interfaces/terminal/config/constants.js +393 -0
  402. package/src/interfaces/terminal/index.js +168 -0
  403. package/src/interfaces/terminal/state/useAgentControl.js +496 -0
  404. package/src/interfaces/terminal/state/useAgents.js +537 -0
  405. package/src/interfaces/terminal/state/useConnection.js +444 -0
  406. package/src/interfaces/terminal/state/useMessages.js +630 -0
  407. package/src/interfaces/terminal/state/useTools.js +554 -0
  408. package/src/interfaces/terminal/utils/debugLogger.js +44 -0
  409. package/src/interfaces/terminal/utils/settingsStorage.js +232 -0
  410. package/src/interfaces/terminal/utils/theme.js +85 -0
  411. package/src/interfaces/webServer.js +5457 -0
  412. package/src/modules/fileExplorer/controller.js +413 -0
  413. package/src/modules/fileExplorer/index.js +37 -0
  414. package/src/modules/fileExplorer/middleware.js +92 -0
  415. package/src/modules/fileExplorer/routes.js +158 -0
  416. package/src/modules/fileExplorer/types.js +44 -0
  417. package/src/services/agentActivityService.js +399 -0
  418. package/src/services/aiService.js +2618 -0
  419. package/src/services/apiKeyManager.js +334 -0
  420. package/src/services/benchmarkService.js +196 -0
  421. package/src/services/budgetService.js +565 -0
  422. package/src/services/contextInjectionService.js +268 -0
  423. package/src/services/conversationCompactionService.js +1103 -0
  424. package/src/services/credentialVault.js +685 -0
  425. package/src/services/errorHandler.js +810 -0
  426. package/src/services/fileAttachmentService.js +547 -0
  427. package/src/services/flowContextService.js +189 -0
  428. package/src/services/memoryService.js +521 -0
  429. package/src/services/modelRouterService.js +365 -0
  430. package/src/services/modelsService.js +323 -0
  431. package/src/services/ollamaService.js +452 -0
  432. package/src/services/portRegistry.js +336 -0
  433. package/src/services/portTracker.js +223 -0
  434. package/src/services/projectDetector.js +404 -0
  435. package/src/services/promptService.js +372 -0
  436. package/src/services/qualityInspector.js +796 -0
  437. package/src/services/scheduleService.js +725 -0
  438. package/src/services/serviceRegistry.js +386 -0
  439. package/src/services/skillsService.js +486 -0
  440. package/src/services/telegramService.js +920 -0
  441. package/src/services/tokenCountingService.js +316 -0
  442. package/src/services/visualEditorBridge.js +1033 -0
  443. package/src/services/visualEditorServer.js +1727 -0
  444. package/src/services/whatsappService.js +663 -0
  445. package/src/tools/__tests__/webTool.e2e.test.js +569 -0
  446. package/src/tools/__tests__/webTool.unit.test.js +195 -0
  447. package/src/tools/agentCommunicationTool.js +1343 -0
  448. package/src/tools/agentDelayTool.js +498 -0
  449. package/src/tools/asyncToolManager.js +604 -0
  450. package/src/tools/baseTool.js +887 -0
  451. package/src/tools/browserTool.js +897 -0
  452. package/src/tools/cloneDetectionTool.js +581 -0
  453. package/src/tools/codeMapTool.js +857 -0
  454. package/src/tools/dependencyResolverTool.js +1212 -0
  455. package/src/tools/docxTool.js +623 -0
  456. package/src/tools/excelTool.js +636 -0
  457. package/src/tools/fileContentReplaceTool.js +840 -0
  458. package/src/tools/fileTreeTool.js +833 -0
  459. package/src/tools/filesystemTool.js +1217 -0
  460. package/src/tools/helpTool.js +198 -0
  461. package/src/tools/imageTool.js +1034 -0
  462. package/src/tools/importAnalyzerTool.js +1056 -0
  463. package/src/tools/jobDoneTool.js +388 -0
  464. package/src/tools/memoryTool.js +554 -0
  465. package/src/tools/pdfTool.js +627 -0
  466. package/src/tools/seekTool.js +883 -0
  467. package/src/tools/skillsTool.js +276 -0
  468. package/src/tools/staticAnalysisTool.js +2146 -0
  469. package/src/tools/taskManagerTool.js +2836 -0
  470. package/src/tools/terminalTool.js +2486 -0
  471. package/src/tools/userPromptTool.js +474 -0
  472. package/src/tools/videoTool.js +1139 -0
  473. package/src/tools/visionTool.js +507 -0
  474. package/src/tools/visualEditorTool.js +1175 -0
  475. package/src/tools/webTool.js +3114 -0
  476. package/src/tools/whatsappTool.js +457 -0
  477. package/src/types/agent.js +519 -0
  478. package/src/types/contextReference.js +972 -0
  479. package/src/types/conversation.js +730 -0
  480. package/src/types/toolCommand.js +747 -0
  481. package/src/utilities/attachmentValidator.js +288 -0
  482. package/src/utilities/browserStealth.js +630 -0
  483. package/src/utilities/configManager.js +618 -0
  484. package/src/utilities/constants.js +870 -0
  485. package/src/utilities/directoryAccessManager.js +566 -0
  486. package/src/utilities/fileProcessor.js +307 -0
  487. package/src/utilities/humanBehavior.js +453 -0
  488. package/src/utilities/jsonRepair.js +242 -0
  489. package/src/utilities/logger.js +436 -0
  490. package/src/utilities/platformUtils.js +255 -0
  491. package/src/utilities/platformUtils.test.js +98 -0
  492. package/src/utilities/stealthConstants.js +377 -0
  493. package/src/utilities/structuredFileValidator.js +699 -0
  494. package/src/utilities/tagParser.js +878 -0
  495. package/src/utilities/toolConstants.js +415 -0
  496. package/src/utilities/userDataDir.js +300 -0
  497. package/web-ui/build/brands/autopilot/favicon.svg +1 -0
  498. package/web-ui/build/brands/autopilot/logo.webp +0 -0
  499. package/web-ui/build/brands/onbuzz/favicon.svg +1 -0
  500. package/web-ui/build/brands/onbuzz/logo-text.webp +0 -0
  501. package/web-ui/build/brands/onbuzz/logo.webp +0 -0
  502. package/web-ui/build/index.html +15 -0
  503. package/web-ui/build/logo.png +0 -0
  504. package/web-ui/build/logo2.png +0 -0
  505. package/web-ui/build/static/index-SmQFfvBs.js +746 -0
  506. package/web-ui/build/static/index-V2ySwjHp.css +1 -0
@@ -0,0 +1,189 @@
1
+ /**
2
+ * FlowContextService - Builds flow-aware context for agents in flow execution
3
+ *
4
+ * Purpose:
5
+ * - Inject flow execution instructions into agent system prompts
6
+ * - Pass previous agent data (summary, files created, output) to next agent
7
+ * - Guide agents on comprehensive job-done completion
8
+ */
9
+
10
+ class FlowContextService {
11
+ constructor(config = {}, logger = null) {
12
+ this.config = config;
13
+ this.logger = logger;
14
+ }
15
+
16
+ /**
17
+ * Build flow execution context to inject into agent's system prompt
18
+ * @param {Object} flowMetadata - Current flow execution metadata
19
+ * @param {Object} previousAgentData - Data from previous agent (if any)
20
+ * @returns {string} Context string to inject into system prompt
21
+ */
22
+ buildFlowAgentContext(flowMetadata, previousAgentData) {
23
+ const sections = [];
24
+
25
+ // Flow execution header
26
+ sections.push(`
27
+ <FLOW_EXECUTION_CONTEXT>
28
+ You are executing step "${flowMetadata.nodeName || 'Agent'}" (${flowMetadata.nodePosition}/${flowMetadata.totalNodes}) in flow "${flowMetadata.flowName}".`);
29
+
30
+ // Critical instruction about context isolation
31
+ sections.push(`
32
+ CRITICAL HANDOFF REQUIREMENT:
33
+ The NEXT agent in this flow has NO ACCESS to your conversation history or any context you've built up.
34
+ Everything you learn, create, or discover must be explicitly passed via job-done.`);
35
+
36
+ // Job-done instructions
37
+ sections.push(`
38
+ When you complete your task, you MUST call the job-done tool with comprehensive details:
39
+ - summary: A complete summary of what you accomplished (not just "task complete")
40
+ - details: ALL information the next agent needs to continue, including:
41
+ • Full results, findings, or output content
42
+ • File paths of ANY files created or modified (list each explicitly)
43
+ • Important decisions made and their rationale
44
+ • Any warnings, caveats, or considerations for the next step
45
+ • Context that would be lost without explicit documentation`);
46
+
47
+ // Previous agent context (if exists)
48
+ if (previousAgentData) {
49
+ sections.push(`
50
+ CONTEXT FROM PREVIOUS AGENT:
51
+ ${previousAgentData.agentName ? `- Previous agent: ${previousAgentData.agentName} (${previousAgentData.agentId})` : `- Previous agent ID: ${previousAgentData.agentId}`}
52
+ ${previousAgentData.summary ? `- Their summary: ${previousAgentData.summary}` : ''}
53
+ ${previousAgentData.filesCreated?.length > 0 ? `- Files they created/modified:\n${previousAgentData.filesCreated.map(f => ` • ${f}`).join('\n')}` : '- No files created by previous agent'}
54
+ ${previousAgentData.output ? `
55
+ - Their output:
56
+ ${this._formatPreviousOutput(previousAgentData.output)}` : ''}`);
57
+ } else {
58
+ sections.push(`
59
+ This is the FIRST agent in the flow - you are receiving the initial user input.`);
60
+ }
61
+
62
+ // Closing instructions
63
+ sections.push(`
64
+ FLOW EXECUTION RULES:
65
+ 1. Focus on your specific task in this pipeline step
66
+ 2. Be thorough in your job-done summary - err on the side of more detail
67
+ 3. List ALL file operations explicitly (create, modify, delete)
68
+ 4. Stay in agent mode after job-done in case there are follow-up questions
69
+ 5. Do not assume the next agent knows anything about what you did
70
+
71
+ </FLOW_EXECUTION_CONTEXT>`);
72
+
73
+ return sections.join('');
74
+ }
75
+
76
+ /**
77
+ * Format previous agent's output for display (truncate if very long)
78
+ * @param {string|Object} output - Previous output
79
+ * @returns {string} Formatted output
80
+ */
81
+ _formatPreviousOutput(output) {
82
+ if (!output) return '';
83
+
84
+ const outputStr = typeof output === 'object'
85
+ ? JSON.stringify(output, null, 2)
86
+ : String(output);
87
+
88
+ // Truncate very long outputs but indicate there's more
89
+ const maxLength = 2000;
90
+ if (outputStr.length > maxLength) {
91
+ return outputStr.substring(0, maxLength) + '\n... (truncated - full output was provided to you)';
92
+ }
93
+
94
+ return outputStr;
95
+ }
96
+
97
+ /**
98
+ * Build minimal context for logging/debugging
99
+ * @param {Object} flowMetadata - Flow metadata
100
+ * @returns {Object} Simplified context object
101
+ */
102
+ buildContextSummary(flowMetadata, previousAgentData) {
103
+ return {
104
+ flowId: flowMetadata.flowId,
105
+ flowName: flowMetadata.flowName,
106
+ currentNode: flowMetadata.nodeName,
107
+ position: `${flowMetadata.nodePosition}/${flowMetadata.totalNodes}`,
108
+ hasPreviousAgent: !!previousAgentData,
109
+ previousAgentId: previousAgentData?.agentId || null,
110
+ previousFilesCount: previousAgentData?.filesCreated?.length || 0
111
+ };
112
+ }
113
+
114
+ /**
115
+ * Validate that job-done result has sufficient detail for flow handoff
116
+ * @param {Object} jobDoneResult - The job-done tool result
117
+ * @returns {Object} Validation result with warnings if insufficient
118
+ */
119
+ validateJobDoneForFlow(jobDoneResult) {
120
+ const warnings = [];
121
+
122
+ if (!jobDoneResult.summary || jobDoneResult.summary.length < 20) {
123
+ warnings.push('Summary is too brief - next agent may lack necessary context');
124
+ }
125
+
126
+ if (!jobDoneResult.details && !jobDoneResult.summary) {
127
+ warnings.push('No details provided - next agent will have minimal context');
128
+ }
129
+
130
+ // Check for file mentions without explicit paths
131
+ const summaryText = (jobDoneResult.summary || '') + (jobDoneResult.details || '');
132
+ const fileKeywords = ['created', 'wrote', 'saved', 'file', 'generated'];
133
+ const hasFileMention = fileKeywords.some(kw => summaryText.toLowerCase().includes(kw));
134
+ const hasExplicitPath = /[\/\\][\w-]+\.\w+/.test(summaryText);
135
+
136
+ if (hasFileMention && !hasExplicitPath && (!jobDoneResult.filesCreated || jobDoneResult.filesCreated.length === 0)) {
137
+ warnings.push('Files mentioned but no explicit paths provided - consider listing created files');
138
+ }
139
+
140
+ return {
141
+ valid: warnings.length === 0,
142
+ warnings,
143
+ suggestions: warnings.length > 0
144
+ ? 'Ensure your job-done includes: detailed summary, explicit file paths, and any context the next agent needs.'
145
+ : null
146
+ };
147
+ }
148
+
149
+ /**
150
+ * Extract file paths from agent messages during flow execution
151
+ * Used to auto-track files created for the next agent
152
+ * @param {Array} messages - Agent conversation messages
153
+ * @returns {Array<string>} Detected file paths
154
+ */
155
+ extractFilePaths(messages) {
156
+ const filePaths = new Set();
157
+
158
+ // Patterns for detecting file operations
159
+ const patterns = [
160
+ // Common path patterns
161
+ /(?:created|wrote|saved|generated|modified)\s+(?:file\s+)?["']?([\/\\][\w\-\.\/\\]+\.\w+)["']?/gi,
162
+ // Direct path mentions
163
+ /(?:at|to|in)\s+["']?([\/\\][\w\-\.\/\\]+\.\w+)["']?/gi,
164
+ // Tool result file paths (from file tools)
165
+ /File\s+(?:created|written|saved):\s*([\/\\][\w\-\.\/\\]+\.\w+)/gi
166
+ ];
167
+
168
+ for (const message of messages) {
169
+ const content = typeof message.content === 'string'
170
+ ? message.content
171
+ : JSON.stringify(message.content || '');
172
+
173
+ for (const pattern of patterns) {
174
+ let match;
175
+ while ((match = pattern.exec(content)) !== null) {
176
+ const path = match[1];
177
+ // Filter out obvious non-file paths
178
+ if (path && !path.includes('http') && path.length > 3) {
179
+ filePaths.add(path);
180
+ }
181
+ }
182
+ }
183
+ }
184
+
185
+ return Array.from(filePaths);
186
+ }
187
+ }
188
+
189
+ export default FlowContextService;
@@ -0,0 +1,521 @@
1
+ /**
2
+ * Memory Service
3
+ *
4
+ * Purpose:
5
+ * - Provide persistent memory storage for agents
6
+ * - Support CRUD operations on memories (add, update, delete, list, read)
7
+ * - Store memories per-agent in dedicated files
8
+ * - Support expiration conditions (date-based or condition-based)
9
+ *
10
+ * Storage: userDataDir/state/agents/agent-{id}-memory.json
11
+ */
12
+
13
+ import { promises as fs } from 'fs';
14
+ import path from 'path';
15
+ import { getUserDataPaths, ensureUserDataDirs } from '../utilities/userDataDir.js';
16
+
17
+ // Memory data version for future migrations
18
+ const MEMORY_VERSION = '1.0.0';
19
+
20
+ class MemoryService {
21
+ constructor(logger = null) {
22
+ this.logger = logger;
23
+
24
+ // In-memory cache: agentId -> memories array
25
+ this.memoriesCache = new Map();
26
+
27
+ // Paths
28
+ this.agentsDir = null;
29
+ this.initialized = false;
30
+ }
31
+
32
+ /**
33
+ * Initialize the memory service
34
+ * @returns {Promise<void>}
35
+ */
36
+ async initialize() {
37
+ if (this.initialized) return;
38
+
39
+ try {
40
+ await ensureUserDataDirs();
41
+ const paths = getUserDataPaths();
42
+ this.agentsDir = paths.agents;
43
+
44
+ this.initialized = true;
45
+ this.logger?.info('[MemoryService] Initialized', { agentsDir: this.agentsDir });
46
+ } catch (error) {
47
+ this.logger?.warn('[MemoryService] Initialization failed', { error: error.message });
48
+ throw error;
49
+ }
50
+ }
51
+
52
+ /**
53
+ * Get the memory file path for an agent
54
+ * @param {string} agentId
55
+ * @returns {string}
56
+ */
57
+ _getMemoryFilePath(agentId) {
58
+ return path.join(this.agentsDir, `${agentId}-memory.json`);
59
+ }
60
+
61
+ /**
62
+ * Generate a unique memory ID
63
+ * @returns {string}
64
+ */
65
+ _generateMemoryId() {
66
+ const timestamp = Date.now();
67
+ const random = Math.random().toString(36).substring(2, 8);
68
+ return `mem-${timestamp}-${random}`;
69
+ }
70
+
71
+ /**
72
+ * Load memories for an agent from disk
73
+ * @param {string} agentId
74
+ * @returns {Promise<Array>} Array of memories
75
+ */
76
+ async loadMemories(agentId) {
77
+ if (!this.initialized) {
78
+ await this.initialize();
79
+ }
80
+
81
+ // Check cache first
82
+ if (this.memoriesCache.has(agentId)) {
83
+ return this.memoriesCache.get(agentId);
84
+ }
85
+
86
+ const filePath = this._getMemoryFilePath(agentId);
87
+
88
+ try {
89
+ const data = await fs.readFile(filePath, 'utf8');
90
+ const parsed = JSON.parse(data);
91
+
92
+ // Filter out expired memories
93
+ const memories = this._filterExpiredMemories(parsed.memories || []);
94
+
95
+ // Update cache
96
+ this.memoriesCache.set(agentId, memories);
97
+
98
+ this.logger?.debug('[MemoryService] Loaded memories', {
99
+ agentId,
100
+ count: memories.length
101
+ });
102
+
103
+ return memories;
104
+ } catch (error) {
105
+ if (error.code === 'ENOENT') {
106
+ // No memory file yet, return empty array
107
+ this.memoriesCache.set(agentId, []);
108
+ return [];
109
+ }
110
+ this.logger?.warn('[MemoryService] Failed to load memories', {
111
+ agentId,
112
+ error: error.message
113
+ });
114
+ return [];
115
+ }
116
+ }
117
+
118
+ /**
119
+ * Save memories for an agent to disk
120
+ * @param {string} agentId
121
+ * @param {Array} memories
122
+ * @returns {Promise<void>}
123
+ */
124
+ async saveMemories(agentId, memories) {
125
+ if (!this.initialized) {
126
+ await this.initialize();
127
+ }
128
+
129
+ const filePath = this._getMemoryFilePath(agentId);
130
+
131
+ const data = {
132
+ version: MEMORY_VERSION,
133
+ agentId,
134
+ memories,
135
+ lastPersisted: new Date().toISOString()
136
+ };
137
+
138
+ try {
139
+ await fs.writeFile(filePath, JSON.stringify(data, null, 2), 'utf8');
140
+
141
+ // Update cache
142
+ this.memoriesCache.set(agentId, memories);
143
+
144
+ this.logger?.debug('[MemoryService] Saved memories', {
145
+ agentId,
146
+ count: memories.length
147
+ });
148
+ } catch (error) {
149
+ this.logger?.error('[MemoryService] Failed to save memories', {
150
+ agentId,
151
+ error: error.message
152
+ });
153
+ throw error;
154
+ }
155
+ }
156
+
157
+ /**
158
+ * Filter out expired memories
159
+ * @param {Array} memories
160
+ * @returns {Array}
161
+ */
162
+ _filterExpiredMemories(memories) {
163
+ const now = new Date();
164
+
165
+ return memories.filter(memory => {
166
+ if (!memory.expiration) return true;
167
+
168
+ if (memory.expiration.type === 'date') {
169
+ const expiryDate = new Date(memory.expiration.value);
170
+ return expiryDate > now;
171
+ }
172
+
173
+ // Condition-based expiration must be manually removed
174
+ // type === 'condition' or type === 'never'
175
+ return true;
176
+ });
177
+ }
178
+
179
+ /**
180
+ * Add a new memory
181
+ * @param {string} agentId
182
+ * @param {Object} memoryData - { title, description, content, expiration }
183
+ * @returns {Promise<Object>} Created memory
184
+ */
185
+ async addMemory(agentId, memoryData) {
186
+ const memories = await this.loadMemories(agentId);
187
+
188
+ const memory = {
189
+ id: this._generateMemoryId(),
190
+ title: memoryData.title,
191
+ description: memoryData.description || '',
192
+ content: memoryData.content,
193
+ createdAt: new Date().toISOString(),
194
+ updatedAt: new Date().toISOString(),
195
+ expiration: this._parseExpiration(memoryData.expiration),
196
+ accessCount: 0,
197
+ lastAccessed: null
198
+ };
199
+
200
+ memories.push(memory);
201
+ await this.saveMemories(agentId, memories);
202
+
203
+ this.logger?.info('[MemoryService] Memory added', {
204
+ agentId,
205
+ memoryId: memory.id,
206
+ title: memory.title
207
+ });
208
+
209
+ return memory;
210
+ }
211
+
212
+ /**
213
+ * Parse expiration input into standard format
214
+ * @param {string|Object} expiration
215
+ * @returns {Object|null}
216
+ */
217
+ _parseExpiration(expiration) {
218
+ if (!expiration) {
219
+ return { type: 'never', value: null };
220
+ }
221
+
222
+ if (typeof expiration === 'string') {
223
+ // Try parsing as date
224
+ const date = new Date(expiration);
225
+ if (!isNaN(date.getTime())) {
226
+ return { type: 'date', value: date.toISOString() };
227
+ }
228
+ // Treat as condition
229
+ return { type: 'condition', value: expiration };
230
+ }
231
+
232
+ if (typeof expiration === 'object') {
233
+ return {
234
+ type: expiration.type || 'condition',
235
+ value: expiration.value || expiration.date || expiration.condition
236
+ };
237
+ }
238
+
239
+ return { type: 'never', value: null };
240
+ }
241
+
242
+ /**
243
+ * Update an existing memory
244
+ * @param {string} agentId
245
+ * @param {string} memoryId
246
+ * @param {Object} updates - { title?, description?, content?, expiration? }
247
+ * @returns {Promise<Object|null>} Updated memory or null if not found
248
+ */
249
+ async updateMemory(agentId, memoryId, updates) {
250
+ const memories = await this.loadMemories(agentId);
251
+
252
+ const index = memories.findIndex(m => m.id === memoryId);
253
+ if (index === -1) {
254
+ this.logger?.warn('[MemoryService] Memory not found for update', {
255
+ agentId,
256
+ memoryId
257
+ });
258
+ return null;
259
+ }
260
+
261
+ const memory = memories[index];
262
+
263
+ if (updates.title !== undefined) memory.title = updates.title;
264
+ if (updates.description !== undefined) memory.description = updates.description;
265
+ if (updates.content !== undefined) memory.content = updates.content;
266
+ if (updates.expiration !== undefined) {
267
+ memory.expiration = this._parseExpiration(updates.expiration);
268
+ }
269
+
270
+ memory.updatedAt = new Date().toISOString();
271
+
272
+ memories[index] = memory;
273
+ await this.saveMemories(agentId, memories);
274
+
275
+ this.logger?.info('[MemoryService] Memory updated', {
276
+ agentId,
277
+ memoryId,
278
+ title: memory.title
279
+ });
280
+
281
+ return memory;
282
+ }
283
+
284
+ /**
285
+ * Delete a memory
286
+ * @param {string} agentId
287
+ * @param {string} memoryId
288
+ * @returns {Promise<boolean>} True if deleted, false if not found
289
+ */
290
+ async deleteMemory(agentId, memoryId) {
291
+ const memories = await this.loadMemories(agentId);
292
+
293
+ const index = memories.findIndex(m => m.id === memoryId);
294
+ if (index === -1) {
295
+ this.logger?.warn('[MemoryService] Memory not found for deletion', {
296
+ agentId,
297
+ memoryId
298
+ });
299
+ return false;
300
+ }
301
+
302
+ const deleted = memories.splice(index, 1)[0];
303
+ await this.saveMemories(agentId, memories);
304
+
305
+ this.logger?.info('[MemoryService] Memory deleted', {
306
+ agentId,
307
+ memoryId,
308
+ title: deleted.title
309
+ });
310
+
311
+ return true;
312
+ }
313
+
314
+ /**
315
+ * List memories with configurable detail level
316
+ * @param {string} agentId
317
+ * @param {string} level - 'titles' | 'descriptions' | 'full'
318
+ * @returns {Promise<Object>} Memories grouped by date
319
+ */
320
+ async listMemories(agentId, level = 'titles') {
321
+ const memories = await this.loadMemories(agentId);
322
+
323
+ // Sort by createdAt descending (newest first)
324
+ const sorted = [...memories].sort((a, b) =>
325
+ new Date(b.createdAt) - new Date(a.createdAt)
326
+ );
327
+
328
+ // Group by date
329
+ const grouped = {};
330
+ for (const memory of sorted) {
331
+ const date = memory.createdAt.split('T')[0]; // YYYY-MM-DD
332
+ if (!grouped[date]) {
333
+ grouped[date] = [];
334
+ }
335
+
336
+ // Apply detail level
337
+ let item;
338
+ switch (level) {
339
+ case 'titles':
340
+ item = { id: memory.id, title: memory.title };
341
+ break;
342
+ case 'descriptions':
343
+ item = {
344
+ id: memory.id,
345
+ title: memory.title,
346
+ description: memory.description
347
+ };
348
+ break;
349
+ case 'full':
350
+ item = {
351
+ id: memory.id,
352
+ title: memory.title,
353
+ description: memory.description,
354
+ expiration: memory.expiration,
355
+ createdAt: memory.createdAt,
356
+ updatedAt: memory.updatedAt
357
+ };
358
+ break;
359
+ default:
360
+ item = { id: memory.id, title: memory.title };
361
+ }
362
+
363
+ grouped[date].push(item);
364
+ }
365
+
366
+ return {
367
+ count: memories.length,
368
+ grouped
369
+ };
370
+ }
371
+
372
+ /**
373
+ * Read a memory's full content (marks as accessed)
374
+ * @param {string} agentId
375
+ * @param {string} memoryId
376
+ * @returns {Promise<Object|null>} Full memory or null if not found
377
+ */
378
+ async readMemory(agentId, memoryId) {
379
+ const memories = await this.loadMemories(agentId);
380
+
381
+ const index = memories.findIndex(m => m.id === memoryId);
382
+ if (index === -1) {
383
+ this.logger?.warn('[MemoryService] Memory not found for read', {
384
+ agentId,
385
+ memoryId
386
+ });
387
+ return null;
388
+ }
389
+
390
+ const memory = memories[index];
391
+
392
+ // Update access tracking
393
+ memory.accessCount = (memory.accessCount || 0) + 1;
394
+ memory.lastAccessed = new Date().toISOString();
395
+
396
+ memories[index] = memory;
397
+ await this.saveMemories(agentId, memories);
398
+
399
+ this.logger?.debug('[MemoryService] Memory read', {
400
+ agentId,
401
+ memoryId,
402
+ accessCount: memory.accessCount
403
+ });
404
+
405
+ return memory;
406
+ }
407
+
408
+ /**
409
+ * Search memories by title or description
410
+ * @param {string} agentId
411
+ * @param {string} query
412
+ * @returns {Promise<Array>} Matching memories (id, title, description)
413
+ */
414
+ async searchMemories(agentId, query) {
415
+ const memories = await this.loadMemories(agentId);
416
+
417
+ const lowerQuery = query.toLowerCase();
418
+
419
+ return memories
420
+ .filter(m =>
421
+ m.title.toLowerCase().includes(lowerQuery) ||
422
+ m.description.toLowerCase().includes(lowerQuery)
423
+ )
424
+ .map(m => ({
425
+ id: m.id,
426
+ title: m.title,
427
+ description: m.description
428
+ }));
429
+ }
430
+
431
+ /**
432
+ * Clear all memories for an agent
433
+ * @param {string} agentId
434
+ * @returns {Promise<number>} Number of memories cleared
435
+ */
436
+ async clearMemories(agentId) {
437
+ const memories = await this.loadMemories(agentId);
438
+ const count = memories.length;
439
+
440
+ await this.saveMemories(agentId, []);
441
+
442
+ this.logger?.info('[MemoryService] Cleared all memories', {
443
+ agentId,
444
+ count
445
+ });
446
+
447
+ return count;
448
+ }
449
+
450
+ /**
451
+ * Delete memory file for an agent (used when agent is deleted)
452
+ * @param {string} agentId
453
+ * @returns {Promise<boolean>}
454
+ */
455
+ async deleteMemoryFile(agentId) {
456
+ const filePath = this._getMemoryFilePath(agentId);
457
+
458
+ try {
459
+ await fs.unlink(filePath);
460
+ this.memoriesCache.delete(agentId);
461
+ this.logger?.info('[MemoryService] Memory file deleted', { agentId });
462
+ return true;
463
+ } catch (error) {
464
+ if (error.code === 'ENOENT') {
465
+ return true; // Already deleted
466
+ }
467
+ this.logger?.warn('[MemoryService] Failed to delete memory file', {
468
+ agentId,
469
+ error: error.message
470
+ });
471
+ return false;
472
+ }
473
+ }
474
+
475
+ /**
476
+ * Get memory statistics for an agent
477
+ * @param {string} agentId
478
+ * @returns {Promise<Object>}
479
+ */
480
+ async getMemoryStats(agentId) {
481
+ const memories = await this.loadMemories(agentId);
482
+
483
+ const now = new Date();
484
+ let expiringCount = 0;
485
+ let totalAccessCount = 0;
486
+
487
+ for (const memory of memories) {
488
+ totalAccessCount += memory.accessCount || 0;
489
+
490
+ if (memory.expiration?.type === 'date') {
491
+ const expiryDate = new Date(memory.expiration.value);
492
+ const daysUntilExpiry = (expiryDate - now) / (1000 * 60 * 60 * 24);
493
+ if (daysUntilExpiry <= 7) {
494
+ expiringCount++;
495
+ }
496
+ }
497
+ }
498
+
499
+ return {
500
+ totalMemories: memories.length,
501
+ totalAccessCount,
502
+ expiringWithin7Days: expiringCount,
503
+ averageAccessCount: memories.length > 0
504
+ ? (totalAccessCount / memories.length).toFixed(2)
505
+ : 0
506
+ };
507
+ }
508
+ }
509
+
510
+ // Export singleton instance
511
+ let instance = null;
512
+
513
+ export function getMemoryService(logger = null) {
514
+ if (!instance) {
515
+ instance = new MemoryService(logger);
516
+ }
517
+ return instance;
518
+ }
519
+
520
+ export { MemoryService };
521
+ export default MemoryService;