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,457 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WhatsApp Tool - Allows agents to access and process WhatsApp data
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* - Read messages from allowed chats/groups
|
|
6
|
+
* - Search across conversations
|
|
7
|
+
* - Download and analyze media/files
|
|
8
|
+
* - Get chat info and participant lists
|
|
9
|
+
* - Filter by date ranges, keywords, media types
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { BaseTool } from './baseTool.js';
|
|
13
|
+
|
|
14
|
+
class WhatsAppTool extends BaseTool {
|
|
15
|
+
constructor(config = {}, logger = null) {
|
|
16
|
+
super(config, logger);
|
|
17
|
+
this.requiresProject = false;
|
|
18
|
+
this.isAsync = false;
|
|
19
|
+
this.timeout = config.timeout || 60000;
|
|
20
|
+
|
|
21
|
+
// Injected dependency
|
|
22
|
+
this.whatsappService = null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Set the WhatsApp service reference
|
|
27
|
+
*/
|
|
28
|
+
setWhatsAppService(service) {
|
|
29
|
+
this.whatsappService = service;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getDescription() {
|
|
33
|
+
return `WhatsApp Tool: Access and process data from linked WhatsApp chats and groups.
|
|
34
|
+
|
|
35
|
+
## USAGE
|
|
36
|
+
|
|
37
|
+
Read messages from a chat (by name):
|
|
38
|
+
\`\`\`json
|
|
39
|
+
{
|
|
40
|
+
"toolId": "whatsapp",
|
|
41
|
+
"parameters": {
|
|
42
|
+
"action": "get-messages",
|
|
43
|
+
"chatId": "Work Group",
|
|
44
|
+
"limit": 30,
|
|
45
|
+
"after": "2025-01-01",
|
|
46
|
+
"before": "2025-03-01",
|
|
47
|
+
"searchTerm": "meeting notes"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
\`\`\`
|
|
51
|
+
|
|
52
|
+
Search across specific chats (by name or ID):
|
|
53
|
+
\`\`\`json
|
|
54
|
+
{
|
|
55
|
+
"toolId": "whatsapp",
|
|
56
|
+
"parameters": {
|
|
57
|
+
"action": "search",
|
|
58
|
+
"searchTerm": "project deadline",
|
|
59
|
+
"chatIds": ["Work Group", "Alice"],
|
|
60
|
+
"limit": 20,
|
|
61
|
+
"after": "2025-02-01"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
\`\`\`
|
|
65
|
+
|
|
66
|
+
List available chats (with optional filtering and pagination):
|
|
67
|
+
\`\`\`json
|
|
68
|
+
{
|
|
69
|
+
"toolId": "whatsapp",
|
|
70
|
+
"parameters": {
|
|
71
|
+
"action": "list-chats",
|
|
72
|
+
"filter": "work",
|
|
73
|
+
"type": "group",
|
|
74
|
+
"page": 1,
|
|
75
|
+
"pageSize": 20,
|
|
76
|
+
"unreadOnly": false
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
\`\`\`
|
|
80
|
+
|
|
81
|
+
Get chat info (participants, description):
|
|
82
|
+
\`\`\`json
|
|
83
|
+
{
|
|
84
|
+
"toolId": "whatsapp",
|
|
85
|
+
"parameters": {
|
|
86
|
+
"action": "chat-info",
|
|
87
|
+
"chatId": "Family Group"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
Download media from a message:
|
|
93
|
+
\`\`\`json
|
|
94
|
+
{
|
|
95
|
+
"toolId": "whatsapp",
|
|
96
|
+
"parameters": {
|
|
97
|
+
"action": "get-media",
|
|
98
|
+
"chatId": "Work Group",
|
|
99
|
+
"messageId": "true_1234567890@g.us_ABCDEF"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
\`\`\`
|
|
103
|
+
|
|
104
|
+
Check connection status:
|
|
105
|
+
\`\`\`json
|
|
106
|
+
{
|
|
107
|
+
"toolId": "whatsapp",
|
|
108
|
+
"parameters": {
|
|
109
|
+
"action": "status"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
\`\`\`
|
|
113
|
+
|
|
114
|
+
## PARAMETERS
|
|
115
|
+
|
|
116
|
+
- **action** (required): One of: \`list-chats\`, \`get-messages\`, \`search\`, \`chat-info\`, \`get-media\`, \`status\`
|
|
117
|
+
- **chatId**: Chat/group name or ID (required for get-messages, chat-info, get-media). You can use the human-readable name (e.g. "Work Group") — it will be resolved automatically. If multiple chats match, you'll get suggestions.
|
|
118
|
+
- **messageId**: Message ID (required for get-media)
|
|
119
|
+
- **searchTerm**: Text to search for (required for search, optional for get-messages)
|
|
120
|
+
- **chatIds**: Array of chat names or IDs to search in (optional for search — defaults to all allowed)
|
|
121
|
+
- **filter**: Filter chat list by name substring (for list-chats)
|
|
122
|
+
- **type**: Filter chat list by type: \`"group"\`, \`"individual"\`, or \`"all"\` (default, for list-chats)
|
|
123
|
+
- **page**: Page number for paginated results, 1-based (default: 1, for list-chats)
|
|
124
|
+
- **pageSize**: Number of chats per page (default: 20, for list-chats)
|
|
125
|
+
- **unreadOnly**: Only show chats with unread messages (default: false, for list-chats)
|
|
126
|
+
- **limit**: Max messages to return (default: 50, for get-messages/search)
|
|
127
|
+
- **before**: ISO date string — only messages before this date
|
|
128
|
+
- **after**: ISO date string — only messages after this date
|
|
129
|
+
|
|
130
|
+
## RECOMMENDED WORKFLOWS
|
|
131
|
+
|
|
132
|
+
**Finding a chat by topic or name:**
|
|
133
|
+
1. Use \`list-chats\` with \`filter\` to search by name substring: \`"filter": "project"\` finds all chats with "project" in the name
|
|
134
|
+
2. Use \`type: "group"\` or \`type: "individual"\` to narrow down
|
|
135
|
+
3. If the user mentions a chat by name, you can skip list-chats and use the name directly as \`chatId\`
|
|
136
|
+
|
|
137
|
+
**Reading a conversation:**
|
|
138
|
+
1. Use \`get-messages\` with the chat name directly: \`"chatId": "Work Group"\`
|
|
139
|
+
2. Use \`after\`/\`before\` to focus on a time window (e.g., last week, a specific date)
|
|
140
|
+
3. Use \`searchTerm\` to filter messages containing specific text within that chat
|
|
141
|
+
4. The response includes a \`mediaSummary\` — check it to know if there are files/images to inspect
|
|
142
|
+
|
|
143
|
+
**Searching across chats:**
|
|
144
|
+
1. Use \`search\` with \`searchTerm\` to find messages across all allowed chats
|
|
145
|
+
2. Narrow with \`chatIds\` (names work) and date filters to reduce noise
|
|
146
|
+
3. Results are grouped by chat for easy scanning
|
|
147
|
+
|
|
148
|
+
**Analyzing shared files and media:**
|
|
149
|
+
1. Messages with \`hasMedia: true\` include \`mediaType\`, \`mimetype\`, and optionally \`fileName\`
|
|
150
|
+
2. Use \`get-media\` with the message's \`id\` to download the file
|
|
151
|
+
3. The downloaded file path is returned — use the \`filesystem\` tool to read documents, or other tools (pdf, doc, spreadsheet) to parse them
|
|
152
|
+
4. Images can be described by reading the file path
|
|
153
|
+
|
|
154
|
+
**Browsing many chats:**
|
|
155
|
+
1. Use \`list-chats\` with pagination: start with page 1, check \`pagination.hasMore\`
|
|
156
|
+
2. Use \`pageSize\` to control batch size (default 20)
|
|
157
|
+
3. Use \`unreadOnly: true\` to focus on active conversations
|
|
158
|
+
4. Combine filters: \`type: "group"\` + \`filter: "team"\` + \`page: 2\`
|
|
159
|
+
|
|
160
|
+
## NOTES
|
|
161
|
+
|
|
162
|
+
- **You can use chat names directly** — no need to look up IDs first. E.g. \`"chatId": "Work Group"\` works. Partial names resolve if unique.
|
|
163
|
+
- If a name matches multiple chats, you'll get an error listing the matches — use a more specific name or the exact ID.
|
|
164
|
+
- Only chats granted access by the user in Settings are available. If you get an access denied error, ask the user to grant access.
|
|
165
|
+
- If no access restrictions are set, all chats are accessible.
|
|
166
|
+
- Media files are downloaded to a temp directory — use the returned \`filePath\` with other tools (filesystem, pdf, doc, spreadsheet) to read/analyze them.
|
|
167
|
+
- Message types include: \`chat\`, \`image\`, \`video\`, \`audio\`, \`document\`, \`sticker\`, \`vcard\`, \`location\`.
|
|
168
|
+
- For large searches, prefer narrowing by \`chatIds\` and date range to avoid slow responses.
|
|
169
|
+
- Always check \`status\` first if unsure whether WhatsApp is connected.
|
|
170
|
+
- The WhatsApp account must be linked by the user via Settings before this tool works.`;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
getSupportedActions() {
|
|
174
|
+
return ['list-chats', 'get-messages', 'search', 'chat-info', 'get-media', 'status'];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
getRequiredParameters() {
|
|
178
|
+
return ['action'];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
getParameterSchema() {
|
|
182
|
+
return {
|
|
183
|
+
type: 'object',
|
|
184
|
+
properties: {
|
|
185
|
+
action: { type: 'string', enum: ['list-chats', 'get-messages', 'search', 'chat-info', 'get-media', 'status'] },
|
|
186
|
+
chatId: { type: 'string' },
|
|
187
|
+
messageId: { type: 'string' },
|
|
188
|
+
searchTerm: { type: 'string' },
|
|
189
|
+
chatIds: { type: 'array', items: { type: 'string' } },
|
|
190
|
+
filter: { type: 'string' },
|
|
191
|
+
type: { type: 'string', enum: ['all', 'group', 'individual'] },
|
|
192
|
+
page: { type: 'number' },
|
|
193
|
+
pageSize: { type: 'number' },
|
|
194
|
+
unreadOnly: { type: 'boolean' },
|
|
195
|
+
limit: { type: 'number' },
|
|
196
|
+
before: { type: 'string' },
|
|
197
|
+
after: { type: 'string' }
|
|
198
|
+
},
|
|
199
|
+
required: ['action']
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
customValidateParameters(params) {
|
|
204
|
+
const { action, chatId, messageId, searchTerm } = params;
|
|
205
|
+
const errors = [];
|
|
206
|
+
|
|
207
|
+
const needsChat = ['get-messages', 'chat-info', 'get-media'];
|
|
208
|
+
if (needsChat.includes(action) && !chatId) {
|
|
209
|
+
errors.push(`chatId is required for action "${action}"`);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (action === 'get-media' && !messageId) {
|
|
213
|
+
errors.push('messageId is required for action "get-media"');
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (action === 'search' && !searchTerm) {
|
|
217
|
+
errors.push('searchTerm is required for action "search"');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (params.limit != null && (params.limit < 1 || params.limit > 500)) {
|
|
221
|
+
errors.push('limit must be between 1 and 500');
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return errors.length > 0
|
|
225
|
+
? { valid: false, error: errors.join('; ') }
|
|
226
|
+
: { valid: true };
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
parseParameters(content) {
|
|
230
|
+
try {
|
|
231
|
+
if (typeof content === 'string' && content.trim().startsWith('{')) {
|
|
232
|
+
const parsed = JSON.parse(content);
|
|
233
|
+
return parsed.parameters || parsed;
|
|
234
|
+
}
|
|
235
|
+
if (typeof content === 'object') {
|
|
236
|
+
return content.parameters || content;
|
|
237
|
+
}
|
|
238
|
+
return { action: 'status' };
|
|
239
|
+
} catch (error) {
|
|
240
|
+
return { action: 'status', parseError: error.message };
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
async execute(params, context) {
|
|
245
|
+
// Unwrap TagParser objects
|
|
246
|
+
const unwrapped = {};
|
|
247
|
+
for (const [key, value] of Object.entries(params)) {
|
|
248
|
+
if (value && typeof value === 'object' && 'value' in value && !Array.isArray(value)) {
|
|
249
|
+
unwrapped[key] = value.value;
|
|
250
|
+
} else {
|
|
251
|
+
unwrapped[key] = value;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
params = unwrapped;
|
|
255
|
+
|
|
256
|
+
if (!this.whatsappService) {
|
|
257
|
+
return {
|
|
258
|
+
success: false,
|
|
259
|
+
error: 'WhatsApp service is not available. The system may not have whatsapp-web.js installed.',
|
|
260
|
+
guidance: 'Ask the user to install whatsapp-web.js: npm install whatsapp-web.js'
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
const { action } = params;
|
|
265
|
+
|
|
266
|
+
try {
|
|
267
|
+
switch (action) {
|
|
268
|
+
case 'status':
|
|
269
|
+
return this._handleStatus();
|
|
270
|
+
|
|
271
|
+
case 'list-chats':
|
|
272
|
+
return await this._handleListChats(params);
|
|
273
|
+
|
|
274
|
+
case 'get-messages':
|
|
275
|
+
return await this._handleGetMessages(params);
|
|
276
|
+
|
|
277
|
+
case 'search':
|
|
278
|
+
return await this._handleSearch(params);
|
|
279
|
+
|
|
280
|
+
case 'chat-info':
|
|
281
|
+
return await this._handleChatInfo(params);
|
|
282
|
+
|
|
283
|
+
case 'get-media':
|
|
284
|
+
return await this._handleGetMedia(params);
|
|
285
|
+
|
|
286
|
+
default:
|
|
287
|
+
return {
|
|
288
|
+
success: false,
|
|
289
|
+
error: `Unknown action: ${action}`,
|
|
290
|
+
guidance: 'Supported actions: list-chats, get-messages, search, chat-info, get-media, status'
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
} catch (error) {
|
|
294
|
+
let suggestion = null;
|
|
295
|
+
if (error.message.includes('not connected')) {
|
|
296
|
+
suggestion = 'The WhatsApp account is not linked. Ask the user to connect via Settings > WhatsApp.';
|
|
297
|
+
} else if (error.message.includes('Access denied')) {
|
|
298
|
+
suggestion = 'This chat is not in the allowed list. Ask the user to grant access in Settings > WhatsApp.';
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return {
|
|
302
|
+
success: false,
|
|
303
|
+
action,
|
|
304
|
+
error: error.message,
|
|
305
|
+
...(suggestion && { suggestion })
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// ========================
|
|
311
|
+
// Action handlers
|
|
312
|
+
// ========================
|
|
313
|
+
|
|
314
|
+
_handleStatus() {
|
|
315
|
+
const status = this.whatsappService.getStatus();
|
|
316
|
+
return {
|
|
317
|
+
success: true,
|
|
318
|
+
action: 'status',
|
|
319
|
+
...status,
|
|
320
|
+
guidance: status.connected
|
|
321
|
+
? 'WhatsApp is connected and ready. Use list-chats to see available conversations.'
|
|
322
|
+
: 'WhatsApp is not connected. Ask the user to link their account in Settings > WhatsApp.'
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
async _handleListChats(params = {}) {
|
|
327
|
+
const { filter, type, page, pageSize, unreadOnly } = params;
|
|
328
|
+
|
|
329
|
+
const result = await this.whatsappService.listChats({
|
|
330
|
+
filter,
|
|
331
|
+
type: type || 'all',
|
|
332
|
+
page: page || 1,
|
|
333
|
+
pageSize: pageSize || 20,
|
|
334
|
+
unreadOnly: unreadOnly || false
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
const { chats, pagination } = result;
|
|
338
|
+
const allowed = chats.filter(c => c.allowed);
|
|
339
|
+
const restricted = chats.filter(c => !c.allowed);
|
|
340
|
+
|
|
341
|
+
let guidance;
|
|
342
|
+
if (allowed.length === 0 && pagination.totalChats === 0) {
|
|
343
|
+
guidance = filter
|
|
344
|
+
? `No chats match "${filter}". Try a different filter or remove it to see all chats.`
|
|
345
|
+
: 'No accessible chats found. The user may need to grant access in Settings > WhatsApp.';
|
|
346
|
+
} else {
|
|
347
|
+
const parts = [`Showing ${allowed.length} chat(s)`];
|
|
348
|
+
if (pagination.totalPages > 1) {
|
|
349
|
+
parts.push(`(page ${pagination.page}/${pagination.totalPages})`);
|
|
350
|
+
}
|
|
351
|
+
parts.push('— use get-messages with a chat name to read messages.');
|
|
352
|
+
if (pagination.hasMore) {
|
|
353
|
+
parts.push(`Use page: ${pagination.page + 1} to see more.`);
|
|
354
|
+
}
|
|
355
|
+
guidance = parts.join(' ');
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
return {
|
|
359
|
+
success: true,
|
|
360
|
+
action: 'list-chats',
|
|
361
|
+
totalChats: pagination.totalChats,
|
|
362
|
+
accessibleChats: allowed.length,
|
|
363
|
+
restrictedChats: restricted.length,
|
|
364
|
+
chats: allowed,
|
|
365
|
+
pagination,
|
|
366
|
+
guidance
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
async _handleGetMessages(params) {
|
|
371
|
+
const { chatId, limit, before, after, searchTerm } = params;
|
|
372
|
+
|
|
373
|
+
const result = await this.whatsappService.getMessages(chatId, {
|
|
374
|
+
limit: limit || 50,
|
|
375
|
+
before,
|
|
376
|
+
after,
|
|
377
|
+
searchTerm
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
// Summarize media in messages
|
|
381
|
+
const mediaMessages = result.messages.filter(m => m.hasMedia);
|
|
382
|
+
const mediaTypes = {};
|
|
383
|
+
mediaMessages.forEach(m => {
|
|
384
|
+
const type = m.mediaType || 'unknown';
|
|
385
|
+
mediaTypes[type] = (mediaTypes[type] || 0) + 1;
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
return {
|
|
389
|
+
success: true,
|
|
390
|
+
action: 'get-messages',
|
|
391
|
+
chatId,
|
|
392
|
+
chatName: result.chatName,
|
|
393
|
+
messageCount: result.messageCount,
|
|
394
|
+
messages: result.messages,
|
|
395
|
+
mediaSummary: {
|
|
396
|
+
totalMedia: mediaMessages.length,
|
|
397
|
+
byType: mediaTypes
|
|
398
|
+
},
|
|
399
|
+
guidance: mediaMessages.length > 0
|
|
400
|
+
? `Found ${mediaMessages.length} media messages. Use get-media with the message ID to download and analyze them.`
|
|
401
|
+
: `Retrieved ${result.messageCount} messages from "${result.chatName}".`
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
async _handleSearch(params) {
|
|
406
|
+
const { searchTerm, chatIds, limit, before, after } = params;
|
|
407
|
+
|
|
408
|
+
const result = await this.whatsappService.searchMessages(searchTerm, {
|
|
409
|
+
chatIds,
|
|
410
|
+
limit: limit || 30,
|
|
411
|
+
before,
|
|
412
|
+
after
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
return {
|
|
416
|
+
success: true,
|
|
417
|
+
action: 'search',
|
|
418
|
+
searchTerm,
|
|
419
|
+
totalMatches: result.totalMatches,
|
|
420
|
+
chatsSearched: result.chatsSearched,
|
|
421
|
+
results: result.results,
|
|
422
|
+
guidance: result.totalMatches > 0
|
|
423
|
+
? `Found ${result.totalMatches} matches across ${result.results.length} chats. Narrow with date ranges or specific chatIds for better results.`
|
|
424
|
+
: `No matches found for "${searchTerm}". Try broader terms or different date ranges.`
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
async _handleChatInfo(params) {
|
|
429
|
+
const { chatId } = params;
|
|
430
|
+
const info = await this.whatsappService.getChatInfo(chatId);
|
|
431
|
+
|
|
432
|
+
return {
|
|
433
|
+
success: true,
|
|
434
|
+
action: 'chat-info',
|
|
435
|
+
...info,
|
|
436
|
+
guidance: info.isGroup
|
|
437
|
+
? `Group "${info.name}" has ${info.participantCount} participants. Use get-messages to read the conversation.`
|
|
438
|
+
: `Individual chat with "${info.name}". Use get-messages to read messages.`
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
async _handleGetMedia(params) {
|
|
443
|
+
const { chatId, messageId } = params;
|
|
444
|
+
const media = await this.whatsappService.getMedia(chatId, messageId);
|
|
445
|
+
|
|
446
|
+
return {
|
|
447
|
+
success: true,
|
|
448
|
+
action: 'get-media',
|
|
449
|
+
chatId,
|
|
450
|
+
messageId,
|
|
451
|
+
...media,
|
|
452
|
+
guidance: `Media downloaded to ${media.filePath}. You can use the filesystem tool to read/process this file.`
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export default WhatsAppTool;
|