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,685 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential Vault Service
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* - Securely store website login credentials with AES-256-GCM encryption
|
|
6
|
+
* - Store authentication sessions (cookies) for reuse
|
|
7
|
+
* - Provide credentials to browser tool without exposing to AI agents
|
|
8
|
+
* - Support credential injection for automated login flows
|
|
9
|
+
*
|
|
10
|
+
* Security Model:
|
|
11
|
+
* - Credentials are encrypted at rest using machine-specific key derivation
|
|
12
|
+
* - Credentials are NEVER exposed to AI agents or included in conversation context
|
|
13
|
+
* - Only the browser tool can access credentials for form filling
|
|
14
|
+
* - Sessions include expiry tracking for automatic cleanup
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { promises as fs } from 'fs';
|
|
18
|
+
import path from 'path';
|
|
19
|
+
import crypto from 'crypto';
|
|
20
|
+
import os from 'os';
|
|
21
|
+
import { getUserDataPaths, ensureUserDataDirs } from '../utilities/userDataDir.js';
|
|
22
|
+
import {
|
|
23
|
+
CREDENTIAL_CONFIG,
|
|
24
|
+
KNOWN_SITES,
|
|
25
|
+
CREDENTIAL_EVENTS
|
|
26
|
+
} from '../utilities/stealthConstants.js';
|
|
27
|
+
|
|
28
|
+
// Encryption configuration (from constants)
|
|
29
|
+
const ALGORITHM = CREDENTIAL_CONFIG.ENCRYPTION_ALGORITHM;
|
|
30
|
+
const KEY_LENGTH = 32; // 256 bits
|
|
31
|
+
const IV_LENGTH = CREDENTIAL_CONFIG.IV_LENGTH;
|
|
32
|
+
const AUTH_TAG_LENGTH = CREDENTIAL_CONFIG.AUTH_TAG_LENGTH;
|
|
33
|
+
const SALT_LENGTH = CREDENTIAL_CONFIG.SALT_LENGTH;
|
|
34
|
+
const PBKDF2_ITERATIONS = CREDENTIAL_CONFIG.KEY_DERIVATION_ITERATIONS;
|
|
35
|
+
|
|
36
|
+
class CredentialVault {
|
|
37
|
+
constructor(logger = null) {
|
|
38
|
+
this.logger = logger;
|
|
39
|
+
|
|
40
|
+
// In-memory storage
|
|
41
|
+
this.credentials = new Map(); // siteId -> credential data
|
|
42
|
+
this.sessions = new Map(); // siteId -> session cookies
|
|
43
|
+
|
|
44
|
+
// Pending credential requests (for async UI flow)
|
|
45
|
+
this.pendingRequests = new Map(); // requestId -> { resolve, reject, timeout }
|
|
46
|
+
|
|
47
|
+
// Persistence configuration
|
|
48
|
+
this.credentialsFile = null;
|
|
49
|
+
this.sessionsFile = null;
|
|
50
|
+
this.encryptionKey = null;
|
|
51
|
+
this.initialized = false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Initialize persistence - must be called before using vault
|
|
56
|
+
* @returns {Promise<void>}
|
|
57
|
+
*/
|
|
58
|
+
async initialize() {
|
|
59
|
+
if (this.initialized) return;
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
await ensureUserDataDirs();
|
|
63
|
+
const paths = getUserDataPaths();
|
|
64
|
+
const settingsDir = paths.settings;
|
|
65
|
+
|
|
66
|
+
this.credentialsFile = path.join(settingsDir, CREDENTIAL_CONFIG.STORAGE.CREDENTIALS_FILE);
|
|
67
|
+
this.sessionsFile = path.join(settingsDir, CREDENTIAL_CONFIG.STORAGE.SESSIONS_FILE);
|
|
68
|
+
|
|
69
|
+
// Generate or load machine-specific encryption key
|
|
70
|
+
this.encryptionKey = await this._getOrCreateEncryptionKey(settingsDir);
|
|
71
|
+
|
|
72
|
+
// Load persisted data
|
|
73
|
+
await this._loadCredentials();
|
|
74
|
+
await this._loadSessions();
|
|
75
|
+
|
|
76
|
+
// Cleanup expired sessions
|
|
77
|
+
this._cleanupExpiredSessions();
|
|
78
|
+
|
|
79
|
+
this.initialized = true;
|
|
80
|
+
this.logger?.info('[CredentialVault] Initialized', {
|
|
81
|
+
credentialsCount: this.credentials.size,
|
|
82
|
+
sessionsCount: this.sessions.size
|
|
83
|
+
});
|
|
84
|
+
} catch (error) {
|
|
85
|
+
this.logger?.warn('[CredentialVault] Initialization failed, using memory-only mode', {
|
|
86
|
+
error: error.message
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Get or create a machine-specific encryption key
|
|
93
|
+
* @private
|
|
94
|
+
*/
|
|
95
|
+
async _getOrCreateEncryptionKey(settingsDir) {
|
|
96
|
+
const saltFile = path.join(settingsDir, '.credential-salt');
|
|
97
|
+
let salt;
|
|
98
|
+
|
|
99
|
+
try {
|
|
100
|
+
salt = await fs.readFile(saltFile);
|
|
101
|
+
} catch (error) {
|
|
102
|
+
// Generate new salt
|
|
103
|
+
salt = crypto.randomBytes(SALT_LENGTH);
|
|
104
|
+
await fs.writeFile(saltFile, salt, { mode: 0o600 });
|
|
105
|
+
this.logger?.info('[CredentialVault] Generated new encryption salt');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Derive key from salt + machine-specific data
|
|
109
|
+
const machineData = this._getMachineIdentifier();
|
|
110
|
+
const key = crypto.pbkdf2Sync(
|
|
111
|
+
machineData,
|
|
112
|
+
salt,
|
|
113
|
+
PBKDF2_ITERATIONS,
|
|
114
|
+
KEY_LENGTH,
|
|
115
|
+
'sha256'
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
return key;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Get a machine-specific identifier for key derivation
|
|
123
|
+
* @private
|
|
124
|
+
*/
|
|
125
|
+
_getMachineIdentifier() {
|
|
126
|
+
const parts = [
|
|
127
|
+
os.hostname(),
|
|
128
|
+
os.homedir(),
|
|
129
|
+
os.userInfo().username,
|
|
130
|
+
process.platform,
|
|
131
|
+
'loxia-credential-vault-v1'
|
|
132
|
+
];
|
|
133
|
+
return parts.join(':');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Encrypt data using AES-256-GCM
|
|
138
|
+
* @private
|
|
139
|
+
*/
|
|
140
|
+
_encrypt(plaintext) {
|
|
141
|
+
if (!this.encryptionKey) {
|
|
142
|
+
throw new Error('Encryption key not initialized');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const iv = crypto.randomBytes(IV_LENGTH);
|
|
146
|
+
const cipher = crypto.createCipheriv(ALGORITHM, this.encryptionKey, iv);
|
|
147
|
+
|
|
148
|
+
let encrypted = cipher.update(plaintext, 'utf8', 'base64');
|
|
149
|
+
encrypted += cipher.final('base64');
|
|
150
|
+
|
|
151
|
+
const authTag = cipher.getAuthTag();
|
|
152
|
+
|
|
153
|
+
// Combine IV + authTag + encrypted data
|
|
154
|
+
const combined = Buffer.concat([
|
|
155
|
+
iv,
|
|
156
|
+
authTag,
|
|
157
|
+
Buffer.from(encrypted, 'base64')
|
|
158
|
+
]);
|
|
159
|
+
|
|
160
|
+
return combined.toString('base64');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Decrypt data using AES-256-GCM
|
|
165
|
+
* @private
|
|
166
|
+
*/
|
|
167
|
+
_decrypt(encryptedData) {
|
|
168
|
+
if (!this.encryptionKey) {
|
|
169
|
+
throw new Error('Encryption key not initialized');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const combined = Buffer.from(encryptedData, 'base64');
|
|
173
|
+
|
|
174
|
+
// Extract IV, authTag, and encrypted data
|
|
175
|
+
const iv = combined.subarray(0, IV_LENGTH);
|
|
176
|
+
const authTag = combined.subarray(IV_LENGTH, IV_LENGTH + AUTH_TAG_LENGTH);
|
|
177
|
+
const encrypted = combined.subarray(IV_LENGTH + AUTH_TAG_LENGTH);
|
|
178
|
+
|
|
179
|
+
const decipher = crypto.createDecipheriv(ALGORITHM, this.encryptionKey, iv);
|
|
180
|
+
decipher.setAuthTag(authTag);
|
|
181
|
+
|
|
182
|
+
let decrypted = decipher.update(encrypted.toString('base64'), 'base64', 'utf8');
|
|
183
|
+
decrypted += decipher.final('utf8');
|
|
184
|
+
|
|
185
|
+
return decrypted;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ============================================================
|
|
189
|
+
// Credential Management
|
|
190
|
+
// ============================================================
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Store credentials for a site
|
|
194
|
+
* @param {string} siteId - Site identifier (e.g., 'linkedin', 'github')
|
|
195
|
+
* @param {Object} credentials - Credential data
|
|
196
|
+
* @param {string} credentials.username - Username or email
|
|
197
|
+
* @param {string} credentials.password - Password
|
|
198
|
+
* @param {string} [credentials.loginUrl] - Custom login URL
|
|
199
|
+
* @param {Object} [credentials.selectors] - Custom CSS selectors
|
|
200
|
+
* @returns {Promise<void>}
|
|
201
|
+
*/
|
|
202
|
+
async saveCredentials(siteId, credentials) {
|
|
203
|
+
if (!siteId || !credentials.username || !credentials.password) {
|
|
204
|
+
throw new Error('siteId, username, and password are required');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const normalizedId = siteId.toLowerCase().trim();
|
|
208
|
+
|
|
209
|
+
// Get known site info if available
|
|
210
|
+
const knownSite = KNOWN_SITES[normalizedId];
|
|
211
|
+
|
|
212
|
+
const credentialEntry = {
|
|
213
|
+
siteId: normalizedId,
|
|
214
|
+
name: knownSite?.name || normalizedId,
|
|
215
|
+
username: credentials.username,
|
|
216
|
+
password: credentials.password,
|
|
217
|
+
loginUrl: credentials.loginUrl || knownSite?.loginUrl || null,
|
|
218
|
+
selectors: credentials.selectors || knownSite?.selectors || null,
|
|
219
|
+
usernameType: credentials.usernameType || knownSite?.usernameType || 'email',
|
|
220
|
+
multiStep: credentials.multiStep || knownSite?.multiStep || false,
|
|
221
|
+
createdAt: Date.now(),
|
|
222
|
+
lastUsed: null
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
this.credentials.set(normalizedId, credentialEntry);
|
|
226
|
+
|
|
227
|
+
await this._persistCredentials();
|
|
228
|
+
|
|
229
|
+
this.logger?.info('[CredentialVault] Credentials saved', {
|
|
230
|
+
siteId: normalizedId,
|
|
231
|
+
username: this._maskUsername(credentials.username)
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Get credentials for a site (internal use only - never expose to agent)
|
|
237
|
+
* @param {string} siteId - Site identifier
|
|
238
|
+
* @returns {Object|null} Credential data or null
|
|
239
|
+
*/
|
|
240
|
+
getCredentials(siteId) {
|
|
241
|
+
const normalizedId = siteId.toLowerCase().trim();
|
|
242
|
+
const entry = this.credentials.get(normalizedId);
|
|
243
|
+
|
|
244
|
+
if (entry) {
|
|
245
|
+
// Update last used timestamp
|
|
246
|
+
entry.lastUsed = Date.now();
|
|
247
|
+
this._persistCredentials().catch(() => {}); // Fire and forget
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return entry || null;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Check if credentials exist for a site
|
|
255
|
+
* @param {string} siteId - Site identifier
|
|
256
|
+
* @returns {boolean}
|
|
257
|
+
*/
|
|
258
|
+
hasCredentials(siteId) {
|
|
259
|
+
const normalizedId = siteId.toLowerCase().trim();
|
|
260
|
+
return this.credentials.has(normalizedId);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Delete credentials for a site
|
|
265
|
+
* @param {string} siteId - Site identifier
|
|
266
|
+
* @returns {Promise<boolean>} True if deleted
|
|
267
|
+
*/
|
|
268
|
+
async deleteCredentials(siteId) {
|
|
269
|
+
const normalizedId = siteId.toLowerCase().trim();
|
|
270
|
+
const deleted = this.credentials.delete(normalizedId);
|
|
271
|
+
|
|
272
|
+
if (deleted) {
|
|
273
|
+
await this._persistCredentials();
|
|
274
|
+
// Also delete associated session
|
|
275
|
+
await this.deleteSession(normalizedId);
|
|
276
|
+
this.logger?.info('[CredentialVault] Credentials deleted', { siteId: normalizedId });
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
return deleted;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* List all stored credentials (safe version without passwords)
|
|
284
|
+
* @returns {Array} Array of credential summaries
|
|
285
|
+
*/
|
|
286
|
+
listCredentials() {
|
|
287
|
+
const list = [];
|
|
288
|
+
for (const [siteId, entry] of this.credentials) {
|
|
289
|
+
list.push({
|
|
290
|
+
siteId,
|
|
291
|
+
name: entry.name,
|
|
292
|
+
username: this._maskUsername(entry.username),
|
|
293
|
+
loginUrl: entry.loginUrl,
|
|
294
|
+
createdAt: entry.createdAt,
|
|
295
|
+
lastUsed: entry.lastUsed,
|
|
296
|
+
hasSession: this.sessions.has(siteId)
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return list.sort((a, b) => (b.lastUsed || 0) - (a.lastUsed || 0));
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// ============================================================
|
|
303
|
+
// Session Management
|
|
304
|
+
// ============================================================
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Save authentication session (cookies) for a site
|
|
308
|
+
* @param {string} siteId - Site identifier
|
|
309
|
+
* @param {Array} cookies - Array of cookie objects from Puppeteer
|
|
310
|
+
* @returns {Promise<void>}
|
|
311
|
+
*/
|
|
312
|
+
async saveSession(siteId, cookies) {
|
|
313
|
+
const normalizedId = siteId.toLowerCase().trim();
|
|
314
|
+
|
|
315
|
+
const sessionEntry = {
|
|
316
|
+
siteId: normalizedId,
|
|
317
|
+
cookies,
|
|
318
|
+
savedAt: Date.now(),
|
|
319
|
+
expiresAt: Date.now() + CREDENTIAL_CONFIG.SESSION_EXPIRY_MS
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
this.sessions.set(normalizedId, sessionEntry);
|
|
323
|
+
await this._persistSessions();
|
|
324
|
+
|
|
325
|
+
this.logger?.info('[CredentialVault] Session saved', {
|
|
326
|
+
siteId: normalizedId,
|
|
327
|
+
cookiesCount: cookies.length
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Get session cookies for a site
|
|
333
|
+
* @param {string} siteId - Site identifier
|
|
334
|
+
* @returns {Object|null} Session data or null
|
|
335
|
+
*/
|
|
336
|
+
getSession(siteId) {
|
|
337
|
+
const normalizedId = siteId.toLowerCase().trim();
|
|
338
|
+
const entry = this.sessions.get(normalizedId);
|
|
339
|
+
|
|
340
|
+
if (!entry) return null;
|
|
341
|
+
|
|
342
|
+
// Check if session has expired
|
|
343
|
+
if (Date.now() > entry.expiresAt) {
|
|
344
|
+
this.sessions.delete(normalizedId);
|
|
345
|
+
this._persistSessions().catch(() => {});
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return entry;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Get all stored sessions (for cookie restoration)
|
|
354
|
+
* @returns {Object} Map of siteId -> session data
|
|
355
|
+
*/
|
|
356
|
+
getAllSessions() {
|
|
357
|
+
const result = {};
|
|
358
|
+
const now = Date.now();
|
|
359
|
+
|
|
360
|
+
for (const [siteId, entry] of this.sessions) {
|
|
361
|
+
// Skip expired sessions
|
|
362
|
+
if (now > entry.expiresAt) {
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
result[siteId] = entry;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return result;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Delete session for a site
|
|
373
|
+
* @param {string} siteId - Site identifier
|
|
374
|
+
* @returns {Promise<boolean>}
|
|
375
|
+
*/
|
|
376
|
+
async deleteSession(siteId) {
|
|
377
|
+
const normalizedId = siteId.toLowerCase().trim();
|
|
378
|
+
const deleted = this.sessions.delete(normalizedId);
|
|
379
|
+
|
|
380
|
+
if (deleted) {
|
|
381
|
+
await this._persistSessions();
|
|
382
|
+
this.logger?.info('[CredentialVault] Session deleted', { siteId: normalizedId });
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
return deleted;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Cleanup expired sessions
|
|
390
|
+
* @private
|
|
391
|
+
*/
|
|
392
|
+
_cleanupExpiredSessions() {
|
|
393
|
+
const now = Date.now();
|
|
394
|
+
let cleaned = 0;
|
|
395
|
+
|
|
396
|
+
for (const [siteId, entry] of this.sessions) {
|
|
397
|
+
if (now > entry.expiresAt) {
|
|
398
|
+
this.sessions.delete(siteId);
|
|
399
|
+
cleaned++;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (cleaned > 0) {
|
|
404
|
+
this._persistSessions().catch(() => {});
|
|
405
|
+
this.logger?.info('[CredentialVault] Cleaned up expired sessions', { count: cleaned });
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// ============================================================
|
|
410
|
+
// Async Credential Request Flow
|
|
411
|
+
// ============================================================
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Create a credential request (for UI prompt flow)
|
|
415
|
+
* @param {string} siteId - Site identifier
|
|
416
|
+
* @param {Object} options - Request options
|
|
417
|
+
* @returns {Promise<Object>} Request info for WebSocket
|
|
418
|
+
*/
|
|
419
|
+
createCredentialRequest(siteId, options = {}) {
|
|
420
|
+
const requestId = `cred_${Date.now()}_${crypto.randomBytes(4).toString('hex')}`;
|
|
421
|
+
const normalizedId = siteId.toLowerCase().trim();
|
|
422
|
+
const knownSite = KNOWN_SITES[normalizedId];
|
|
423
|
+
|
|
424
|
+
const createdAt = Date.now();
|
|
425
|
+
const requestInfo = {
|
|
426
|
+
requestId,
|
|
427
|
+
siteId: normalizedId,
|
|
428
|
+
siteName: knownSite?.name || normalizedId,
|
|
429
|
+
loginUrl: options.loginUrl || knownSite?.loginUrl || null,
|
|
430
|
+
fields: options.fields || ['username', 'password'],
|
|
431
|
+
usernameType: knownSite?.usernameType || 'email',
|
|
432
|
+
agentId: options.agentId || null,
|
|
433
|
+
createdAt,
|
|
434
|
+
timeout: createdAt + CREDENTIAL_CONFIG.REQUEST_TIMEOUT_MS // Timestamp when request expires
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
// Create a promise that will be resolved when credentials are submitted
|
|
438
|
+
const promise = new Promise((resolve, reject) => {
|
|
439
|
+
// Set timeout for credential request
|
|
440
|
+
const timeout = setTimeout(() => {
|
|
441
|
+
this.pendingRequests.delete(requestId);
|
|
442
|
+
reject(new Error(`Credential request timed out for ${normalizedId}`));
|
|
443
|
+
}, CREDENTIAL_CONFIG.REQUEST_TIMEOUT_MS);
|
|
444
|
+
|
|
445
|
+
this.pendingRequests.set(requestId, {
|
|
446
|
+
resolve,
|
|
447
|
+
reject,
|
|
448
|
+
timeout,
|
|
449
|
+
requestInfo
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
this.logger?.info('[CredentialVault] Credential request created', {
|
|
454
|
+
requestId,
|
|
455
|
+
siteId: normalizedId
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
return {
|
|
459
|
+
requestInfo,
|
|
460
|
+
promise
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Submit credentials for a pending request
|
|
466
|
+
* @param {string} requestId - Request ID
|
|
467
|
+
* @param {Object} credentials - Submitted credentials
|
|
468
|
+
* @param {boolean} saveForFuture - Whether to save for future use
|
|
469
|
+
* @returns {Promise<void>}
|
|
470
|
+
*/
|
|
471
|
+
async submitCredentials(requestId, credentials, saveForFuture = false) {
|
|
472
|
+
const pending = this.pendingRequests.get(requestId);
|
|
473
|
+
|
|
474
|
+
if (!pending) {
|
|
475
|
+
throw new Error(`No pending credential request found: ${requestId}`);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// Clear timeout
|
|
479
|
+
clearTimeout(pending.timeout);
|
|
480
|
+
this.pendingRequests.delete(requestId);
|
|
481
|
+
|
|
482
|
+
// Save credentials if requested
|
|
483
|
+
if (saveForFuture) {
|
|
484
|
+
await this.saveCredentials(pending.requestInfo.siteId, credentials);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// Resolve the promise with credentials
|
|
488
|
+
pending.resolve({
|
|
489
|
+
credentials,
|
|
490
|
+
siteId: pending.requestInfo.siteId,
|
|
491
|
+
saved: saveForFuture
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
this.logger?.info('[CredentialVault] Credentials submitted', {
|
|
495
|
+
requestId,
|
|
496
|
+
siteId: pending.requestInfo.siteId,
|
|
497
|
+
saved: saveForFuture
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Cancel a pending credential request
|
|
503
|
+
* @param {string} requestId - Request ID
|
|
504
|
+
*/
|
|
505
|
+
cancelCredentialRequest(requestId) {
|
|
506
|
+
const pending = this.pendingRequests.get(requestId);
|
|
507
|
+
|
|
508
|
+
if (pending) {
|
|
509
|
+
clearTimeout(pending.timeout);
|
|
510
|
+
this.pendingRequests.delete(requestId);
|
|
511
|
+
pending.reject(new Error('Credential request cancelled by user'));
|
|
512
|
+
|
|
513
|
+
this.logger?.info('[CredentialVault] Credential request cancelled', { requestId });
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Get pending request info (for status checks)
|
|
519
|
+
* @param {string} requestId - Request ID
|
|
520
|
+
* @returns {Object|null}
|
|
521
|
+
*/
|
|
522
|
+
getPendingRequest(requestId) {
|
|
523
|
+
const pending = this.pendingRequests.get(requestId);
|
|
524
|
+
return pending ? pending.requestInfo : null;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// ============================================================
|
|
528
|
+
// Persistence
|
|
529
|
+
// ============================================================
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Persist credentials to encrypted file
|
|
533
|
+
* @private
|
|
534
|
+
*/
|
|
535
|
+
async _persistCredentials() {
|
|
536
|
+
if (!this.credentialsFile || !this.encryptionKey) return;
|
|
537
|
+
|
|
538
|
+
try {
|
|
539
|
+
const data = {
|
|
540
|
+
version: 1,
|
|
541
|
+
savedAt: new Date().toISOString(),
|
|
542
|
+
credentials: Array.from(this.credentials.entries())
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
const encrypted = this._encrypt(JSON.stringify(data));
|
|
546
|
+
await fs.writeFile(this.credentialsFile, encrypted, { mode: 0o600 });
|
|
547
|
+
} catch (error) {
|
|
548
|
+
this.logger?.warn('[CredentialVault] Failed to persist credentials', {
|
|
549
|
+
error: error.message
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Load credentials from encrypted file
|
|
556
|
+
* @private
|
|
557
|
+
*/
|
|
558
|
+
async _loadCredentials() {
|
|
559
|
+
if (!this.credentialsFile || !this.encryptionKey) return;
|
|
560
|
+
|
|
561
|
+
try {
|
|
562
|
+
const encrypted = await fs.readFile(this.credentialsFile, 'utf8');
|
|
563
|
+
const decrypted = this._decrypt(encrypted);
|
|
564
|
+
const data = JSON.parse(decrypted);
|
|
565
|
+
|
|
566
|
+
if (data.credentials) {
|
|
567
|
+
this.credentials = new Map(data.credentials);
|
|
568
|
+
}
|
|
569
|
+
} catch (error) {
|
|
570
|
+
if (error.code !== 'ENOENT') {
|
|
571
|
+
this.logger?.warn('[CredentialVault] Failed to load credentials', {
|
|
572
|
+
error: error.message
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Persist sessions to encrypted file
|
|
580
|
+
* @private
|
|
581
|
+
*/
|
|
582
|
+
async _persistSessions() {
|
|
583
|
+
if (!this.sessionsFile || !this.encryptionKey) return;
|
|
584
|
+
|
|
585
|
+
try {
|
|
586
|
+
const data = {
|
|
587
|
+
version: 1,
|
|
588
|
+
savedAt: new Date().toISOString(),
|
|
589
|
+
sessions: Array.from(this.sessions.entries())
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
const encrypted = this._encrypt(JSON.stringify(data));
|
|
593
|
+
await fs.writeFile(this.sessionsFile, encrypted, { mode: 0o600 });
|
|
594
|
+
} catch (error) {
|
|
595
|
+
this.logger?.warn('[CredentialVault] Failed to persist sessions', {
|
|
596
|
+
error: error.message
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Load sessions from encrypted file
|
|
603
|
+
* @private
|
|
604
|
+
*/
|
|
605
|
+
async _loadSessions() {
|
|
606
|
+
if (!this.sessionsFile || !this.encryptionKey) return;
|
|
607
|
+
|
|
608
|
+
try {
|
|
609
|
+
const encrypted = await fs.readFile(this.sessionsFile, 'utf8');
|
|
610
|
+
const decrypted = this._decrypt(encrypted);
|
|
611
|
+
const data = JSON.parse(decrypted);
|
|
612
|
+
|
|
613
|
+
if (data.sessions) {
|
|
614
|
+
this.sessions = new Map(data.sessions);
|
|
615
|
+
}
|
|
616
|
+
} catch (error) {
|
|
617
|
+
if (error.code !== 'ENOENT') {
|
|
618
|
+
this.logger?.warn('[CredentialVault] Failed to load sessions', {
|
|
619
|
+
error: error.message
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
// ============================================================
|
|
626
|
+
// Helpers
|
|
627
|
+
// ============================================================
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Mask username for logging (show only first/last chars)
|
|
631
|
+
* @private
|
|
632
|
+
*/
|
|
633
|
+
_maskUsername(username) {
|
|
634
|
+
if (!username || username.length < 4) return '***';
|
|
635
|
+
return username[0] + '***' + username.slice(-2);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Get known site configuration
|
|
640
|
+
* @param {string} siteId - Site identifier
|
|
641
|
+
* @returns {Object|null}
|
|
642
|
+
*/
|
|
643
|
+
getKnownSite(siteId) {
|
|
644
|
+
const normalizedId = siteId.toLowerCase().trim();
|
|
645
|
+
return KNOWN_SITES[normalizedId] || null;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* List all known sites
|
|
650
|
+
* @returns {Array}
|
|
651
|
+
*/
|
|
652
|
+
listKnownSites() {
|
|
653
|
+
return Object.entries(KNOWN_SITES).map(([id, config]) => ({
|
|
654
|
+
siteId: id,
|
|
655
|
+
name: config.name,
|
|
656
|
+
loginUrl: config.loginUrl,
|
|
657
|
+
hasCredentials: this.hasCredentials(id)
|
|
658
|
+
}));
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Get credential event types (for WebSocket integration)
|
|
663
|
+
* @returns {Object}
|
|
664
|
+
*/
|
|
665
|
+
static getEventTypes() {
|
|
666
|
+
return CREDENTIAL_EVENTS;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
// Singleton instance
|
|
671
|
+
let vaultInstance = null;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Get or create the credential vault instance
|
|
675
|
+
* @param {Object} logger - Logger instance
|
|
676
|
+
* @returns {CredentialVault}
|
|
677
|
+
*/
|
|
678
|
+
export function getCredentialVault(logger = null) {
|
|
679
|
+
if (!vaultInstance) {
|
|
680
|
+
vaultInstance = new CredentialVault(logger);
|
|
681
|
+
}
|
|
682
|
+
return vaultInstance;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
export default CredentialVault;
|