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,566 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DirectoryAccessManager - Manage directory access permissions for agents
|
|
3
|
+
*
|
|
4
|
+
* Purpose:
|
|
5
|
+
* - Control agent access to directories and files
|
|
6
|
+
* - Distinguish between read-only and write-enabled directories
|
|
7
|
+
* - Validate paths against access permissions
|
|
8
|
+
* - Provide working directory management
|
|
9
|
+
* - Support both absolute and relative path resolution
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import path from 'path';
|
|
13
|
+
import fs from 'fs/promises';
|
|
14
|
+
import os from 'os';
|
|
15
|
+
import { getSystemRestrictedPaths } from './platformUtils.js';
|
|
16
|
+
|
|
17
|
+
class DirectoryAccessManager {
|
|
18
|
+
constructor(config = {}, logger = null) {
|
|
19
|
+
this.logger = logger;
|
|
20
|
+
this.config = config;
|
|
21
|
+
|
|
22
|
+
// Default system restrictions (platform-aware from platformUtils)
|
|
23
|
+
this.systemRestrictedPaths = [
|
|
24
|
+
...getSystemRestrictedPaths(),
|
|
25
|
+
// User sensitive directories (cross-platform)
|
|
26
|
+
path.join(os.homedir(), '.ssh'),
|
|
27
|
+
path.join(os.homedir(), '.aws'),
|
|
28
|
+
path.join(os.homedir(), '.config'),
|
|
29
|
+
path.join(os.homedir(), '.gnupg'),
|
|
30
|
+
// Common package managers and git internals
|
|
31
|
+
'node_modules/.bin',
|
|
32
|
+
'.git/objects',
|
|
33
|
+
'.git/hooks'
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create directory access configuration for an agent
|
|
39
|
+
* @param {Object} options - Access configuration options
|
|
40
|
+
* @returns {Object} Directory access configuration
|
|
41
|
+
*/
|
|
42
|
+
createDirectoryAccess(options = {}) {
|
|
43
|
+
const {
|
|
44
|
+
workingDirectory = process.cwd(),
|
|
45
|
+
readOnlyDirectories = [],
|
|
46
|
+
writeEnabledDirectories = [],
|
|
47
|
+
restrictToProject = true,
|
|
48
|
+
allowSystemAccess = false,
|
|
49
|
+
customRestrictions = []
|
|
50
|
+
} = options;
|
|
51
|
+
|
|
52
|
+
// Normalize all paths to absolute
|
|
53
|
+
const workingDir = path.resolve(workingDirectory);
|
|
54
|
+
const readOnlyDirs = readOnlyDirectories.map(dir => this.normalizePath(dir, workingDir));
|
|
55
|
+
const writeEnabledDirs = writeEnabledDirectories.map(dir => this.normalizePath(dir, workingDir));
|
|
56
|
+
|
|
57
|
+
// If restrict to project, ensure working directory is included
|
|
58
|
+
const finalReadOnlyDirs = restrictToProject
|
|
59
|
+
? [...new Set([...readOnlyDirs, workingDir])]
|
|
60
|
+
: readOnlyDirs;
|
|
61
|
+
|
|
62
|
+
const finalWriteEnabledDirs = restrictToProject
|
|
63
|
+
? writeEnabledDirs.filter(dir => this.isPathWithinDirectory(dir, workingDir))
|
|
64
|
+
: writeEnabledDirs;
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
workingDirectory: workingDir,
|
|
68
|
+
readOnlyDirectories: finalReadOnlyDirs,
|
|
69
|
+
writeEnabledDirectories: finalWriteEnabledDirs,
|
|
70
|
+
restrictToProject,
|
|
71
|
+
allowSystemAccess,
|
|
72
|
+
customRestrictions: customRestrictions.map(restriction => path.resolve(restriction)),
|
|
73
|
+
createdAt: new Date().toISOString(),
|
|
74
|
+
version: '1.0'
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Validate if a path can be accessed for reading
|
|
80
|
+
* @param {string} targetPath - Path to validate
|
|
81
|
+
* @param {Object} accessConfig - Directory access configuration
|
|
82
|
+
* @returns {Object} Validation result
|
|
83
|
+
*/
|
|
84
|
+
validateReadAccess(targetPath, accessConfig) {
|
|
85
|
+
try {
|
|
86
|
+
const resolvedPath = this.resolvePath(targetPath, accessConfig.workingDirectory);
|
|
87
|
+
|
|
88
|
+
// Check system restrictions first
|
|
89
|
+
if (!accessConfig.allowSystemAccess && this.isSystemRestrictedPath(resolvedPath)) {
|
|
90
|
+
return {
|
|
91
|
+
allowed: false,
|
|
92
|
+
reason: 'System path access denied',
|
|
93
|
+
path: resolvedPath,
|
|
94
|
+
category: 'system_restricted'
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Check custom restrictions
|
|
99
|
+
if (this.isCustomRestricted(resolvedPath, accessConfig.customRestrictions)) {
|
|
100
|
+
return {
|
|
101
|
+
allowed: false,
|
|
102
|
+
reason: 'Custom restriction applied',
|
|
103
|
+
path: resolvedPath,
|
|
104
|
+
category: 'custom_restricted'
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// If restricting to project, ensure path is within allowed boundaries
|
|
109
|
+
if (accessConfig.restrictToProject) {
|
|
110
|
+
// Build list of allowed directories, using workingDirectory as fallback if lists are empty
|
|
111
|
+
const allowedDirs = [
|
|
112
|
+
...(accessConfig.readOnlyDirectories || []),
|
|
113
|
+
...(accessConfig.writeEnabledDirectories || [])
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
// If no explicit directories configured, use workingDirectory as the project scope
|
|
117
|
+
if (allowedDirs.length === 0 && accessConfig.workingDirectory) {
|
|
118
|
+
allowedDirs.push(accessConfig.workingDirectory);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const isWithinProject = this.isPathWithinAnyDirectory(resolvedPath, allowedDirs);
|
|
122
|
+
|
|
123
|
+
if (!isWithinProject) {
|
|
124
|
+
return {
|
|
125
|
+
allowed: false,
|
|
126
|
+
reason: 'Path outside project scope',
|
|
127
|
+
path: resolvedPath,
|
|
128
|
+
category: 'project_restricted'
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Check if path is within any allowed directory
|
|
134
|
+
const isWithinAllowed = this.isPathWithinAnyDirectory(resolvedPath, [
|
|
135
|
+
...accessConfig.readOnlyDirectories,
|
|
136
|
+
...accessConfig.writeEnabledDirectories
|
|
137
|
+
]);
|
|
138
|
+
|
|
139
|
+
if (!isWithinAllowed && accessConfig.readOnlyDirectories.length > 0) {
|
|
140
|
+
return {
|
|
141
|
+
allowed: false,
|
|
142
|
+
reason: 'Path not in allowed directories',
|
|
143
|
+
path: resolvedPath,
|
|
144
|
+
category: 'directory_restricted'
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return {
|
|
149
|
+
allowed: true,
|
|
150
|
+
path: resolvedPath,
|
|
151
|
+
category: 'allowed'
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
} catch (error) {
|
|
155
|
+
return {
|
|
156
|
+
allowed: false,
|
|
157
|
+
reason: `Path validation error: ${error.message}`,
|
|
158
|
+
path: targetPath,
|
|
159
|
+
category: 'validation_error'
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Validate if a path can be accessed for writing
|
|
166
|
+
* @param {string} targetPath - Path to validate
|
|
167
|
+
* @param {Object} accessConfig - Directory access configuration
|
|
168
|
+
* @returns {Object} Validation result
|
|
169
|
+
*/
|
|
170
|
+
validateWriteAccess(targetPath, accessConfig) {
|
|
171
|
+
// First check read access
|
|
172
|
+
const readResult = this.validateReadAccess(targetPath, accessConfig);
|
|
173
|
+
if (!readResult.allowed) {
|
|
174
|
+
return {
|
|
175
|
+
...readResult,
|
|
176
|
+
writeAllowed: false
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const resolvedPath = readResult.path;
|
|
181
|
+
|
|
182
|
+
// Build effective write-enabled directories list
|
|
183
|
+
// If writeEnabledDirectories is empty but we have a workingDirectory,
|
|
184
|
+
// treat the workingDirectory as implicitly write-enabled
|
|
185
|
+
let effectiveWriteEnabled = [...(accessConfig.writeEnabledDirectories || [])];
|
|
186
|
+
|
|
187
|
+
if (effectiveWriteEnabled.length === 0 && accessConfig.workingDirectory) {
|
|
188
|
+
// Fallback: working directory is implicitly write-enabled when no explicit dirs configured
|
|
189
|
+
effectiveWriteEnabled = [accessConfig.workingDirectory];
|
|
190
|
+
this.logger?.debug('No writeEnabledDirectories configured, using workingDirectory as fallback', {
|
|
191
|
+
workingDirectory: accessConfig.workingDirectory
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Check if path is within write-enabled directories
|
|
196
|
+
const isWithinWriteEnabled = this.isPathWithinAnyDirectory(
|
|
197
|
+
resolvedPath,
|
|
198
|
+
effectiveWriteEnabled
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
if (!isWithinWriteEnabled) {
|
|
202
|
+
// Check if it's in read-only directories
|
|
203
|
+
const isWithinReadOnly = this.isPathWithinAnyDirectory(
|
|
204
|
+
resolvedPath,
|
|
205
|
+
accessConfig.readOnlyDirectories || []
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
if (isWithinReadOnly) {
|
|
209
|
+
return {
|
|
210
|
+
allowed: false,
|
|
211
|
+
writeAllowed: false,
|
|
212
|
+
reason: 'Path is in read-only directory',
|
|
213
|
+
path: resolvedPath,
|
|
214
|
+
category: 'read_only_restricted'
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return {
|
|
219
|
+
allowed: false,
|
|
220
|
+
writeAllowed: false,
|
|
221
|
+
reason: 'Path not in write-enabled directories',
|
|
222
|
+
path: resolvedPath,
|
|
223
|
+
category: 'write_restricted'
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return {
|
|
228
|
+
allowed: true,
|
|
229
|
+
writeAllowed: true,
|
|
230
|
+
path: resolvedPath,
|
|
231
|
+
category: 'write_allowed'
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Get the effective working directory for an agent
|
|
237
|
+
* @param {Object} accessConfig - Directory access configuration
|
|
238
|
+
* @returns {string} Working directory path
|
|
239
|
+
*/
|
|
240
|
+
getWorkingDirectory(accessConfig) {
|
|
241
|
+
return accessConfig.workingDirectory || process.cwd();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* List accessible directories for an agent
|
|
246
|
+
* @param {Object} accessConfig - Directory access configuration
|
|
247
|
+
* @returns {Object} Directory listing with permissions
|
|
248
|
+
*/
|
|
249
|
+
getAccessibleDirectories(accessConfig) {
|
|
250
|
+
return {
|
|
251
|
+
workingDirectory: accessConfig.workingDirectory,
|
|
252
|
+
readOnly: [...accessConfig.readOnlyDirectories],
|
|
253
|
+
writeEnabled: [...accessConfig.writeEnabledDirectories],
|
|
254
|
+
projectRestricted: accessConfig.restrictToProject,
|
|
255
|
+
systemAccessAllowed: accessConfig.allowSystemAccess,
|
|
256
|
+
totalDirectories: accessConfig.readOnlyDirectories.length + accessConfig.writeEnabledDirectories.length
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Update directory access configuration
|
|
262
|
+
* @param {Object} currentConfig - Current access configuration
|
|
263
|
+
* @param {Object} updates - Updates to apply
|
|
264
|
+
* @returns {Object} Updated configuration
|
|
265
|
+
*/
|
|
266
|
+
updateDirectoryAccess(currentConfig, updates) {
|
|
267
|
+
const updatedConfig = { ...currentConfig };
|
|
268
|
+
|
|
269
|
+
if (updates.workingDirectory) {
|
|
270
|
+
updatedConfig.workingDirectory = path.resolve(updates.workingDirectory);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (updates.readOnlyDirectories !== undefined) {
|
|
274
|
+
updatedConfig.readOnlyDirectories = updates.readOnlyDirectories.map(dir =>
|
|
275
|
+
this.normalizePath(dir, updatedConfig.workingDirectory)
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (updates.writeEnabledDirectories !== undefined) {
|
|
280
|
+
updatedConfig.writeEnabledDirectories = updates.writeEnabledDirectories.map(dir =>
|
|
281
|
+
this.normalizePath(dir, updatedConfig.workingDirectory)
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (updates.restrictToProject !== undefined) {
|
|
286
|
+
updatedConfig.restrictToProject = updates.restrictToProject;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (updates.allowSystemAccess !== undefined) {
|
|
290
|
+
updatedConfig.allowSystemAccess = updates.allowSystemAccess;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (updates.customRestrictions !== undefined) {
|
|
294
|
+
updatedConfig.customRestrictions = updates.customRestrictions.map(restriction =>
|
|
295
|
+
path.resolve(restriction)
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
updatedConfig.version = currentConfig.version || '1.0';
|
|
300
|
+
updatedConfig.updatedAt = new Date().toISOString();
|
|
301
|
+
|
|
302
|
+
return updatedConfig;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Validate directory access configuration
|
|
307
|
+
* @param {Object} accessConfig - Configuration to validate
|
|
308
|
+
* @returns {Object} Validation result
|
|
309
|
+
*/
|
|
310
|
+
validateAccessConfiguration(accessConfig) {
|
|
311
|
+
const errors = [];
|
|
312
|
+
const warnings = [];
|
|
313
|
+
|
|
314
|
+
// Validate working directory exists
|
|
315
|
+
if (!accessConfig.workingDirectory) {
|
|
316
|
+
errors.push('Working directory is required');
|
|
317
|
+
} else {
|
|
318
|
+
// Convert relative paths to absolute paths relative to process.cwd()
|
|
319
|
+
if (!path.isAbsolute(accessConfig.workingDirectory)) {
|
|
320
|
+
accessConfig.workingDirectory = path.resolve(process.cwd(), accessConfig.workingDirectory);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Validate directory arrays
|
|
325
|
+
if (!Array.isArray(accessConfig.readOnlyDirectories)) {
|
|
326
|
+
errors.push('readOnlyDirectories must be an array');
|
|
327
|
+
} else {
|
|
328
|
+
// Convert relative paths to absolute paths
|
|
329
|
+
accessConfig.readOnlyDirectories = accessConfig.readOnlyDirectories.map(dir =>
|
|
330
|
+
path.isAbsolute(dir) ? dir : path.resolve(process.cwd(), dir)
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (!Array.isArray(accessConfig.writeEnabledDirectories)) {
|
|
335
|
+
errors.push('writeEnabledDirectories must be an array');
|
|
336
|
+
} else {
|
|
337
|
+
// Convert relative paths to absolute paths
|
|
338
|
+
accessConfig.writeEnabledDirectories = accessConfig.writeEnabledDirectories.map(dir =>
|
|
339
|
+
path.isAbsolute(dir) ? dir : path.resolve(process.cwd(), dir)
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Check for overlapping directories
|
|
344
|
+
if (accessConfig.readOnlyDirectories && accessConfig.writeEnabledDirectories) {
|
|
345
|
+
const overlapping = this.findOverlappingPaths(
|
|
346
|
+
accessConfig.readOnlyDirectories,
|
|
347
|
+
accessConfig.writeEnabledDirectories
|
|
348
|
+
);
|
|
349
|
+
|
|
350
|
+
if (overlapping.length > 0) {
|
|
351
|
+
warnings.push(`Overlapping directories found: ${overlapping.join(', ')}`);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Check for system path access
|
|
356
|
+
if (accessConfig.allowSystemAccess) {
|
|
357
|
+
warnings.push('System path access is enabled - use with caution');
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Validate paths exist (async check would be needed in real implementation)
|
|
361
|
+
const allPaths = [
|
|
362
|
+
...accessConfig.readOnlyDirectories,
|
|
363
|
+
...accessConfig.writeEnabledDirectories
|
|
364
|
+
];
|
|
365
|
+
|
|
366
|
+
for (const dirPath of allPaths) {
|
|
367
|
+
if (!path.isAbsolute(dirPath)) {
|
|
368
|
+
errors.push(`Directory path must be absolute: ${dirPath}`);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return {
|
|
373
|
+
valid: errors.length === 0,
|
|
374
|
+
errors,
|
|
375
|
+
warnings,
|
|
376
|
+
summary: {
|
|
377
|
+
readOnlyCount: accessConfig.readOnlyDirectories?.length || 0,
|
|
378
|
+
writeEnabledCount: accessConfig.writeEnabledDirectories?.length || 0,
|
|
379
|
+
restrictToProject: accessConfig.restrictToProject,
|
|
380
|
+
allowSystemAccess: accessConfig.allowSystemAccess
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Create relative path from absolute path within accessible directories
|
|
387
|
+
* @param {string} absolutePath - Absolute path to convert
|
|
388
|
+
* @param {Object} accessConfig - Directory access configuration
|
|
389
|
+
* @returns {string} Relative path or original if not within accessible directories
|
|
390
|
+
*/
|
|
391
|
+
createRelativePath(absolutePath, accessConfig) {
|
|
392
|
+
const allDirectories = [
|
|
393
|
+
...accessConfig.readOnlyDirectories,
|
|
394
|
+
...accessConfig.writeEnabledDirectories,
|
|
395
|
+
accessConfig.workingDirectory
|
|
396
|
+
];
|
|
397
|
+
|
|
398
|
+
for (const dir of allDirectories) {
|
|
399
|
+
if (this.isPathWithinDirectory(absolutePath, dir)) {
|
|
400
|
+
return path.relative(dir, absolutePath);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
return absolutePath;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Resolve path relative to working directory or as absolute
|
|
409
|
+
* @private
|
|
410
|
+
*/
|
|
411
|
+
resolvePath(targetPath, workingDirectory) {
|
|
412
|
+
if (path.isAbsolute(targetPath)) {
|
|
413
|
+
return path.normalize(targetPath);
|
|
414
|
+
}
|
|
415
|
+
return path.resolve(workingDirectory, targetPath);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Normalize path to absolute, resolving relative to working directory
|
|
420
|
+
* @private
|
|
421
|
+
*/
|
|
422
|
+
normalizePath(targetPath, workingDirectory) {
|
|
423
|
+
if (path.isAbsolute(targetPath)) {
|
|
424
|
+
return path.normalize(targetPath);
|
|
425
|
+
}
|
|
426
|
+
return path.resolve(workingDirectory, targetPath);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Check if path is within a directory
|
|
431
|
+
* Uses case-insensitive comparison on macOS and Windows
|
|
432
|
+
* @private
|
|
433
|
+
*/
|
|
434
|
+
isPathWithinDirectory(targetPath, parentDirectory) {
|
|
435
|
+
// macOS (APFS/HFS+) and Windows (NTFS) are case-insensitive
|
|
436
|
+
const caseInsensitive = process.platform === 'darwin' || process.platform === 'win32';
|
|
437
|
+
|
|
438
|
+
// Normalize paths for comparison
|
|
439
|
+
let normalizedTarget = path.normalize(targetPath);
|
|
440
|
+
let normalizedParent = path.normalize(parentDirectory);
|
|
441
|
+
|
|
442
|
+
// Apply case-insensitive comparison if needed
|
|
443
|
+
if (caseInsensitive) {
|
|
444
|
+
normalizedTarget = normalizedTarget.toLowerCase();
|
|
445
|
+
normalizedParent = normalizedParent.toLowerCase();
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const relative = path.relative(normalizedParent, normalizedTarget);
|
|
449
|
+
return !relative.startsWith('..') && !path.isAbsolute(relative);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Check if path is within any of the provided directories
|
|
454
|
+
* @private
|
|
455
|
+
*/
|
|
456
|
+
isPathWithinAnyDirectory(targetPath, directories) {
|
|
457
|
+
return directories.some(dir => this.isPathWithinDirectory(targetPath, dir));
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Check if path is system restricted
|
|
462
|
+
* Uses case-insensitive comparison on macOS and Windows
|
|
463
|
+
* @private
|
|
464
|
+
*/
|
|
465
|
+
isSystemRestrictedPath(targetPath) {
|
|
466
|
+
// macOS (APFS/HFS+) and Windows (NTFS) are case-insensitive
|
|
467
|
+
const caseInsensitive = process.platform === 'darwin' || process.platform === 'win32';
|
|
468
|
+
|
|
469
|
+
const normalizedTarget = caseInsensitive ? targetPath.toLowerCase() : targetPath;
|
|
470
|
+
|
|
471
|
+
return this.systemRestrictedPaths.some(restrictedPath => {
|
|
472
|
+
const normalizedRestricted = caseInsensitive ? restrictedPath.toLowerCase() : restrictedPath;
|
|
473
|
+
return normalizedTarget.startsWith(normalizedRestricted) || normalizedTarget === normalizedRestricted;
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Check if path is custom restricted
|
|
479
|
+
* @private
|
|
480
|
+
*/
|
|
481
|
+
isCustomRestricted(targetPath, customRestrictions) {
|
|
482
|
+
if (!customRestrictions || customRestrictions.length === 0) {
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return customRestrictions.some(restriction => {
|
|
487
|
+
return targetPath.startsWith(restriction) || targetPath === restriction;
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Find overlapping paths between two arrays
|
|
493
|
+
* @private
|
|
494
|
+
*/
|
|
495
|
+
findOverlappingPaths(paths1, paths2) {
|
|
496
|
+
const overlapping = [];
|
|
497
|
+
|
|
498
|
+
for (const path1 of paths1) {
|
|
499
|
+
for (const path2 of paths2) {
|
|
500
|
+
if (this.isPathWithinDirectory(path1, path2) || this.isPathWithinDirectory(path2, path1)) {
|
|
501
|
+
overlapping.push(`${path1} <-> ${path2}`);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return overlapping;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Get directory access summary for logging/debugging
|
|
511
|
+
* @param {Object} accessConfig - Directory access configuration
|
|
512
|
+
* @returns {Object} Summary object
|
|
513
|
+
*/
|
|
514
|
+
getAccessSummary(accessConfig) {
|
|
515
|
+
return {
|
|
516
|
+
workingDirectory: accessConfig.workingDirectory,
|
|
517
|
+
readOnlyCount: accessConfig.readOnlyDirectories.length,
|
|
518
|
+
writeEnabledCount: accessConfig.writeEnabledDirectories.length,
|
|
519
|
+
projectRestricted: accessConfig.restrictToProject,
|
|
520
|
+
systemAccessAllowed: accessConfig.allowSystemAccess,
|
|
521
|
+
customRestrictionsCount: accessConfig.customRestrictions?.length || 0,
|
|
522
|
+
configVersion: accessConfig.version || 'unknown',
|
|
523
|
+
lastUpdated: accessConfig.updatedAt || accessConfig.createdAt
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Create default directory access for project-based agents
|
|
529
|
+
* @param {string} projectDir - Project directory path
|
|
530
|
+
* @returns {Object} Default directory access configuration
|
|
531
|
+
*/
|
|
532
|
+
static createProjectDefaults(projectDir) {
|
|
533
|
+
const resolvedProject = path.resolve(projectDir);
|
|
534
|
+
|
|
535
|
+
return {
|
|
536
|
+
workingDirectory: resolvedProject,
|
|
537
|
+
readOnlyDirectories: [resolvedProject],
|
|
538
|
+
writeEnabledDirectories: [resolvedProject],
|
|
539
|
+
restrictToProject: true,
|
|
540
|
+
allowSystemAccess: false,
|
|
541
|
+
customRestrictions: [],
|
|
542
|
+
createdAt: new Date().toISOString(),
|
|
543
|
+
version: '1.0'
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Create permissive directory access (use with caution)
|
|
549
|
+
* @param {string} workingDir - Working directory
|
|
550
|
+
* @returns {Object} Permissive directory access configuration
|
|
551
|
+
*/
|
|
552
|
+
static createPermissiveDefaults(workingDir = process.cwd()) {
|
|
553
|
+
return {
|
|
554
|
+
workingDirectory: path.resolve(workingDir),
|
|
555
|
+
readOnlyDirectories: [os.homedir()],
|
|
556
|
+
writeEnabledDirectories: [path.resolve(workingDir)],
|
|
557
|
+
restrictToProject: false,
|
|
558
|
+
allowSystemAccess: false,
|
|
559
|
+
customRestrictions: [],
|
|
560
|
+
createdAt: new Date().toISOString(),
|
|
561
|
+
version: '1.0'
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export default DirectoryAccessManager;
|