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,436 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger - Centralized logging system for the Loxia AI Agents System
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* - Structured logging with different levels
|
|
6
|
+
* - Agent activity logging
|
|
7
|
+
* - Tool execution logging
|
|
8
|
+
* - System event logging
|
|
9
|
+
* - Log output management (console, file)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { promises as fs } from 'fs';
|
|
13
|
+
import path from 'path';
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
SYSTEM_VERSION
|
|
17
|
+
} from './constants.js';
|
|
18
|
+
|
|
19
|
+
class Logger {
|
|
20
|
+
constructor(config = {}) {
|
|
21
|
+
this.config = config;
|
|
22
|
+
|
|
23
|
+
// Log levels in order of severity
|
|
24
|
+
this.levels = {
|
|
25
|
+
error: 0,
|
|
26
|
+
warn: 1,
|
|
27
|
+
info: 2,
|
|
28
|
+
debug: 3
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
this.currentLevel = this.levels[config.level || 'info'];
|
|
32
|
+
this.outputs = config.outputs || ['console'];
|
|
33
|
+
this.logFile = config.logFile || null;
|
|
34
|
+
this.maxFileSize = config.maxFileSize || 10 * 1024 * 1024; // 10MB
|
|
35
|
+
this.maxFiles = config.maxFiles || 5;
|
|
36
|
+
|
|
37
|
+
// Log formatting
|
|
38
|
+
this.enableColors = config.colors !== false;
|
|
39
|
+
this.includeTimestamp = config.timestamp !== false;
|
|
40
|
+
this.includeLevel = config.includeLevel !== false;
|
|
41
|
+
|
|
42
|
+
// Color codes for console output
|
|
43
|
+
this.colors = {
|
|
44
|
+
error: '\x1b[31m', // Red
|
|
45
|
+
warn: '\x1b[33m', // Yellow
|
|
46
|
+
info: '\x1b[36m', // Cyan
|
|
47
|
+
debug: '\x1b[90m', // Gray
|
|
48
|
+
reset: '\x1b[0m'
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
this.initialized = false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Initialize logger
|
|
56
|
+
* @returns {Promise<void>}
|
|
57
|
+
*/
|
|
58
|
+
async initialize() {
|
|
59
|
+
if (this.initialized) return;
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
// Create log directory if file output is enabled
|
|
63
|
+
if (this.outputs.includes('file') && this.logFile) {
|
|
64
|
+
const logDir = path.dirname(this.logFile);
|
|
65
|
+
await fs.mkdir(logDir, { recursive: true });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
this.initialized = true;
|
|
69
|
+
this.info('Logger initialized', {
|
|
70
|
+
level: Object.keys(this.levels)[this.currentLevel],
|
|
71
|
+
outputs: this.outputs,
|
|
72
|
+
logFile: this.logFile
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error('Logger initialization failed:', error.message);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Log error message
|
|
82
|
+
* @param {string} message - Log message
|
|
83
|
+
* @param {Object} meta - Additional metadata
|
|
84
|
+
*/
|
|
85
|
+
error(message, meta = {}) {
|
|
86
|
+
this.log('error', message, meta);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Log warning message
|
|
91
|
+
* @param {string} message - Log message
|
|
92
|
+
* @param {Object} meta - Additional metadata
|
|
93
|
+
*/
|
|
94
|
+
warn(message, meta = {}) {
|
|
95
|
+
this.log('warn', message, meta);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Log info message
|
|
100
|
+
* @param {string} message - Log message
|
|
101
|
+
* @param {Object} meta - Additional metadata
|
|
102
|
+
*/
|
|
103
|
+
info(message, meta = {}) {
|
|
104
|
+
this.log('info', message, meta);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Log debug message
|
|
109
|
+
* @param {string} message - Log message
|
|
110
|
+
* @param {Object} meta - Additional metadata
|
|
111
|
+
*/
|
|
112
|
+
debug(message, meta = {}) {
|
|
113
|
+
this.log('debug', message, meta);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Log agent activity
|
|
118
|
+
* @param {string} agentId - Agent identifier
|
|
119
|
+
* @param {string} action - Action performed
|
|
120
|
+
* @param {Object} details - Action details
|
|
121
|
+
*/
|
|
122
|
+
logAgentActivity(agentId, action, details = {}) {
|
|
123
|
+
this.info(`[AGENT:${agentId}] ${action}`, {
|
|
124
|
+
category: 'agent-activity',
|
|
125
|
+
agentId,
|
|
126
|
+
action,
|
|
127
|
+
...details
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Log tool execution
|
|
133
|
+
* @param {string} toolId - Tool identifier
|
|
134
|
+
* @param {string} operationId - Operation identifier
|
|
135
|
+
* @param {string} status - Execution status
|
|
136
|
+
* @param {number} duration - Execution duration in ms
|
|
137
|
+
* @param {Object} details - Additional details
|
|
138
|
+
*/
|
|
139
|
+
logToolExecution(toolId, operationId, status, duration, details = {}) {
|
|
140
|
+
const level = status === 'failed' ? 'error' : 'info';
|
|
141
|
+
this[level](`[TOOL:${toolId}] Operation ${operationId} ${status} (${duration}ms)`, {
|
|
142
|
+
category: 'tool-execution',
|
|
143
|
+
toolId,
|
|
144
|
+
operationId,
|
|
145
|
+
status,
|
|
146
|
+
duration,
|
|
147
|
+
...details
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Log system event
|
|
153
|
+
* @param {string} event - Event name
|
|
154
|
+
* @param {Object} context - Event context
|
|
155
|
+
*/
|
|
156
|
+
logSystemEvent(event, context = {}) {
|
|
157
|
+
this.info(`[SYSTEM] ${event}`, {
|
|
158
|
+
category: 'system-event',
|
|
159
|
+
event,
|
|
160
|
+
...context
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Log API request/response
|
|
166
|
+
* @param {string} method - HTTP method
|
|
167
|
+
* @param {string} url - Request URL
|
|
168
|
+
* @param {number} status - Response status
|
|
169
|
+
* @param {number} duration - Request duration in ms
|
|
170
|
+
* @param {Object} details - Additional details
|
|
171
|
+
*/
|
|
172
|
+
logApiRequest(method, url, status, duration, details = {}) {
|
|
173
|
+
const level = status >= 400 ? 'error' : 'info';
|
|
174
|
+
this[level](`[API] ${method} ${url} ${status} (${duration}ms)`, {
|
|
175
|
+
category: 'api-request',
|
|
176
|
+
method,
|
|
177
|
+
url,
|
|
178
|
+
status,
|
|
179
|
+
duration,
|
|
180
|
+
...details
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Log with specified level
|
|
186
|
+
* @param {string} level - Log level
|
|
187
|
+
* @param {string} message - Log message
|
|
188
|
+
* @param {Object} meta - Additional metadata
|
|
189
|
+
*/
|
|
190
|
+
log(level, message, meta = {}) {
|
|
191
|
+
// Check if level is enabled
|
|
192
|
+
if (this.levels[level] > this.currentLevel) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const logEntry = this.createLogEntry(level, message, meta);
|
|
197
|
+
|
|
198
|
+
// Output to configured destinations
|
|
199
|
+
for (const output of this.outputs) {
|
|
200
|
+
switch (output) {
|
|
201
|
+
case 'console':
|
|
202
|
+
this.outputToConsole(logEntry);
|
|
203
|
+
break;
|
|
204
|
+
case 'file':
|
|
205
|
+
this.outputToFile(logEntry);
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Create structured log entry
|
|
213
|
+
* @private
|
|
214
|
+
*/
|
|
215
|
+
createLogEntry(level, message, meta) {
|
|
216
|
+
const entry = {
|
|
217
|
+
timestamp: new Date().toISOString(),
|
|
218
|
+
level: level.toUpperCase(),
|
|
219
|
+
message,
|
|
220
|
+
version: SYSTEM_VERSION,
|
|
221
|
+
...meta
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// Add process information
|
|
225
|
+
entry.pid = process.pid;
|
|
226
|
+
|
|
227
|
+
// Add memory usage for debug level
|
|
228
|
+
if (level === 'debug') {
|
|
229
|
+
const memUsage = process.memoryUsage();
|
|
230
|
+
entry.memory = {
|
|
231
|
+
rss: Math.round(memUsage.rss / 1024 / 1024),
|
|
232
|
+
heapUsed: Math.round(memUsage.heapUsed / 1024 / 1024),
|
|
233
|
+
heapTotal: Math.round(memUsage.heapTotal / 1024 / 1024)
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return entry;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Output log entry to console
|
|
242
|
+
* @private
|
|
243
|
+
*/
|
|
244
|
+
outputToConsole(entry) {
|
|
245
|
+
let output = '';
|
|
246
|
+
|
|
247
|
+
// Add timestamp
|
|
248
|
+
if (this.includeTimestamp) {
|
|
249
|
+
const timestamp = new Date(entry.timestamp).toLocaleTimeString();
|
|
250
|
+
output += `[${timestamp}] `;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Add level with color
|
|
254
|
+
if (this.includeLevel) {
|
|
255
|
+
const levelStr = entry.level.padEnd(5);
|
|
256
|
+
if (this.enableColors && process.stdout.isTTY) {
|
|
257
|
+
const color = this.colors[entry.level.toLowerCase()] || '';
|
|
258
|
+
output += `${color}${levelStr}${this.colors.reset} `;
|
|
259
|
+
} else {
|
|
260
|
+
output += `${levelStr} `;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Add message
|
|
265
|
+
output += entry.message;
|
|
266
|
+
|
|
267
|
+
// Add metadata if present
|
|
268
|
+
const { timestamp, level, message, version, pid, ...metadata } = entry;
|
|
269
|
+
if (Object.keys(metadata).length > 0) {
|
|
270
|
+
output += ` ${JSON.stringify(metadata)}`;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Output based on level
|
|
274
|
+
if (entry.level === 'ERROR') {
|
|
275
|
+
console.error(output);
|
|
276
|
+
} else {
|
|
277
|
+
console.log(output);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Output log entry to file
|
|
283
|
+
* @private
|
|
284
|
+
*/
|
|
285
|
+
async outputToFile(entry) {
|
|
286
|
+
if (!this.logFile) return;
|
|
287
|
+
|
|
288
|
+
try {
|
|
289
|
+
// Check file size and rotate if needed
|
|
290
|
+
await this.rotateLogFileIfNeeded();
|
|
291
|
+
|
|
292
|
+
const logLine = JSON.stringify(entry) + '\n';
|
|
293
|
+
await fs.appendFile(this.logFile, logLine, 'utf8');
|
|
294
|
+
|
|
295
|
+
} catch (error) {
|
|
296
|
+
console.error('Failed to write to log file:', error.message);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Rotate log file if it exceeds max size
|
|
302
|
+
* @private
|
|
303
|
+
*/
|
|
304
|
+
async rotateLogFileIfNeeded() {
|
|
305
|
+
try {
|
|
306
|
+
const stats = await fs.stat(this.logFile);
|
|
307
|
+
|
|
308
|
+
if (stats.size >= this.maxFileSize) {
|
|
309
|
+
await this.rotateLogFiles();
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
} catch (error) {
|
|
313
|
+
// File doesn't exist yet, that's ok
|
|
314
|
+
if (error.code !== 'ENOENT') {
|
|
315
|
+
throw error;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Rotate log files
|
|
322
|
+
* @private
|
|
323
|
+
*/
|
|
324
|
+
async rotateLogFiles() {
|
|
325
|
+
const dir = path.dirname(this.logFile);
|
|
326
|
+
const basename = path.basename(this.logFile, path.extname(this.logFile));
|
|
327
|
+
const ext = path.extname(this.logFile);
|
|
328
|
+
|
|
329
|
+
// Rotate existing files
|
|
330
|
+
for (let i = this.maxFiles - 1; i >= 1; i--) {
|
|
331
|
+
const oldFile = path.join(dir, `${basename}.${i}${ext}`);
|
|
332
|
+
const newFile = path.join(dir, `${basename}.${i + 1}${ext}`);
|
|
333
|
+
|
|
334
|
+
try {
|
|
335
|
+
await fs.rename(oldFile, newFile);
|
|
336
|
+
} catch (error) {
|
|
337
|
+
// File doesn't exist, continue
|
|
338
|
+
if (error.code !== 'ENOENT') {
|
|
339
|
+
console.error(`Failed to rotate log file ${oldFile}:`, error.message);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Move current file to .1
|
|
345
|
+
const rotatedFile = path.join(dir, `${basename}.1${ext}`);
|
|
346
|
+
try {
|
|
347
|
+
await fs.rename(this.logFile, rotatedFile);
|
|
348
|
+
} catch (error) {
|
|
349
|
+
console.error(`Failed to rotate current log file:`, error.message);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Set log level
|
|
355
|
+
* @param {string} level - New log level
|
|
356
|
+
*/
|
|
357
|
+
setLevel(level) {
|
|
358
|
+
if (level in this.levels) {
|
|
359
|
+
this.currentLevel = this.levels[level];
|
|
360
|
+
this.info(`Log level changed to: ${level}`);
|
|
361
|
+
} else {
|
|
362
|
+
this.warn(`Invalid log level: ${level}. Valid levels: ${Object.keys(this.levels).join(', ')}`);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Add output destination
|
|
368
|
+
* @param {string} output - Output destination ('console' or 'file')
|
|
369
|
+
*/
|
|
370
|
+
addOutput(output) {
|
|
371
|
+
if (!this.outputs.includes(output)) {
|
|
372
|
+
this.outputs.push(output);
|
|
373
|
+
this.info(`Added log output: ${output}`);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Remove output destination
|
|
379
|
+
* @param {string} output - Output destination to remove
|
|
380
|
+
*/
|
|
381
|
+
removeOutput(output) {
|
|
382
|
+
const index = this.outputs.indexOf(output);
|
|
383
|
+
if (index > -1) {
|
|
384
|
+
this.outputs.splice(index, 1);
|
|
385
|
+
this.info(`Removed log output: ${output}`);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Create child logger with additional context
|
|
391
|
+
* @param {Object} context - Additional context to include in all logs
|
|
392
|
+
* @returns {Logger} Child logger instance
|
|
393
|
+
*/
|
|
394
|
+
child(context) {
|
|
395
|
+
const childLogger = Object.create(this);
|
|
396
|
+
childLogger.childContext = { ...this.childContext, ...context };
|
|
397
|
+
return childLogger;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Flush any pending log entries
|
|
402
|
+
* @returns {Promise<void>}
|
|
403
|
+
*/
|
|
404
|
+
async flush() {
|
|
405
|
+
// File system writes are typically immediate, but this provides
|
|
406
|
+
// a hook for more complex logging backends
|
|
407
|
+
return Promise.resolve();
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Close logger and cleanup resources
|
|
412
|
+
* @returns {Promise<void>}
|
|
413
|
+
*/
|
|
414
|
+
async close() {
|
|
415
|
+
await this.flush();
|
|
416
|
+
this.info('Logger closed');
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Create a logger instance with specified configuration
|
|
422
|
+
* @param {Object} config - Logger configuration
|
|
423
|
+
* @returns {Logger} Logger instance
|
|
424
|
+
*/
|
|
425
|
+
function createLogger(config = {}) {
|
|
426
|
+
const logger = new Logger(config);
|
|
427
|
+
|
|
428
|
+
// Auto-initialize if not explicitly disabled
|
|
429
|
+
if (config.autoInit !== false) {
|
|
430
|
+
setImmediate(() => logger.initialize());
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
return logger;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export { Logger, createLogger };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Utilities Module
|
|
3
|
+
*
|
|
4
|
+
* Centralized platform abstraction for cross-platform compatibility.
|
|
5
|
+
* Provides functions for detecting platform, shell, paths, and other
|
|
6
|
+
* platform-specific configurations.
|
|
7
|
+
*
|
|
8
|
+
* @module platformUtils
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import os from 'os';
|
|
12
|
+
import path from 'path';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Platform constants
|
|
16
|
+
*/
|
|
17
|
+
export const PLATFORMS = {
|
|
18
|
+
MACOS: 'darwin',
|
|
19
|
+
WINDOWS: 'win32',
|
|
20
|
+
LINUX: 'linux'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get the current platform
|
|
25
|
+
* @returns {string} Platform identifier (darwin, win32, linux)
|
|
26
|
+
*/
|
|
27
|
+
export function getPlatform() {
|
|
28
|
+
return process.platform;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Check if running on macOS
|
|
33
|
+
* @returns {boolean}
|
|
34
|
+
*/
|
|
35
|
+
export function isMacOS() {
|
|
36
|
+
return process.platform === 'darwin';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Check if running on Windows
|
|
41
|
+
* @returns {boolean}
|
|
42
|
+
*/
|
|
43
|
+
export function isWindows() {
|
|
44
|
+
return process.platform === 'win32';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Check if running on Linux
|
|
49
|
+
* @returns {boolean}
|
|
50
|
+
*/
|
|
51
|
+
export function isLinux() {
|
|
52
|
+
return process.platform === 'linux';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Detect the user's shell
|
|
57
|
+
* @returns {string} Shell type (zsh, bash, fish, powershell, cmd)
|
|
58
|
+
*/
|
|
59
|
+
export function getUserShell() {
|
|
60
|
+
if (isWindows()) {
|
|
61
|
+
// Windows: Check for PowerShell or CMD
|
|
62
|
+
if (process.env.PSModulePath) {
|
|
63
|
+
return 'powershell';
|
|
64
|
+
}
|
|
65
|
+
// Check if running in WSL or Git Bash
|
|
66
|
+
if (process.env.SHELL && process.env.SHELL.includes('bash')) {
|
|
67
|
+
return 'bash';
|
|
68
|
+
}
|
|
69
|
+
return 'cmd';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Unix-like systems (macOS, Linux)
|
|
73
|
+
// macOS Catalina (10.15) and later default to zsh
|
|
74
|
+
const defaultShell = isMacOS() ? '/bin/zsh' : '/bin/bash';
|
|
75
|
+
const shell = process.env.SHELL || defaultShell;
|
|
76
|
+
|
|
77
|
+
if (shell.includes('zsh')) return 'zsh';
|
|
78
|
+
if (shell.includes('fish')) return 'fish';
|
|
79
|
+
if (shell.includes('bash')) return 'bash';
|
|
80
|
+
|
|
81
|
+
return 'bash'; // Fallback
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Get the shell executable path
|
|
86
|
+
* @returns {string} Path to shell executable
|
|
87
|
+
*/
|
|
88
|
+
export function getShellPath() {
|
|
89
|
+
if (isWindows()) {
|
|
90
|
+
const shell = getUserShell();
|
|
91
|
+
if (shell === 'powershell') return 'powershell';
|
|
92
|
+
return 'cmd';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return process.env.SHELL || (isMacOS() ? '/bin/zsh' : '/bin/bash');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Get system restricted paths for the current platform
|
|
100
|
+
* These paths should be protected from unauthorized access
|
|
101
|
+
* @returns {string[]} Array of restricted paths
|
|
102
|
+
*/
|
|
103
|
+
export function getSystemRestrictedPaths() {
|
|
104
|
+
const common = [
|
|
105
|
+
'/etc',
|
|
106
|
+
'/var',
|
|
107
|
+
'/usr',
|
|
108
|
+
'/bin',
|
|
109
|
+
'/sbin',
|
|
110
|
+
'/boot',
|
|
111
|
+
'/dev',
|
|
112
|
+
'/proc',
|
|
113
|
+
'/sys'
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
if (isMacOS()) {
|
|
117
|
+
return [
|
|
118
|
+
...common,
|
|
119
|
+
'/System',
|
|
120
|
+
'/Library',
|
|
121
|
+
'/Applications',
|
|
122
|
+
'/private',
|
|
123
|
+
'/cores',
|
|
124
|
+
'/Volumes',
|
|
125
|
+
path.join(os.homedir(), 'Library')
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (isWindows()) {
|
|
130
|
+
// Use environment variables for Windows paths (handles different drive letters)
|
|
131
|
+
const winDir = process.env.WINDIR || 'C:\\Windows';
|
|
132
|
+
const programFiles = process.env.ProgramFiles || 'C:\\Program Files';
|
|
133
|
+
const programFilesX86 = process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)';
|
|
134
|
+
return [winDir, programFiles, programFilesX86];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Linux
|
|
138
|
+
return common;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Get platform-specific blocked file extensions
|
|
143
|
+
* Only blocks executables/installers for the current platform
|
|
144
|
+
* @returns {string[]} Array of blocked extensions
|
|
145
|
+
*/
|
|
146
|
+
export function getPlatformBlockedExtensions() {
|
|
147
|
+
// Universal - blocked on all platforms
|
|
148
|
+
const universal = ['.jar', '.apk'];
|
|
149
|
+
|
|
150
|
+
// Platform-specific executables and installers
|
|
151
|
+
const platformSpecific = {
|
|
152
|
+
darwin: ['.app', '.dmg', '.pkg', '.dylib'],
|
|
153
|
+
win32: ['.exe', '.dll', '.bat', '.cmd', '.ps1', '.msi'],
|
|
154
|
+
linux: ['.so', '.deb', '.rpm']
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
return [...universal, ...(platformSpecific[process.platform] || [])];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Normalize a path for comparison
|
|
162
|
+
* Handles case-insensitivity on macOS and Windows
|
|
163
|
+
* @param {string} p - Path to normalize
|
|
164
|
+
* @returns {string} Normalized path
|
|
165
|
+
*/
|
|
166
|
+
export function normalizePath(p) {
|
|
167
|
+
let normalized = path.normalize(p);
|
|
168
|
+
|
|
169
|
+
// macOS (APFS/HFS+) and Windows (NTFS) are case-insensitive
|
|
170
|
+
if (isMacOS() || isWindows()) {
|
|
171
|
+
normalized = normalized.toLowerCase();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return normalized;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Compare two paths for equality (case-aware based on platform)
|
|
179
|
+
* @param {string} path1 - First path
|
|
180
|
+
* @param {string} path2 - Second path
|
|
181
|
+
* @returns {boolean} True if paths are equal
|
|
182
|
+
*/
|
|
183
|
+
export function pathsEqual(path1, path2) {
|
|
184
|
+
return normalizePath(path1) === normalizePath(path2);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Check if targetPath starts with basePath (case-aware)
|
|
189
|
+
* @param {string} targetPath - Path to check
|
|
190
|
+
* @param {string} basePath - Base path to compare against
|
|
191
|
+
* @returns {boolean} True if targetPath starts with basePath
|
|
192
|
+
*/
|
|
193
|
+
export function pathStartsWith(targetPath, basePath) {
|
|
194
|
+
const normalizedTarget = normalizePath(targetPath);
|
|
195
|
+
const normalizedBase = normalizePath(basePath);
|
|
196
|
+
return normalizedTarget.startsWith(normalizedBase);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Get platform-appropriate default user agent for browser automation
|
|
201
|
+
* @returns {string} User agent string
|
|
202
|
+
*/
|
|
203
|
+
export function getDefaultUserAgent() {
|
|
204
|
+
if (isMacOS()) {
|
|
205
|
+
return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
|
|
206
|
+
}
|
|
207
|
+
if (isWindows()) {
|
|
208
|
+
return 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
|
|
209
|
+
}
|
|
210
|
+
// Linux
|
|
211
|
+
return 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Get common Python executable locations for macOS
|
|
216
|
+
* Includes Homebrew and pyenv paths
|
|
217
|
+
* @returns {string[]} Array of Python paths to try
|
|
218
|
+
*/
|
|
219
|
+
export function getMacOSPythonPaths() {
|
|
220
|
+
if (!isMacOS()) return [];
|
|
221
|
+
|
|
222
|
+
const homeDir = os.homedir();
|
|
223
|
+
return [
|
|
224
|
+
'/opt/homebrew/bin/python3', // Homebrew (Apple Silicon)
|
|
225
|
+
'/usr/local/bin/python3', // Homebrew (Intel Mac)
|
|
226
|
+
`${homeDir}/.pyenv/shims/python3`, // pyenv
|
|
227
|
+
`${homeDir}/.pyenv/shims/python`
|
|
228
|
+
];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Check if a Python command is from Homebrew installation
|
|
233
|
+
* @param {string} pythonPath - Path to Python executable
|
|
234
|
+
* @returns {boolean} True if Homebrew Python
|
|
235
|
+
*/
|
|
236
|
+
export function isHomebrewPython(pythonPath) {
|
|
237
|
+
if (!pythonPath) return false;
|
|
238
|
+
return pythonPath.includes('/opt/homebrew') || pythonPath.includes('/usr/local/Cellar');
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Get platform info object for logging/debugging
|
|
243
|
+
* @returns {object} Platform information
|
|
244
|
+
*/
|
|
245
|
+
export function getPlatformInfo() {
|
|
246
|
+
return {
|
|
247
|
+
platform: process.platform,
|
|
248
|
+
arch: process.arch,
|
|
249
|
+
shell: getUserShell(),
|
|
250
|
+
shellPath: getShellPath(),
|
|
251
|
+
homeDir: os.homedir(),
|
|
252
|
+
tmpDir: os.tmpdir(),
|
|
253
|
+
nodeVersion: process.version
|
|
254
|
+
};
|
|
255
|
+
}
|