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.
- package/LICENSE +267 -0
- package/README.md +425 -0
- package/bin/cli.js +556 -0
- package/bin/loxia-terminal-v2.js +162 -0
- package/bin/loxia-terminal.js +90 -0
- package/bin/start-with-terminal.js +200 -0
- package/node_modules/@isaacs/balanced-match/LICENSE.md +23 -0
- package/node_modules/@isaacs/balanced-match/README.md +60 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts +9 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.js +59 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts +9 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.js +54 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/balanced-match/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/balanced-match/package.json +79 -0
- package/node_modules/@isaacs/brace-expansion/LICENSE +23 -0
- package/node_modules/@isaacs/brace-expansion/README.md +97 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts +6 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +199 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts +6 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.js +195 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/brace-expansion/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/brace-expansion/package.json +60 -0
- package/node_modules/glob/LICENSE.md +63 -0
- package/node_modules/glob/README.md +1177 -0
- package/node_modules/glob/dist/commonjs/glob.d.ts +388 -0
- package/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/glob.js +247 -0
- package/node_modules/glob/dist/commonjs/glob.js.map +1 -0
- package/node_modules/glob/dist/commonjs/has-magic.d.ts +14 -0
- package/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/node_modules/glob/dist/commonjs/has-magic.js.map +1 -0
- package/node_modules/glob/dist/commonjs/ignore.d.ts +24 -0
- package/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/node_modules/glob/dist/commonjs/ignore.js.map +1 -0
- package/node_modules/glob/dist/commonjs/index.d.ts +97 -0
- package/node_modules/glob/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/index.js +68 -0
- package/node_modules/glob/dist/commonjs/index.js.map +1 -0
- package/node_modules/glob/dist/commonjs/index.min.js +4 -0
- package/node_modules/glob/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/glob/dist/commonjs/package.json +3 -0
- package/node_modules/glob/dist/commonjs/pattern.d.ts +76 -0
- package/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/pattern.js +219 -0
- package/node_modules/glob/dist/commonjs/pattern.js.map +1 -0
- package/node_modules/glob/dist/commonjs/processor.d.ts +59 -0
- package/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/node_modules/glob/dist/commonjs/processor.js.map +1 -0
- package/node_modules/glob/dist/commonjs/walker.d.ts +97 -0
- package/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -0
- package/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/node_modules/glob/dist/commonjs/walker.js.map +1 -0
- package/node_modules/glob/dist/esm/glob.d.ts +388 -0
- package/node_modules/glob/dist/esm/glob.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/glob.js +243 -0
- package/node_modules/glob/dist/esm/glob.js.map +1 -0
- package/node_modules/glob/dist/esm/has-magic.d.ts +14 -0
- package/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/has-magic.js +23 -0
- package/node_modules/glob/dist/esm/has-magic.js.map +1 -0
- package/node_modules/glob/dist/esm/ignore.d.ts +24 -0
- package/node_modules/glob/dist/esm/ignore.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/ignore.js +115 -0
- package/node_modules/glob/dist/esm/ignore.js.map +1 -0
- package/node_modules/glob/dist/esm/index.d.ts +97 -0
- package/node_modules/glob/dist/esm/index.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/index.js +55 -0
- package/node_modules/glob/dist/esm/index.js.map +1 -0
- package/node_modules/glob/dist/esm/index.min.js +4 -0
- package/node_modules/glob/dist/esm/index.min.js.map +7 -0
- package/node_modules/glob/dist/esm/package.json +3 -0
- package/node_modules/glob/dist/esm/pattern.d.ts +76 -0
- package/node_modules/glob/dist/esm/pattern.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/pattern.js +215 -0
- package/node_modules/glob/dist/esm/pattern.js.map +1 -0
- package/node_modules/glob/dist/esm/processor.d.ts +59 -0
- package/node_modules/glob/dist/esm/processor.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/processor.js +294 -0
- package/node_modules/glob/dist/esm/processor.js.map +1 -0
- package/node_modules/glob/dist/esm/walker.d.ts +97 -0
- package/node_modules/glob/dist/esm/walker.d.ts.map +1 -0
- package/node_modules/glob/dist/esm/walker.js +381 -0
- package/node_modules/glob/dist/esm/walker.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/LICENSE.md +55 -0
- package/node_modules/glob/node_modules/minimatch/README.md +453 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/ast.d.ts +20 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js +591 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/index.d.ts +94 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/index.js +1029 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/ast.d.ts +20 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/ast.js +587 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/ast.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/brace-expressions.js +148 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/escape.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/index.d.ts +94 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/index.js +1016 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/index.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/package.json +3 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/node_modules/glob/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
- package/node_modules/glob/node_modules/minimatch/package.json +67 -0
- package/node_modules/glob/package.json +101 -0
- package/node_modules/minipass/LICENSE +15 -0
- package/node_modules/minipass/README.md +825 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts +549 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/commonjs/index.js +1028 -0
- package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
- package/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/node_modules/minipass/dist/esm/index.d.ts +549 -0
- package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/esm/index.js +1018 -0
- package/node_modules/minipass/dist/esm/index.js.map +1 -0
- package/node_modules/minipass/dist/esm/package.json +3 -0
- package/node_modules/minipass/package.json +82 -0
- package/node_modules/package-json-from-dist/LICENSE.md +63 -0
- package/node_modules/package-json-from-dist/README.md +110 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts +89 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.js +134 -0
- package/node_modules/package-json-from-dist/dist/commonjs/index.js.map +1 -0
- package/node_modules/package-json-from-dist/dist/commonjs/package.json +3 -0
- package/node_modules/package-json-from-dist/dist/esm/index.d.ts +89 -0
- package/node_modules/package-json-from-dist/dist/esm/index.d.ts.map +1 -0
- package/node_modules/package-json-from-dist/dist/esm/index.js +129 -0
- package/node_modules/package-json-from-dist/dist/esm/index.js.map +1 -0
- package/node_modules/package-json-from-dist/dist/esm/package.json +3 -0
- package/node_modules/package-json-from-dist/package.json +68 -0
- package/node_modules/path-scurry/LICENSE.md +55 -0
- package/node_modules/path-scurry/README.md +636 -0
- package/node_modules/path-scurry/dist/commonjs/index.d.ts +1115 -0
- package/node_modules/path-scurry/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
- package/node_modules/path-scurry/dist/commonjs/index.js.map +1 -0
- package/node_modules/path-scurry/dist/commonjs/package.json +3 -0
- package/node_modules/path-scurry/dist/esm/index.d.ts +1115 -0
- package/node_modules/path-scurry/dist/esm/index.d.ts.map +1 -0
- package/node_modules/path-scurry/dist/esm/index.js +1983 -0
- package/node_modules/path-scurry/dist/esm/index.js.map +1 -0
- package/node_modules/path-scurry/dist/esm/package.json +3 -0
- package/node_modules/path-scurry/node_modules/lru-cache/LICENSE.md +55 -0
- package/node_modules/path-scurry/node_modules/lru-cache/README.md +383 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts +1323 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js +1589 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts +1323 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js +1585 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js.map +1 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
- package/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json +3 -0
- package/node_modules/path-scurry/node_modules/lru-cache/package.json +101 -0
- package/node_modules/path-scurry/package.json +88 -0
- package/node_modules/rimraf/LICENSE.md +55 -0
- package/node_modules/rimraf/README.md +226 -0
- package/node_modules/rimraf/dist/commonjs/default-tmp.d.ts +3 -0
- package/node_modules/rimraf/dist/commonjs/default-tmp.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/default-tmp.js +58 -0
- package/node_modules/rimraf/dist/commonjs/default-tmp.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/error.d.ts +6 -0
- package/node_modules/rimraf/dist/commonjs/error.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/error.js +10 -0
- package/node_modules/rimraf/dist/commonjs/error.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/fix-eperm.d.ts +3 -0
- package/node_modules/rimraf/dist/commonjs/fix-eperm.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/fix-eperm.js +38 -0
- package/node_modules/rimraf/dist/commonjs/fix-eperm.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/fs.d.ts +15 -0
- package/node_modules/rimraf/dist/commonjs/fs.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/fs.js +33 -0
- package/node_modules/rimraf/dist/commonjs/fs.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/ignore-enoent.d.ts +3 -0
- package/node_modules/rimraf/dist/commonjs/ignore-enoent.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/ignore-enoent.js +24 -0
- package/node_modules/rimraf/dist/commonjs/ignore-enoent.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/index.d.ts +50 -0
- package/node_modules/rimraf/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/index.js +78 -0
- package/node_modules/rimraf/dist/commonjs/index.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/opt-arg.d.ts +34 -0
- package/node_modules/rimraf/dist/commonjs/opt-arg.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/opt-arg.js +53 -0
- package/node_modules/rimraf/dist/commonjs/opt-arg.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/package.json +3 -0
- package/node_modules/rimraf/dist/commonjs/path-arg.d.ts +4 -0
- package/node_modules/rimraf/dist/commonjs/path-arg.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/path-arg.js +48 -0
- package/node_modules/rimraf/dist/commonjs/path-arg.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/readdir-or-error.d.ts +3 -0
- package/node_modules/rimraf/dist/commonjs/readdir-or-error.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/readdir-or-error.js +19 -0
- package/node_modules/rimraf/dist/commonjs/readdir-or-error.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/retry-busy.d.ts +8 -0
- package/node_modules/rimraf/dist/commonjs/retry-busy.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/retry-busy.js +65 -0
- package/node_modules/rimraf/dist/commonjs/retry-busy.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-manual.d.ts +3 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-manual.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-manual.js +8 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-manual.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-move-remove.d.ts +4 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-move-remove.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-move-remove.js +138 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-move-remove.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-native.d.ts +4 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-native.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-native.js +24 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-native.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-posix.d.ts +4 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-posix.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-posix.js +103 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-posix.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-windows.d.ts +4 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-windows.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-windows.js +159 -0
- package/node_modules/rimraf/dist/commonjs/rimraf-windows.js.map +1 -0
- package/node_modules/rimraf/dist/commonjs/use-native.d.ts +4 -0
- package/node_modules/rimraf/dist/commonjs/use-native.d.ts.map +1 -0
- package/node_modules/rimraf/dist/commonjs/use-native.js +18 -0
- package/node_modules/rimraf/dist/commonjs/use-native.js.map +1 -0
- package/node_modules/rimraf/dist/esm/bin.d.mts +3 -0
- package/node_modules/rimraf/dist/esm/bin.d.mts.map +1 -0
- package/node_modules/rimraf/dist/esm/bin.mjs +250 -0
- package/node_modules/rimraf/dist/esm/bin.mjs.map +1 -0
- package/node_modules/rimraf/dist/esm/default-tmp.d.ts +3 -0
- package/node_modules/rimraf/dist/esm/default-tmp.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/default-tmp.js +55 -0
- package/node_modules/rimraf/dist/esm/default-tmp.js.map +1 -0
- package/node_modules/rimraf/dist/esm/error.d.ts +6 -0
- package/node_modules/rimraf/dist/esm/error.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/error.js +5 -0
- package/node_modules/rimraf/dist/esm/error.js.map +1 -0
- package/node_modules/rimraf/dist/esm/fix-eperm.d.ts +3 -0
- package/node_modules/rimraf/dist/esm/fix-eperm.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/fix-eperm.js +33 -0
- package/node_modules/rimraf/dist/esm/fix-eperm.js.map +1 -0
- package/node_modules/rimraf/dist/esm/fs.d.ts +15 -0
- package/node_modules/rimraf/dist/esm/fs.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/fs.js +18 -0
- package/node_modules/rimraf/dist/esm/fs.js.map +1 -0
- package/node_modules/rimraf/dist/esm/ignore-enoent.d.ts +3 -0
- package/node_modules/rimraf/dist/esm/ignore-enoent.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/ignore-enoent.js +19 -0
- package/node_modules/rimraf/dist/esm/ignore-enoent.js.map +1 -0
- package/node_modules/rimraf/dist/esm/index.d.ts +50 -0
- package/node_modules/rimraf/dist/esm/index.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/index.js +70 -0
- package/node_modules/rimraf/dist/esm/index.js.map +1 -0
- package/node_modules/rimraf/dist/esm/opt-arg.d.ts +34 -0
- package/node_modules/rimraf/dist/esm/opt-arg.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/opt-arg.js +46 -0
- package/node_modules/rimraf/dist/esm/opt-arg.js.map +1 -0
- package/node_modules/rimraf/dist/esm/package.json +3 -0
- package/node_modules/rimraf/dist/esm/path-arg.d.ts +4 -0
- package/node_modules/rimraf/dist/esm/path-arg.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/path-arg.js +46 -0
- package/node_modules/rimraf/dist/esm/path-arg.js.map +1 -0
- package/node_modules/rimraf/dist/esm/readdir-or-error.d.ts +3 -0
- package/node_modules/rimraf/dist/esm/readdir-or-error.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/readdir-or-error.js +14 -0
- package/node_modules/rimraf/dist/esm/readdir-or-error.js.map +1 -0
- package/node_modules/rimraf/dist/esm/retry-busy.d.ts +8 -0
- package/node_modules/rimraf/dist/esm/retry-busy.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/retry-busy.js +60 -0
- package/node_modules/rimraf/dist/esm/retry-busy.js.map +1 -0
- package/node_modules/rimraf/dist/esm/rimraf-manual.d.ts +3 -0
- package/node_modules/rimraf/dist/esm/rimraf-manual.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/rimraf-manual.js +5 -0
- package/node_modules/rimraf/dist/esm/rimraf-manual.js.map +1 -0
- package/node_modules/rimraf/dist/esm/rimraf-move-remove.d.ts +4 -0
- package/node_modules/rimraf/dist/esm/rimraf-move-remove.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/rimraf-move-remove.js +133 -0
- package/node_modules/rimraf/dist/esm/rimraf-move-remove.js.map +1 -0
- package/node_modules/rimraf/dist/esm/rimraf-native.d.ts +4 -0
- package/node_modules/rimraf/dist/esm/rimraf-native.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/rimraf-native.js +19 -0
- package/node_modules/rimraf/dist/esm/rimraf-native.js.map +1 -0
- package/node_modules/rimraf/dist/esm/rimraf-posix.d.ts +4 -0
- package/node_modules/rimraf/dist/esm/rimraf-posix.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/rimraf-posix.js +98 -0
- package/node_modules/rimraf/dist/esm/rimraf-posix.js.map +1 -0
- package/node_modules/rimraf/dist/esm/rimraf-windows.d.ts +4 -0
- package/node_modules/rimraf/dist/esm/rimraf-windows.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/rimraf-windows.js +154 -0
- package/node_modules/rimraf/dist/esm/rimraf-windows.js.map +1 -0
- package/node_modules/rimraf/dist/esm/use-native.d.ts +4 -0
- package/node_modules/rimraf/dist/esm/use-native.d.ts.map +1 -0
- package/node_modules/rimraf/dist/esm/use-native.js +15 -0
- package/node_modules/rimraf/dist/esm/use-native.js.map +1 -0
- package/node_modules/rimraf/package.json +92 -0
- package/package.json +152 -0
- package/scripts/install-scanners.js +258 -0
- package/scripts/watchdog.js +147 -0
- package/src/analyzers/CSSAnalyzer.js +297 -0
- package/src/analyzers/ConfigValidator.js +690 -0
- package/src/analyzers/ESLintAnalyzer.js +320 -0
- package/src/analyzers/JavaScriptAnalyzer.js +261 -0
- package/src/analyzers/PrettierFormatter.js +247 -0
- package/src/analyzers/PythonAnalyzer.js +283 -0
- package/src/analyzers/SecurityAnalyzer.js +729 -0
- package/src/analyzers/SparrowAnalyzer.js +341 -0
- package/src/analyzers/TypeScriptAnalyzer.js +247 -0
- package/src/analyzers/codeCloneDetector/analyzer.js +344 -0
- package/src/analyzers/codeCloneDetector/detector.js +250 -0
- package/src/analyzers/codeCloneDetector/index.js +192 -0
- package/src/analyzers/codeCloneDetector/parser.js +199 -0
- package/src/analyzers/codeCloneDetector/reporter.js +148 -0
- package/src/analyzers/codeCloneDetector/scanner.js +88 -0
- package/src/core/agentPool.js +1957 -0
- package/src/core/agentScheduler.js +3212 -0
- package/src/core/contextManager.js +709 -0
- package/src/core/flowExecutor.js +928 -0
- package/src/core/messageProcessor.js +808 -0
- package/src/core/orchestrator.js +584 -0
- package/src/core/stateManager.js +1500 -0
- package/src/index.js +972 -0
- package/src/interfaces/cli.js +553 -0
- package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +208 -0
- package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +236 -0
- package/src/interfaces/terminal/__tests__/smoke/agents.test.js +138 -0
- package/src/interfaces/terminal/__tests__/smoke/components.test.js +137 -0
- package/src/interfaces/terminal/__tests__/smoke/connection.test.js +350 -0
- package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +156 -0
- package/src/interfaces/terminal/__tests__/smoke/imports.test.js +332 -0
- package/src/interfaces/terminal/__tests__/smoke/messages.test.js +256 -0
- package/src/interfaces/terminal/__tests__/smoke/tools.test.js +388 -0
- package/src/interfaces/terminal/api/apiClient.js +299 -0
- package/src/interfaces/terminal/api/messageRouter.js +262 -0
- package/src/interfaces/terminal/api/session.js +266 -0
- package/src/interfaces/terminal/api/websocket.js +497 -0
- package/src/interfaces/terminal/components/AgentCreator.js +705 -0
- package/src/interfaces/terminal/components/AgentEditor.js +678 -0
- package/src/interfaces/terminal/components/AgentSwitcher.js +330 -0
- package/src/interfaces/terminal/components/ErrorBoundary.js +92 -0
- package/src/interfaces/terminal/components/ErrorPanel.js +264 -0
- package/src/interfaces/terminal/components/Header.js +28 -0
- package/src/interfaces/terminal/components/HelpPanel.js +231 -0
- package/src/interfaces/terminal/components/InputBox.js +118 -0
- package/src/interfaces/terminal/components/Layout.js +603 -0
- package/src/interfaces/terminal/components/LoadingSpinner.js +71 -0
- package/src/interfaces/terminal/components/MessageList.js +281 -0
- package/src/interfaces/terminal/components/MultilineTextInput.js +251 -0
- package/src/interfaces/terminal/components/SearchPanel.js +265 -0
- package/src/interfaces/terminal/components/SettingsPanel.js +415 -0
- package/src/interfaces/terminal/components/StatusBar.js +65 -0
- package/src/interfaces/terminal/components/TextInput.js +127 -0
- package/src/interfaces/terminal/config/agentEditorConstants.js +227 -0
- package/src/interfaces/terminal/config/constants.js +393 -0
- package/src/interfaces/terminal/index.js +168 -0
- package/src/interfaces/terminal/state/useAgentControl.js +496 -0
- package/src/interfaces/terminal/state/useAgents.js +537 -0
- package/src/interfaces/terminal/state/useConnection.js +444 -0
- package/src/interfaces/terminal/state/useMessages.js +630 -0
- package/src/interfaces/terminal/state/useTools.js +554 -0
- package/src/interfaces/terminal/utils/debugLogger.js +44 -0
- package/src/interfaces/terminal/utils/settingsStorage.js +232 -0
- package/src/interfaces/terminal/utils/theme.js +85 -0
- package/src/interfaces/webServer.js +5457 -0
- package/src/modules/fileExplorer/controller.js +413 -0
- package/src/modules/fileExplorer/index.js +37 -0
- package/src/modules/fileExplorer/middleware.js +92 -0
- package/src/modules/fileExplorer/routes.js +158 -0
- package/src/modules/fileExplorer/types.js +44 -0
- package/src/services/agentActivityService.js +399 -0
- package/src/services/aiService.js +2618 -0
- package/src/services/apiKeyManager.js +334 -0
- package/src/services/benchmarkService.js +196 -0
- package/src/services/budgetService.js +565 -0
- package/src/services/contextInjectionService.js +268 -0
- package/src/services/conversationCompactionService.js +1103 -0
- package/src/services/credentialVault.js +685 -0
- package/src/services/errorHandler.js +810 -0
- package/src/services/fileAttachmentService.js +547 -0
- package/src/services/flowContextService.js +189 -0
- package/src/services/memoryService.js +521 -0
- package/src/services/modelRouterService.js +365 -0
- package/src/services/modelsService.js +323 -0
- package/src/services/ollamaService.js +452 -0
- package/src/services/portRegistry.js +336 -0
- package/src/services/portTracker.js +223 -0
- package/src/services/projectDetector.js +404 -0
- package/src/services/promptService.js +372 -0
- package/src/services/qualityInspector.js +796 -0
- package/src/services/scheduleService.js +725 -0
- package/src/services/serviceRegistry.js +386 -0
- package/src/services/skillsService.js +486 -0
- package/src/services/telegramService.js +920 -0
- package/src/services/tokenCountingService.js +316 -0
- package/src/services/visualEditorBridge.js +1033 -0
- package/src/services/visualEditorServer.js +1727 -0
- package/src/services/whatsappService.js +663 -0
- package/src/tools/__tests__/webTool.e2e.test.js +569 -0
- package/src/tools/__tests__/webTool.unit.test.js +195 -0
- package/src/tools/agentCommunicationTool.js +1343 -0
- package/src/tools/agentDelayTool.js +498 -0
- package/src/tools/asyncToolManager.js +604 -0
- package/src/tools/baseTool.js +887 -0
- package/src/tools/browserTool.js +897 -0
- package/src/tools/cloneDetectionTool.js +581 -0
- package/src/tools/codeMapTool.js +857 -0
- package/src/tools/dependencyResolverTool.js +1212 -0
- package/src/tools/docxTool.js +623 -0
- package/src/tools/excelTool.js +636 -0
- package/src/tools/fileContentReplaceTool.js +840 -0
- package/src/tools/fileTreeTool.js +833 -0
- package/src/tools/filesystemTool.js +1217 -0
- package/src/tools/helpTool.js +198 -0
- package/src/tools/imageTool.js +1034 -0
- package/src/tools/importAnalyzerTool.js +1056 -0
- package/src/tools/jobDoneTool.js +388 -0
- package/src/tools/memoryTool.js +554 -0
- package/src/tools/pdfTool.js +627 -0
- package/src/tools/seekTool.js +883 -0
- package/src/tools/skillsTool.js +276 -0
- package/src/tools/staticAnalysisTool.js +2146 -0
- package/src/tools/taskManagerTool.js +2836 -0
- package/src/tools/terminalTool.js +2486 -0
- package/src/tools/userPromptTool.js +474 -0
- package/src/tools/videoTool.js +1139 -0
- package/src/tools/visionTool.js +507 -0
- package/src/tools/visualEditorTool.js +1175 -0
- package/src/tools/webTool.js +3114 -0
- package/src/tools/whatsappTool.js +457 -0
- package/src/types/agent.js +519 -0
- package/src/types/contextReference.js +972 -0
- package/src/types/conversation.js +730 -0
- package/src/types/toolCommand.js +747 -0
- package/src/utilities/attachmentValidator.js +288 -0
- package/src/utilities/browserStealth.js +630 -0
- package/src/utilities/configManager.js +618 -0
- package/src/utilities/constants.js +870 -0
- package/src/utilities/directoryAccessManager.js +566 -0
- package/src/utilities/fileProcessor.js +307 -0
- package/src/utilities/humanBehavior.js +453 -0
- package/src/utilities/jsonRepair.js +242 -0
- package/src/utilities/logger.js +436 -0
- package/src/utilities/platformUtils.js +255 -0
- package/src/utilities/platformUtils.test.js +98 -0
- package/src/utilities/stealthConstants.js +377 -0
- package/src/utilities/structuredFileValidator.js +699 -0
- package/src/utilities/tagParser.js +878 -0
- package/src/utilities/toolConstants.js +415 -0
- package/src/utilities/userDataDir.js +300 -0
- package/web-ui/build/brands/autopilot/favicon.svg +1 -0
- package/web-ui/build/brands/autopilot/logo.webp +0 -0
- package/web-ui/build/brands/onbuzz/favicon.svg +1 -0
- package/web-ui/build/brands/onbuzz/logo-text.webp +0 -0
- package/web-ui/build/brands/onbuzz/logo.webp +0 -0
- package/web-ui/build/index.html +15 -0
- package/web-ui/build/logo.png +0 -0
- package/web-ui/build/logo2.png +0 -0
- package/web-ui/build/static/index-SmQFfvBs.js +746 -0
- 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
|
+
};
|