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,630 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message State Management Hook
|
|
3
|
+
* React hook for managing chat messages - sending, receiving, history, and pagination
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { useState, useEffect, useCallback, useRef, useMemo } from 'react';
|
|
7
|
+
import { debugLog } from '../utils/debugLogger.js';
|
|
8
|
+
import {
|
|
9
|
+
MESSAGE_CONFIG,
|
|
10
|
+
PAGINATION,
|
|
11
|
+
MESSAGE_ROLE,
|
|
12
|
+
WS_MESSAGE_TYPE,
|
|
13
|
+
} from '../config/constants.js';
|
|
14
|
+
|
|
15
|
+
// Funny thinking phrases for loading animation
|
|
16
|
+
const THINKING_PHRASES = [
|
|
17
|
+
'Pondering deeply...',
|
|
18
|
+
'Consulting the oracle...',
|
|
19
|
+
'Summoning wisdom...',
|
|
20
|
+
'Brewing thoughts...',
|
|
21
|
+
'Channeling brilliance...',
|
|
22
|
+
'Contemplating existence...',
|
|
23
|
+
'Computing the answer to life...',
|
|
24
|
+
'Thinking really hard...',
|
|
25
|
+
'Engaging neural networks...',
|
|
26
|
+
'Processing cosmic data...',
|
|
27
|
+
'Calibrating response generators...',
|
|
28
|
+
'Warming up the brain cells...',
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Message state management hook
|
|
33
|
+
* Manages message list, sending, receiving, history, and pagination
|
|
34
|
+
*/
|
|
35
|
+
export function useMessages(sessionManager, messageRouter, currentAgentId) {
|
|
36
|
+
// Message state
|
|
37
|
+
const [messages, setMessages] = useState([]);
|
|
38
|
+
const [loading, setLoading] = useState(false);
|
|
39
|
+
const [sending, setSending] = useState(false);
|
|
40
|
+
const [error, setError] = useState(null);
|
|
41
|
+
|
|
42
|
+
// Pagination state
|
|
43
|
+
const [hasMore, setHasMore] = useState(false);
|
|
44
|
+
const [currentPage, setCurrentPage] = useState(0);
|
|
45
|
+
const [totalMessages, setTotalMessages] = useState(0);
|
|
46
|
+
|
|
47
|
+
// Message cache (per agent)
|
|
48
|
+
const messageCache = useRef(new Map());
|
|
49
|
+
|
|
50
|
+
// Current input text
|
|
51
|
+
const [inputText, setInputText] = useState('');
|
|
52
|
+
|
|
53
|
+
// Thinking animation state
|
|
54
|
+
const [thinkingPhraseIndex, setThinkingPhraseIndex] = useState(0);
|
|
55
|
+
const thinkingIntervalRef = useRef(null);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Start thinking animation
|
|
59
|
+
*/
|
|
60
|
+
const startThinkingAnimation = useCallback(() => {
|
|
61
|
+
// Pick a random starting phrase
|
|
62
|
+
const randomIndex = Math.floor(Math.random() * THINKING_PHRASES.length);
|
|
63
|
+
setThinkingPhraseIndex(randomIndex);
|
|
64
|
+
|
|
65
|
+
// Clear any existing interval
|
|
66
|
+
if (thinkingIntervalRef.current) {
|
|
67
|
+
clearInterval(thinkingIntervalRef.current);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Cycle through phrases every 2 seconds
|
|
71
|
+
thinkingIntervalRef.current = setInterval(() => {
|
|
72
|
+
setThinkingPhraseIndex(prev => (prev + 1) % THINKING_PHRASES.length);
|
|
73
|
+
}, 2000);
|
|
74
|
+
}, []);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Stop thinking animation
|
|
78
|
+
*/
|
|
79
|
+
const stopThinkingAnimation = useCallback(() => {
|
|
80
|
+
if (thinkingIntervalRef.current) {
|
|
81
|
+
clearInterval(thinkingIntervalRef.current);
|
|
82
|
+
thinkingIntervalRef.current = null;
|
|
83
|
+
}
|
|
84
|
+
}, []);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Get messages for current agent from cache
|
|
88
|
+
*/
|
|
89
|
+
const getCachedMessages = useCallback(() => {
|
|
90
|
+
if (!currentAgentId) return [];
|
|
91
|
+
return messageCache.current.get(currentAgentId) || [];
|
|
92
|
+
}, [currentAgentId]);
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Update cache for current agent
|
|
96
|
+
*/
|
|
97
|
+
const updateCache = useCallback((newMessages) => {
|
|
98
|
+
if (!currentAgentId) return;
|
|
99
|
+
messageCache.current.set(currentAgentId, newMessages);
|
|
100
|
+
}, [currentAgentId]);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Fetch message history for current agent
|
|
104
|
+
*/
|
|
105
|
+
const fetchMessages = useCallback(async (options = {}) => {
|
|
106
|
+
debugLog('useMessages fetchMessages', 'Called with options:', options);
|
|
107
|
+
|
|
108
|
+
if (!sessionManager?.isValid() || !currentAgentId) {
|
|
109
|
+
debugLog('useMessages fetchMessages', 'FAILED: Invalid session or no agent');
|
|
110
|
+
return { success: false, error: 'Invalid session or no agent selected' };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const {
|
|
114
|
+
page = 0,
|
|
115
|
+
limit = PAGINATION.PAGE_SIZE,
|
|
116
|
+
append = false,
|
|
117
|
+
} = options;
|
|
118
|
+
|
|
119
|
+
debugLog('useMessages fetchMessages', `Starting fetch - page: ${page}, limit: ${limit}, append: ${append}`);
|
|
120
|
+
setLoading(true);
|
|
121
|
+
setError(null);
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
debugLog('useMessages fetchMessages', 'Making API request to orchestrator...');
|
|
125
|
+
|
|
126
|
+
// Request messages via orchestrator
|
|
127
|
+
const response = await sessionManager.makeRequest('POST', '/api/orchestrator', {
|
|
128
|
+
action: 'get_agent_conversations',
|
|
129
|
+
payload: {
|
|
130
|
+
agentId: currentAgentId,
|
|
131
|
+
offset: page * limit,
|
|
132
|
+
limit,
|
|
133
|
+
},
|
|
134
|
+
sessionId: sessionManager.getSessionId(),
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
debugLog('useMessages fetchMessages', 'API response received:', {
|
|
138
|
+
success: response.success,
|
|
139
|
+
hasData: !!response.data,
|
|
140
|
+
hasConversations: !!(response.data?.conversations || response.conversations),
|
|
141
|
+
error: response.error
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
if (response.success) {
|
|
145
|
+
// Extract messages from conversations structure (can be in response.data or response directly)
|
|
146
|
+
const responseData = response.data || response;
|
|
147
|
+
const conversations = responseData.conversations || {};
|
|
148
|
+
const fullConversation = conversations.full || {};
|
|
149
|
+
const allMessages = fullConversation.messages || [];
|
|
150
|
+
|
|
151
|
+
debugLog('useMessages fetchMessages', `Extracted ${allMessages.length} messages from response`);
|
|
152
|
+
|
|
153
|
+
// Apply pagination manually since orchestrator returns full conversation
|
|
154
|
+
const startIndex = page * limit;
|
|
155
|
+
const endIndex = startIndex + limit;
|
|
156
|
+
const newMessages = allMessages.slice(startIndex, endIndex);
|
|
157
|
+
|
|
158
|
+
debugLog('useMessages fetchMessages', `After pagination: showing ${newMessages.length} messages (${startIndex} to ${endIndex})`);
|
|
159
|
+
|
|
160
|
+
if (append) {
|
|
161
|
+
// Append to existing messages (pagination) - use functional setState
|
|
162
|
+
setMessages(prev => {
|
|
163
|
+
const combined = [...prev, ...newMessages];
|
|
164
|
+
updateCache(combined);
|
|
165
|
+
debugLog('useMessages fetchMessages', `Appended messages, total: ${combined.length}`);
|
|
166
|
+
return combined;
|
|
167
|
+
});
|
|
168
|
+
} else {
|
|
169
|
+
// Replace messages (initial load)
|
|
170
|
+
setMessages(newMessages);
|
|
171
|
+
updateCache(newMessages);
|
|
172
|
+
debugLog('useMessages fetchMessages', `Replaced messages, total: ${newMessages.length}`);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
setTotalMessages(allMessages.length);
|
|
176
|
+
setHasMore(endIndex < allMessages.length);
|
|
177
|
+
setCurrentPage(page);
|
|
178
|
+
|
|
179
|
+
debugLog('useMessages fetchMessages', 'Fetch complete - SUCCESS');
|
|
180
|
+
return { success: true, messages: newMessages };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const errorMsg = response.error || 'Failed to fetch messages';
|
|
184
|
+
debugLog('useMessages fetchMessages', 'Fetch FAILED:', errorMsg);
|
|
185
|
+
throw new Error(errorMsg);
|
|
186
|
+
} catch (err) {
|
|
187
|
+
debugLog('useMessages fetchMessages', 'Exception caught:', err.message);
|
|
188
|
+
debugLog('useMessages fetchMessages', 'Full error:', err.stack);
|
|
189
|
+
setError(err.message);
|
|
190
|
+
return { success: false, error: err.message };
|
|
191
|
+
} finally {
|
|
192
|
+
setLoading(false);
|
|
193
|
+
debugLog('useMessages fetchMessages', 'Fetch complete (finally block)');
|
|
194
|
+
}
|
|
195
|
+
}, [sessionManager, currentAgentId, updateCache]);
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Send a message to the current agent
|
|
199
|
+
*/
|
|
200
|
+
const sendMessage = useCallback(async (content, options = {}) => {
|
|
201
|
+
// DEBUG: Log received parameters
|
|
202
|
+
debugLog('useMessages sendMessage', ' Called with content:', JSON.stringify(content));
|
|
203
|
+
debugLog('useMessages sendMessage', ' content type:', typeof content);
|
|
204
|
+
debugLog('useMessages sendMessage', ' options:', JSON.stringify(options));
|
|
205
|
+
|
|
206
|
+
if (!sessionManager?.isValid() || !currentAgentId) {
|
|
207
|
+
debugLog('useMessages sendMessage', ' VALIDATION FAILED: Invalid session or no agent');
|
|
208
|
+
throw new Error('Invalid session or no agent selected');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (!content || content.trim().length === 0) {
|
|
212
|
+
debugLog('useMessages sendMessage', ' VALIDATION FAILED: Empty content');
|
|
213
|
+
debugLog('useMessages sendMessage', ' !content:', !content);
|
|
214
|
+
debugLog('useMessages sendMessage', ' trim length:', typeof content === 'string' ? content.trim().length : 'N/A');
|
|
215
|
+
throw new Error('Message content cannot be empty');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (content.length > MESSAGE_CONFIG.MAX_MESSAGE_LENGTH) {
|
|
219
|
+
debugLog('useMessages sendMessage', ' VALIDATION FAILED: Content too long');
|
|
220
|
+
throw new Error(`Message too long (max ${MESSAGE_CONFIG.MAX_MESSAGE_LENGTH} characters)`);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
debugLog('useMessages sendMessage', ' All validations PASSED');
|
|
224
|
+
|
|
225
|
+
setSending(true);
|
|
226
|
+
setError(null);
|
|
227
|
+
|
|
228
|
+
try {
|
|
229
|
+
const {
|
|
230
|
+
role = MESSAGE_ROLE.USER,
|
|
231
|
+
attachments = [],
|
|
232
|
+
} = options;
|
|
233
|
+
|
|
234
|
+
debugLog('useMessages sendMessage', ' Prepared payload - agentId:', currentAgentId, 'content:', JSON.stringify(content), 'role:', role);
|
|
235
|
+
|
|
236
|
+
// Send message via orchestrator
|
|
237
|
+
const response = await sessionManager.makeRequest('POST', '/api/orchestrator', {
|
|
238
|
+
action: 'send_message',
|
|
239
|
+
payload: {
|
|
240
|
+
agentId: currentAgentId,
|
|
241
|
+
message: content, // Backend expects 'message' not 'content'
|
|
242
|
+
role,
|
|
243
|
+
attachments,
|
|
244
|
+
},
|
|
245
|
+
sessionId: sessionManager.getSessionId(),
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
debugLog('useMessages sendMessage', ' API response:', response.success ? 'SUCCESS' : 'FAILED');
|
|
249
|
+
|
|
250
|
+
if (response.success) {
|
|
251
|
+
// Clear input
|
|
252
|
+
setInputText('');
|
|
253
|
+
|
|
254
|
+
// OPTIMISTIC UPDATE: Add user message to UI immediately
|
|
255
|
+
// Backend doesn't broadcast user messages via WebSocket, only assistant responses
|
|
256
|
+
const userMessage = {
|
|
257
|
+
id: `user-message-${Date.now()}`,
|
|
258
|
+
agentId: currentAgentId,
|
|
259
|
+
role,
|
|
260
|
+
content,
|
|
261
|
+
timestamp: new Date().toISOString(),
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
debugLog('useMessages sendMessage', ' Adding user message optimistically:', JSON.stringify(userMessage));
|
|
265
|
+
addMessage(userMessage);
|
|
266
|
+
|
|
267
|
+
// Add thinking message
|
|
268
|
+
const thinkingMessage = {
|
|
269
|
+
id: 'thinking-placeholder',
|
|
270
|
+
agentId: currentAgentId,
|
|
271
|
+
role: MESSAGE_ROLE.ASSISTANT,
|
|
272
|
+
content: THINKING_PHRASES[thinkingPhraseIndex],
|
|
273
|
+
timestamp: new Date().toISOString(),
|
|
274
|
+
isThinking: true, // Special flag to identify this as a thinking message
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
addMessage(thinkingMessage);
|
|
278
|
+
startThinkingAnimation();
|
|
279
|
+
|
|
280
|
+
return { success: true };
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
throw new Error(response.error || 'Failed to send message');
|
|
284
|
+
} catch (err) {
|
|
285
|
+
setError(err.message);
|
|
286
|
+
throw err;
|
|
287
|
+
} finally {
|
|
288
|
+
setSending(false);
|
|
289
|
+
}
|
|
290
|
+
}, [sessionManager, currentAgentId]);
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Add a message to the list (from WebSocket)
|
|
294
|
+
*/
|
|
295
|
+
const addMessage = useCallback((message) => {
|
|
296
|
+
debugLog('useMessages addMessage', 'Called with message:', JSON.stringify(message));
|
|
297
|
+
debugLog('useMessages addMessage', 'currentAgentId:', currentAgentId);
|
|
298
|
+
debugLog('useMessages addMessage', 'message.agentId:', message.agentId);
|
|
299
|
+
|
|
300
|
+
// Only add if for current agent
|
|
301
|
+
if (message.agentId !== currentAgentId) {
|
|
302
|
+
debugLog('useMessages addMessage', 'BLOCKED: agentId mismatch');
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
debugLog('useMessages addMessage', 'Adding message to state');
|
|
307
|
+
|
|
308
|
+
setMessages(prev => {
|
|
309
|
+
// If this is a real assistant message, remove the thinking placeholder
|
|
310
|
+
if (message.role === MESSAGE_ROLE.ASSISTANT && !message.isThinking) {
|
|
311
|
+
stopThinkingAnimation();
|
|
312
|
+
// Remove thinking placeholder
|
|
313
|
+
const withoutThinking = prev.filter(m => m.id !== 'thinking-placeholder');
|
|
314
|
+
|
|
315
|
+
// Check for duplicates in the filtered array
|
|
316
|
+
if (withoutThinking.find(m => m.id === message.id)) {
|
|
317
|
+
debugLog('useMessages addMessage', 'BLOCKED: Duplicate message ID');
|
|
318
|
+
return prev;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const updated = [...withoutThinking, message];
|
|
322
|
+
const trimmed = updated.slice(-MESSAGE_CONFIG.MAX_MESSAGES_DISPLAY);
|
|
323
|
+
|
|
324
|
+
debugLog('useMessages addMessage', 'Real AI response added, thinking removed, new count:', trimmed.length);
|
|
325
|
+
updateCache(trimmed);
|
|
326
|
+
return trimmed;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// Check for duplicates
|
|
330
|
+
if (prev.find(m => m.id === message.id)) {
|
|
331
|
+
debugLog('useMessages addMessage', 'BLOCKED: Duplicate message ID');
|
|
332
|
+
return prev;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const updated = [...prev, message];
|
|
336
|
+
|
|
337
|
+
// Enforce max messages limit
|
|
338
|
+
const trimmed = updated.slice(-MESSAGE_CONFIG.MAX_MESSAGES_DISPLAY);
|
|
339
|
+
|
|
340
|
+
debugLog('useMessages addMessage', 'Message added, new count:', trimmed.length);
|
|
341
|
+
updateCache(trimmed);
|
|
342
|
+
return trimmed;
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
setTotalMessages(prev => prev + 1);
|
|
346
|
+
}, [currentAgentId, updateCache, stopThinkingAnimation]);
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Update a message in the list
|
|
350
|
+
*/
|
|
351
|
+
const updateMessage = useCallback((messageId, updates) => {
|
|
352
|
+
setMessages(prev => prev.map(msg =>
|
|
353
|
+
msg.id === messageId ? { ...msg, ...updates } : msg
|
|
354
|
+
));
|
|
355
|
+
}, []);
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Remove a message from the list
|
|
359
|
+
*/
|
|
360
|
+
const removeMessage = useCallback((messageId) => {
|
|
361
|
+
setMessages(prev => prev.filter(msg => msg.id !== messageId));
|
|
362
|
+
setTotalMessages(prev => Math.max(0, prev - 1));
|
|
363
|
+
}, []);
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Clear all messages
|
|
367
|
+
*/
|
|
368
|
+
const clearMessages = useCallback(() => {
|
|
369
|
+
setMessages([]);
|
|
370
|
+
setTotalMessages(0);
|
|
371
|
+
setHasMore(false);
|
|
372
|
+
setCurrentPage(0);
|
|
373
|
+
if (currentAgentId) {
|
|
374
|
+
updateCache([]);
|
|
375
|
+
}
|
|
376
|
+
}, [currentAgentId, updateCache]);
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Load more messages (pagination)
|
|
380
|
+
*/
|
|
381
|
+
const loadMore = useCallback(async () => {
|
|
382
|
+
if (!hasMore || loading) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return fetchMessages({
|
|
387
|
+
page: currentPage + 1,
|
|
388
|
+
append: true,
|
|
389
|
+
});
|
|
390
|
+
}, [hasMore, loading, currentPage, fetchMessages]);
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Refresh message list
|
|
394
|
+
*/
|
|
395
|
+
const refresh = useCallback(async () => {
|
|
396
|
+
return fetchMessages({ page: 0, append: false });
|
|
397
|
+
}, [fetchMessages]);
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Get messages by role
|
|
401
|
+
*/
|
|
402
|
+
const getMessagesByRole = useCallback((role) => {
|
|
403
|
+
return messages.filter(msg => msg.role === role);
|
|
404
|
+
}, [messages]);
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Get user messages
|
|
408
|
+
*/
|
|
409
|
+
const getUserMessages = useCallback(() => {
|
|
410
|
+
return getMessagesByRole(MESSAGE_ROLE.USER);
|
|
411
|
+
}, [getMessagesByRole]);
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Get assistant messages
|
|
415
|
+
*/
|
|
416
|
+
const getAssistantMessages = useCallback(() => {
|
|
417
|
+
return getMessagesByRole(MESSAGE_ROLE.ASSISTANT);
|
|
418
|
+
}, [getMessagesByRole]);
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Get latest message
|
|
422
|
+
*/
|
|
423
|
+
const getLatestMessage = useCallback(() => {
|
|
424
|
+
return messages[messages.length - 1] || null;
|
|
425
|
+
}, [messages]);
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Search messages by content
|
|
429
|
+
*/
|
|
430
|
+
const searchMessages = useCallback((query) => {
|
|
431
|
+
if (!query || query.trim().length === 0) {
|
|
432
|
+
return messages;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
const lowerQuery = query.toLowerCase();
|
|
436
|
+
return messages.filter(msg =>
|
|
437
|
+
msg.content?.toLowerCase().includes(lowerQuery)
|
|
438
|
+
);
|
|
439
|
+
}, [messages]);
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Clear error
|
|
443
|
+
*/
|
|
444
|
+
const clearError = useCallback(() => {
|
|
445
|
+
setError(null);
|
|
446
|
+
}, []);
|
|
447
|
+
|
|
448
|
+
// Set up WebSocket message listeners
|
|
449
|
+
useEffect(() => {
|
|
450
|
+
if (!messageRouter) return;
|
|
451
|
+
|
|
452
|
+
debugLog('useMessages WebSocket', 'Setting up listeners for agent:', currentAgentId);
|
|
453
|
+
|
|
454
|
+
// New message added
|
|
455
|
+
const handleMessageAdded = (data) => {
|
|
456
|
+
debugLog('useMessages WebSocket', 'Received agent:message_added event:', JSON.stringify(data));
|
|
457
|
+
debugLog('useMessages WebSocket', 'data.agentId:', data.agentId, 'currentAgentId:', currentAgentId);
|
|
458
|
+
|
|
459
|
+
if (data.agentId === currentAgentId) {
|
|
460
|
+
debugLog('useMessages WebSocket', 'Agent ID matches, calling addMessage');
|
|
461
|
+
addMessage(data.message);
|
|
462
|
+
} else {
|
|
463
|
+
debugLog('useMessages WebSocket', 'Agent ID mismatch, ignoring message');
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
// Message updated
|
|
468
|
+
const handleMessageUpdated = (data) => {
|
|
469
|
+
debugLog('useMessages WebSocket', 'Received message:updated event:', JSON.stringify(data));
|
|
470
|
+
|
|
471
|
+
if (data.agentId === currentAgentId) {
|
|
472
|
+
updateMessage(data.messageId, data.updates);
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
messageRouter.on('agent:message_added', handleMessageAdded);
|
|
477
|
+
messageRouter.on('message:updated', handleMessageUpdated);
|
|
478
|
+
|
|
479
|
+
debugLog('useMessages WebSocket', 'Listeners registered');
|
|
480
|
+
|
|
481
|
+
return () => {
|
|
482
|
+
debugLog('useMessages WebSocket', 'Cleaning up listeners');
|
|
483
|
+
messageRouter.off('agent:message_added', handleMessageAdded);
|
|
484
|
+
messageRouter.off('message:updated', handleMessageUpdated);
|
|
485
|
+
};
|
|
486
|
+
}, [messageRouter, currentAgentId, addMessage, updateMessage]);
|
|
487
|
+
|
|
488
|
+
// Update thinking message content when phrase changes
|
|
489
|
+
useEffect(() => {
|
|
490
|
+
setMessages(prev => {
|
|
491
|
+
const thinkingMsg = prev.find(m => m.id === 'thinking-placeholder');
|
|
492
|
+
if (!thinkingMsg) return prev;
|
|
493
|
+
|
|
494
|
+
return prev.map(m =>
|
|
495
|
+
m.id === 'thinking-placeholder'
|
|
496
|
+
? { ...m, content: THINKING_PHRASES[thinkingPhraseIndex] }
|
|
497
|
+
: m
|
|
498
|
+
);
|
|
499
|
+
});
|
|
500
|
+
}, [thinkingPhraseIndex]);
|
|
501
|
+
|
|
502
|
+
// Cleanup thinking animation on unmount
|
|
503
|
+
useEffect(() => {
|
|
504
|
+
return () => {
|
|
505
|
+
stopThinkingAnimation();
|
|
506
|
+
};
|
|
507
|
+
}, [stopThinkingAnimation]);
|
|
508
|
+
|
|
509
|
+
// Load messages when agent changes
|
|
510
|
+
useEffect(() => {
|
|
511
|
+
debugLog('useMessages', `Agent changed: currentAgentId=${currentAgentId}`);
|
|
512
|
+
|
|
513
|
+
if (!currentAgentId) {
|
|
514
|
+
debugLog('useMessages', 'No agent selected, clearing messages');
|
|
515
|
+
setMessages([]);
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// Check cache first
|
|
520
|
+
const cached = getCachedMessages();
|
|
521
|
+
debugLog('useMessages', `Cache check: found ${cached.length} cached messages`);
|
|
522
|
+
|
|
523
|
+
if (cached.length > 0) {
|
|
524
|
+
debugLog('useMessages', `Loading ${cached.length} messages from cache`);
|
|
525
|
+
setMessages(cached);
|
|
526
|
+
setTotalMessages(cached.length);
|
|
527
|
+
} else {
|
|
528
|
+
// Load conversation history from server
|
|
529
|
+
debugLog('useMessages', 'No cache, fetching messages from server...');
|
|
530
|
+
fetchMessages({ page: 0 });
|
|
531
|
+
}
|
|
532
|
+
}, [currentAgentId, getCachedMessages, fetchMessages]);
|
|
533
|
+
|
|
534
|
+
// Return hook interface
|
|
535
|
+
return useMemo(() => ({
|
|
536
|
+
// State
|
|
537
|
+
messages,
|
|
538
|
+
loading,
|
|
539
|
+
sending,
|
|
540
|
+
error,
|
|
541
|
+
|
|
542
|
+
// Pagination
|
|
543
|
+
hasMore,
|
|
544
|
+
currentPage,
|
|
545
|
+
totalMessages,
|
|
546
|
+
|
|
547
|
+
// Input
|
|
548
|
+
inputText,
|
|
549
|
+
setInputText,
|
|
550
|
+
|
|
551
|
+
// Operations
|
|
552
|
+
sendMessage,
|
|
553
|
+
fetchMessages,
|
|
554
|
+
loadMore,
|
|
555
|
+
refresh,
|
|
556
|
+
|
|
557
|
+
// Message management
|
|
558
|
+
addMessage,
|
|
559
|
+
updateMessage,
|
|
560
|
+
removeMessage,
|
|
561
|
+
clearMessages,
|
|
562
|
+
|
|
563
|
+
// Queries
|
|
564
|
+
getMessagesByRole,
|
|
565
|
+
getUserMessages,
|
|
566
|
+
getAssistantMessages,
|
|
567
|
+
getLatestMessage,
|
|
568
|
+
searchMessages,
|
|
569
|
+
|
|
570
|
+
// Utilities
|
|
571
|
+
clearError,
|
|
572
|
+
}), [
|
|
573
|
+
messages,
|
|
574
|
+
loading,
|
|
575
|
+
sending,
|
|
576
|
+
error,
|
|
577
|
+
hasMore,
|
|
578
|
+
currentPage,
|
|
579
|
+
totalMessages,
|
|
580
|
+
inputText,
|
|
581
|
+
setInputText,
|
|
582
|
+
sendMessage,
|
|
583
|
+
fetchMessages,
|
|
584
|
+
loadMore,
|
|
585
|
+
refresh,
|
|
586
|
+
addMessage,
|
|
587
|
+
updateMessage,
|
|
588
|
+
removeMessage,
|
|
589
|
+
clearMessages,
|
|
590
|
+
getMessagesByRole,
|
|
591
|
+
getUserMessages,
|
|
592
|
+
getAssistantMessages,
|
|
593
|
+
getLatestMessage,
|
|
594
|
+
searchMessages,
|
|
595
|
+
clearError,
|
|
596
|
+
]);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Lightweight hook for message count only
|
|
601
|
+
*/
|
|
602
|
+
export function useMessageCount(messages) {
|
|
603
|
+
const [userCount, setUserCount] = useState(0);
|
|
604
|
+
const [assistantCount, setAssistantCount] = useState(0);
|
|
605
|
+
const [totalCount, setTotalCount] = useState(0);
|
|
606
|
+
|
|
607
|
+
useEffect(() => {
|
|
608
|
+
if (!messages) {
|
|
609
|
+
setUserCount(0);
|
|
610
|
+
setAssistantCount(0);
|
|
611
|
+
setTotalCount(0);
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
const user = messages.filter(m => m.role === MESSAGE_ROLE.USER).length;
|
|
616
|
+
const assistant = messages.filter(m => m.role === MESSAGE_ROLE.ASSISTANT).length;
|
|
617
|
+
|
|
618
|
+
setUserCount(user);
|
|
619
|
+
setAssistantCount(assistant);
|
|
620
|
+
setTotalCount(messages.length);
|
|
621
|
+
}, [messages]);
|
|
622
|
+
|
|
623
|
+
return useMemo(() => ({
|
|
624
|
+
userCount,
|
|
625
|
+
assistantCount,
|
|
626
|
+
totalCount,
|
|
627
|
+
}), [userCount, assistantCount, totalCount]);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
export default useMessages;
|