@nocobase/plugin-ai 2.4.0-alpha.1 → 2.4.0-alpha.3

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.
Files changed (50) hide show
  1. package/dist/ai/docs/nocobase/ops-management/migration-manager/built-in-tables.md +0 -1
  2. package/dist/client/{705.a4fe26945d175e8a.js → 705.1d735e63c25f66a8.js} +1 -1
  3. package/dist/client/index.js +3 -3
  4. package/dist/client-v2/{705.f2e1b26a3f000075.js → 705.00c101bef403fb44.js} +1 -1
  5. package/dist/client-v2/index.js +2 -2
  6. package/dist/client-v2/workflow/types.d.ts +1 -0
  7. package/dist/externalVersion.js +15 -15
  8. package/dist/locale/de-DE.json +0 -11
  9. package/dist/locale/en-US.json +1 -12
  10. package/dist/locale/es-ES.json +0 -11
  11. package/dist/locale/fr-FR.json +0 -11
  12. package/dist/locale/hu-HU.json +0 -11
  13. package/dist/locale/id-ID.json +0 -11
  14. package/dist/locale/it-IT.json +0 -11
  15. package/dist/locale/ja-JP.json +0 -11
  16. package/dist/locale/ko-KR.json +0 -11
  17. package/dist/locale/nl-NL.json +0 -11
  18. package/dist/locale/pt-BR.json +0 -11
  19. package/dist/locale/ru-RU.json +0 -11
  20. package/dist/locale/tr-TR.json +0 -11
  21. package/dist/locale/uk-UA.json +0 -11
  22. package/dist/locale/vi-VN.json +0 -11
  23. package/dist/locale/zh-CN.json +1 -12
  24. package/dist/locale/zh-TW.json +0 -11
  25. package/dist/node_modules/@langchain/mistralai/package.json +1 -1
  26. package/dist/node_modules/@langchain/xai/package.json +1 -1
  27. package/dist/node_modules/fs-extra/package.json +1 -1
  28. package/dist/node_modules/jsonrepair/package.json +1 -1
  29. package/dist/node_modules/just-bash/package.json +1 -1
  30. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  31. package/dist/node_modules/openai/package.json +1 -1
  32. package/dist/node_modules/zod/package.json +1 -1
  33. package/dist/server/manager/ai-context-datasource-manager.d.ts +10 -12
  34. package/dist/server/manager/ai-context-datasource-manager.js +0 -3
  35. package/dist/server/plugin.d.ts +0 -4
  36. package/dist/server/plugin.js +1 -14
  37. package/dist/server/workflow/nodes/employee/files.d.ts +1 -1
  38. package/dist/server/workflow/nodes/employee/files.js +48 -1
  39. package/dist/server/workflow/nodes/employee/index.js +7 -2
  40. package/dist/server/workflow/nodes/employee/types.d.ts +1 -0
  41. package/package.json +2 -2
  42. package/dist/client-v2/ai-employees/context/datasource.d.ts +0 -10
  43. package/dist/client-v2/ai-employees/datasource/DatasourceSelector.d.ts +0 -21
  44. package/dist/client-v2/pages/DatasourceSettingsPage.d.ts +0 -62
  45. package/dist/collections/ai-context-datasource.d.ts +0 -25
  46. package/dist/collections/ai-context-datasource.js +0 -89
  47. package/dist/server/collections/ai-context-datasource.d.ts +0 -10
  48. package/dist/server/collections/ai-context-datasource.js +0 -44
  49. package/dist/server/resource/aiContextDatasources.d.ts +0 -10
  50. package/dist/server/resource/aiContextDatasources.js +0 -45
@@ -1 +1 @@
1
- {"name":"fs-extra","version":"9.1.0","description":"fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.","engines":{"node":">=10"},"homepage":"https://github.com/jprichardson/node-fs-extra","repository":{"type":"git","url":"https://github.com/jprichardson/node-fs-extra"},"keywords":["fs","file","file system","copy","directory","extra","mkdirp","mkdir","mkdirs","recursive","json","read","write","extra","delete","remove","touch","create","text","output","move","promise"],"author":"JP Richardson <jprichardson@gmail.com>","license":"MIT","dependencies":{"at-least-node":"^1.0.0","graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^2.0.0"},"devDependencies":{"coveralls":"^3.0.0","klaw":"^2.1.1","klaw-sync":"^3.0.2","minimist":"^1.1.1","mocha":"^5.0.5","nyc":"^15.0.0","proxyquire":"^2.0.1","read-dir-files":"^0.1.1","standard":"^14.1.0"},"main":"./lib/index.js","files":["lib/","!lib/**/__tests__/"],"scripts":{"full-ci":"npm run lint && npm run coverage","coverage":"nyc -r lcovonly npm run unit","coveralls":"coveralls < coverage/lcov.info","lint":"standard","test-find":"find ./lib/**/__tests__ -name *.test.js | xargs mocha","test":"npm run lint && npm run unit","unit":"node test.js"},"_lastModified":"2026-09-02T04:19:52.798Z"}
1
+ {"name":"fs-extra","version":"9.1.0","description":"fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.","engines":{"node":">=10"},"homepage":"https://github.com/jprichardson/node-fs-extra","repository":{"type":"git","url":"https://github.com/jprichardson/node-fs-extra"},"keywords":["fs","file","file system","copy","directory","extra","mkdirp","mkdir","mkdirs","recursive","json","read","write","extra","delete","remove","touch","create","text","output","move","promise"],"author":"JP Richardson <jprichardson@gmail.com>","license":"MIT","dependencies":{"at-least-node":"^1.0.0","graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^2.0.0"},"devDependencies":{"coveralls":"^3.0.0","klaw":"^2.1.1","klaw-sync":"^3.0.2","minimist":"^1.1.1","mocha":"^5.0.5","nyc":"^15.0.0","proxyquire":"^2.0.1","read-dir-files":"^0.1.1","standard":"^14.1.0"},"main":"./lib/index.js","files":["lib/","!lib/**/__tests__/"],"scripts":{"full-ci":"npm run lint && npm run coverage","coverage":"nyc -r lcovonly npm run unit","coveralls":"coveralls < coverage/lcov.info","lint":"standard","test-find":"find ./lib/**/__tests__ -name *.test.js | xargs mocha","test":"npm run lint && npm run unit","unit":"node test.js"},"_lastModified":"2026-09-02T12:36:23.465Z"}
@@ -1 +1 @@
1
- {"name":"jsonrepair","version":"3.13.1","description":"Repair broken JSON documents","repository":{"type":"git","url":"https://github.com/josdejong/jsonrepair.git"},"type":"module","main":"lib/cjs/index.js","module":"lib/esm/index.js","browser":"lib/umd/jsonrepair.min.js","types":"lib/types/index.d.ts","sideEffects":false,"exports":{".":{"import":"./lib/esm/index.js","require":"./lib/cjs/index.js","types":"./lib/types/index.d.ts"},"./stream":{"import":"./lib/esm/stream.js","require":"./lib/cjs/stream.js","types":"./lib/types/stream.d.ts"}},"keywords":["simple","json","repair","fix","invalid","stream","streaming"],"bin":{"jsonrepair":"./bin/cli.js"},"scripts":{"test":"vitest watch src","test:it":"vitest run src","build":"npm-run-all build:**","build:clean":"del-cli lib","build:esm":"babel src --out-dir lib/esm --extensions \".ts\" --source-maps --config-file ./babel.config.json","build:cjs":"babel src --out-dir lib/cjs --extensions \".ts\" --source-maps --config-file ./babel-cjs.config.json && cpy tools/cjs lib/cjs --flat","build:umd":"rollup lib/esm/index.js --format umd --name JSONRepair --sourcemap --output.file lib/umd/jsonrepair.js && cpy tools/cjs/package.json lib/umd --flat","build:umd:min":"uglifyjs --compress --mangle --source-map --comments --output lib/umd/jsonrepair.min.js -- lib/umd/jsonrepair.js","build:types":"tsc --project tsconfig-types.json","build:validate":"vitest run test-lib","lint":"biome check","format":"biome check --write","benchmark":"npm run build:esm && node tools/benchmark/run.mjs","build-and-test":"npm run lint && npm run test:it && npm run build","release":"npm-run-all release:**","release:build-and-test":"npm run build-and-test","release:version":"standard-version","release:push":"git push && git push --tag","release:publish":"npm publish","release-dry-run":"npm run build-and-test && standard-version --dry-run","prepare":"husky"},"files":["README.md","LICENSE.md","lib"],"author":"Jos de Jong","license":"ISC","devDependencies":{"@babel/cli":"7.28.3","@babel/core":"7.28.4","@babel/plugin-transform-typescript":"7.28.0","@babel/preset-env":"7.28.3","@babel/preset-typescript":"7.27.1","@biomejs/biome":"2.2.4","@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@types/node":"24.5.2","cpy-cli":"6.0.0","del-cli":"7.0.0","husky":"9.1.7","npm-run-all":"4.1.5","rollup":"4.51.0","standard-version":"9.5.0","tinybench":"5.0.1","ts-node":"10.9.2","typescript":"5.9.2","uglify-js":"3.19.3","vitest":"3.2.4"},"_lastModified":"2026-09-02T04:20:00.054Z"}
1
+ {"name":"jsonrepair","version":"3.13.1","description":"Repair broken JSON documents","repository":{"type":"git","url":"https://github.com/josdejong/jsonrepair.git"},"type":"module","main":"lib/cjs/index.js","module":"lib/esm/index.js","browser":"lib/umd/jsonrepair.min.js","types":"lib/types/index.d.ts","sideEffects":false,"exports":{".":{"import":"./lib/esm/index.js","require":"./lib/cjs/index.js","types":"./lib/types/index.d.ts"},"./stream":{"import":"./lib/esm/stream.js","require":"./lib/cjs/stream.js","types":"./lib/types/stream.d.ts"}},"keywords":["simple","json","repair","fix","invalid","stream","streaming"],"bin":{"jsonrepair":"./bin/cli.js"},"scripts":{"test":"vitest watch src","test:it":"vitest run src","build":"npm-run-all build:**","build:clean":"del-cli lib","build:esm":"babel src --out-dir lib/esm --extensions \".ts\" --source-maps --config-file ./babel.config.json","build:cjs":"babel src --out-dir lib/cjs --extensions \".ts\" --source-maps --config-file ./babel-cjs.config.json && cpy tools/cjs lib/cjs --flat","build:umd":"rollup lib/esm/index.js --format umd --name JSONRepair --sourcemap --output.file lib/umd/jsonrepair.js && cpy tools/cjs/package.json lib/umd --flat","build:umd:min":"uglifyjs --compress --mangle --source-map --comments --output lib/umd/jsonrepair.min.js -- lib/umd/jsonrepair.js","build:types":"tsc --project tsconfig-types.json","build:validate":"vitest run test-lib","lint":"biome check","format":"biome check --write","benchmark":"npm run build:esm && node tools/benchmark/run.mjs","build-and-test":"npm run lint && npm run test:it && npm run build","release":"npm-run-all release:**","release:build-and-test":"npm run build-and-test","release:version":"standard-version","release:push":"git push && git push --tag","release:publish":"npm publish","release-dry-run":"npm run build-and-test && standard-version --dry-run","prepare":"husky"},"files":["README.md","LICENSE.md","lib"],"author":"Jos de Jong","license":"ISC","devDependencies":{"@babel/cli":"7.28.3","@babel/core":"7.28.4","@babel/plugin-transform-typescript":"7.28.0","@babel/preset-env":"7.28.3","@babel/preset-typescript":"7.27.1","@biomejs/biome":"2.2.4","@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@types/node":"24.5.2","cpy-cli":"6.0.0","del-cli":"7.0.0","husky":"9.1.7","npm-run-all":"4.1.5","rollup":"4.51.0","standard-version":"9.5.0","tinybench":"5.0.1","ts-node":"10.9.2","typescript":"5.9.2","uglify-js":"3.19.3","vitest":"3.2.4"},"_lastModified":"2026-09-02T12:36:31.326Z"}
@@ -1 +1 @@
1
- {"name":"just-bash","version":"2.14.3","description":"A simulated bash environment with virtual filesystem","repository":{"type":"git","url":"git+https://github.com/vercel-labs/just-bash.git"},"homepage":"https://github.com/vercel-labs/just-bash#readme","bugs":{"url":"https://github.com/vercel-labs/just-bash/issues"},"type":"module","main":"dist/bundle/index.js","types":"dist/index.d.ts","exports":{".":{"browser":"./dist/bundle/browser.js","require":{"types":"./dist/index.d.cts","default":"./dist/bundle/index.cjs"},"import":{"types":"./dist/index.d.ts","default":"./dist/bundle/index.js"}},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/bundle/browser.js"}},"files":["dist/bundle/","dist/bin/","dist/*.d.ts","dist/*.d.cts","dist/ast/*.d.ts","dist/commands/**/*.d.ts","dist/fs/**/*.d.ts","dist/interpreter/**/*.d.ts","dist/network/**/*.d.ts","dist/parser/*.d.ts","dist/sandbox/*.d.ts","dist/utils/*.d.ts","vendor/cpython-emscripten/","README.md","CHANGELOG.md","dist/AGENTS.md"],"bin":{"just-bash":"./dist/bin/just-bash.js","just-bash-shell":"./dist/bin/shell/shell.js"},"publishConfig":{"access":"public"},"keywords":[],"author":"Malte and Claude","license":"Apache-2.0","devDependencies":{"@types/ini":"^4.1.1","@types/node":"^25.0.3","@types/papaparse":"^5.5.2","@types/sprintf-js":"^1.1.4","@types/sql.js":"^1.4.9","@types/turndown":"^5.0.6","@vitest/coverage-v8":"^4.0.18","esbuild":"^0.27.2","fast-check":"^3.23.2","knip":"^5.41.1","typescript":"^5.9.3","vitest":"^4.0.16"},"dependencies":{"seek-bzip":"^2.0.0","diff":"^8.0.2","fast-xml-parser":"5.3.3","file-type":"^21.2.0","ini":"^6.0.0","minimatch":"^10.1.1","modern-tar":"^0.7.3","papaparse":"^5.5.3","quickjs-emscripten":"^0.32.0","re2js":"^1.2.1","smol-toml":"^1.6.0","sprintf-js":"^1.1.3","sql.js":"^1.13.0","turndown":"^7.2.2","yaml":"^2.8.2"},"optionalDependencies":{"@mongodb-js/zstd":"^7.0.0","node-liblzma":"^2.0.3"},"scripts":{"build":"rm -rf dist && tsc && pnpm build:lib && pnpm build:lib:cjs && pnpm build:browser && pnpm build:cli && pnpm build:shell && pnpm build:worker && pnpm build:clean && cp dist/index.d.ts dist/index.d.cts && sed '1,/^-->/d' AGENTS.npm.md > dist/AGENTS.md","build:clean":"find dist -name '*.test.js' -delete && find dist -name '*.test.d.ts' -delete","build:worker":"esbuild src/commands/python3/worker.ts --bundle --platform=node --format=esm --outfile=src/commands/python3/worker.js --external:../../../vendor/cpython-emscripten/* && cp src/commands/python3/worker.js dist/commands/python3/worker.js && mkdir -p dist/bin/chunks && cp src/commands/python3/worker.js dist/bin/chunks/worker.js && mkdir -p dist/bundle/chunks && cp src/commands/python3/worker.js dist/bundle/chunks/worker.js && esbuild src/commands/js-exec/js-exec-worker.ts --bundle --platform=node --format=esm --outfile=src/commands/js-exec/js-exec-worker.js --external:quickjs-emscripten && cp src/commands/js-exec/js-exec-worker.js dist/commands/js-exec/js-exec-worker.js && cp src/commands/js-exec/js-exec-worker.js dist/bin/chunks/js-exec-worker.js && cp src/commands/js-exec/js-exec-worker.js dist/bundle/chunks/js-exec-worker.js","build:lib":"esbuild dist/index.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bundle --chunk-names=chunks/[name]-[hash] --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:lib:cjs":"esbuild dist/index.js --bundle --platform=node --format=cjs --minify --outfile=dist/bundle/index.cjs --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:browser":"esbuild dist/browser.js --bundle --platform=browser --format=esm --minify --outfile=dist/bundle/browser.js --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:node:zlib --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip --define:__BROWSER__=true --alias:node:dns=./src/shims/browser-unsupported.js","build:cli":"esbuild dist/cli/just-bash.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:shell":"esbuild dist/cli/shell.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin/shell --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","validate":"pnpm lint && pnpm knip && pnpm typecheck && pnpm build && pnpm check:worker-sync && pnpm test:run && pnpm test:wasm && pnpm test:dist","typecheck":"tsc --noEmit","lint":"pnpm lint:banned","check:worker-sync":"node scripts/check-worker-sync.js","lint:banned":"node scripts/check-banned-patterns.js","lint:fix":"pnpm --workspace-root lint:fix","knip":"knip","test":"vitest","test:run":"vitest run --exclude src/security/fuzzing/ --exclude src/commands/python3/ --exclude src/commands/sqlite3/ --exclude src/commands/js-exec/ --exclude src/agent-examples/python-scripting.test.ts","test:dist":"vitest run src/cli/just-bash.bundle.test.ts","test:unit":"vitest run --config vitest.unit.config.ts","test:wasm":"vitest run --config vitest.wasm.config.ts","test:comparison":"vitest run --config vitest.comparison.config.ts","test:comparison:record":"RECORD_FIXTURES=1 vitest run --config vitest.comparison.config.ts","test:coverage":"vitest run --coverage","test:coverage:unit":"vitest run --config vitest.unit.config.ts --coverage","test:fuzz":"vitest run src/security/fuzzing/","test:fuzz:long":"FUZZ_RUNS=10000 vitest run src/security/fuzzing/","shell":"npx tsx src/cli/shell.ts","dev:exec":"npx tsx src/cli/exec.ts"},"_lastModified":"2026-09-02T04:19:58.169Z"}
1
+ {"name":"just-bash","version":"2.14.3","description":"A simulated bash environment with virtual filesystem","repository":{"type":"git","url":"git+https://github.com/vercel-labs/just-bash.git"},"homepage":"https://github.com/vercel-labs/just-bash#readme","bugs":{"url":"https://github.com/vercel-labs/just-bash/issues"},"type":"module","main":"dist/bundle/index.js","types":"dist/index.d.ts","exports":{".":{"browser":"./dist/bundle/browser.js","require":{"types":"./dist/index.d.cts","default":"./dist/bundle/index.cjs"},"import":{"types":"./dist/index.d.ts","default":"./dist/bundle/index.js"}},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/bundle/browser.js"}},"files":["dist/bundle/","dist/bin/","dist/*.d.ts","dist/*.d.cts","dist/ast/*.d.ts","dist/commands/**/*.d.ts","dist/fs/**/*.d.ts","dist/interpreter/**/*.d.ts","dist/network/**/*.d.ts","dist/parser/*.d.ts","dist/sandbox/*.d.ts","dist/utils/*.d.ts","vendor/cpython-emscripten/","README.md","CHANGELOG.md","dist/AGENTS.md"],"bin":{"just-bash":"./dist/bin/just-bash.js","just-bash-shell":"./dist/bin/shell/shell.js"},"publishConfig":{"access":"public"},"keywords":[],"author":"Malte and Claude","license":"Apache-2.0","devDependencies":{"@types/ini":"^4.1.1","@types/node":"^25.0.3","@types/papaparse":"^5.5.2","@types/sprintf-js":"^1.1.4","@types/sql.js":"^1.4.9","@types/turndown":"^5.0.6","@vitest/coverage-v8":"^4.0.18","esbuild":"^0.27.2","fast-check":"^3.23.2","knip":"^5.41.1","typescript":"^5.9.3","vitest":"^4.0.16"},"dependencies":{"seek-bzip":"^2.0.0","diff":"^8.0.2","fast-xml-parser":"5.3.3","file-type":"^21.2.0","ini":"^6.0.0","minimatch":"^10.1.1","modern-tar":"^0.7.3","papaparse":"^5.5.3","quickjs-emscripten":"^0.32.0","re2js":"^1.2.1","smol-toml":"^1.6.0","sprintf-js":"^1.1.3","sql.js":"^1.13.0","turndown":"^7.2.2","yaml":"^2.8.2"},"optionalDependencies":{"@mongodb-js/zstd":"^7.0.0","node-liblzma":"^2.0.3"},"scripts":{"build":"rm -rf dist && tsc && pnpm build:lib && pnpm build:lib:cjs && pnpm build:browser && pnpm build:cli && pnpm build:shell && pnpm build:worker && pnpm build:clean && cp dist/index.d.ts dist/index.d.cts && sed '1,/^-->/d' AGENTS.npm.md > dist/AGENTS.md","build:clean":"find dist -name '*.test.js' -delete && find dist -name '*.test.d.ts' -delete","build:worker":"esbuild src/commands/python3/worker.ts --bundle --platform=node --format=esm --outfile=src/commands/python3/worker.js --external:../../../vendor/cpython-emscripten/* && cp src/commands/python3/worker.js dist/commands/python3/worker.js && mkdir -p dist/bin/chunks && cp src/commands/python3/worker.js dist/bin/chunks/worker.js && mkdir -p dist/bundle/chunks && cp src/commands/python3/worker.js dist/bundle/chunks/worker.js && esbuild src/commands/js-exec/js-exec-worker.ts --bundle --platform=node --format=esm --outfile=src/commands/js-exec/js-exec-worker.js --external:quickjs-emscripten && cp src/commands/js-exec/js-exec-worker.js dist/commands/js-exec/js-exec-worker.js && cp src/commands/js-exec/js-exec-worker.js dist/bin/chunks/js-exec-worker.js && cp src/commands/js-exec/js-exec-worker.js dist/bundle/chunks/js-exec-worker.js","build:lib":"esbuild dist/index.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bundle --chunk-names=chunks/[name]-[hash] --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:lib:cjs":"esbuild dist/index.js --bundle --platform=node --format=cjs --minify --outfile=dist/bundle/index.cjs --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:browser":"esbuild dist/browser.js --bundle --platform=browser --format=esm --minify --outfile=dist/bundle/browser.js --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:node:zlib --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip --define:__BROWSER__=true --alias:node:dns=./src/shims/browser-unsupported.js","build:cli":"esbuild dist/cli/just-bash.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:shell":"esbuild dist/cli/shell.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin/shell --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","validate":"pnpm lint && pnpm knip && pnpm typecheck && pnpm build && pnpm check:worker-sync && pnpm test:run && pnpm test:wasm && pnpm test:dist","typecheck":"tsc --noEmit","lint":"pnpm lint:banned","check:worker-sync":"node scripts/check-worker-sync.js","lint:banned":"node scripts/check-banned-patterns.js","lint:fix":"pnpm --workspace-root lint:fix","knip":"knip","test":"vitest","test:run":"vitest run --exclude src/security/fuzzing/ --exclude src/commands/python3/ --exclude src/commands/sqlite3/ --exclude src/commands/js-exec/ --exclude src/agent-examples/python-scripting.test.ts","test:dist":"vitest run src/cli/just-bash.bundle.test.ts","test:unit":"vitest run --config vitest.unit.config.ts","test:wasm":"vitest run --config vitest.wasm.config.ts","test:comparison":"vitest run --config vitest.comparison.config.ts","test:comparison:record":"RECORD_FIXTURES=1 vitest run --config vitest.comparison.config.ts","test:coverage":"vitest run --coverage","test:coverage:unit":"vitest run --config vitest.unit.config.ts --coverage","test:fuzz":"vitest run src/security/fuzzing/","test:fuzz:long":"FUZZ_RUNS=10000 vitest run src/security/fuzzing/","shell":"npx tsx src/cli/shell.ts","dev:exec":"npx tsx src/cli/exec.ts"},"_lastModified":"2026-09-02T12:36:29.300Z"}
@@ -1 +1 @@
1
- {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-09-02T04:19:42.716Z"}
1
+ {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-09-02T12:36:12.754Z"}
@@ -1 +1 @@
1
- {"name":"openai","version":"6.39.1","description":"The official TypeScript library for the OpenAI API","author":"OpenAI <support@openai.com>","types":"./index.d.ts","main":"./index.js","type":"commonjs","repository":"github:openai/openai-node","license":"Apache-2.0","packageManager":"yarn@1.22.22","files":["**/*"],"private":false,"publishConfig":{"access":"public"},"scripts":{"test":"./scripts/test","build":"./scripts/build","format":"./scripts/format","tsn":"ts-node -r tsconfig-paths/register","lint":"./scripts/lint","fix":"./scripts/format"},"dependencies":{},"bin":{"openai":"bin/cli"},"overrides":{"minimatch":"^9.0.5"},"pnpm":{"overrides":{"minimatch":"^9.0.5"}},"resolutions":{"minimatch":"^9.0.5"},"exports":{".":{"require":{"types":"./index.d.ts","default":"./index.js"},"types":"./index.d.mts","default":"./index.mjs"},"./_vendor/*.mjs":{"default":"./_vendor/*.mjs"},"./_vendor/*.js":{"default":"./_vendor/*.js"},"./_vendor/*":{"import":"./_vendor/*.mjs","require":"./_vendor/*.js"},"./api-promise":{"import":"./api-promise.mjs","require":"./api-promise.js"},"./api-promise.js":{"default":"./api-promise.js"},"./api-promise.mjs":{"default":"./api-promise.mjs"},"./auth/*.mjs":{"default":"./auth/*.mjs"},"./auth/*.js":{"default":"./auth/*.js"},"./auth/*":{"import":"./auth/*.mjs","require":"./auth/*.js"},"./azure":{"import":"./azure.mjs","require":"./azure.js"},"./azure.js":{"default":"./azure.js"},"./azure.mjs":{"default":"./azure.mjs"},"./beta/*.mjs":{"default":"./beta/*.mjs"},"./beta/*.js":{"default":"./beta/*.js"},"./beta/*":{"import":"./beta/*.mjs","require":"./beta/*.js"},"./client":{"import":"./client.mjs","require":"./client.js"},"./client.js":{"default":"./client.js"},"./client.mjs":{"default":"./client.mjs"},"./core/*.mjs":{"default":"./core/*.mjs"},"./core/*.js":{"default":"./core/*.js"},"./core/*":{"import":"./core/*.mjs","require":"./core/*.js"},"./error":{"import":"./error.mjs","require":"./error.js"},"./error.js":{"default":"./error.js"},"./error.mjs":{"default":"./error.mjs"},"./helpers/*.mjs":{"default":"./helpers/*.mjs"},"./helpers/*.js":{"default":"./helpers/*.js"},"./helpers/*":{"import":"./helpers/*.mjs","require":"./helpers/*.js"},"./index":{"import":"./index.mjs","require":"./index.js"},"./index.js":{"default":"./index.js"},"./index.mjs":{"default":"./index.mjs"},"./lib/*.mjs":{"default":"./lib/*.mjs"},"./lib/*.js":{"default":"./lib/*.js"},"./lib/*":{"import":"./lib/*.mjs","require":"./lib/*.js"},"./pagination":{"import":"./pagination.mjs","require":"./pagination.js"},"./pagination.js":{"default":"./pagination.js"},"./pagination.mjs":{"default":"./pagination.mjs"},"./realtime/*.mjs":{"default":"./realtime/*.mjs"},"./realtime/*.js":{"default":"./realtime/*.js"},"./realtime/*":{"import":"./realtime/*.mjs","require":"./realtime/*.js"},"./resource":{"import":"./resource.mjs","require":"./resource.js"},"./resource.js":{"default":"./resource.js"},"./resource.mjs":{"default":"./resource.mjs"},"./resources/*.mjs":{"default":"./resources/*.mjs"},"./resources/*.js":{"default":"./resources/*.js"},"./resources/*":{"import":"./resources/*.mjs","require":"./resources/*.js"},"./resources":{"import":"./resources.mjs","require":"./resources.js"},"./resources.js":{"default":"./resources.js"},"./resources.mjs":{"default":"./resources.mjs"},"./streaming":{"import":"./streaming.mjs","require":"./streaming.js"},"./streaming.js":{"default":"./streaming.js"},"./streaming.mjs":{"default":"./streaming.mjs"},"./uploads":{"import":"./uploads.mjs","require":"./uploads.js"},"./uploads.js":{"default":"./uploads.js"},"./uploads.mjs":{"default":"./uploads.mjs"},"./version":{"import":"./version.mjs","require":"./version.js"},"./version.js":{"default":"./version.js"},"./version.mjs":{"default":"./version.mjs"}},"peerDependencies":{"ws":"^8.18.0","zod":"^3.25 || ^4.0"},"peerDependenciesMeta":{"ws":{"optional":true},"zod":{"optional":true}},"_lastModified":"2026-09-02T04:19:59.895Z"}
1
+ {"name":"openai","version":"6.39.1","description":"The official TypeScript library for the OpenAI API","author":"OpenAI <support@openai.com>","types":"./index.d.ts","main":"./index.js","type":"commonjs","repository":"github:openai/openai-node","license":"Apache-2.0","packageManager":"yarn@1.22.22","files":["**/*"],"private":false,"publishConfig":{"access":"public"},"scripts":{"test":"./scripts/test","build":"./scripts/build","format":"./scripts/format","tsn":"ts-node -r tsconfig-paths/register","lint":"./scripts/lint","fix":"./scripts/format"},"dependencies":{},"bin":{"openai":"bin/cli"},"overrides":{"minimatch":"^9.0.5"},"pnpm":{"overrides":{"minimatch":"^9.0.5"}},"resolutions":{"minimatch":"^9.0.5"},"exports":{".":{"require":{"types":"./index.d.ts","default":"./index.js"},"types":"./index.d.mts","default":"./index.mjs"},"./_vendor/*.mjs":{"default":"./_vendor/*.mjs"},"./_vendor/*.js":{"default":"./_vendor/*.js"},"./_vendor/*":{"import":"./_vendor/*.mjs","require":"./_vendor/*.js"},"./api-promise":{"import":"./api-promise.mjs","require":"./api-promise.js"},"./api-promise.js":{"default":"./api-promise.js"},"./api-promise.mjs":{"default":"./api-promise.mjs"},"./auth/*.mjs":{"default":"./auth/*.mjs"},"./auth/*.js":{"default":"./auth/*.js"},"./auth/*":{"import":"./auth/*.mjs","require":"./auth/*.js"},"./azure":{"import":"./azure.mjs","require":"./azure.js"},"./azure.js":{"default":"./azure.js"},"./azure.mjs":{"default":"./azure.mjs"},"./beta/*.mjs":{"default":"./beta/*.mjs"},"./beta/*.js":{"default":"./beta/*.js"},"./beta/*":{"import":"./beta/*.mjs","require":"./beta/*.js"},"./client":{"import":"./client.mjs","require":"./client.js"},"./client.js":{"default":"./client.js"},"./client.mjs":{"default":"./client.mjs"},"./core/*.mjs":{"default":"./core/*.mjs"},"./core/*.js":{"default":"./core/*.js"},"./core/*":{"import":"./core/*.mjs","require":"./core/*.js"},"./error":{"import":"./error.mjs","require":"./error.js"},"./error.js":{"default":"./error.js"},"./error.mjs":{"default":"./error.mjs"},"./helpers/*.mjs":{"default":"./helpers/*.mjs"},"./helpers/*.js":{"default":"./helpers/*.js"},"./helpers/*":{"import":"./helpers/*.mjs","require":"./helpers/*.js"},"./index":{"import":"./index.mjs","require":"./index.js"},"./index.js":{"default":"./index.js"},"./index.mjs":{"default":"./index.mjs"},"./lib/*.mjs":{"default":"./lib/*.mjs"},"./lib/*.js":{"default":"./lib/*.js"},"./lib/*":{"import":"./lib/*.mjs","require":"./lib/*.js"},"./pagination":{"import":"./pagination.mjs","require":"./pagination.js"},"./pagination.js":{"default":"./pagination.js"},"./pagination.mjs":{"default":"./pagination.mjs"},"./realtime/*.mjs":{"default":"./realtime/*.mjs"},"./realtime/*.js":{"default":"./realtime/*.js"},"./realtime/*":{"import":"./realtime/*.mjs","require":"./realtime/*.js"},"./resource":{"import":"./resource.mjs","require":"./resource.js"},"./resource.js":{"default":"./resource.js"},"./resource.mjs":{"default":"./resource.mjs"},"./resources/*.mjs":{"default":"./resources/*.mjs"},"./resources/*.js":{"default":"./resources/*.js"},"./resources/*":{"import":"./resources/*.mjs","require":"./resources/*.js"},"./resources":{"import":"./resources.mjs","require":"./resources.js"},"./resources.js":{"default":"./resources.js"},"./resources.mjs":{"default":"./resources.mjs"},"./streaming":{"import":"./streaming.mjs","require":"./streaming.js"},"./streaming.js":{"default":"./streaming.js"},"./streaming.mjs":{"default":"./streaming.mjs"},"./uploads":{"import":"./uploads.mjs","require":"./uploads.js"},"./uploads.js":{"default":"./uploads.js"},"./uploads.mjs":{"default":"./uploads.mjs"},"./version":{"import":"./version.mjs","require":"./version.js"},"./version.js":{"default":"./version.js"},"./version.mjs":{"default":"./version.mjs"}},"peerDependencies":{"ws":"^8.18.0","zod":"^3.25 || ^4.0"},"peerDependenciesMeta":{"ws":{"optional":true},"zod":{"optional":true}},"_lastModified":"2026-09-02T12:36:31.155Z"}
@@ -1 +1 @@
1
- {"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-09-02T04:19:42.663Z"}
1
+ {"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-09-02T12:36:12.696Z"}
@@ -7,26 +7,28 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { QueryObject } from '@nocobase/utils';
10
- import { AIContextDatasource } from '../../collections/ai-context-datasource';
11
10
  import PluginAIServer from '../plugin';
12
11
  import { WorkContextResolveStrategy } from '../types';
13
12
  import { Context } from '@nocobase/actions';
14
13
  export declare class AIContextDatasourceManager {
15
14
  protected plugin: PluginAIServer;
16
15
  constructor(plugin: PluginAIServer);
17
- preview(ctx: Context, options: PreviewOptions): Promise<QueryResult | null>;
18
- query(ctx: Context, options: InnerQueryOptions): Promise<QueryResult | null>;
16
+ query(ctx: Context, options: DatasourceQueryOptions): Promise<QueryResult | null>;
19
17
  provideWorkContextResolveStrategy(): WorkContextResolveStrategy;
20
18
  private innerQuery;
21
19
  }
22
- export type PreviewOptions = Pick<AIContextDatasource, 'datasource' | 'collectionName' | 'fields' | 'appends' | 'filter' | 'sort' | 'limit'> & {
20
+ export type DatasourceQueryOptions = {
21
+ datasource: string;
22
+ collectionName: string;
23
+ fields?: string[];
24
+ appends?: string[];
25
+ filter?: QueryObject | null;
26
+ sort?: string[];
27
+ limit: number;
23
28
  offset?: number;
24
29
  };
25
- export type QueryOptions = {
26
- id: string;
27
- };
28
30
  export type QueryResult = {
29
- options: InnerQueryOptions;
31
+ options: DatasourceQueryOptions;
30
32
  total: number;
31
33
  records: {
32
34
  name: string;
@@ -34,7 +36,3 @@ export type QueryResult = {
34
36
  value: unknown;
35
37
  }[][];
36
38
  };
37
- type InnerQueryOptions = Omit<PreviewOptions, 'filter'> & {
38
- filter: QueryObject;
39
- };
40
- export {};
@@ -92,9 +92,6 @@ class AIContextDatasourceManager {
92
92
  constructor(plugin) {
93
93
  this.plugin = plugin;
94
94
  }
95
- async preview(ctx, options) {
96
- return await this.innerQuery(ctx, { ...options, filter: options.filter ? (0, import_utils.transformFilter)(options.filter) : null });
97
- }
98
95
  async query(ctx, options) {
99
96
  return await this.innerQuery(ctx, { ...options, filter: options.filter });
100
97
  }
@@ -59,11 +59,7 @@ export declare class PluginAIServer extends Plugin {
59
59
  afterEnable(): Promise<void>;
60
60
  afterDisable(): Promise<void>;
61
61
  remove(): Promise<void>;
62
- get repositories(): {
63
- aiContextDatasources: import("@nocobase/database").Repository<any, any>;
64
- };
65
62
  private registerAIFileAccessAuthorizer;
66
63
  get fileManager(): PluginFileManagerServer;
67
- private repository;
68
64
  }
69
65
  export default PluginAIServer;
@@ -66,7 +66,6 @@ var import_dashscope = require("./llm-providers/dashscope");
66
66
  var import_ollama = require("./llm-providers/ollama");
67
67
  var import_built_in_manager = require("./manager/built-in-manager");
68
68
  var import_ai_context_datasource_manager = require("./manager/ai-context-datasource-manager");
69
- var import_aiContextDatasources = require("./resource/aiContextDatasources");
70
69
  var import_aiMcpClients = __toESM(require("./resource/aiMcpClients"));
71
70
  var import_work_context_handler = require("./manager/work-context-handler");
72
71
  var import_ai_coding_manager = require("./manager/ai-coding-manager");
@@ -212,7 +211,6 @@ class PluginAIServer extends import_server.Plugin {
212
211
  this.app.resourceManager.define(import_aiTools.default);
213
212
  this.app.resourceManager.define(import_aiSkills.default);
214
213
  this.app.resourceManager.define(import_aiSettings.default);
215
- this.app.resourceManager.define(import_aiContextDatasources.aiContextDatasources);
216
214
  this.app.resourceManager.define(import_aiMcpClients.default);
217
215
  this.app.resourceManager.use(
218
216
  async (ctx, next) => {
@@ -287,7 +285,7 @@ class PluginAIServer extends import_server.Plugin {
287
285
  });
288
286
  this.app.acl.registerSnippet({
289
287
  name: `pm.${this.name}.ai-employees`,
290
- actions: ["aiEmployees:*", "aiTools:*", "aiSkills:*", "roles.aiEmployees:*", "aiContextDatasources:*"]
288
+ actions: ["aiEmployees:*", "aiTools:*", "aiSkills:*", "roles.aiEmployees:*"]
291
289
  });
292
290
  this.app.acl.registerSnippet({
293
291
  name: `pm.${this.name}.ai-settings`,
@@ -295,9 +293,6 @@ class PluginAIServer extends import_server.Plugin {
295
293
  });
296
294
  this.app.acl.allow("aiConversations", "*", "loggedIn");
297
295
  this.app.acl.allow("aiWorkflowTasks", "*", "loggedIn");
298
- this.app.acl.allow("aiContextDatasources", "get", "loggedIn");
299
- this.app.acl.allow("aiContextDatasources", "list", "loggedIn");
300
- this.app.acl.allow("aiContextDatasources", "preview", "loggedIn");
301
296
  this.app.acl.allow("aiFiles", "create", "loggedIn");
302
297
  this.app.acl.allow("aiSettings", "publicGet", "loggedIn");
303
298
  this.app.acl.allow("ai", "listAllEnabledModels", "loggedIn");
@@ -376,11 +371,6 @@ class PluginAIServer extends import_server.Plugin {
376
371
  }
377
372
  async remove() {
378
373
  }
379
- get repositories() {
380
- return {
381
- aiContextDatasources: this.repository("aiContextDatasources")
382
- };
383
- }
384
374
  registerAIFileAccessAuthorizer() {
385
375
  this.fileManager.registerFileAccessAuthorizer({
386
376
  name: "ai-files",
@@ -404,9 +394,6 @@ class PluginAIServer extends import_server.Plugin {
404
394
  get fileManager() {
405
395
  return this.app.pm.get("file-manager");
406
396
  }
407
- repository(collectionName) {
408
- return this.app.db.getRepository(collectionName);
409
- }
410
397
  }
411
398
  var plugin_default = PluginAIServer;
412
399
  // Annotate the CommonJS export names for ESM import in node:
@@ -11,7 +11,7 @@ import { Plugin } from '@nocobase/server';
11
11
  export declare abstract class Files {
12
12
  static resolvers(plugin: Plugin, attachmentPart: {
13
13
  attachments?: unknown[];
14
- }): {
14
+ }, fileUrlOrigin?: string): {
15
15
  resolveAttachments: (files: AIEmployeeInstructionFiles[]) => Promise<void>;
16
16
  resolveFileIds: (files: AIEmployeeInstructionFiles[]) => Promise<void>;
17
17
  resolveUrls: (files: AIEmployeeInstructionFiles[]) => Promise<void>;
@@ -44,6 +44,7 @@ var import_node_os = __toESM(require("node:os"));
44
44
  var import_node_path = __toESM(require("node:path"));
45
45
  var import_lodash = __toESM(require("lodash"));
46
46
  var import_axios = __toESM(require("axios"));
47
+ var import_plugin_file_manager = require("@nocobase/plugin-file-manager");
47
48
  var import_utils = require("../../utils");
48
49
  var import_attachments = require("../../../attachments");
49
50
  function appendSource(record, source) {
@@ -55,8 +56,45 @@ function appendSource(record, source) {
55
56
  source
56
57
  };
57
58
  }
59
+ function toFilePlainObject(record) {
60
+ const value = typeof record.toJSON === "function" ? record.toJSON() : record;
61
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
62
+ throw new Error("Invalid file record");
63
+ }
64
+ return value;
65
+ }
66
+ async function resolveInternalFileURL(plugin, url, origin) {
67
+ var _a;
68
+ const reference = (0, import_plugin_file_manager.parsePermanentFileReference)(url, origin);
69
+ if (!reference) {
70
+ return null;
71
+ }
72
+ if (reference.appName !== (plugin.app.name || "main")) {
73
+ throw new Error("File not found");
74
+ }
75
+ const dataSource = plugin.app.dataSourceManager.get(reference.dataSourceKey);
76
+ const collection = dataSource == null ? void 0 : dataSource.collectionManager.getCollection(reference.collectionName);
77
+ if (!dataSource || !collection || collection.name !== "attachments" && ((_a = collection.options) == null ? void 0 : _a.template) !== "file") {
78
+ throw new Error("File not found");
79
+ }
80
+ const record = await dataSource.collectionManager.getRepository(collection.name).findOne({
81
+ filter: { id: reference.id }
82
+ });
83
+ if (!record) {
84
+ throw new Error("File not found");
85
+ }
86
+ const file = toFilePlainObject(record);
87
+ if (file.storageId == null || reference.extname && reference.extname !== file.extname) {
88
+ throw new Error("File not found");
89
+ }
90
+ return appendSource(file, {
91
+ dataSourceKey: reference.dataSourceKey,
92
+ collectionName: collection.name,
93
+ trustworthy: true
94
+ });
95
+ }
58
96
  class Files {
59
- static resolvers(plugin, attachmentPart) {
97
+ static resolvers(plugin, attachmentPart, fileUrlOrigin) {
60
98
  const resolveAttachments = async (files) => {
61
99
  const attachments = files.filter((it) => it.type === "attachments").flatMap((it) => import_lodash.default.isArray(it.value) ? it.value : [it.value]).map(
62
100
  (attachment) => appendSource(attachment, {
@@ -114,6 +152,15 @@ class Files {
114
152
  const storageName = (_a = settings == null ? void 0 : settings.options) == null ? void 0 : _a.storage;
115
153
  const attachments = await Promise.all(
116
154
  urls.map(async (url) => {
155
+ const internalFile = await resolveInternalFileURL(plugin, url, fileUrlOrigin);
156
+ if (internalFile) {
157
+ return internalFile;
158
+ }
159
+ try {
160
+ new URL(url);
161
+ } catch (error) {
162
+ throw new Error(`File URL must be an absolute URL or a NocoBase permanent file URL: ${url}`);
163
+ }
117
164
  const response = await import_axios.default.get(url, {
118
165
  responseType: "arraybuffer"
119
166
  });
@@ -59,7 +59,8 @@ class AIEmployeeInstruction extends import_plugin_workflow.Instruction {
59
59
  model,
60
60
  requiresApproval = import_constants.REQUIRES_APPROVAL.NO_REQUIRED,
61
61
  userId,
62
- files
62
+ files,
63
+ fileUrlOrigin
63
64
  } = processor.getParsedValue(node.config, node.id);
64
65
  const toolName = import_ai.SYSTEM_TOOLS.WORK_FLOW_TASK_OUTPUT;
65
66
  const workflowSystemPrompt = `
@@ -153,7 +154,11 @@ ${typeof message.system === "object" ? JSON.stringify(message.system) : message.
153
154
  });
154
155
  const attachmentPart = {};
155
156
  if (files == null ? void 0 : files.length) {
156
- const { resolveAttachments, resolveFileIds, resolveUrls } = import_files.Files.resolvers(this.workflow, attachmentPart);
157
+ const { resolveAttachments, resolveFileIds, resolveUrls } = import_files.Files.resolvers(
158
+ this.workflow,
159
+ attachmentPart,
160
+ fileUrlOrigin
161
+ );
157
162
  await resolveAttachments(files);
158
163
  await resolveFileIds(files);
159
164
  await resolveUrls(files);
@@ -29,6 +29,7 @@ export type AIEmployeeInstructionConfig = {
29
29
  assignees?: string[];
30
30
  userId: string;
31
31
  files: AIEmployeeInstructionFiles[];
32
+ fileUrlOrigin?: string;
32
33
  };
33
34
  export type AIEmployeeInstructionFiles = {
34
35
  type: 'attachments' | 'file_id' | 'file_url';
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Create AI employees with diverse skills to collaborate with humans, build systems, and handle business operations.",
7
7
  "description.ru-RU": "Поддержка интеграции с AI-сервисами: предоставляются AI-узлы для рабочих процессов, расширяя возможности бизнес-обработки.",
8
8
  "description.zh-CN": "创建各种技能的 AI 员工,与人类协同,搭建系统,处理业务。",
9
- "version": "2.4.0-alpha.1",
9
+ "version": "2.4.0-alpha.3",
10
10
  "main": "dist/server/index.js",
11
11
  "homepage": "https://docs.nocobase.com/handbook/action-ai",
12
12
  "homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/action-ai",
@@ -66,5 +66,5 @@
66
66
  "keywords": [
67
67
  "AI"
68
68
  ],
69
- "gitHead": "82ecd3aed067e4cc98c32e7a0039b6e55cee76a7"
69
+ "gitHead": "746e2e042c12df2cb03877361ea9f2a8797a1921"
70
70
  }
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import type { WorkContextOptions } from '../types';
10
- export declare const DatasourceContext: WorkContextOptions;
@@ -1,21 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- import type { ContextItem } from '../types';
11
- export type DatasourceSelectorProps = {
12
- contextItems?: ContextItem[];
13
- onAdd: (item: Omit<ContextItem, 'type'>) => void;
14
- onRemove: (uid: string) => void;
15
- onClose?: () => void;
16
- };
17
- export declare const getCheckedDatasourceIds: (contextItems?: ContextItem[]) => string[];
18
- export declare const addCheckedDatasourceId: (checkedIds: Set<string>, uid: string) => Set<string>;
19
- export declare const removeCheckedDatasourceId: (checkedIds: Set<string>, uid: string) => Set<string>;
20
- export declare const DatasourceSelector: React.FC<DatasourceSelectorProps>;
21
- export default DatasourceSelector;
@@ -1,62 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- import type { APIClient } from '@nocobase/client-v2';
11
- type APIClientLike = Pick<APIClient, 'resource'>;
12
- type FilterValue = Record<string, unknown>;
13
- type SortValue = string[];
14
- export type AIContextDatasourceRecord = {
15
- id: number | string;
16
- title: string;
17
- description?: string;
18
- datasource: string;
19
- collectionName: string;
20
- fields?: string[];
21
- filter?: FilterValue;
22
- sort?: SortValue;
23
- limit: number;
24
- enabled: boolean;
25
- createdAt?: string;
26
- };
27
- export type DatasourceFormValues = Omit<AIContextDatasourceRecord, 'id' | 'datasource' | 'collectionName'> & {
28
- id?: number | string;
29
- collection?: string[];
30
- filterText?: string;
31
- sortText?: string;
32
- datasource?: string;
33
- collectionName?: string;
34
- };
35
- type DatasourceListResult = {
36
- data: AIContextDatasourceRecord[];
37
- total?: number;
38
- };
39
- export type PreviewResult = {
40
- options?: {
41
- datasource?: string;
42
- collectionName?: string;
43
- fields?: string[];
44
- };
45
- records?: Array<Array<{
46
- name: string;
47
- value: unknown;
48
- }>>;
49
- };
50
- export declare const normalizeDatasourceValues: (values: DatasourceFormValues) => Omit<AIContextDatasourceRecord, 'id'>;
51
- export declare const toDatasourceFormValues: (record: AIContextDatasourceRecord) => DatasourceFormValues;
52
- export declare function listContextDatasources(apiClient: APIClientLike, params?: {
53
- page?: number;
54
- pageSize?: number;
55
- }): Promise<DatasourceListResult>;
56
- export declare function createContextDatasource(apiClient: APIClientLike, values: DatasourceFormValues): Promise<void>;
57
- export declare function updateContextDatasource(apiClient: APIClientLike, id: string | number, values: DatasourceFormValues): Promise<void>;
58
- export declare function deleteContextDatasource(apiClient: APIClientLike, id: string | number): Promise<void>;
59
- export declare function updateContextDatasourceEnabled(apiClient: APIClientLike, id: string | number, enabled: boolean): Promise<void>;
60
- export declare function previewContextDatasource(apiClient: APIClientLike, values: DatasourceFormValues): Promise<PreviewResult>;
61
- export declare const DatasourceSettingsPage: React.FC;
62
- export default DatasourceSettingsPage;
@@ -1,25 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import type { CollectionOptions, Fields, Sort } from '@nocobase/database';
10
- import type { FilterGroupType } from '@nocobase/utils';
11
- declare const _default: CollectionOptions;
12
- export default _default;
13
- export type AIContextDatasource = {
14
- id: string;
15
- title: string;
16
- description: string;
17
- datasource: string;
18
- collectionName: string;
19
- fields?: Fields;
20
- appends?: string[];
21
- filter?: FilterGroupType;
22
- sort?: Sort[];
23
- limit: number;
24
- enabled: boolean;
25
- };
@@ -1,89 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var ai_context_datasource_exports = {};
28
- __export(ai_context_datasource_exports, {
29
- default: () => ai_context_datasource_default
30
- });
31
- module.exports = __toCommonJS(ai_context_datasource_exports);
32
- var ai_context_datasource_default = {
33
- name: "aiContextDatasources",
34
- dataCategory: "business",
35
- migrationRules: ["schema-only"],
36
- fields: [
37
- {
38
- name: "title",
39
- type: "string",
40
- length: 64,
41
- allowNull: false
42
- },
43
- {
44
- name: "description",
45
- length: 512,
46
- type: "string",
47
- allowNull: false
48
- },
49
- {
50
- name: "datasource",
51
- length: 128,
52
- type: "string",
53
- allowNull: false
54
- },
55
- {
56
- name: "collectionName",
57
- length: 128,
58
- type: "string",
59
- allowNull: false
60
- },
61
- {
62
- name: "fields",
63
- type: "jsonb",
64
- allowNull: true
65
- },
66
- {
67
- name: "filter",
68
- type: "jsonb",
69
- allowNull: true
70
- },
71
- {
72
- name: "sort",
73
- type: "jsonb",
74
- allowNull: true
75
- },
76
- {
77
- name: "limit",
78
- type: "integer",
79
- allowNull: false,
80
- defaultValue: 1e3
81
- },
82
- {
83
- name: "enabled",
84
- type: "boolean",
85
- allowNull: false,
86
- defaultValue: true
87
- }
88
- ]
89
- };
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- declare const _default: import("@nocobase/database").CollectionOptions;
10
- export default _default;