@nocobase/plugin-ai 2.2.18 → 2.2.19
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/dist/ai/tools/subAgentWebSearch.js +10 -6
- package/dist/externalVersion.js +15 -15
- package/dist/node_modules/@langchain/mistralai/package.json +1 -1
- package/dist/node_modules/@langchain/xai/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonrepair/package.json +1 -1
- package/dist/node_modules/just-bash/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/ai-employees/ai-employee.js +18 -9
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +2 -0
- package/dist/server/llm-providers/anthropic.js +4 -0
- package/dist/server/llm-providers/dashscope.js +2 -1
- package/dist/server/llm-providers/deepseek/provider.d.ts +2 -1
- package/dist/server/llm-providers/deepseek/provider.js +16 -6
- package/dist/server/llm-providers/deepseek/reasoning.d.ts +36 -1
- package/dist/server/llm-providers/deepseek/reasoning.js +41 -4
- package/dist/server/llm-providers/google-genai.js +4 -2
- package/dist/server/llm-providers/kimi/provider.js +2 -1
- package/dist/server/llm-providers/mimo.js +2 -1
- package/dist/server/llm-providers/mistral.d.ts +1 -0
- package/dist/server/llm-providers/mistral.js +17 -1
- package/dist/server/llm-providers/ollama.js +3 -1
- package/dist/server/llm-providers/openai/completions.js +2 -1
- package/dist/server/llm-providers/openai/responses.js +2 -1
- package/dist/server/llm-providers/orcarouter.js +2 -2
- package/dist/server/llm-providers/provider.d.ts +10 -0
- package/dist/server/llm-providers/provider.js +34 -1
- package/dist/server/llm-providers/shengsuanyun.js +5 -1
- package/dist/server/llm-providers/xai.js +6 -1
- package/dist/server/manager/ai-manager.d.ts +2 -2
- package/dist/server/manager/ai-manager.js +3 -2
- package/dist/server/resource/ai.js +4 -0
- package/dist/server/workflow/nodes/llm/index.d.ts +2 -2
- package/dist/server/workflow/nodes/llm/index.js +10 -3
- package/package.json +2 -2
|
@@ -31,6 +31,7 @@ __export(subAgentWebSearch_exports, {
|
|
|
31
31
|
module.exports = __toCommonJS(subAgentWebSearch_exports);
|
|
32
32
|
var import_ai = require("@nocobase/ai");
|
|
33
33
|
var import_zod = require("zod");
|
|
34
|
+
var import_node_crypto = require("node:crypto");
|
|
34
35
|
var subAgentWebSearch_default = (0, import_ai.defineTools)({
|
|
35
36
|
scope: "SPECIFIED",
|
|
36
37
|
defaultPermission: "ALLOW",
|
|
@@ -51,12 +52,15 @@ var subAgentWebSearch_default = (0, import_ai.defineTools)({
|
|
|
51
52
|
invoke: async (ctx, args, id) => {
|
|
52
53
|
var _a, _b, _c;
|
|
53
54
|
const pluginAI = ctx.app.pm.get("ai");
|
|
54
|
-
const { model } = ((_b = (_a = ctx.action) == null ? void 0 : _a.params) == null ? void 0 : _b.values) ?? {};
|
|
55
|
-
const { provider } = await pluginAI.aiManager.getLLMService(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
const { model, sessionId } = ((_b = (_a = ctx.action) == null ? void 0 : _a.params) == null ? void 0 : _b.values) ?? {};
|
|
56
|
+
const { provider } = await pluginAI.aiManager.getLLMService(
|
|
57
|
+
{
|
|
58
|
+
...model,
|
|
59
|
+
webSearch: true,
|
|
60
|
+
reasoning: { mode: "off" }
|
|
61
|
+
},
|
|
62
|
+
{ sessionId: typeof sessionId === "string" && sessionId ? sessionId : `web-search-${(0, import_node_crypto.randomUUID)()}` }
|
|
63
|
+
);
|
|
60
64
|
if (!((_c = args.query) == null ? void 0 : _c.length)) {
|
|
61
65
|
return {
|
|
62
66
|
status: "success",
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/plugin-acl": "2.2.
|
|
12
|
-
"@nocobase/plugin-workflow": "2.2.
|
|
13
|
-
"@nocobase/client": "2.2.
|
|
14
|
-
"@nocobase/utils": "2.2.
|
|
15
|
-
"@nocobase/flow-engine": "2.2.
|
|
16
|
-
"@nocobase/client-v2": "2.2.
|
|
17
|
-
"@nocobase/database": "2.2.
|
|
18
|
-
"@nocobase/actions": "2.2.
|
|
19
|
-
"@nocobase/plugin-file-manager": "2.2.
|
|
20
|
-
"@nocobase/server": "2.2.
|
|
21
|
-
"@nocobase/ai": "2.2.
|
|
11
|
+
"@nocobase/plugin-acl": "2.2.19",
|
|
12
|
+
"@nocobase/plugin-workflow": "2.2.19",
|
|
13
|
+
"@nocobase/client": "2.2.19",
|
|
14
|
+
"@nocobase/utils": "2.2.19",
|
|
15
|
+
"@nocobase/flow-engine": "2.2.19",
|
|
16
|
+
"@nocobase/client-v2": "2.2.19",
|
|
17
|
+
"@nocobase/database": "2.2.19",
|
|
18
|
+
"@nocobase/actions": "2.2.19",
|
|
19
|
+
"@nocobase/plugin-file-manager": "2.2.19",
|
|
20
|
+
"@nocobase/server": "2.2.19",
|
|
21
|
+
"@nocobase/ai": "2.2.19",
|
|
22
22
|
"langchain": "1.2.39",
|
|
23
23
|
"react": "18.2.0",
|
|
24
24
|
"antd": "5.24.2",
|
|
@@ -30,14 +30,14 @@ module.exports = {
|
|
|
30
30
|
"react-router-dom": "6.30.1",
|
|
31
31
|
"@langchain/core": "1.1.49",
|
|
32
32
|
"@langchain/langgraph": "1.4.4",
|
|
33
|
-
"@nocobase/cache": "2.2.
|
|
33
|
+
"@nocobase/cache": "2.2.19",
|
|
34
34
|
"@langchain/anthropic": "1.3.17",
|
|
35
35
|
"@langchain/openai": "1.4.7",
|
|
36
36
|
"@langchain/google-genai": "2.1.18",
|
|
37
37
|
"@langchain/ollama": "1.2.7",
|
|
38
|
-
"@nocobase/acl": "2.2.
|
|
39
|
-
"@nocobase/data-source-manager": "2.2.
|
|
40
|
-
"@nocobase/resourcer": "2.2.
|
|
38
|
+
"@nocobase/acl": "2.2.19",
|
|
39
|
+
"@nocobase/data-source-manager": "2.2.19",
|
|
40
|
+
"@nocobase/resourcer": "2.2.19",
|
|
41
41
|
"dayjs": "1.11.13",
|
|
42
42
|
"react-dom": "18.2.0",
|
|
43
43
|
"@formily/core": "2.3.7",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@langchain/mistralai","version":"1.0.0","description":"MistralAI integration for LangChain.js","author":"LangChain","license":"MIT","type":"module","engines":{"node":">=20"},"repository":{"type":"git","url":"git@github.com:langchain-ai/langchainjs.git"},"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-mistralai/","dependencies":{"@mistralai/mistralai":"^1.3.1","uuid":"^10.0.0"},"peerDependencies":{"@langchain/core":"^1.0.0"},"devDependencies":{"@tsconfig/recommended":"^1.0.3","@vitest/coverage-v8":"^3.2.4","dotenv":"^16.3.1","dpdm":"^3.14.0","eslint":"^9.34.0","prettier":"^2.8.3","rollup":"^4.5.2","typescript":"~5.8.3","vitest":"^3.2.4","zod":"^3.25.76","@langchain/eslint":"0.1.0","@langchain/standard-tests":"0.0.0","@langchain/core":"1.0.1"},"publishConfig":{"access":"public"},"main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"input":"./src/index.ts","import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"files":["dist/","CHANGELOG.md","README.md","LICENSE"],"scripts":{"build":"pnpm --filter @langchain/build compile @langchain/mistralai","lint:eslint":"eslint --cache src/","lint:dpdm":"dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts","lint":"pnpm lint:eslint && pnpm lint:dpdm","lint:fix":"pnpm lint:eslint --fix && pnpm lint:dpdm","clean":"rm -rf .turbo dist/","test":"vitest run","test:watch":"vitest","test:int":"vitest run --mode int","test:standard:unit":"vitest run --mode standard-unit","test:standard:int":"vitest run --mode standard-int","test:standard":"pnpm test:standard:unit && pnpm test:standard:int","format":"prettier --config .prettierrc --write \"src\"","format:check":"prettier --config .prettierrc --check \"src\""},"_lastModified":"2026-09-
|
|
1
|
+
{"name":"@langchain/mistralai","version":"1.0.0","description":"MistralAI integration for LangChain.js","author":"LangChain","license":"MIT","type":"module","engines":{"node":">=20"},"repository":{"type":"git","url":"git@github.com:langchain-ai/langchainjs.git"},"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-mistralai/","dependencies":{"@mistralai/mistralai":"^1.3.1","uuid":"^10.0.0"},"peerDependencies":{"@langchain/core":"^1.0.0"},"devDependencies":{"@tsconfig/recommended":"^1.0.3","@vitest/coverage-v8":"^3.2.4","dotenv":"^16.3.1","dpdm":"^3.14.0","eslint":"^9.34.0","prettier":"^2.8.3","rollup":"^4.5.2","typescript":"~5.8.3","vitest":"^3.2.4","zod":"^3.25.76","@langchain/eslint":"0.1.0","@langchain/standard-tests":"0.0.0","@langchain/core":"1.0.1"},"publishConfig":{"access":"public"},"main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"input":"./src/index.ts","import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"files":["dist/","CHANGELOG.md","README.md","LICENSE"],"scripts":{"build":"pnpm --filter @langchain/build compile @langchain/mistralai","lint:eslint":"eslint --cache src/","lint:dpdm":"dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts","lint":"pnpm lint:eslint && pnpm lint:dpdm","lint:fix":"pnpm lint:eslint --fix && pnpm lint:dpdm","clean":"rm -rf .turbo dist/","test":"vitest run","test:watch":"vitest","test:int":"vitest run --mode int","test:standard:unit":"vitest run --mode standard-unit","test:standard:int":"vitest run --mode standard-int","test:standard":"pnpm test:standard:unit && pnpm test:standard:int","format":"prettier --config .prettierrc --write \"src\"","format:check":"prettier --config .prettierrc --check \"src\""},"_lastModified":"2026-09-29T04:32:19.319Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@langchain/xai","version":"1.3.19","description":"xAI integration for LangChain.js","author":"LangChain","license":"MIT","type":"module","engines":{"node":">=20"},"repository":{"type":"git","url":"git@github.com:langchain-ai/langchainjs.git"},"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-xai/","dependencies":{"@langchain/openai":"1.4.7"},"peerDependencies":{"@langchain/core":"^1.0.0"},"devDependencies":{"@tsconfig/recommended":"^1.0.3","@vitest/coverage-v8":"^3.2.4","dotenv":"^17.4.0","dpdm":"^3.14.0","typescript":"~5.8.3","vitest":"^4.1.2","zod":"^3.25.76","@langchain/openai":"^1.4.7","@langchain/core":"^1.1.48","@langchain/standard-tests":"0.0.23","@langchain/tsconfig":"0.0.1"},"publishConfig":{"access":"public"},"main":"./dist/index.cjs","types":"./dist/index.d.cts","exports":{".":{"input":"./src/index.ts","require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./package.json":"./package.json"},"files":["dist/","CHANGELOG.md","README.md","LICENSE"],"module":"./dist/index.js","scripts":{"build":"turbo build:compile --filter @langchain/xai --output-logs new-only","build:compile":"tsdown","clean":"rm -rf .turbo dist/","test":"vitest run","test:watch":"vitest --watch","test:int":"vitest --mode int","test:standard:unit":"vitest --mode standard-unit","test:standard:int":"vitest --mode standard-int","test:standard":"pnpm test:standard:unit && pnpm test:standard:int","typegen":"pnpm run typegen:profiles","typegen:profiles":"pnpm --filter @langchain/model-profiles make --config profiles.toml"},"_lastModified":"2026-09-
|
|
1
|
+
{"name":"@langchain/xai","version":"1.3.19","description":"xAI integration for LangChain.js","author":"LangChain","license":"MIT","type":"module","engines":{"node":">=20"},"repository":{"type":"git","url":"git@github.com:langchain-ai/langchainjs.git"},"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-xai/","dependencies":{"@langchain/openai":"1.4.7"},"peerDependencies":{"@langchain/core":"^1.0.0"},"devDependencies":{"@tsconfig/recommended":"^1.0.3","@vitest/coverage-v8":"^3.2.4","dotenv":"^17.4.0","dpdm":"^3.14.0","typescript":"~5.8.3","vitest":"^4.1.2","zod":"^3.25.76","@langchain/openai":"^1.4.7","@langchain/core":"^1.1.48","@langchain/standard-tests":"0.0.23","@langchain/tsconfig":"0.0.1"},"publishConfig":{"access":"public"},"main":"./dist/index.cjs","types":"./dist/index.d.cts","exports":{".":{"input":"./src/index.ts","require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"},"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./package.json":"./package.json"},"files":["dist/","CHANGELOG.md","README.md","LICENSE"],"module":"./dist/index.js","scripts":{"build":"turbo build:compile --filter @langchain/xai --output-logs new-only","build:compile":"tsdown","clean":"rm -rf .turbo dist/","test":"vitest run","test:watch":"vitest --watch","test:int":"vitest --mode int","test:standard:unit":"vitest --mode standard-unit","test:standard:int":"vitest --mode standard-int","test:standard":"pnpm test:standard:unit && pnpm test:standard:int","typegen":"pnpm run typegen:profiles","typegen:profiles":"pnpm --filter @langchain/model-profiles make --config profiles.toml"},"_lastModified":"2026-09-29T04:32:22.164Z"}
|
|
@@ -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-
|
|
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-29T04:32:22.336Z"}
|
|
@@ -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-
|
|
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-29T04:32:27.633Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"just-bash","version":"3.4.2","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","engines":{"node":">=20.18.1"},"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/commands/sqlite3/worker.js","dist/fs/**/*.d.ts","dist/interpreter/**/*.d.ts","dist/network/**/*.d.ts","dist/parser/*.d.ts","dist/sandbox/*.d.ts","dist/security/*.d.ts","dist/transform/**/*.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.9.5","@types/papaparse":"^5.5.2","@types/sprintf-js":"^1.1.4","@types/sql.js":"^1.4.11","@types/turndown":"^5.0.6","@vitest/coverage-v8":"^4.1.10","esbuild":"^0.27.7","fast-check":"^3.23.2","knip":"^5.88.1","tsx":"^4.23.12","typescript":"^5.9.3","vitest":"^4.1.10"},"dependencies":{"diff":"^8.0.4","fast-xml-parser":"^5.10.1","file-type":"^21.3.4","ini":"^6.0.0","minimatch":"^10.2.6","modern-tar":"^0.7.7","papaparse":"^5.6.0","quickjs-emscripten":"^0.32.0","re2js":"^1.3.3","seek-bzip":"^2.0.0","smol-toml":"^1.8.0","sprintf-js":"^1.1.3","sql.js":"^1.14.1","turndown":"^7.2.4","undici":"^7.29.0","yaml":"^2.9.0"},"optionalDependencies":{"@mongodb-js/zstd":"^7.0.0","node-liblzma":"^2.2.0"},"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 && esbuild src/commands/sqlite3/worker.ts --bundle --platform=node --format=esm --outfile=src/commands/sqlite3/worker.js --external:sql.js && mkdir -p dist/commands/sqlite3 && cp src/commands/sqlite3/worker.js dist/commands/sqlite3/worker.js && cp src/commands/sqlite3/worker.js dist/bin/chunks/sqlite3-worker.js && cp src/commands/sqlite3/worker.js dist/bundle/chunks/sqlite3-worker.js","build:lib":"esbuild dist/index.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bundle --chunk-names=chunks/[name]-[hash] --banner:js='import{createRequire} from\"node:module\";const require=createRequire(import.meta.url);' --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:undici --external:node:zlib --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip --define:__BROWSER__=true --alias:node:async_hooks=./src/shims/browser-unsupported.js --alias:node:dns=./src/shims/browser-unsupported.js --alias:node:module=./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\nimport{createRequire} from\"node:module\";const require=createRequire(import.meta.url);' --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\nimport{createRequire} from\"node:module\";const require=createRequire(import.meta.url);' --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 src/package-contents.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":"tsx src/cli/shell.ts","dev:exec":"tsx src/cli/exec.ts"},"_lastModified":"2026-09-
|
|
1
|
+
{"name":"just-bash","version":"3.4.2","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","engines":{"node":">=20.18.1"},"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/commands/sqlite3/worker.js","dist/fs/**/*.d.ts","dist/interpreter/**/*.d.ts","dist/network/**/*.d.ts","dist/parser/*.d.ts","dist/sandbox/*.d.ts","dist/security/*.d.ts","dist/transform/**/*.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.9.5","@types/papaparse":"^5.5.2","@types/sprintf-js":"^1.1.4","@types/sql.js":"^1.4.11","@types/turndown":"^5.0.6","@vitest/coverage-v8":"^4.1.10","esbuild":"^0.27.7","fast-check":"^3.23.2","knip":"^5.88.1","tsx":"^4.23.12","typescript":"^5.9.3","vitest":"^4.1.10"},"dependencies":{"diff":"^8.0.4","fast-xml-parser":"^5.10.1","file-type":"^21.3.4","ini":"^6.0.0","minimatch":"^10.2.6","modern-tar":"^0.7.7","papaparse":"^5.6.0","quickjs-emscripten":"^0.32.0","re2js":"^1.3.3","seek-bzip":"^2.0.0","smol-toml":"^1.8.0","sprintf-js":"^1.1.3","sql.js":"^1.14.1","turndown":"^7.2.4","undici":"^7.29.0","yaml":"^2.9.0"},"optionalDependencies":{"@mongodb-js/zstd":"^7.0.0","node-liblzma":"^2.2.0"},"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 && esbuild src/commands/sqlite3/worker.ts --bundle --platform=node --format=esm --outfile=src/commands/sqlite3/worker.js --external:sql.js && mkdir -p dist/commands/sqlite3 && cp src/commands/sqlite3/worker.js dist/commands/sqlite3/worker.js && cp src/commands/sqlite3/worker.js dist/bin/chunks/sqlite3-worker.js && cp src/commands/sqlite3/worker.js dist/bundle/chunks/sqlite3-worker.js","build:lib":"esbuild dist/index.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bundle --chunk-names=chunks/[name]-[hash] --banner:js='import{createRequire} from\"node:module\";const require=createRequire(import.meta.url);' --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:undici --external:node:zlib --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip --define:__BROWSER__=true --alias:node:async_hooks=./src/shims/browser-unsupported.js --alias:node:dns=./src/shims/browser-unsupported.js --alias:node:module=./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\nimport{createRequire} from\"node:module\";const require=createRequire(import.meta.url);' --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\nimport{createRequire} from\"node:module\";const require=createRequire(import.meta.url);' --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 src/package-contents.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":"tsx src/cli/shell.ts","dev:exec":"tsx src/cli/exec.ts"},"_lastModified":"2026-09-29T04:32:25.469Z"}
|
|
@@ -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-
|
|
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-29T04:32:11.327Z"}
|
|
@@ -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-
|
|
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-29T04:32:27.467Z"}
|
|
@@ -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-
|
|
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-29T04:32:11.265Z"}
|
|
@@ -133,9 +133,12 @@ class AIEmployee {
|
|
|
133
133
|
return this.employee.toJSON();
|
|
134
134
|
}
|
|
135
135
|
async getFormatMessages(userMessages) {
|
|
136
|
-
const { provider } = await this.plugin.aiManager.getLLMService(
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
const { provider } = await this.plugin.aiManager.getLLMService(
|
|
137
|
+
{
|
|
138
|
+
...this.model
|
|
139
|
+
},
|
|
140
|
+
{ sessionId: this.sessionId }
|
|
141
|
+
);
|
|
139
142
|
const { messages } = await this.aiChatConversation.getChatContext({
|
|
140
143
|
userMessages,
|
|
141
144
|
formatMessages: (messages2) => this.formatMessages({ messages: messages2, provider })
|
|
@@ -211,9 +214,12 @@ class AIEmployee {
|
|
|
211
214
|
userDecisions
|
|
212
215
|
}) {
|
|
213
216
|
var _a, _b;
|
|
214
|
-
const { provider, model, service } = await this.plugin.aiManager.getLLMService(
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
const { provider, model, service } = await this.plugin.aiManager.getLLMService(
|
|
218
|
+
{
|
|
219
|
+
...this.model
|
|
220
|
+
},
|
|
221
|
+
{ sessionId: this.sessionId }
|
|
222
|
+
);
|
|
217
223
|
this.userMessageCount = (userMessages ?? []).filter((message) => message.role === "user").length;
|
|
218
224
|
const { historyMessages, tools, resolvedTools, middleware, config, state } = await this.initSession({
|
|
219
225
|
messageId,
|
|
@@ -1186,9 +1192,12 @@ If information is missing, clearly state it in the summary.</Important>`;
|
|
|
1186
1192
|
if (!toolMessages || import_lodash.default.isEmpty(toolMessages)) {
|
|
1187
1193
|
return;
|
|
1188
1194
|
}
|
|
1189
|
-
const { model, service } = await this.plugin.aiManager.getLLMService(
|
|
1190
|
-
|
|
1191
|
-
|
|
1195
|
+
const { model, service } = await this.plugin.aiManager.getLLMService(
|
|
1196
|
+
{
|
|
1197
|
+
...this.model
|
|
1198
|
+
},
|
|
1199
|
+
{ sessionId: this.sessionId }
|
|
1200
|
+
);
|
|
1192
1201
|
const toolCallMap = await this.getToolCallMap(messageId);
|
|
1193
1202
|
const now = /* @__PURE__ */ new Date();
|
|
1194
1203
|
const toolMessageContent = "The user ignored the application for tools usage and will continued to ask questions";
|
package/dist/server/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
export { default } from './plugin';
|
|
10
|
-
export { LLMProvider, LLMProviderOptions } from './llm-providers/provider';
|
|
10
|
+
export { LLMProvider, LLMProviderOptions, LLMProviderRequestContext } from './llm-providers/provider';
|
|
11
11
|
export { LLMProviderMeta } from './manager/ai-manager';
|
|
12
12
|
export { ToolOptions } from './manager/tool-manager';
|
|
13
13
|
export { DocumentLoader } from './document-loader';
|
package/dist/server/index.js
CHANGED
|
@@ -41,6 +41,7 @@ __export(server_exports, {
|
|
|
41
41
|
LLMProvider: () => import_provider.LLMProvider,
|
|
42
42
|
LLMProviderMeta: () => import_ai_manager.LLMProviderMeta,
|
|
43
43
|
LLMProviderOptions: () => import_provider.LLMProviderOptions,
|
|
44
|
+
LLMProviderRequestContext: () => import_provider.LLMProviderRequestContext,
|
|
44
45
|
ToolOptions: () => import_tool_manager.ToolOptions,
|
|
45
46
|
default: () => import_plugin.default
|
|
46
47
|
});
|
|
@@ -58,5 +59,6 @@ var import_ai_employee = require("./ai-employees/ai-employee");
|
|
|
58
59
|
LLMProvider,
|
|
59
60
|
LLMProviderMeta,
|
|
60
61
|
LLMProviderOptions,
|
|
62
|
+
LLMProviderRequestContext,
|
|
61
63
|
ToolOptions
|
|
62
64
|
});
|
|
@@ -72,6 +72,9 @@ class AnthropicProvider extends import_provider.LLMProvider {
|
|
|
72
72
|
...sanitizedModelOptions,
|
|
73
73
|
model,
|
|
74
74
|
anthropicApiUrl: this.getResolvedBaseURL(),
|
|
75
|
+
clientOptions: {
|
|
76
|
+
defaultHeaders: this.getDefaultHeaders()
|
|
77
|
+
},
|
|
75
78
|
verbose: false
|
|
76
79
|
});
|
|
77
80
|
}
|
|
@@ -96,6 +99,7 @@ class AnthropicProvider extends import_provider.LLMProvider {
|
|
|
96
99
|
method: "GET",
|
|
97
100
|
url,
|
|
98
101
|
headers: {
|
|
102
|
+
...this.getDefaultHeaders(),
|
|
99
103
|
"x-api-key": apiKey,
|
|
100
104
|
"anthropic-version": "2023-06-01"
|
|
101
105
|
}
|
|
@@ -83,7 +83,8 @@ class DashscopeProvider extends import_provider.LLMProvider {
|
|
|
83
83
|
...reasoningOptions.modelKwargs || {}
|
|
84
84
|
},
|
|
85
85
|
configuration: {
|
|
86
|
-
baseURL: this.getResolvedBaseURL()
|
|
86
|
+
baseURL: this.getResolvedBaseURL(),
|
|
87
|
+
defaultHeaders: this.getDefaultHeaders()
|
|
87
88
|
},
|
|
88
89
|
verbose: false
|
|
89
90
|
});
|
|
@@ -12,6 +12,7 @@ import { ChatOpenAI } from '@langchain/openai';
|
|
|
12
12
|
import type { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
|
|
13
13
|
import type OpenAI from 'openai';
|
|
14
14
|
import { Model } from '@nocobase/database';
|
|
15
|
+
import type { AttachmentModel } from '@nocobase/plugin-file-manager';
|
|
15
16
|
import { LLMProvider, ReasoningOptions, ResolvedReasoningOptions } from '../provider';
|
|
16
17
|
import { LLMProviderMeta } from '../../manager/ai-manager';
|
|
17
18
|
import { DeepSeekReasoningConfig } from './reasoning';
|
|
@@ -51,7 +52,7 @@ export declare class DeepSeekProvider extends LLMProvider {
|
|
|
51
52
|
}[];
|
|
52
53
|
protected resolveReasoningOptions(reasoning?: ReasoningOptions): ResolvedReasoningOptions;
|
|
53
54
|
isToolConflict(): boolean;
|
|
54
|
-
protected isApiSupportedAttachment(): boolean;
|
|
55
|
+
protected isApiSupportedAttachment(attachment: AttachmentModel): boolean;
|
|
55
56
|
}
|
|
56
57
|
export declare const deepseekProviderOptions: LLMProviderMeta;
|
|
57
58
|
export {};
|
|
@@ -166,7 +166,8 @@ class DeepSeekProvider extends import_provider.LLMProvider {
|
|
|
166
166
|
...reasoningParams
|
|
167
167
|
},
|
|
168
168
|
configuration: {
|
|
169
|
-
baseURL: this.getResolvedBaseURL()
|
|
169
|
+
baseURL: this.getResolvedBaseURL(),
|
|
170
|
+
defaultHeaders: this.getDefaultHeaders()
|
|
170
171
|
},
|
|
171
172
|
verbose: false
|
|
172
173
|
};
|
|
@@ -190,7 +191,8 @@ class DeepSeekProvider extends import_provider.LLMProvider {
|
|
|
190
191
|
...modelOptions,
|
|
191
192
|
modelKwargs,
|
|
192
193
|
configuration: {
|
|
193
|
-
baseURL: this.getResolvedBaseURL()
|
|
194
|
+
baseURL: this.getResolvedBaseURL(),
|
|
195
|
+
defaultHeaders: this.getDefaultHeaders()
|
|
194
196
|
},
|
|
195
197
|
verbose: false
|
|
196
198
|
},
|
|
@@ -299,18 +301,26 @@ class DeepSeekProvider extends import_provider.LLMProvider {
|
|
|
299
301
|
isToolConflict() {
|
|
300
302
|
return false;
|
|
301
303
|
}
|
|
302
|
-
isApiSupportedAttachment() {
|
|
303
|
-
|
|
304
|
+
isApiSupportedAttachment(attachment) {
|
|
305
|
+
var _a, _b;
|
|
306
|
+
const capabilities = (0, import_reasoning2.getDeepSeekModelCapabilities)(String((_a = this.modelOptions) == null ? void 0 : _a.model));
|
|
307
|
+
return (capabilities == null ? void 0 : capabilities.supportsImageInput) === true && (((_b = attachment == null ? void 0 : attachment.mimetype) == null ? void 0 : _b.startsWith("image/")) ?? false);
|
|
304
308
|
}
|
|
305
309
|
}
|
|
306
310
|
const deepseekProviderOptions = {
|
|
307
311
|
title: "DeepSeek",
|
|
308
312
|
supportedModel: [import_ai_manager.SupportedModel.LLM],
|
|
309
313
|
models: {
|
|
310
|
-
[import_ai_manager.SupportedModel.LLM]: [
|
|
314
|
+
[import_ai_manager.SupportedModel.LLM]: [
|
|
315
|
+
"deepseek-v4-pro",
|
|
316
|
+
"deepseek-flash",
|
|
317
|
+
"deepseek-v4-flash",
|
|
318
|
+
"deepseek-chat",
|
|
319
|
+
"deepseek-reasoner"
|
|
320
|
+
]
|
|
311
321
|
},
|
|
312
322
|
supportWebSearch: true,
|
|
313
|
-
webSearchModels: ["deepseek-v4-
|
|
323
|
+
webSearchModels: ["deepseek-v4-pro"],
|
|
314
324
|
provider: DeepSeekProvider
|
|
315
325
|
};
|
|
316
326
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -20,6 +20,7 @@ type DeepSeekModelCapabilities = {
|
|
|
20
20
|
supportsFunctionTools: boolean;
|
|
21
21
|
supportsStructuredOutput: boolean;
|
|
22
22
|
supportsWebSearch: boolean;
|
|
23
|
+
supportsImageInput: boolean;
|
|
23
24
|
};
|
|
24
25
|
export type DeepSeekReasoningConfig = {
|
|
25
26
|
protocol: DeepSeekApiProtocol;
|
|
@@ -34,6 +35,16 @@ type ReasoningSource = {
|
|
|
34
35
|
response_metadata?: Record<string, unknown>;
|
|
35
36
|
};
|
|
36
37
|
export declare const DEEPSEEK_MODEL_CAPABILITIES: {
|
|
38
|
+
readonly 'deepseek-flash': {
|
|
39
|
+
readonly protocol: "responses";
|
|
40
|
+
readonly reasoning: "switchable";
|
|
41
|
+
readonly defaultThinking: "enabled";
|
|
42
|
+
readonly efforts: Set<DeepSeekReasoningEffort>;
|
|
43
|
+
readonly supportsFunctionTools: true;
|
|
44
|
+
readonly supportsStructuredOutput: true;
|
|
45
|
+
readonly supportsWebSearch: false;
|
|
46
|
+
readonly supportsImageInput: true;
|
|
47
|
+
};
|
|
37
48
|
readonly 'deepseek-v4-flash': {
|
|
38
49
|
readonly protocol: "responses";
|
|
39
50
|
readonly reasoning: "switchable";
|
|
@@ -41,7 +52,28 @@ export declare const DEEPSEEK_MODEL_CAPABILITIES: {
|
|
|
41
52
|
readonly efforts: Set<DeepSeekReasoningEffort>;
|
|
42
53
|
readonly supportsFunctionTools: true;
|
|
43
54
|
readonly supportsStructuredOutput: true;
|
|
44
|
-
readonly supportsWebSearch:
|
|
55
|
+
readonly supportsWebSearch: false;
|
|
56
|
+
readonly supportsImageInput: true;
|
|
57
|
+
};
|
|
58
|
+
readonly 'deepseek-v4-flash-vision-exp': {
|
|
59
|
+
readonly protocol: "responses";
|
|
60
|
+
readonly reasoning: "switchable";
|
|
61
|
+
readonly defaultThinking: "enabled";
|
|
62
|
+
readonly efforts: Set<DeepSeekReasoningEffort>;
|
|
63
|
+
readonly supportsFunctionTools: true;
|
|
64
|
+
readonly supportsStructuredOutput: true;
|
|
65
|
+
readonly supportsWebSearch: false;
|
|
66
|
+
readonly supportsImageInput: true;
|
|
67
|
+
};
|
|
68
|
+
readonly 'deepseek-v4.1-flash': {
|
|
69
|
+
readonly protocol: "responses";
|
|
70
|
+
readonly reasoning: "switchable";
|
|
71
|
+
readonly defaultThinking: "enabled";
|
|
72
|
+
readonly efforts: Set<DeepSeekReasoningEffort>;
|
|
73
|
+
readonly supportsFunctionTools: true;
|
|
74
|
+
readonly supportsStructuredOutput: true;
|
|
75
|
+
readonly supportsWebSearch: false;
|
|
76
|
+
readonly supportsImageInput: true;
|
|
45
77
|
};
|
|
46
78
|
readonly 'deepseek-v4-pro': {
|
|
47
79
|
readonly protocol: "responses";
|
|
@@ -51,6 +83,7 @@ export declare const DEEPSEEK_MODEL_CAPABILITIES: {
|
|
|
51
83
|
readonly supportsFunctionTools: true;
|
|
52
84
|
readonly supportsStructuredOutput: true;
|
|
53
85
|
readonly supportsWebSearch: true;
|
|
86
|
+
readonly supportsImageInput: false;
|
|
54
87
|
};
|
|
55
88
|
readonly 'deepseek-chat': {
|
|
56
89
|
readonly protocol: "chat-completions";
|
|
@@ -60,6 +93,7 @@ export declare const DEEPSEEK_MODEL_CAPABILITIES: {
|
|
|
60
93
|
readonly supportsFunctionTools: true;
|
|
61
94
|
readonly supportsStructuredOutput: true;
|
|
62
95
|
readonly supportsWebSearch: false;
|
|
96
|
+
readonly supportsImageInput: false;
|
|
63
97
|
};
|
|
64
98
|
readonly 'deepseek-reasoner': {
|
|
65
99
|
readonly protocol: "chat-completions";
|
|
@@ -69,6 +103,7 @@ export declare const DEEPSEEK_MODEL_CAPABILITIES: {
|
|
|
69
103
|
readonly supportsFunctionTools: true;
|
|
70
104
|
readonly supportsStructuredOutput: true;
|
|
71
105
|
readonly supportsWebSearch: false;
|
|
106
|
+
readonly supportsImageInput: false;
|
|
72
107
|
};
|
|
73
108
|
};
|
|
74
109
|
export type OfficialDeepSeekModel = keyof typeof DEEPSEEK_MODEL_CAPABILITIES;
|
|
@@ -42,6 +42,17 @@ const V4_EFFORTS = /* @__PURE__ */ new Set(["low", "high", "max"]);
|
|
|
42
42
|
const THINKING_UNSUPPORTED_FIELDS = /* @__PURE__ */ new Set(["temperature", "top_p", "presence_penalty", "frequency_penalty"]);
|
|
43
43
|
const NO_UNSUPPORTED_FIELDS = /* @__PURE__ */ new Set();
|
|
44
44
|
const DEEPSEEK_MODEL_CAPABILITIES = {
|
|
45
|
+
"deepseek-flash": {
|
|
46
|
+
protocol: "responses",
|
|
47
|
+
reasoning: "switchable",
|
|
48
|
+
defaultThinking: "enabled",
|
|
49
|
+
efforts: V4_EFFORTS,
|
|
50
|
+
supportsFunctionTools: true,
|
|
51
|
+
supportsStructuredOutput: true,
|
|
52
|
+
supportsWebSearch: false,
|
|
53
|
+
supportsImageInput: true
|
|
54
|
+
},
|
|
55
|
+
// Legacy name, now served by the same DeepSeek-V4.1-Flash model as `deepseek-flash`
|
|
45
56
|
"deepseek-v4-flash": {
|
|
46
57
|
protocol: "responses",
|
|
47
58
|
reasoning: "switchable",
|
|
@@ -49,7 +60,30 @@ const DEEPSEEK_MODEL_CAPABILITIES = {
|
|
|
49
60
|
efforts: V4_EFFORTS,
|
|
50
61
|
supportsFunctionTools: true,
|
|
51
62
|
supportsStructuredOutput: true,
|
|
52
|
-
supportsWebSearch:
|
|
63
|
+
supportsWebSearch: false,
|
|
64
|
+
supportsImageInput: true
|
|
65
|
+
},
|
|
66
|
+
// Legacy vision name, also routed to DeepSeek-V4.1-Flash
|
|
67
|
+
"deepseek-v4-flash-vision-exp": {
|
|
68
|
+
protocol: "responses",
|
|
69
|
+
reasoning: "switchable",
|
|
70
|
+
defaultThinking: "enabled",
|
|
71
|
+
efforts: V4_EFFORTS,
|
|
72
|
+
supportsFunctionTools: true,
|
|
73
|
+
supportsStructuredOutput: true,
|
|
74
|
+
supportsWebSearch: false,
|
|
75
|
+
supportsImageInput: true
|
|
76
|
+
},
|
|
77
|
+
// OpenCode Go alias of DeepSeek-V4.1-Flash; DeepSeek's own API does not expose this name
|
|
78
|
+
"deepseek-v4.1-flash": {
|
|
79
|
+
protocol: "responses",
|
|
80
|
+
reasoning: "switchable",
|
|
81
|
+
defaultThinking: "enabled",
|
|
82
|
+
efforts: V4_EFFORTS,
|
|
83
|
+
supportsFunctionTools: true,
|
|
84
|
+
supportsStructuredOutput: true,
|
|
85
|
+
supportsWebSearch: false,
|
|
86
|
+
supportsImageInput: true
|
|
53
87
|
},
|
|
54
88
|
"deepseek-v4-pro": {
|
|
55
89
|
protocol: "responses",
|
|
@@ -58,7 +92,8 @@ const DEEPSEEK_MODEL_CAPABILITIES = {
|
|
|
58
92
|
efforts: V4_EFFORTS,
|
|
59
93
|
supportsFunctionTools: true,
|
|
60
94
|
supportsStructuredOutput: true,
|
|
61
|
-
supportsWebSearch: true
|
|
95
|
+
supportsWebSearch: true,
|
|
96
|
+
supportsImageInput: false
|
|
62
97
|
},
|
|
63
98
|
"deepseek-chat": {
|
|
64
99
|
protocol: "chat-completions",
|
|
@@ -67,7 +102,8 @@ const DEEPSEEK_MODEL_CAPABILITIES = {
|
|
|
67
102
|
efforts: NO_EFFORTS,
|
|
68
103
|
supportsFunctionTools: true,
|
|
69
104
|
supportsStructuredOutput: true,
|
|
70
|
-
supportsWebSearch: false
|
|
105
|
+
supportsWebSearch: false,
|
|
106
|
+
supportsImageInput: false
|
|
71
107
|
},
|
|
72
108
|
"deepseek-reasoner": {
|
|
73
109
|
protocol: "chat-completions",
|
|
@@ -76,7 +112,8 @@ const DEEPSEEK_MODEL_CAPABILITIES = {
|
|
|
76
112
|
efforts: NO_EFFORTS,
|
|
77
113
|
supportsFunctionTools: true,
|
|
78
114
|
supportsStructuredOutput: true,
|
|
79
|
-
supportsWebSearch: false
|
|
115
|
+
supportsWebSearch: false,
|
|
116
|
+
supportsImageInput: false
|
|
80
117
|
}
|
|
81
118
|
};
|
|
82
119
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -48,7 +48,8 @@ class GoogleGenAIProvider extends import_provider.LLMProvider {
|
|
|
48
48
|
...this.modelOptions,
|
|
49
49
|
model,
|
|
50
50
|
json: responseFormat === "json",
|
|
51
|
-
baseUrl: this.getResolvedBaseURL()
|
|
51
|
+
baseUrl: this.getResolvedBaseURL(),
|
|
52
|
+
customHeaders: this.getDefaultHeaders()
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
async listModels() {
|
|
@@ -70,7 +71,8 @@ class GoogleGenAIProvider extends import_provider.LLMProvider {
|
|
|
70
71
|
try {
|
|
71
72
|
const res = await (0, import_utils.serverRequest)({
|
|
72
73
|
method: "GET",
|
|
73
|
-
url
|
|
74
|
+
url,
|
|
75
|
+
headers: this.getDefaultHeaders()
|
|
74
76
|
});
|
|
75
77
|
return {
|
|
76
78
|
models: (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.models.map((model) => ({
|
|
@@ -72,7 +72,8 @@ class KimiProvider extends import_provider.LLMProvider {
|
|
|
72
72
|
},
|
|
73
73
|
...reasoningOptions.modelRequestParams || {},
|
|
74
74
|
configuration: {
|
|
75
|
-
baseURL: this.getResolvedBaseURL()
|
|
75
|
+
baseURL: this.getResolvedBaseURL(),
|
|
76
|
+
defaultHeaders: this.getDefaultHeaders()
|
|
76
77
|
}
|
|
77
78
|
});
|
|
78
79
|
}
|
|
@@ -67,7 +67,8 @@ class MiMoProvider extends import_provider.LLMProvider {
|
|
|
67
67
|
response_format: responseFormatOptions
|
|
68
68
|
},
|
|
69
69
|
configuration: {
|
|
70
|
-
baseURL: this.getResolvedBaseURL()
|
|
70
|
+
baseURL: this.getResolvedBaseURL(),
|
|
71
|
+
defaultHeaders: this.getDefaultHeaders()
|
|
71
72
|
},
|
|
72
73
|
verbose: true
|
|
73
74
|
});
|
|
@@ -24,6 +24,7 @@ type MistralBeforeRequestHook = (request: Request) => Request | void | Promise<R
|
|
|
24
24
|
type ReasoningChatMistralAIFields = ConstructorParameters<typeof ChatMistralAI>[0] & {
|
|
25
25
|
[MISTRAL_REASONING_MODE_KEY]?: ReasoningMode;
|
|
26
26
|
};
|
|
27
|
+
export declare const createMistralHeadersHook: (defaultHeaders: Record<string, string>) => MistralBeforeRequestHook;
|
|
27
28
|
export declare const injectMistralReasoningEffort: MistralBeforeRequestHook;
|
|
28
29
|
declare class ReasoningChatMistralAI extends ChatMistralAI {
|
|
29
30
|
private readonly reasoningMode?;
|
|
@@ -28,6 +28,7 @@ var mistral_exports = {};
|
|
|
28
28
|
__export(mistral_exports, {
|
|
29
29
|
MistralEmbeddingProvider: () => MistralEmbeddingProvider,
|
|
30
30
|
MistralProvider: () => MistralProvider,
|
|
31
|
+
createMistralHeadersHook: () => createMistralHeadersHook,
|
|
31
32
|
injectMistralReasoningEffort: () => injectMistralReasoningEffort,
|
|
32
33
|
mistralProviderOptions: () => mistralProviderOptions
|
|
33
34
|
});
|
|
@@ -63,6 +64,18 @@ function extractThinkingChunks(content) {
|
|
|
63
64
|
}
|
|
64
65
|
return content.filter((chunk) => chunk && typeof chunk === "object").filter((chunk) => chunk.type === "thinking" && Array.isArray(chunk.thinking)).map((chunk) => extractTextChunks(chunk.thinking)).join("");
|
|
65
66
|
}
|
|
67
|
+
const createMistralHeadersHook = (defaultHeaders) => {
|
|
68
|
+
return (request) => {
|
|
69
|
+
if (!Object.keys(defaultHeaders).length) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const headers = new Headers(request.headers);
|
|
73
|
+
for (const [key, value] of Object.entries(defaultHeaders)) {
|
|
74
|
+
headers.set(key, value);
|
|
75
|
+
}
|
|
76
|
+
return new Request(request, { headers });
|
|
77
|
+
};
|
|
78
|
+
};
|
|
66
79
|
const injectMistralReasoningEffort = async (request) => {
|
|
67
80
|
if (request.method !== "POST") {
|
|
68
81
|
return;
|
|
@@ -139,7 +152,8 @@ class MistralProvider extends import_provider.LLMProvider {
|
|
|
139
152
|
const { apiKey } = this.serviceOptions || {};
|
|
140
153
|
const { responseFormat, structuredOutput, ...modelOptions } = this.modelOptions || {};
|
|
141
154
|
omitDisabledNumberOptions(modelOptions);
|
|
142
|
-
const
|
|
155
|
+
const defaultHooks = [createMistralHeadersHook(this.getDefaultHeaders()), injectMistralReasoningEffort];
|
|
156
|
+
const beforeRequestHooks = Array.isArray(modelOptions.beforeRequestHooks) ? [...defaultHooks, ...modelOptions.beforeRequestHooks] : defaultHooks;
|
|
143
157
|
const reasoningOptions = this.resolveReasoningOptions(this.modelReasoningOptions);
|
|
144
158
|
return new ReasoningChatMistralAI({
|
|
145
159
|
apiKey,
|
|
@@ -187,6 +201,7 @@ class MistralProvider extends import_provider.LLMProvider {
|
|
|
187
201
|
method: "GET",
|
|
188
202
|
url,
|
|
189
203
|
headers: {
|
|
204
|
+
...this.getDefaultHeaders(),
|
|
190
205
|
Authorization: `Bearer ${apiKey}`
|
|
191
206
|
}
|
|
192
207
|
});
|
|
@@ -320,6 +335,7 @@ const mistralProviderOptions = {
|
|
|
320
335
|
0 && (module.exports = {
|
|
321
336
|
MistralEmbeddingProvider,
|
|
322
337
|
MistralProvider,
|
|
338
|
+
createMistralHeadersHook,
|
|
323
339
|
injectMistralReasoningEffort,
|
|
324
340
|
mistralProviderOptions
|
|
325
341
|
});
|
|
@@ -50,6 +50,7 @@ class OllamaProvider extends import_provider.LLMProvider {
|
|
|
50
50
|
topK,
|
|
51
51
|
numPredict,
|
|
52
52
|
...rest,
|
|
53
|
+
headers: this.getDefaultHeaders(),
|
|
53
54
|
verbose: false,
|
|
54
55
|
format: void 0,
|
|
55
56
|
keepAlive: "5m"
|
|
@@ -69,7 +70,8 @@ class OllamaProvider extends import_provider.LLMProvider {
|
|
|
69
70
|
try {
|
|
70
71
|
const res = await (0, import_utils.serverRequest)({
|
|
71
72
|
method: "GET",
|
|
72
|
-
url
|
|
73
|
+
url,
|
|
74
|
+
headers: this.getDefaultHeaders()
|
|
73
75
|
});
|
|
74
76
|
const models = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.models) || [];
|
|
75
77
|
return {
|
|
@@ -55,7 +55,8 @@ class OpenAICompletionsProvider extends import_provider.LLMProvider {
|
|
|
55
55
|
...reasoningOptions.modelKwargs || {}
|
|
56
56
|
},
|
|
57
57
|
configuration: {
|
|
58
|
-
baseURL: this.getResolvedBaseURL()
|
|
58
|
+
baseURL: this.getResolvedBaseURL(),
|
|
59
|
+
defaultHeaders: this.getDefaultHeaders()
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
}
|
|
@@ -63,7 +63,8 @@ class OpenAIResponsesProvider extends import_provider.LLMProvider {
|
|
|
63
63
|
...reasoningOptions.modelKwargs || {}
|
|
64
64
|
},
|
|
65
65
|
configuration: {
|
|
66
|
-
baseURL: this.getResolvedBaseURL()
|
|
66
|
+
baseURL: this.getResolvedBaseURL(),
|
|
67
|
+
defaultHeaders: this.getDefaultHeaders()
|
|
67
68
|
},
|
|
68
69
|
verbose: false,
|
|
69
70
|
useResponsesApi: true
|
|
@@ -60,7 +60,7 @@ class OrcaRouterProvider extends import_provider.LLMProvider {
|
|
|
60
60
|
if (responseFormat === "json_schema" && schema) {
|
|
61
61
|
responseFormatOptions["json_schema"] = { schema, name: name ?? "schema" };
|
|
62
62
|
}
|
|
63
|
-
const defaultHeaders =
|
|
63
|
+
const defaultHeaders = this.getDefaultHeaders();
|
|
64
64
|
if (httpReferer) {
|
|
65
65
|
defaultHeaders["HTTP-Referer"] = httpReferer;
|
|
66
66
|
}
|
|
@@ -75,7 +75,7 @@ class OrcaRouterProvider extends import_provider.LLMProvider {
|
|
|
75
75
|
},
|
|
76
76
|
configuration: {
|
|
77
77
|
baseURL: this.getResolvedBaseURL(),
|
|
78
|
-
|
|
78
|
+
defaultHeaders
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -40,10 +40,14 @@ export type LLMModelRequestBuilder = (input: {
|
|
|
40
40
|
context: AIChatContext;
|
|
41
41
|
options?: LLMProviderInvokeOptions;
|
|
42
42
|
}) => LLMModelRequestBuilderResult;
|
|
43
|
+
export type LLMProviderRequestContext = {
|
|
44
|
+
sessionId?: string;
|
|
45
|
+
};
|
|
43
46
|
export interface LLMProviderOptions {
|
|
44
47
|
app: Application;
|
|
45
48
|
serviceOptions?: Record<string, any>;
|
|
46
49
|
modelOptions?: Record<string, any>;
|
|
50
|
+
requestContext?: LLMProviderRequestContext;
|
|
47
51
|
}
|
|
48
52
|
export declare abstract class LLMProvider {
|
|
49
53
|
app: Application;
|
|
@@ -51,6 +55,7 @@ export declare abstract class LLMProvider {
|
|
|
51
55
|
modelOptions: Record<string, any> | undefined;
|
|
52
56
|
chatModel: any;
|
|
53
57
|
protected modelReasoningOptions: ReasoningOptions | undefined;
|
|
58
|
+
protected requestContext: LLMProviderRequestContext;
|
|
54
59
|
abstract createModel(): BaseChatModel | any;
|
|
55
60
|
get baseURL(): string | null;
|
|
56
61
|
constructor(opts: LLMProviderOptions);
|
|
@@ -105,6 +110,11 @@ export declare abstract class LLMProvider {
|
|
|
105
110
|
}): void;
|
|
106
111
|
protected get documentLoader(): CachedDocumentLoader;
|
|
107
112
|
protected getResolvedBaseURL(): string;
|
|
113
|
+
/**
|
|
114
|
+
* Headers every provider must merge into its model client. Decided by the resolved baseURL; returns an empty object
|
|
115
|
+
* when the target service needs no extra headers.
|
|
116
|
+
*/
|
|
117
|
+
protected getDefaultHeaders(): Record<string, string>;
|
|
108
118
|
protected buildRequestURL(pathname: string): string;
|
|
109
119
|
protected get aiPlugin(): PluginAIServer;
|
|
110
120
|
}
|
|
@@ -46,6 +46,14 @@ var import_stream = require("@langchain/core/utils/stream");
|
|
|
46
46
|
var import_document_loader = require("../document-loader");
|
|
47
47
|
var import_node_path = __toESM(require("node:path"));
|
|
48
48
|
var import_reasoning = require("./common/reasoning");
|
|
49
|
+
function isOpenCodeBaseURL(baseURL) {
|
|
50
|
+
try {
|
|
51
|
+
const { hostname } = new URL(baseURL);
|
|
52
|
+
return hostname === "opencode.ai" || hostname.endsWith(".opencode.ai");
|
|
53
|
+
} catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
49
57
|
function assertBaseURLString(baseURL) {
|
|
50
58
|
if (typeof baseURL !== "string") {
|
|
51
59
|
throw new Error("baseURL must be a string");
|
|
@@ -85,13 +93,15 @@ class LLMProvider {
|
|
|
85
93
|
modelOptions;
|
|
86
94
|
chatModel;
|
|
87
95
|
modelReasoningOptions;
|
|
96
|
+
requestContext;
|
|
88
97
|
get baseURL() {
|
|
89
98
|
return null;
|
|
90
99
|
}
|
|
91
100
|
constructor(opts) {
|
|
92
|
-
const { app, serviceOptions, modelOptions } = opts;
|
|
101
|
+
const { app, serviceOptions, modelOptions, requestContext } = opts;
|
|
93
102
|
this.app = app;
|
|
94
103
|
this.serviceOptions = resolveServiceOptions(serviceOptions, app);
|
|
104
|
+
this.requestContext = requestContext ?? {};
|
|
95
105
|
if (modelOptions) {
|
|
96
106
|
const { _reasoning, ...restModelOptions } = modelOptions;
|
|
97
107
|
this.modelReasoningOptions = _reasoning;
|
|
@@ -171,6 +181,7 @@ class LLMProvider {
|
|
|
171
181
|
method: "GET",
|
|
172
182
|
url,
|
|
173
183
|
headers: {
|
|
184
|
+
...this.getDefaultHeaders(),
|
|
174
185
|
Authorization: `Bearer ${apiKey}`
|
|
175
186
|
}
|
|
176
187
|
});
|
|
@@ -382,6 +393,28 @@ ${parsed.text}
|
|
|
382
393
|
}
|
|
383
394
|
return normalizeBaseURL(baseURL);
|
|
384
395
|
}
|
|
396
|
+
/**
|
|
397
|
+
* Headers every provider must merge into its model client. Decided by the resolved baseURL; returns an empty object
|
|
398
|
+
* when the target service needs no extra headers.
|
|
399
|
+
*/
|
|
400
|
+
getDefaultHeaders() {
|
|
401
|
+
let baseURL;
|
|
402
|
+
try {
|
|
403
|
+
baseURL = this.getResolvedBaseURL();
|
|
404
|
+
} catch {
|
|
405
|
+
return {};
|
|
406
|
+
}
|
|
407
|
+
if (!isOpenCodeBaseURL(baseURL)) {
|
|
408
|
+
return {};
|
|
409
|
+
}
|
|
410
|
+
const headers = {
|
|
411
|
+
"User-Agent": `NocoBase/${this.app.getVersion()}`
|
|
412
|
+
};
|
|
413
|
+
if (this.requestContext.sessionId) {
|
|
414
|
+
headers["x-opencode-session"] = this.requestContext.sessionId;
|
|
415
|
+
}
|
|
416
|
+
return headers;
|
|
417
|
+
}
|
|
385
418
|
buildRequestURL(pathname) {
|
|
386
419
|
const url = new URL(pathname.replace(/^\/+/, ""), `${this.getResolvedBaseURL()}/`).toString();
|
|
387
420
|
(0, import_utils.checkUrlAgainstWhitelist)(url);
|
|
@@ -64,7 +64,10 @@ class ShengSuanYunProvider extends import_provider.LLMProvider {
|
|
|
64
64
|
},
|
|
65
65
|
configuration: {
|
|
66
66
|
baseURL: this.getResolvedBaseURL(),
|
|
67
|
-
|
|
67
|
+
defaultHeaders: {
|
|
68
|
+
...this.getDefaultHeaders(),
|
|
69
|
+
...xTitle ? { "X-Title": xTitle } : {}
|
|
70
|
+
}
|
|
68
71
|
}
|
|
69
72
|
});
|
|
70
73
|
}
|
|
@@ -85,6 +88,7 @@ class ShengSuanYunProvider extends import_provider.LLMProvider {
|
|
|
85
88
|
method: "GET",
|
|
86
89
|
url,
|
|
87
90
|
headers: {
|
|
91
|
+
...this.getDefaultHeaders(),
|
|
88
92
|
Authorization: `Bearer ${apiKey}`,
|
|
89
93
|
...xTitle ? { "X-Title": xTitle } : {}
|
|
90
94
|
}
|
|
@@ -47,7 +47,7 @@ class XAIProvider extends import_provider.LLMProvider {
|
|
|
47
47
|
if (responseFormat === "json_schema" && schema) {
|
|
48
48
|
responseFormatOptions["json_schema"] = schema;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
const model = new import_xai.ChatXAI({
|
|
51
51
|
apiKey,
|
|
52
52
|
...restModelOptions,
|
|
53
53
|
baseURL: this.getResolvedBaseURL(),
|
|
@@ -55,6 +55,11 @@ class XAIProvider extends import_provider.LLMProvider {
|
|
|
55
55
|
response_format: responseFormatOptions
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
+
model.clientConfig = {
|
|
59
|
+
...model.clientConfig,
|
|
60
|
+
defaultHeaders: this.getDefaultHeaders()
|
|
61
|
+
};
|
|
62
|
+
return model;
|
|
58
63
|
}
|
|
59
64
|
}
|
|
60
65
|
const xaiProviderOptions = {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import { LLMProvider, LLMProviderOptions, EmbeddingProvider, EmbeddingProviderOptions, ReasoningOptions } from '../llm-providers/provider';
|
|
9
|
+
import { LLMProvider, LLMProviderOptions, LLMProviderRequestContext, EmbeddingProvider, EmbeddingProviderOptions, ReasoningOptions } from '../llm-providers/provider';
|
|
10
10
|
import PluginAIServer from '../plugin';
|
|
11
11
|
import { ToolManager } from './tool-manager';
|
|
12
12
|
export type LLMProviderMeta = {
|
|
@@ -60,7 +60,7 @@ export declare class AIManager {
|
|
|
60
60
|
resolveModel(model?: LLMModelOptions | null): Promise<LLMModelOptions>;
|
|
61
61
|
private toEnabledLLMService;
|
|
62
62
|
private getEnabledModels;
|
|
63
|
-
getLLMService(options: LLMModelOptions): Promise<{
|
|
63
|
+
getLLMService(options: LLMModelOptions, requestContext?: LLMProviderRequestContext): Promise<{
|
|
64
64
|
provider: LLMProvider;
|
|
65
65
|
model: string;
|
|
66
66
|
service: any;
|
|
@@ -124,7 +124,7 @@ class AIManager {
|
|
|
124
124
|
}
|
|
125
125
|
return (0, import_recommended_models.getRecommendedModels)(provider);
|
|
126
126
|
}
|
|
127
|
-
async getLLMService(options) {
|
|
127
|
+
async getLLMService(options, requestContext) {
|
|
128
128
|
const { llmService, model, webSearch, reasoning } = options ?? {};
|
|
129
129
|
if (!llmService || !model) {
|
|
130
130
|
throw new Error("LLM service not configured");
|
|
@@ -158,7 +158,8 @@ class AIManager {
|
|
|
158
158
|
const provider = new Provider({
|
|
159
159
|
app: this.plugin.app,
|
|
160
160
|
serviceOptions: service.options,
|
|
161
|
-
modelOptions
|
|
161
|
+
modelOptions,
|
|
162
|
+
requestContext
|
|
162
163
|
});
|
|
163
164
|
return { provider, model, service };
|
|
164
165
|
}
|
|
@@ -41,6 +41,7 @@ __export(ai_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(ai_exports);
|
|
42
42
|
var import_package = require("../../../package.json");
|
|
43
43
|
var import_lodash = __toESM(require("lodash"));
|
|
44
|
+
var import_node_crypto = require("node:crypto");
|
|
44
45
|
const getModelsListFailedMessage = "Get models list failed, you can enter a model name manually.";
|
|
45
46
|
const testFlightFailedMessage = "LLM service test failed. Please check the service configuration.";
|
|
46
47
|
const aiResource = {
|
|
@@ -146,6 +147,9 @@ const aiResource = {
|
|
|
146
147
|
modelOptions: {
|
|
147
148
|
model,
|
|
148
149
|
responseFormat: "text"
|
|
150
|
+
},
|
|
151
|
+
requestContext: {
|
|
152
|
+
sessionId: `test-flight-${(0, import_node_crypto.randomUUID)()}`
|
|
149
153
|
}
|
|
150
154
|
});
|
|
151
155
|
const result = await providerClient.testFlight();
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { FlowNodeModel, Instruction, Processor } from '@nocobase/plugin-workflow';
|
|
10
|
-
import { LLMProvider } from '../../../llm-providers/provider';
|
|
10
|
+
import { LLMProvider, LLMProviderRequestContext } from '../../../llm-providers/provider';
|
|
11
11
|
export declare class LLMInstruction extends Instruction {
|
|
12
|
-
getLLMProvider(llmService: string, modelOptions: any): Promise<LLMProvider>;
|
|
12
|
+
getLLMProvider(llmService: string, modelOptions: any, requestContext?: LLMProviderRequestContext): Promise<LLMProvider>;
|
|
13
13
|
run(node: FlowNodeModel, input: any, processor: Processor): Promise<any>;
|
|
14
14
|
resume(node: FlowNodeModel, job: any, processor: Processor): any;
|
|
15
15
|
}
|
|
@@ -43,7 +43,7 @@ var import_plugin_workflow = require("@nocobase/plugin-workflow");
|
|
|
43
43
|
var import_lodash = __toESM(require("lodash"));
|
|
44
44
|
var import_parse_messages = require("./parse-messages");
|
|
45
45
|
class LLMInstruction extends import_plugin_workflow.Instruction {
|
|
46
|
-
async getLLMProvider(llmService, modelOptions) {
|
|
46
|
+
async getLLMProvider(llmService, modelOptions, requestContext) {
|
|
47
47
|
const service = await this.workflow.db.getRepository("llmServices").findOne({
|
|
48
48
|
filter: {
|
|
49
49
|
name: llmService
|
|
@@ -58,7 +58,12 @@ class LLMInstruction extends import_plugin_workflow.Instruction {
|
|
|
58
58
|
throw new Error("invalid llm provider");
|
|
59
59
|
}
|
|
60
60
|
const Provider = providerOptions.provider;
|
|
61
|
-
const provider = new Provider({
|
|
61
|
+
const provider = new Provider({
|
|
62
|
+
app: this.workflow.app,
|
|
63
|
+
serviceOptions: service.options,
|
|
64
|
+
modelOptions,
|
|
65
|
+
requestContext
|
|
66
|
+
});
|
|
62
67
|
return provider;
|
|
63
68
|
}
|
|
64
69
|
async run(node, input, processor) {
|
|
@@ -69,7 +74,9 @@ class LLMInstruction extends import_plugin_workflow.Instruction {
|
|
|
69
74
|
}
|
|
70
75
|
let provider;
|
|
71
76
|
try {
|
|
72
|
-
provider = await this.getLLMProvider(llmService, modelOptions
|
|
77
|
+
provider = await this.getLLMProvider(llmService, modelOptions, {
|
|
78
|
+
sessionId: `workflow-${processor.execution.id}-${node.id}`
|
|
79
|
+
});
|
|
73
80
|
} catch (e) {
|
|
74
81
|
return {
|
|
75
82
|
status: import_plugin_workflow.JOB_STATUS.ERROR,
|
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.2.
|
|
9
|
+
"version": "2.2.19",
|
|
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": "
|
|
69
|
+
"gitHead": "0d4e2dc07729c32533e35c8e8e16c57815d6242a"
|
|
70
70
|
}
|