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,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlowContextService - Builds flow-aware context for agents in flow execution
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* - Inject flow execution instructions into agent system prompts
|
|
6
|
+
* - Pass previous agent data (summary, files created, output) to next agent
|
|
7
|
+
* - Guide agents on comprehensive job-done completion
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
class FlowContextService {
|
|
11
|
+
constructor(config = {}, logger = null) {
|
|
12
|
+
this.config = config;
|
|
13
|
+
this.logger = logger;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Build flow execution context to inject into agent's system prompt
|
|
18
|
+
* @param {Object} flowMetadata - Current flow execution metadata
|
|
19
|
+
* @param {Object} previousAgentData - Data from previous agent (if any)
|
|
20
|
+
* @returns {string} Context string to inject into system prompt
|
|
21
|
+
*/
|
|
22
|
+
buildFlowAgentContext(flowMetadata, previousAgentData) {
|
|
23
|
+
const sections = [];
|
|
24
|
+
|
|
25
|
+
// Flow execution header
|
|
26
|
+
sections.push(`
|
|
27
|
+
<FLOW_EXECUTION_CONTEXT>
|
|
28
|
+
You are executing step "${flowMetadata.nodeName || 'Agent'}" (${flowMetadata.nodePosition}/${flowMetadata.totalNodes}) in flow "${flowMetadata.flowName}".`);
|
|
29
|
+
|
|
30
|
+
// Critical instruction about context isolation
|
|
31
|
+
sections.push(`
|
|
32
|
+
CRITICAL HANDOFF REQUIREMENT:
|
|
33
|
+
The NEXT agent in this flow has NO ACCESS to your conversation history or any context you've built up.
|
|
34
|
+
Everything you learn, create, or discover must be explicitly passed via job-done.`);
|
|
35
|
+
|
|
36
|
+
// Job-done instructions
|
|
37
|
+
sections.push(`
|
|
38
|
+
When you complete your task, you MUST call the job-done tool with comprehensive details:
|
|
39
|
+
- summary: A complete summary of what you accomplished (not just "task complete")
|
|
40
|
+
- details: ALL information the next agent needs to continue, including:
|
|
41
|
+
• Full results, findings, or output content
|
|
42
|
+
• File paths of ANY files created or modified (list each explicitly)
|
|
43
|
+
• Important decisions made and their rationale
|
|
44
|
+
• Any warnings, caveats, or considerations for the next step
|
|
45
|
+
• Context that would be lost without explicit documentation`);
|
|
46
|
+
|
|
47
|
+
// Previous agent context (if exists)
|
|
48
|
+
if (previousAgentData) {
|
|
49
|
+
sections.push(`
|
|
50
|
+
CONTEXT FROM PREVIOUS AGENT:
|
|
51
|
+
${previousAgentData.agentName ? `- Previous agent: ${previousAgentData.agentName} (${previousAgentData.agentId})` : `- Previous agent ID: ${previousAgentData.agentId}`}
|
|
52
|
+
${previousAgentData.summary ? `- Their summary: ${previousAgentData.summary}` : ''}
|
|
53
|
+
${previousAgentData.filesCreated?.length > 0 ? `- Files they created/modified:\n${previousAgentData.filesCreated.map(f => ` • ${f}`).join('\n')}` : '- No files created by previous agent'}
|
|
54
|
+
${previousAgentData.output ? `
|
|
55
|
+
- Their output:
|
|
56
|
+
${this._formatPreviousOutput(previousAgentData.output)}` : ''}`);
|
|
57
|
+
} else {
|
|
58
|
+
sections.push(`
|
|
59
|
+
This is the FIRST agent in the flow - you are receiving the initial user input.`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Closing instructions
|
|
63
|
+
sections.push(`
|
|
64
|
+
FLOW EXECUTION RULES:
|
|
65
|
+
1. Focus on your specific task in this pipeline step
|
|
66
|
+
2. Be thorough in your job-done summary - err on the side of more detail
|
|
67
|
+
3. List ALL file operations explicitly (create, modify, delete)
|
|
68
|
+
4. Stay in agent mode after job-done in case there are follow-up questions
|
|
69
|
+
5. Do not assume the next agent knows anything about what you did
|
|
70
|
+
|
|
71
|
+
</FLOW_EXECUTION_CONTEXT>`);
|
|
72
|
+
|
|
73
|
+
return sections.join('');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Format previous agent's output for display (truncate if very long)
|
|
78
|
+
* @param {string|Object} output - Previous output
|
|
79
|
+
* @returns {string} Formatted output
|
|
80
|
+
*/
|
|
81
|
+
_formatPreviousOutput(output) {
|
|
82
|
+
if (!output) return '';
|
|
83
|
+
|
|
84
|
+
const outputStr = typeof output === 'object'
|
|
85
|
+
? JSON.stringify(output, null, 2)
|
|
86
|
+
: String(output);
|
|
87
|
+
|
|
88
|
+
// Truncate very long outputs but indicate there's more
|
|
89
|
+
const maxLength = 2000;
|
|
90
|
+
if (outputStr.length > maxLength) {
|
|
91
|
+
return outputStr.substring(0, maxLength) + '\n... (truncated - full output was provided to you)';
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return outputStr;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Build minimal context for logging/debugging
|
|
99
|
+
* @param {Object} flowMetadata - Flow metadata
|
|
100
|
+
* @returns {Object} Simplified context object
|
|
101
|
+
*/
|
|
102
|
+
buildContextSummary(flowMetadata, previousAgentData) {
|
|
103
|
+
return {
|
|
104
|
+
flowId: flowMetadata.flowId,
|
|
105
|
+
flowName: flowMetadata.flowName,
|
|
106
|
+
currentNode: flowMetadata.nodeName,
|
|
107
|
+
position: `${flowMetadata.nodePosition}/${flowMetadata.totalNodes}`,
|
|
108
|
+
hasPreviousAgent: !!previousAgentData,
|
|
109
|
+
previousAgentId: previousAgentData?.agentId || null,
|
|
110
|
+
previousFilesCount: previousAgentData?.filesCreated?.length || 0
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Validate that job-done result has sufficient detail for flow handoff
|
|
116
|
+
* @param {Object} jobDoneResult - The job-done tool result
|
|
117
|
+
* @returns {Object} Validation result with warnings if insufficient
|
|
118
|
+
*/
|
|
119
|
+
validateJobDoneForFlow(jobDoneResult) {
|
|
120
|
+
const warnings = [];
|
|
121
|
+
|
|
122
|
+
if (!jobDoneResult.summary || jobDoneResult.summary.length < 20) {
|
|
123
|
+
warnings.push('Summary is too brief - next agent may lack necessary context');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (!jobDoneResult.details && !jobDoneResult.summary) {
|
|
127
|
+
warnings.push('No details provided - next agent will have minimal context');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Check for file mentions without explicit paths
|
|
131
|
+
const summaryText = (jobDoneResult.summary || '') + (jobDoneResult.details || '');
|
|
132
|
+
const fileKeywords = ['created', 'wrote', 'saved', 'file', 'generated'];
|
|
133
|
+
const hasFileMention = fileKeywords.some(kw => summaryText.toLowerCase().includes(kw));
|
|
134
|
+
const hasExplicitPath = /[\/\\][\w-]+\.\w+/.test(summaryText);
|
|
135
|
+
|
|
136
|
+
if (hasFileMention && !hasExplicitPath && (!jobDoneResult.filesCreated || jobDoneResult.filesCreated.length === 0)) {
|
|
137
|
+
warnings.push('Files mentioned but no explicit paths provided - consider listing created files');
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return {
|
|
141
|
+
valid: warnings.length === 0,
|
|
142
|
+
warnings,
|
|
143
|
+
suggestions: warnings.length > 0
|
|
144
|
+
? 'Ensure your job-done includes: detailed summary, explicit file paths, and any context the next agent needs.'
|
|
145
|
+
: null
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Extract file paths from agent messages during flow execution
|
|
151
|
+
* Used to auto-track files created for the next agent
|
|
152
|
+
* @param {Array} messages - Agent conversation messages
|
|
153
|
+
* @returns {Array<string>} Detected file paths
|
|
154
|
+
*/
|
|
155
|
+
extractFilePaths(messages) {
|
|
156
|
+
const filePaths = new Set();
|
|
157
|
+
|
|
158
|
+
// Patterns for detecting file operations
|
|
159
|
+
const patterns = [
|
|
160
|
+
// Common path patterns
|
|
161
|
+
/(?:created|wrote|saved|generated|modified)\s+(?:file\s+)?["']?([\/\\][\w\-\.\/\\]+\.\w+)["']?/gi,
|
|
162
|
+
// Direct path mentions
|
|
163
|
+
/(?:at|to|in)\s+["']?([\/\\][\w\-\.\/\\]+\.\w+)["']?/gi,
|
|
164
|
+
// Tool result file paths (from file tools)
|
|
165
|
+
/File\s+(?:created|written|saved):\s*([\/\\][\w\-\.\/\\]+\.\w+)/gi
|
|
166
|
+
];
|
|
167
|
+
|
|
168
|
+
for (const message of messages) {
|
|
169
|
+
const content = typeof message.content === 'string'
|
|
170
|
+
? message.content
|
|
171
|
+
: JSON.stringify(message.content || '');
|
|
172
|
+
|
|
173
|
+
for (const pattern of patterns) {
|
|
174
|
+
let match;
|
|
175
|
+
while ((match = pattern.exec(content)) !== null) {
|
|
176
|
+
const path = match[1];
|
|
177
|
+
// Filter out obvious non-file paths
|
|
178
|
+
if (path && !path.includes('http') && path.length > 3) {
|
|
179
|
+
filePaths.add(path);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return Array.from(filePaths);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export default FlowContextService;
|
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory Service
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* - Provide persistent memory storage for agents
|
|
6
|
+
* - Support CRUD operations on memories (add, update, delete, list, read)
|
|
7
|
+
* - Store memories per-agent in dedicated files
|
|
8
|
+
* - Support expiration conditions (date-based or condition-based)
|
|
9
|
+
*
|
|
10
|
+
* Storage: userDataDir/state/agents/agent-{id}-memory.json
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { promises as fs } from 'fs';
|
|
14
|
+
import path from 'path';
|
|
15
|
+
import { getUserDataPaths, ensureUserDataDirs } from '../utilities/userDataDir.js';
|
|
16
|
+
|
|
17
|
+
// Memory data version for future migrations
|
|
18
|
+
const MEMORY_VERSION = '1.0.0';
|
|
19
|
+
|
|
20
|
+
class MemoryService {
|
|
21
|
+
constructor(logger = null) {
|
|
22
|
+
this.logger = logger;
|
|
23
|
+
|
|
24
|
+
// In-memory cache: agentId -> memories array
|
|
25
|
+
this.memoriesCache = new Map();
|
|
26
|
+
|
|
27
|
+
// Paths
|
|
28
|
+
this.agentsDir = null;
|
|
29
|
+
this.initialized = false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Initialize the memory service
|
|
34
|
+
* @returns {Promise<void>}
|
|
35
|
+
*/
|
|
36
|
+
async initialize() {
|
|
37
|
+
if (this.initialized) return;
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
await ensureUserDataDirs();
|
|
41
|
+
const paths = getUserDataPaths();
|
|
42
|
+
this.agentsDir = paths.agents;
|
|
43
|
+
|
|
44
|
+
this.initialized = true;
|
|
45
|
+
this.logger?.info('[MemoryService] Initialized', { agentsDir: this.agentsDir });
|
|
46
|
+
} catch (error) {
|
|
47
|
+
this.logger?.warn('[MemoryService] Initialization failed', { error: error.message });
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get the memory file path for an agent
|
|
54
|
+
* @param {string} agentId
|
|
55
|
+
* @returns {string}
|
|
56
|
+
*/
|
|
57
|
+
_getMemoryFilePath(agentId) {
|
|
58
|
+
return path.join(this.agentsDir, `${agentId}-memory.json`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Generate a unique memory ID
|
|
63
|
+
* @returns {string}
|
|
64
|
+
*/
|
|
65
|
+
_generateMemoryId() {
|
|
66
|
+
const timestamp = Date.now();
|
|
67
|
+
const random = Math.random().toString(36).substring(2, 8);
|
|
68
|
+
return `mem-${timestamp}-${random}`;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Load memories for an agent from disk
|
|
73
|
+
* @param {string} agentId
|
|
74
|
+
* @returns {Promise<Array>} Array of memories
|
|
75
|
+
*/
|
|
76
|
+
async loadMemories(agentId) {
|
|
77
|
+
if (!this.initialized) {
|
|
78
|
+
await this.initialize();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Check cache first
|
|
82
|
+
if (this.memoriesCache.has(agentId)) {
|
|
83
|
+
return this.memoriesCache.get(agentId);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const filePath = this._getMemoryFilePath(agentId);
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
const data = await fs.readFile(filePath, 'utf8');
|
|
90
|
+
const parsed = JSON.parse(data);
|
|
91
|
+
|
|
92
|
+
// Filter out expired memories
|
|
93
|
+
const memories = this._filterExpiredMemories(parsed.memories || []);
|
|
94
|
+
|
|
95
|
+
// Update cache
|
|
96
|
+
this.memoriesCache.set(agentId, memories);
|
|
97
|
+
|
|
98
|
+
this.logger?.debug('[MemoryService] Loaded memories', {
|
|
99
|
+
agentId,
|
|
100
|
+
count: memories.length
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return memories;
|
|
104
|
+
} catch (error) {
|
|
105
|
+
if (error.code === 'ENOENT') {
|
|
106
|
+
// No memory file yet, return empty array
|
|
107
|
+
this.memoriesCache.set(agentId, []);
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
this.logger?.warn('[MemoryService] Failed to load memories', {
|
|
111
|
+
agentId,
|
|
112
|
+
error: error.message
|
|
113
|
+
});
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Save memories for an agent to disk
|
|
120
|
+
* @param {string} agentId
|
|
121
|
+
* @param {Array} memories
|
|
122
|
+
* @returns {Promise<void>}
|
|
123
|
+
*/
|
|
124
|
+
async saveMemories(agentId, memories) {
|
|
125
|
+
if (!this.initialized) {
|
|
126
|
+
await this.initialize();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const filePath = this._getMemoryFilePath(agentId);
|
|
130
|
+
|
|
131
|
+
const data = {
|
|
132
|
+
version: MEMORY_VERSION,
|
|
133
|
+
agentId,
|
|
134
|
+
memories,
|
|
135
|
+
lastPersisted: new Date().toISOString()
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
await fs.writeFile(filePath, JSON.stringify(data, null, 2), 'utf8');
|
|
140
|
+
|
|
141
|
+
// Update cache
|
|
142
|
+
this.memoriesCache.set(agentId, memories);
|
|
143
|
+
|
|
144
|
+
this.logger?.debug('[MemoryService] Saved memories', {
|
|
145
|
+
agentId,
|
|
146
|
+
count: memories.length
|
|
147
|
+
});
|
|
148
|
+
} catch (error) {
|
|
149
|
+
this.logger?.error('[MemoryService] Failed to save memories', {
|
|
150
|
+
agentId,
|
|
151
|
+
error: error.message
|
|
152
|
+
});
|
|
153
|
+
throw error;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Filter out expired memories
|
|
159
|
+
* @param {Array} memories
|
|
160
|
+
* @returns {Array}
|
|
161
|
+
*/
|
|
162
|
+
_filterExpiredMemories(memories) {
|
|
163
|
+
const now = new Date();
|
|
164
|
+
|
|
165
|
+
return memories.filter(memory => {
|
|
166
|
+
if (!memory.expiration) return true;
|
|
167
|
+
|
|
168
|
+
if (memory.expiration.type === 'date') {
|
|
169
|
+
const expiryDate = new Date(memory.expiration.value);
|
|
170
|
+
return expiryDate > now;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Condition-based expiration must be manually removed
|
|
174
|
+
// type === 'condition' or type === 'never'
|
|
175
|
+
return true;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Add a new memory
|
|
181
|
+
* @param {string} agentId
|
|
182
|
+
* @param {Object} memoryData - { title, description, content, expiration }
|
|
183
|
+
* @returns {Promise<Object>} Created memory
|
|
184
|
+
*/
|
|
185
|
+
async addMemory(agentId, memoryData) {
|
|
186
|
+
const memories = await this.loadMemories(agentId);
|
|
187
|
+
|
|
188
|
+
const memory = {
|
|
189
|
+
id: this._generateMemoryId(),
|
|
190
|
+
title: memoryData.title,
|
|
191
|
+
description: memoryData.description || '',
|
|
192
|
+
content: memoryData.content,
|
|
193
|
+
createdAt: new Date().toISOString(),
|
|
194
|
+
updatedAt: new Date().toISOString(),
|
|
195
|
+
expiration: this._parseExpiration(memoryData.expiration),
|
|
196
|
+
accessCount: 0,
|
|
197
|
+
lastAccessed: null
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
memories.push(memory);
|
|
201
|
+
await this.saveMemories(agentId, memories);
|
|
202
|
+
|
|
203
|
+
this.logger?.info('[MemoryService] Memory added', {
|
|
204
|
+
agentId,
|
|
205
|
+
memoryId: memory.id,
|
|
206
|
+
title: memory.title
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
return memory;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Parse expiration input into standard format
|
|
214
|
+
* @param {string|Object} expiration
|
|
215
|
+
* @returns {Object|null}
|
|
216
|
+
*/
|
|
217
|
+
_parseExpiration(expiration) {
|
|
218
|
+
if (!expiration) {
|
|
219
|
+
return { type: 'never', value: null };
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (typeof expiration === 'string') {
|
|
223
|
+
// Try parsing as date
|
|
224
|
+
const date = new Date(expiration);
|
|
225
|
+
if (!isNaN(date.getTime())) {
|
|
226
|
+
return { type: 'date', value: date.toISOString() };
|
|
227
|
+
}
|
|
228
|
+
// Treat as condition
|
|
229
|
+
return { type: 'condition', value: expiration };
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (typeof expiration === 'object') {
|
|
233
|
+
return {
|
|
234
|
+
type: expiration.type || 'condition',
|
|
235
|
+
value: expiration.value || expiration.date || expiration.condition
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return { type: 'never', value: null };
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Update an existing memory
|
|
244
|
+
* @param {string} agentId
|
|
245
|
+
* @param {string} memoryId
|
|
246
|
+
* @param {Object} updates - { title?, description?, content?, expiration? }
|
|
247
|
+
* @returns {Promise<Object|null>} Updated memory or null if not found
|
|
248
|
+
*/
|
|
249
|
+
async updateMemory(agentId, memoryId, updates) {
|
|
250
|
+
const memories = await this.loadMemories(agentId);
|
|
251
|
+
|
|
252
|
+
const index = memories.findIndex(m => m.id === memoryId);
|
|
253
|
+
if (index === -1) {
|
|
254
|
+
this.logger?.warn('[MemoryService] Memory not found for update', {
|
|
255
|
+
agentId,
|
|
256
|
+
memoryId
|
|
257
|
+
});
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const memory = memories[index];
|
|
262
|
+
|
|
263
|
+
if (updates.title !== undefined) memory.title = updates.title;
|
|
264
|
+
if (updates.description !== undefined) memory.description = updates.description;
|
|
265
|
+
if (updates.content !== undefined) memory.content = updates.content;
|
|
266
|
+
if (updates.expiration !== undefined) {
|
|
267
|
+
memory.expiration = this._parseExpiration(updates.expiration);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
memory.updatedAt = new Date().toISOString();
|
|
271
|
+
|
|
272
|
+
memories[index] = memory;
|
|
273
|
+
await this.saveMemories(agentId, memories);
|
|
274
|
+
|
|
275
|
+
this.logger?.info('[MemoryService] Memory updated', {
|
|
276
|
+
agentId,
|
|
277
|
+
memoryId,
|
|
278
|
+
title: memory.title
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
return memory;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Delete a memory
|
|
286
|
+
* @param {string} agentId
|
|
287
|
+
* @param {string} memoryId
|
|
288
|
+
* @returns {Promise<boolean>} True if deleted, false if not found
|
|
289
|
+
*/
|
|
290
|
+
async deleteMemory(agentId, memoryId) {
|
|
291
|
+
const memories = await this.loadMemories(agentId);
|
|
292
|
+
|
|
293
|
+
const index = memories.findIndex(m => m.id === memoryId);
|
|
294
|
+
if (index === -1) {
|
|
295
|
+
this.logger?.warn('[MemoryService] Memory not found for deletion', {
|
|
296
|
+
agentId,
|
|
297
|
+
memoryId
|
|
298
|
+
});
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const deleted = memories.splice(index, 1)[0];
|
|
303
|
+
await this.saveMemories(agentId, memories);
|
|
304
|
+
|
|
305
|
+
this.logger?.info('[MemoryService] Memory deleted', {
|
|
306
|
+
agentId,
|
|
307
|
+
memoryId,
|
|
308
|
+
title: deleted.title
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
return true;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* List memories with configurable detail level
|
|
316
|
+
* @param {string} agentId
|
|
317
|
+
* @param {string} level - 'titles' | 'descriptions' | 'full'
|
|
318
|
+
* @returns {Promise<Object>} Memories grouped by date
|
|
319
|
+
*/
|
|
320
|
+
async listMemories(agentId, level = 'titles') {
|
|
321
|
+
const memories = await this.loadMemories(agentId);
|
|
322
|
+
|
|
323
|
+
// Sort by createdAt descending (newest first)
|
|
324
|
+
const sorted = [...memories].sort((a, b) =>
|
|
325
|
+
new Date(b.createdAt) - new Date(a.createdAt)
|
|
326
|
+
);
|
|
327
|
+
|
|
328
|
+
// Group by date
|
|
329
|
+
const grouped = {};
|
|
330
|
+
for (const memory of sorted) {
|
|
331
|
+
const date = memory.createdAt.split('T')[0]; // YYYY-MM-DD
|
|
332
|
+
if (!grouped[date]) {
|
|
333
|
+
grouped[date] = [];
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Apply detail level
|
|
337
|
+
let item;
|
|
338
|
+
switch (level) {
|
|
339
|
+
case 'titles':
|
|
340
|
+
item = { id: memory.id, title: memory.title };
|
|
341
|
+
break;
|
|
342
|
+
case 'descriptions':
|
|
343
|
+
item = {
|
|
344
|
+
id: memory.id,
|
|
345
|
+
title: memory.title,
|
|
346
|
+
description: memory.description
|
|
347
|
+
};
|
|
348
|
+
break;
|
|
349
|
+
case 'full':
|
|
350
|
+
item = {
|
|
351
|
+
id: memory.id,
|
|
352
|
+
title: memory.title,
|
|
353
|
+
description: memory.description,
|
|
354
|
+
expiration: memory.expiration,
|
|
355
|
+
createdAt: memory.createdAt,
|
|
356
|
+
updatedAt: memory.updatedAt
|
|
357
|
+
};
|
|
358
|
+
break;
|
|
359
|
+
default:
|
|
360
|
+
item = { id: memory.id, title: memory.title };
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
grouped[date].push(item);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return {
|
|
367
|
+
count: memories.length,
|
|
368
|
+
grouped
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Read a memory's full content (marks as accessed)
|
|
374
|
+
* @param {string} agentId
|
|
375
|
+
* @param {string} memoryId
|
|
376
|
+
* @returns {Promise<Object|null>} Full memory or null if not found
|
|
377
|
+
*/
|
|
378
|
+
async readMemory(agentId, memoryId) {
|
|
379
|
+
const memories = await this.loadMemories(agentId);
|
|
380
|
+
|
|
381
|
+
const index = memories.findIndex(m => m.id === memoryId);
|
|
382
|
+
if (index === -1) {
|
|
383
|
+
this.logger?.warn('[MemoryService] Memory not found for read', {
|
|
384
|
+
agentId,
|
|
385
|
+
memoryId
|
|
386
|
+
});
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const memory = memories[index];
|
|
391
|
+
|
|
392
|
+
// Update access tracking
|
|
393
|
+
memory.accessCount = (memory.accessCount || 0) + 1;
|
|
394
|
+
memory.lastAccessed = new Date().toISOString();
|
|
395
|
+
|
|
396
|
+
memories[index] = memory;
|
|
397
|
+
await this.saveMemories(agentId, memories);
|
|
398
|
+
|
|
399
|
+
this.logger?.debug('[MemoryService] Memory read', {
|
|
400
|
+
agentId,
|
|
401
|
+
memoryId,
|
|
402
|
+
accessCount: memory.accessCount
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
return memory;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Search memories by title or description
|
|
410
|
+
* @param {string} agentId
|
|
411
|
+
* @param {string} query
|
|
412
|
+
* @returns {Promise<Array>} Matching memories (id, title, description)
|
|
413
|
+
*/
|
|
414
|
+
async searchMemories(agentId, query) {
|
|
415
|
+
const memories = await this.loadMemories(agentId);
|
|
416
|
+
|
|
417
|
+
const lowerQuery = query.toLowerCase();
|
|
418
|
+
|
|
419
|
+
return memories
|
|
420
|
+
.filter(m =>
|
|
421
|
+
m.title.toLowerCase().includes(lowerQuery) ||
|
|
422
|
+
m.description.toLowerCase().includes(lowerQuery)
|
|
423
|
+
)
|
|
424
|
+
.map(m => ({
|
|
425
|
+
id: m.id,
|
|
426
|
+
title: m.title,
|
|
427
|
+
description: m.description
|
|
428
|
+
}));
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Clear all memories for an agent
|
|
433
|
+
* @param {string} agentId
|
|
434
|
+
* @returns {Promise<number>} Number of memories cleared
|
|
435
|
+
*/
|
|
436
|
+
async clearMemories(agentId) {
|
|
437
|
+
const memories = await this.loadMemories(agentId);
|
|
438
|
+
const count = memories.length;
|
|
439
|
+
|
|
440
|
+
await this.saveMemories(agentId, []);
|
|
441
|
+
|
|
442
|
+
this.logger?.info('[MemoryService] Cleared all memories', {
|
|
443
|
+
agentId,
|
|
444
|
+
count
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
return count;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Delete memory file for an agent (used when agent is deleted)
|
|
452
|
+
* @param {string} agentId
|
|
453
|
+
* @returns {Promise<boolean>}
|
|
454
|
+
*/
|
|
455
|
+
async deleteMemoryFile(agentId) {
|
|
456
|
+
const filePath = this._getMemoryFilePath(agentId);
|
|
457
|
+
|
|
458
|
+
try {
|
|
459
|
+
await fs.unlink(filePath);
|
|
460
|
+
this.memoriesCache.delete(agentId);
|
|
461
|
+
this.logger?.info('[MemoryService] Memory file deleted', { agentId });
|
|
462
|
+
return true;
|
|
463
|
+
} catch (error) {
|
|
464
|
+
if (error.code === 'ENOENT') {
|
|
465
|
+
return true; // Already deleted
|
|
466
|
+
}
|
|
467
|
+
this.logger?.warn('[MemoryService] Failed to delete memory file', {
|
|
468
|
+
agentId,
|
|
469
|
+
error: error.message
|
|
470
|
+
});
|
|
471
|
+
return false;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Get memory statistics for an agent
|
|
477
|
+
* @param {string} agentId
|
|
478
|
+
* @returns {Promise<Object>}
|
|
479
|
+
*/
|
|
480
|
+
async getMemoryStats(agentId) {
|
|
481
|
+
const memories = await this.loadMemories(agentId);
|
|
482
|
+
|
|
483
|
+
const now = new Date();
|
|
484
|
+
let expiringCount = 0;
|
|
485
|
+
let totalAccessCount = 0;
|
|
486
|
+
|
|
487
|
+
for (const memory of memories) {
|
|
488
|
+
totalAccessCount += memory.accessCount || 0;
|
|
489
|
+
|
|
490
|
+
if (memory.expiration?.type === 'date') {
|
|
491
|
+
const expiryDate = new Date(memory.expiration.value);
|
|
492
|
+
const daysUntilExpiry = (expiryDate - now) / (1000 * 60 * 60 * 24);
|
|
493
|
+
if (daysUntilExpiry <= 7) {
|
|
494
|
+
expiringCount++;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
return {
|
|
500
|
+
totalMemories: memories.length,
|
|
501
|
+
totalAccessCount,
|
|
502
|
+
expiringWithin7Days: expiringCount,
|
|
503
|
+
averageAccessCount: memories.length > 0
|
|
504
|
+
? (totalAccessCount / memories.length).toFixed(2)
|
|
505
|
+
: 0
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// Export singleton instance
|
|
511
|
+
let instance = null;
|
|
512
|
+
|
|
513
|
+
export function getMemoryService(logger = null) {
|
|
514
|
+
if (!instance) {
|
|
515
|
+
instance = new MemoryService(logger);
|
|
516
|
+
}
|
|
517
|
+
return instance;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export { MemoryService };
|
|
521
|
+
export default MemoryService;
|