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,699 @@
1
+ /**
2
+ * Structured File Validator
3
+ *
4
+ * A plug-and-play validation utility for structured file formats.
5
+ * Supports JSON, YAML, XML, TOML, and can be extended with custom validators.
6
+ *
7
+ * Usage:
8
+ * import { validateStructuredFile, validateContent } from './structuredFileValidator.js';
9
+ *
10
+ * // Validate by file path
11
+ * const result = await validateStructuredFile('/path/to/config.json');
12
+ *
13
+ * // Validate content directly
14
+ * const result = validateContent('{"key": "value"}', 'json');
15
+ */
16
+
17
+ import { promises as fs } from 'fs';
18
+ import path from 'path';
19
+
20
+ // ============================================================================
21
+ // VALIDATION RESULT TYPES
22
+ // ============================================================================
23
+
24
+ /**
25
+ * @typedef {Object} ValidationError
26
+ * @property {number} [line] - Line number (1-indexed)
27
+ * @property {number} [column] - Column number (1-indexed)
28
+ * @property {string} message - Error message
29
+ * @property {string} [severity] - 'error' | 'warning'
30
+ */
31
+
32
+ /**
33
+ * @typedef {Object} ValidationResult
34
+ * @property {boolean} valid - Whether the content is valid
35
+ * @property {string} format - Detected/specified format (json, yaml, xml, etc.)
36
+ * @property {ValidationError[]} errors - Array of validation errors
37
+ * @property {Object} [parsed] - Parsed content (if valid and parsing requested)
38
+ * @property {Object} [meta] - Additional metadata
39
+ */
40
+
41
+ // ============================================================================
42
+ // FORMAT DETECTION
43
+ // ============================================================================
44
+
45
+ /**
46
+ * Map of file extensions to format names
47
+ */
48
+ const EXTENSION_FORMAT_MAP = {
49
+ '.json': 'json',
50
+ '.jsonc': 'jsonc', // JSON with comments
51
+ '.json5': 'json5',
52
+ '.yaml': 'yaml',
53
+ '.yml': 'yaml',
54
+ '.xml': 'xml',
55
+ '.toml': 'toml',
56
+ '.ini': 'ini',
57
+ '.properties': 'properties',
58
+ };
59
+
60
+ // Files that match by exact name (no extension or dotfiles)
61
+ const FILENAME_FORMAT_MAP = {
62
+ '.env': 'env',
63
+ '.env.local': 'env',
64
+ '.env.development': 'env',
65
+ '.env.production': 'env',
66
+ '.env.test': 'env',
67
+ '.env.example': 'env',
68
+ };
69
+
70
+ /**
71
+ * Detect format from file path
72
+ * @param {string} filePath - Path to file
73
+ * @returns {string|null} Format name or null if unknown
74
+ */
75
+ export function detectFormat(filePath) {
76
+ // First check by extension
77
+ const ext = path.extname(filePath).toLowerCase();
78
+ if (EXTENSION_FORMAT_MAP[ext]) {
79
+ return EXTENSION_FORMAT_MAP[ext];
80
+ }
81
+
82
+ // Then check by filename (for dotfiles like .env)
83
+ const filename = path.basename(filePath).toLowerCase();
84
+ if (FILENAME_FORMAT_MAP[filename]) {
85
+ return FILENAME_FORMAT_MAP[filename];
86
+ }
87
+
88
+ // Check if filename starts with .env (handles .env.local, .env.anything)
89
+ if (filename.startsWith('.env')) {
90
+ return 'env';
91
+ }
92
+
93
+ return null;
94
+ }
95
+
96
+ /**
97
+ * Get supported formats
98
+ * @returns {string[]} Array of supported format names
99
+ */
100
+ export function getSupportedFormats() {
101
+ return [...new Set(Object.values(EXTENSION_FORMAT_MAP))];
102
+ }
103
+
104
+ // ============================================================================
105
+ // VALIDATORS
106
+ // ============================================================================
107
+
108
+ /**
109
+ * Validator registry - maps format names to validator functions
110
+ * Each validator returns ValidationResult
111
+ */
112
+ const validators = new Map();
113
+
114
+ /**
115
+ * Register a custom validator
116
+ * @param {string} format - Format name
117
+ * @param {Function} validatorFn - Validator function (content, options) => ValidationResult
118
+ */
119
+ export function registerValidator(format, validatorFn) {
120
+ validators.set(format.toLowerCase(), validatorFn);
121
+ }
122
+
123
+ /**
124
+ * Check if a format has a registered validator
125
+ * @param {string} format - Format name
126
+ * @returns {boolean}
127
+ */
128
+ export function hasValidator(format) {
129
+ return validators.has(format.toLowerCase());
130
+ }
131
+
132
+ // ============================================================================
133
+ // BUILT-IN VALIDATORS
134
+ // ============================================================================
135
+
136
+ /**
137
+ * JSON Validator
138
+ * Validates JSON syntax and provides detailed error location
139
+ */
140
+ function validateJson(content, options = {}) {
141
+ const result = {
142
+ valid: true,
143
+ format: 'json',
144
+ errors: [],
145
+ meta: { contentLength: content.length }
146
+ };
147
+
148
+ try {
149
+ const parsed = JSON.parse(content);
150
+ if (options.returnParsed) {
151
+ result.parsed = parsed;
152
+ }
153
+ } catch (error) {
154
+ result.valid = false;
155
+
156
+ // Parse error message to extract location
157
+ const errorInfo = parseJsonError(error.message, content);
158
+ result.errors.push({
159
+ line: errorInfo.line,
160
+ column: errorInfo.column,
161
+ message: errorInfo.message,
162
+ severity: 'error'
163
+ });
164
+ }
165
+
166
+ return result;
167
+ }
168
+
169
+ /**
170
+ * Parse JSON error message to extract line/column
171
+ */
172
+ function parseJsonError(errorMessage, content) {
173
+ // JSON.parse errors typically look like:
174
+ // "Unexpected token X in JSON at position N"
175
+ // "Expected property name or '}' at line X column Y"
176
+
177
+ const positionMatch = errorMessage.match(/at position (\d+)/);
178
+ const lineColMatch = errorMessage.match(/at line (\d+) column (\d+)/);
179
+
180
+ let line = 1;
181
+ let column = 1;
182
+
183
+ if (lineColMatch) {
184
+ line = parseInt(lineColMatch[1], 10);
185
+ column = parseInt(lineColMatch[2], 10);
186
+ } else if (positionMatch) {
187
+ const position = parseInt(positionMatch[1], 10);
188
+ // Convert position to line/column
189
+ const upToPosition = content.substring(0, position);
190
+ const lines = upToPosition.split('\n');
191
+ line = lines.length;
192
+ column = lines[lines.length - 1].length + 1;
193
+ }
194
+
195
+ return {
196
+ line,
197
+ column,
198
+ message: errorMessage
199
+ };
200
+ }
201
+
202
+ /**
203
+ * JSON with Comments (JSONC) Validator
204
+ * Strips comments before validating as JSON
205
+ */
206
+ function validateJsonc(content, options = {}) {
207
+ // Strip single-line comments (//)
208
+ let stripped = content.replace(/\/\/.*$/gm, '');
209
+ // Strip multi-line comments (/* */)
210
+ stripped = stripped.replace(/\/\*[\s\S]*?\*\//g, '');
211
+
212
+ const result = validateJson(stripped, options);
213
+ result.format = 'jsonc';
214
+ return result;
215
+ }
216
+
217
+ /**
218
+ * YAML Validator
219
+ * Uses basic YAML parsing rules (no external dependency)
220
+ */
221
+ function validateYaml(content, options = {}) {
222
+ const result = {
223
+ valid: true,
224
+ format: 'yaml',
225
+ errors: [],
226
+ meta: { contentLength: content.length }
227
+ };
228
+
229
+ const lines = content.split('\n');
230
+ let indentStack = [0];
231
+ let inMultilineString = false;
232
+
233
+ for (let i = 0; i < lines.length; i++) {
234
+ const line = lines[i];
235
+ const lineNum = i + 1;
236
+
237
+ // Skip empty lines and comments
238
+ if (line.trim() === '' || line.trim().startsWith('#')) {
239
+ continue;
240
+ }
241
+
242
+ // Check for tabs (YAML should use spaces)
243
+ if (line.match(/^\t/)) {
244
+ result.errors.push({
245
+ line: lineNum,
246
+ column: 1,
247
+ message: 'YAML should use spaces for indentation, not tabs',
248
+ severity: 'error'
249
+ });
250
+ result.valid = false;
251
+ }
252
+
253
+ // Check for inconsistent indentation
254
+ const indent = line.match(/^(\s*)/)[1].length;
255
+ const trimmed = line.trim();
256
+
257
+ // Basic key-value syntax check
258
+ if (trimmed.includes(':') && !trimmed.startsWith('-')) {
259
+ const colonIndex = trimmed.indexOf(':');
260
+ const key = trimmed.substring(0, colonIndex);
261
+
262
+ // Check for invalid characters in unquoted keys
263
+ if (!key.startsWith('"') && !key.startsWith("'")) {
264
+ if (key.match(/[{}\[\],&*#?|<>=!%@`]/)) {
265
+ result.errors.push({
266
+ line: lineNum,
267
+ column: indent + 1,
268
+ message: `Invalid characters in unquoted key: "${key}"`,
269
+ severity: 'warning'
270
+ });
271
+ }
272
+ }
273
+ }
274
+
275
+ // Check for duplicate keys (basic check within visible scope)
276
+ // This is a simplified check - full YAML parsing would be more accurate
277
+ }
278
+
279
+ if (result.errors.length === 0) {
280
+ result.valid = true;
281
+ } else {
282
+ // Only mark invalid if there are actual errors (not just warnings)
283
+ result.valid = !result.errors.some(e => e.severity === 'error');
284
+ }
285
+
286
+ return result;
287
+ }
288
+
289
+ /**
290
+ * XML Validator
291
+ * Validates basic XML structure
292
+ */
293
+ function validateXml(content, options = {}) {
294
+ const result = {
295
+ valid: true,
296
+ format: 'xml',
297
+ errors: [],
298
+ meta: { contentLength: content.length }
299
+ };
300
+
301
+ const lines = content.split('\n');
302
+ const tagStack = [];
303
+
304
+ // Check for XML declaration
305
+ const hasDeclaration = content.trim().startsWith('<?xml');
306
+ result.meta.hasDeclaration = hasDeclaration;
307
+
308
+ // Simple tag matching regex
309
+ const tagRegex = /<\/?([a-zA-Z_][\w\-.:]*)[^>]*\/?>/g;
310
+ const selfClosingRegex = /\/\s*>$/;
311
+
312
+ let match;
313
+ let position = 0;
314
+
315
+ while ((match = tagRegex.exec(content)) !== null) {
316
+ const fullTag = match[0];
317
+ const tagName = match[1];
318
+ const tagPosition = match.index;
319
+
320
+ // Calculate line number
321
+ const upToTag = content.substring(0, tagPosition);
322
+ const lineNum = upToTag.split('\n').length;
323
+ const lastNewline = upToTag.lastIndexOf('\n');
324
+ const column = tagPosition - lastNewline;
325
+
326
+ // Skip processing instructions and comments
327
+ if (fullTag.startsWith('<?') || fullTag.startsWith('<!')) {
328
+ continue;
329
+ }
330
+
331
+ // Check if self-closing
332
+ if (selfClosingRegex.test(fullTag)) {
333
+ continue;
334
+ }
335
+
336
+ // Check if closing tag
337
+ if (fullTag.startsWith('</')) {
338
+ if (tagStack.length === 0) {
339
+ result.errors.push({
340
+ line: lineNum,
341
+ column,
342
+ message: `Unexpected closing tag </${tagName}> with no matching opening tag`,
343
+ severity: 'error'
344
+ });
345
+ result.valid = false;
346
+ } else {
347
+ const expected = tagStack.pop();
348
+ if (expected !== tagName) {
349
+ result.errors.push({
350
+ line: lineNum,
351
+ column,
352
+ message: `Mismatched closing tag: expected </${expected}>, found </${tagName}>`,
353
+ severity: 'error'
354
+ });
355
+ result.valid = false;
356
+ }
357
+ }
358
+ } else {
359
+ // Opening tag
360
+ tagStack.push(tagName);
361
+ }
362
+ }
363
+
364
+ // Check for unclosed tags
365
+ if (tagStack.length > 0) {
366
+ result.errors.push({
367
+ line: lines.length,
368
+ column: 1,
369
+ message: `Unclosed tags: ${tagStack.join(', ')}`,
370
+ severity: 'error'
371
+ });
372
+ result.valid = false;
373
+ }
374
+
375
+ return result;
376
+ }
377
+
378
+ /**
379
+ * TOML Validator
380
+ * Validates basic TOML structure
381
+ */
382
+ function validateToml(content, options = {}) {
383
+ const result = {
384
+ valid: true,
385
+ format: 'toml',
386
+ errors: [],
387
+ meta: { contentLength: content.length }
388
+ };
389
+
390
+ const lines = content.split('\n');
391
+ const sections = new Set();
392
+ let currentSection = '';
393
+
394
+ for (let i = 0; i < lines.length; i++) {
395
+ const line = lines[i];
396
+ const lineNum = i + 1;
397
+ const trimmed = line.trim();
398
+
399
+ // Skip empty lines and comments
400
+ if (trimmed === '' || trimmed.startsWith('#')) {
401
+ continue;
402
+ }
403
+
404
+ // Section header [section] or [[array]]
405
+ if (trimmed.startsWith('[')) {
406
+ const sectionMatch = trimmed.match(/^\[{1,2}([^\]]+)\]{1,2}$/);
407
+ if (!sectionMatch) {
408
+ result.errors.push({
409
+ line: lineNum,
410
+ column: 1,
411
+ message: `Invalid section header: ${trimmed}`,
412
+ severity: 'error'
413
+ });
414
+ result.valid = false;
415
+ continue;
416
+ }
417
+
418
+ currentSection = sectionMatch[1].trim();
419
+
420
+ // Check for duplicate sections (non-array)
421
+ if (!trimmed.startsWith('[[') && sections.has(currentSection)) {
422
+ result.errors.push({
423
+ line: lineNum,
424
+ column: 1,
425
+ message: `Duplicate section: [${currentSection}]`,
426
+ severity: 'error'
427
+ });
428
+ result.valid = false;
429
+ }
430
+ sections.add(currentSection);
431
+ continue;
432
+ }
433
+
434
+ // Key-value pair
435
+ const kvMatch = trimmed.match(/^([a-zA-Z0-9_\-."]+)\s*=\s*(.+)$/);
436
+ if (!kvMatch) {
437
+ result.errors.push({
438
+ line: lineNum,
439
+ column: 1,
440
+ message: `Invalid key-value pair: ${trimmed}`,
441
+ severity: 'error'
442
+ });
443
+ result.valid = false;
444
+ continue;
445
+ }
446
+
447
+ const [, key, value] = kvMatch;
448
+
449
+ // Basic value validation
450
+ const trimmedValue = value.trim();
451
+
452
+ // Check for unclosed strings
453
+ if ((trimmedValue.startsWith('"') && !trimmedValue.endsWith('"')) ||
454
+ (trimmedValue.startsWith("'") && !trimmedValue.endsWith("'"))) {
455
+ // Could be multi-line, but basic check
456
+ if (!trimmedValue.startsWith('"""') && !trimmedValue.startsWith("'''")) {
457
+ result.errors.push({
458
+ line: lineNum,
459
+ column: line.indexOf(value) + 1,
460
+ message: `Unclosed string value for key "${key}"`,
461
+ severity: 'warning'
462
+ });
463
+ }
464
+ }
465
+ }
466
+
467
+ return result;
468
+ }
469
+
470
+ /**
471
+ * INI Validator
472
+ * Validates basic INI file structure
473
+ */
474
+ function validateIni(content, options = {}) {
475
+ const result = {
476
+ valid: true,
477
+ format: 'ini',
478
+ errors: [],
479
+ meta: { contentLength: content.length }
480
+ };
481
+
482
+ const lines = content.split('\n');
483
+
484
+ for (let i = 0; i < lines.length; i++) {
485
+ const line = lines[i];
486
+ const lineNum = i + 1;
487
+ const trimmed = line.trim();
488
+
489
+ // Skip empty lines and comments
490
+ if (trimmed === '' || trimmed.startsWith(';') || trimmed.startsWith('#')) {
491
+ continue;
492
+ }
493
+
494
+ // Section header
495
+ if (trimmed.startsWith('[')) {
496
+ if (!trimmed.endsWith(']')) {
497
+ result.errors.push({
498
+ line: lineNum,
499
+ column: 1,
500
+ message: `Invalid section header: missing closing bracket`,
501
+ severity: 'error'
502
+ });
503
+ result.valid = false;
504
+ }
505
+ continue;
506
+ }
507
+
508
+ // Key-value pair
509
+ if (!trimmed.includes('=')) {
510
+ result.errors.push({
511
+ line: lineNum,
512
+ column: 1,
513
+ message: `Invalid line: expected key=value format`,
514
+ severity: 'error'
515
+ });
516
+ result.valid = false;
517
+ }
518
+ }
519
+
520
+ return result;
521
+ }
522
+
523
+ /**
524
+ * ENV file Validator
525
+ * Validates .env file format
526
+ */
527
+ function validateEnv(content, options = {}) {
528
+ const result = {
529
+ valid: true,
530
+ format: 'env',
531
+ errors: [],
532
+ meta: { contentLength: content.length, variableCount: 0 }
533
+ };
534
+
535
+ const lines = content.split('\n');
536
+ const variables = new Set();
537
+
538
+ for (let i = 0; i < lines.length; i++) {
539
+ const line = lines[i];
540
+ const lineNum = i + 1;
541
+ const trimmed = line.trim();
542
+
543
+ // Skip empty lines and comments
544
+ if (trimmed === '' || trimmed.startsWith('#')) {
545
+ continue;
546
+ }
547
+
548
+ // Parse variable assignment
549
+ const match = trimmed.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);
550
+ if (!match) {
551
+ result.errors.push({
552
+ line: lineNum,
553
+ column: 1,
554
+ message: `Invalid variable assignment: "${trimmed.substring(0, 30)}..."`,
555
+ severity: 'error'
556
+ });
557
+ result.valid = false;
558
+ continue;
559
+ }
560
+
561
+ const [, varName] = match;
562
+
563
+ // Check for duplicates
564
+ if (variables.has(varName)) {
565
+ result.errors.push({
566
+ line: lineNum,
567
+ column: 1,
568
+ message: `Duplicate variable: ${varName}`,
569
+ severity: 'warning'
570
+ });
571
+ }
572
+ variables.add(varName);
573
+ result.meta.variableCount++;
574
+ }
575
+
576
+ return result;
577
+ }
578
+
579
+ // Register built-in validators
580
+ registerValidator('json', validateJson);
581
+ registerValidator('jsonc', validateJsonc);
582
+ registerValidator('json5', validateJsonc); // Use JSONC validator for JSON5 (basic support)
583
+ registerValidator('yaml', validateYaml);
584
+ registerValidator('yml', validateYaml);
585
+ registerValidator('xml', validateXml);
586
+ registerValidator('toml', validateToml);
587
+ registerValidator('ini', validateIni);
588
+ registerValidator('env', validateEnv);
589
+ registerValidator('properties', validateIni); // Similar to INI
590
+
591
+ // ============================================================================
592
+ // PUBLIC API
593
+ // ============================================================================
594
+
595
+ /**
596
+ * Validate content string
597
+ * @param {string} content - Content to validate
598
+ * @param {string} format - Format name (json, yaml, xml, etc.)
599
+ * @param {Object} [options] - Validation options
600
+ * @param {boolean} [options.returnParsed] - Include parsed content in result
601
+ * @returns {ValidationResult}
602
+ */
603
+ export function validateContent(content, format, options = {}) {
604
+ const formatLower = format.toLowerCase();
605
+
606
+ if (!validators.has(formatLower)) {
607
+ return {
608
+ valid: false,
609
+ format: formatLower,
610
+ errors: [{
611
+ message: `No validator available for format: ${format}`,
612
+ severity: 'error'
613
+ }],
614
+ meta: { unsupportedFormat: true }
615
+ };
616
+ }
617
+
618
+ const validator = validators.get(formatLower);
619
+ return validator(content, options);
620
+ }
621
+
622
+ /**
623
+ * Validate a file by path
624
+ * @param {string} filePath - Path to file
625
+ * @param {Object} [options] - Validation options
626
+ * @param {string} [options.format] - Override format detection
627
+ * @param {boolean} [options.returnParsed] - Include parsed content in result
628
+ * @returns {Promise<ValidationResult>}
629
+ */
630
+ export async function validateStructuredFile(filePath, options = {}) {
631
+ const format = options.format || detectFormat(filePath);
632
+
633
+ if (!format) {
634
+ return {
635
+ valid: false,
636
+ format: 'unknown',
637
+ errors: [{
638
+ message: `Cannot detect format for file: ${filePath}`,
639
+ severity: 'error'
640
+ }],
641
+ meta: { filePath, unknownExtension: path.extname(filePath) }
642
+ };
643
+ }
644
+
645
+ try {
646
+ const content = await fs.readFile(filePath, 'utf8');
647
+ const result = validateContent(content, format, options);
648
+ result.meta = { ...result.meta, filePath };
649
+ return result;
650
+ } catch (error) {
651
+ return {
652
+ valid: false,
653
+ format,
654
+ errors: [{
655
+ message: `Failed to read file: ${error.message}`,
656
+ severity: 'error'
657
+ }],
658
+ meta: { filePath, readError: true }
659
+ };
660
+ }
661
+ }
662
+
663
+ /**
664
+ * Validate content and return a simplified result suitable for tool responses
665
+ * @param {string} content - Content to validate
666
+ * @param {string} filePath - File path (for format detection)
667
+ * @returns {Object} Simplified validation result
668
+ */
669
+ export function validateForToolResponse(content, filePath) {
670
+ const format = detectFormat(filePath);
671
+
672
+ if (!format) {
673
+ return null; // Not a structured file format
674
+ }
675
+
676
+ const result = validateContent(content, format);
677
+
678
+ return {
679
+ valid: result.valid,
680
+ format: result.format,
681
+ errors: result.errors.length > 0 ? result.errors : undefined,
682
+ errorCount: result.errors.filter(e => e.severity === 'error').length,
683
+ warningCount: result.errors.filter(e => e.severity === 'warning').length
684
+ };
685
+ }
686
+
687
+ // ============================================================================
688
+ // EXPORTS
689
+ // ============================================================================
690
+
691
+ export default {
692
+ validateContent,
693
+ validateStructuredFile,
694
+ validateForToolResponse,
695
+ detectFormat,
696
+ getSupportedFormats,
697
+ registerValidator,
698
+ hasValidator
699
+ };