@nocobase/plugin-ai 2.4.0-alpha.17 → 2.4.0-alpha.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.
Files changed (37) hide show
  1. package/dist/ai/docs/nocobase/ai/upgrade-nocobase-app.md +2 -0
  2. package/dist/ai/docs/nocobase/api/cli/api/resource/list.md +2 -0
  3. package/dist/ai/docs/nocobase/api/flow-engine/flow-context.md +1 -2
  4. package/dist/ai/docs/nocobase/get-started/installation/env.md +8 -0
  5. package/dist/ai/docs/nocobase/get-started/upgrading/create-nocobase-app.md +1 -0
  6. package/dist/ai/docs/nocobase/get-started/upgrading/docker.md +1 -0
  7. package/dist/ai/docs/nocobase/get-started/upgrading/git.md +1 -0
  8. package/dist/ai/docs/nocobase/plugin-development/client/ctx/common-capabilities.md +1 -1
  9. package/dist/ai/docs/nocobase/runjs/context/exit-all.md +3 -27
  10. package/dist/ai/docs/nocobase/runjs/context/exit.md +5 -29
  11. package/dist/client/264.a434eda1b7001d79.js +10 -0
  12. package/dist/client/index.js +1 -1
  13. package/dist/client-v2/264.92bd3dc68e1cb80d.js +10 -0
  14. package/dist/client-v2/ai-employees/chatbox/components/ChatBoxLayout.d.ts +2 -0
  15. package/dist/client-v2/ai-employees/chatbox/components/ChatButton.d.ts +3 -1
  16. package/dist/client-v2/index.js +1 -1
  17. package/dist/client-v2/pages/MCPSettingsPage.d.ts +3 -1
  18. package/dist/collections/ai-mcp-clients.js +5 -0
  19. package/dist/externalVersion.js +15 -15
  20. package/dist/locale/en-US.json +9 -0
  21. package/dist/locale/zh-CN.json +9 -0
  22. package/dist/node_modules/@langchain/mistralai/package.json +1 -1
  23. package/dist/node_modules/@langchain/xai/package.json +1 -1
  24. package/dist/node_modules/fs-extra/package.json +1 -1
  25. package/dist/node_modules/jsonrepair/package.json +1 -1
  26. package/dist/node_modules/just-bash/package.json +1 -1
  27. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  28. package/dist/node_modules/openai/package.json +1 -1
  29. package/dist/node_modules/zod/package.json +1 -1
  30. package/dist/server/ai-employees/ai-employee.js +31 -2
  31. package/dist/server/collections/ai-mcp-tool-permissions.d.ts +10 -0
  32. package/dist/server/collections/ai-mcp-tool-permissions.js +53 -0
  33. package/dist/server/plugin.js +4 -2
  34. package/dist/server/resource/aiMcpClients.js +106 -9
  35. package/package.json +2 -2
  36. package/dist/client/264.6ca5f2eeb4173d86.js +0 -10
  37. package/dist/client-v2/264.3c7d8e90aa7f46ee.js +0 -10
@@ -20,6 +20,7 @@ export type MCPRecord = {
20
20
  title?: string;
21
21
  description?: string;
22
22
  enabled?: boolean;
23
+ fromFile?: boolean;
23
24
  transport: MCPTransport;
24
25
  command?: string | null;
25
26
  url?: string | null;
@@ -55,11 +56,12 @@ type MCPListResult = {
55
56
  data: MCPRecord[];
56
57
  total?: number;
57
58
  };
59
+ export declare const isProtectedMCP: (record?: MCPRecord) => boolean;
58
60
  export declare const sanitizeMCPValues: (values: MCPFormValues) => MCPRecord;
59
61
  export declare const toMCPFormValues: (record: MCPRecord) => MCPFormValues;
60
62
  export declare const getMCPToolsByServer: (toolsMap: Record<string, MCPToolEntry[]> | null | undefined, serverName: string) => MCPToolEntry[];
61
63
  export declare function listMCPClients(apiClient: APIClientLike): Promise<MCPListResult>;
62
- export declare function testMCPConnection(apiClient: APIClientLike, values: MCPFormValues): Promise<MCPTestResultData>;
64
+ export declare function testMCPConnection(apiClient: APIClientLike, values: MCPFormValues, record?: MCPRecord): Promise<MCPTestResultData>;
63
65
  export declare function createMCPClient(apiClient: APIClientLike, values: MCPFormValues): Promise<void>;
64
66
  export declare function updateMCPClient(apiClient: APIClientLike, values: MCPFormValues, name: string): Promise<void>;
65
67
  export declare function deleteMCPClient(apiClient: APIClientLike, name: string): Promise<void>;
@@ -60,6 +60,11 @@ var ai_mcp_clients_default = {
60
60
  type: "boolean",
61
61
  defaultValue: true
62
62
  },
63
+ {
64
+ name: "fromFile",
65
+ type: "boolean",
66
+ defaultValue: false
67
+ },
63
68
  {
64
69
  name: "transport",
65
70
  type: "string",
@@ -8,17 +8,17 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/plugin-acl": "2.4.0-alpha.17",
12
- "@nocobase/plugin-workflow": "2.4.0-alpha.17",
13
- "@nocobase/client": "2.4.0-alpha.17",
14
- "@nocobase/utils": "2.4.0-alpha.17",
15
- "@nocobase/flow-engine": "2.4.0-alpha.17",
16
- "@nocobase/client-v2": "2.4.0-alpha.17",
17
- "@nocobase/actions": "2.4.0-alpha.17",
18
- "@nocobase/database": "2.4.0-alpha.17",
19
- "@nocobase/plugin-file-manager": "2.4.0-alpha.17",
20
- "@nocobase/server": "2.4.0-alpha.17",
21
- "@nocobase/ai": "2.4.0-alpha.17",
11
+ "@nocobase/plugin-acl": "2.4.0-alpha.19",
12
+ "@nocobase/plugin-workflow": "2.4.0-alpha.19",
13
+ "@nocobase/client": "2.4.0-alpha.19",
14
+ "@nocobase/utils": "2.4.0-alpha.19",
15
+ "@nocobase/flow-engine": "2.4.0-alpha.19",
16
+ "@nocobase/client-v2": "2.4.0-alpha.19",
17
+ "@nocobase/actions": "2.4.0-alpha.19",
18
+ "@nocobase/database": "2.4.0-alpha.19",
19
+ "@nocobase/plugin-file-manager": "2.4.0-alpha.19",
20
+ "@nocobase/server": "2.4.0-alpha.19",
21
+ "@nocobase/ai": "2.4.0-alpha.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.4.0-alpha.17",
33
+ "@nocobase/cache": "2.4.0-alpha.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.4.0-alpha.17",
39
- "@nocobase/data-source-manager": "2.4.0-alpha.17",
40
- "@nocobase/resourcer": "2.4.0-alpha.17",
38
+ "@nocobase/acl": "2.4.0-alpha.19",
39
+ "@nocobase/data-source-manager": "2.4.0-alpha.19",
40
+ "@nocobase/resourcer": "2.4.0-alpha.19",
41
41
  "dayjs": "1.11.13",
42
42
  "react-dom": "18.2.0",
43
43
  "@formily/core": "2.3.7",
@@ -1,4 +1,13 @@
1
1
  {
2
+ "Stdio MCP servers can only be configured in storage/ai/mcp/servers.json.": "Stdio MCP servers can only be configured in storage/ai/mcp/servers.json.",
3
+ "This MCP server is managed by deployment configuration. Only its enabled state can be changed.": "This MCP server is managed by deployment configuration. Only its enabled state can be changed.",
4
+ "Invalid MCP configuration": "Invalid MCP configuration",
5
+ "Invalid MCP tool permission": "Invalid MCP tool permission",
6
+ "MCP tool not found or ambiguous": "MCP tool not found or ambiguous",
7
+ "MCP server is disabled or deleted": "MCP server is disabled or deleted",
8
+ "MCP server not found": "MCP server not found",
9
+ "Command is required for stdio transport": "Command is required for stdio transport",
10
+ "No configuration provided": "No configuration provided",
2
11
  "API Key": "API Key",
3
12
  "X-Title": "X-Title",
4
13
  "Sent as the \"X-Title\" request header.": "Sent as the \"X-Title\" request header.",
@@ -1,4 +1,13 @@
1
1
  {
2
+ "Stdio MCP servers can only be configured in storage/ai/mcp/servers.json.": "Stdio MCP 服务只能通过 storage/ai/mcp/servers.json 配置。",
3
+ "This MCP server is managed by deployment configuration. Only its enabled state can be changed.": "此 MCP 服务由部署配置管理,仅可切换启用状态。",
4
+ "Invalid MCP configuration": "MCP 配置无效",
5
+ "Invalid MCP tool permission": "MCP 工具权限配置无效",
6
+ "MCP tool not found or ambiguous": "MCP 工具不存在或标识不唯一",
7
+ "MCP server is disabled or deleted": "MCP 服务已停用或删除",
8
+ "MCP server not found": "MCP 服务不存在",
9
+ "Command is required for stdio transport": "Stdio 传输必须配置命令",
10
+ "No configuration provided": "未提供连接配置",
2
11
  "API Key": "API Key",
3
12
  "X-Title": "X-Title",
4
13
  "Sent as the \"X-Title\" request header.": "作为 \"X-Title\" 请求头发送。",
@@ -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-11-08T11:08:16.328Z"}
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-11-24T11:22:42.621Z"}
@@ -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-11-08T11:08:19.061Z"}
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-11-24T11:22:45.813Z"}
@@ -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-11-08T11:08:19.235Z"}
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-11-24T11:22:45.982Z"}
@@ -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-11-08T11:08:24.793Z"}
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-11-24T11:22:51.364Z"}
@@ -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-11-08T11:08:22.482Z"}
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-11-24T11:22:49.149Z"}
@@ -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-11-08T11:08:08.693Z"}
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-11-24T11:22:35.546Z"}
@@ -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-11-08T11:08:24.608Z"}
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-11-24T11:22:51.194Z"}
@@ -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-11-08T11:08:08.636Z"}
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-11-24T11:22:35.490Z"}
@@ -60,6 +60,29 @@ var import_attachments = require("../attachments");
60
60
  var import_frontend_tools = require("../../common/frontend-tools");
61
61
  var import_frontend_tools2 = require("../frontend-tools");
62
62
  var import_reasoning_stream_state = require("./reasoning-stream-state");
63
+ function getNestedRangeErrorStack(error) {
64
+ if (!(error instanceof Error) || error.name !== "RangeError") {
65
+ return;
66
+ }
67
+ const seen = /* @__PURE__ */ new Set([error]);
68
+ let cause = error;
69
+ let causeDepth = 0;
70
+ while (cause.cause instanceof Error && !seen.has(cause.cause) && causeDepth < 16) {
71
+ cause = cause.cause;
72
+ seen.add(cause);
73
+ causeDepth++;
74
+ }
75
+ if (causeDepth < 2 || typeof cause.stack !== "string") {
76
+ return;
77
+ }
78
+ const header = Error.prototype.toString.call(cause) + "\n";
79
+ if (cause.stack.startsWith(header)) {
80
+ const stackFrames = cause.stack.slice(header.length).split("\n", 20).filter((line) => /^\s+at /.test(line));
81
+ if (stackFrames.length) {
82
+ return { causeDepth, stackFrames };
83
+ }
84
+ }
85
+ }
63
86
  const ABORTED_TOOL_CALL_CONTENT = "The tool call was interrupted because the conversation was aborted.";
64
87
  class AIEmployee {
65
88
  sessionId;
@@ -388,7 +411,8 @@ class AIEmployee {
388
411
  if (this.from === "sub-agent") {
389
412
  delete config.configurable;
390
413
  }
391
- return agent.stream(input, this.withRunMetadata(config));
414
+ const runner = input instanceof import_langgraph.Command ? agent.graph : agent;
415
+ return runner.stream(input, this.withRunMetadata(config));
392
416
  }
393
417
  async agentInvoke(provider, context, config, state) {
394
418
  const { systemPrompt, tools, middleware } = context;
@@ -397,7 +421,8 @@ class AIEmployee {
397
421
  if (this.from === "sub-agent") {
398
422
  delete config.configurable;
399
423
  }
400
- return agent.invoke(input, this.withRunMetadata(config));
424
+ const runner = input instanceof import_langgraph.Command ? agent.graph : agent;
425
+ return runner.invoke(input, this.withRunMetadata(config));
401
426
  }
402
427
  async prepareChatStream({
403
428
  chatContext,
@@ -677,6 +702,10 @@ class AIEmployee {
677
702
  } catch (err) {
678
703
  await stopAllReasoning();
679
704
  this.ctx.log.error(err);
705
+ const nestedStack = getNestedRangeErrorStack(err);
706
+ if (nestedStack) {
707
+ this.ctx.log.error("AI employee stream nested RangeError stack", nestedStack);
708
+ }
680
709
  if (err.name === "GraphRecursionError") {
681
710
  this.sendSpecificError({ name: err.name, message: err.message });
682
711
  } else {
@@ -0,0 +1,10 @@
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;
@@ -0,0 +1,53 @@
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_mcp_tool_permissions_exports = {};
28
+ __export(ai_mcp_tool_permissions_exports, {
29
+ default: () => ai_mcp_tool_permissions_default
30
+ });
31
+ module.exports = __toCommonJS(ai_mcp_tool_permissions_exports);
32
+ var import_database = require("@nocobase/database");
33
+ var ai_mcp_tool_permissions_default = (0, import_database.defineCollection)({
34
+ name: "aiMcpToolPermissions",
35
+ migrationRules: ["overwrite", "schema-only"],
36
+ fields: [
37
+ // The column-level cascade also covers bulk/model deletes that bypass individual relation hooks.
38
+ { name: "serverName", type: "string", allowNull: false, onDelete: "CASCADE" },
39
+ { name: "toolName", type: "string", allowNull: false },
40
+ { name: "permission", type: "string", allowNull: false, validate: { isIn: [["ASK", "ALLOW"]] } },
41
+ // Relation setup refreshes indexes, so declare the indexed columns before this association.
42
+ {
43
+ name: "server",
44
+ type: "belongsTo",
45
+ target: "aiMcpClients",
46
+ targetKey: "name",
47
+ foreignKey: "serverName",
48
+ constraints: true,
49
+ onDelete: "CASCADE"
50
+ }
51
+ ],
52
+ indexes: [{ fields: ["serverName", "toolName"], unique: true }]
53
+ });
@@ -41,12 +41,13 @@ __export(plugin_exports, {
41
41
  });
42
42
  module.exports = __toCommonJS(plugin_exports);
43
43
  var import_server = require("@nocobase/server");
44
+ var import_ai = require("@nocobase/ai");
44
45
  var import_ai_manager = require("./manager/ai-manager");
45
46
  var import_ai_feature_manager = require("./manager/ai-feature-manager");
46
47
  var import_openai = require("./llm-providers/openai");
47
48
  var import_openai2 = require("./llm-providers/openai");
48
49
  var import_deepseek = require("./llm-providers/deepseek");
49
- var import_ai = __toESM(require("./resource/ai"));
50
+ var import_ai2 = __toESM(require("./resource/ai"));
50
51
  var import_llm = require("./workflow/nodes/llm");
51
52
  var import_aiConversations = __toESM(require("./resource/aiConversations"));
52
53
  var import_aiWorkflowTasks = __toESM(require("./resource/aiWorkflowTasks"));
@@ -131,6 +132,7 @@ class PluginAIServer extends import_server.Plugin {
131
132
  this.app.on("afterStart", async () => {
132
133
  await this.ai.skillsManager.init();
133
134
  await this.ai.employeeManager.init();
135
+ await new import_ai.MCPLoader(this.ai.mcpManager, { log: this.log }).load();
134
136
  await this.ai.mcpManager.init();
135
137
  });
136
138
  this.app.on("afterUpgrade", async () => {
@@ -205,7 +207,7 @@ class PluginAIServer extends import_server.Plugin {
205
207
  toolsManager.registerDynamicTools(this.ai.mcpManager.getMCPToolsProvider());
206
208
  }
207
209
  defineResources() {
208
- this.app.resourceManager.define(import_ai.default);
210
+ this.app.resourceManager.define(import_ai2.default);
209
211
  this.app.resourceManager.define(import_aiConversations.default);
210
212
  this.app.resourceManager.define(import_aiWorkflowTasks.default);
211
213
  this.app.resourceManager.define(import_aiTools.default);
@@ -30,22 +30,111 @@ __export(aiMcpClients_exports, {
30
30
  default: () => aiMcpClients_default
31
31
  });
32
32
  module.exports = __toCommonJS(aiMcpClients_exports);
33
+ var import_database = require("@nocobase/database");
34
+ var import_ai = require("@nocobase/ai");
35
+ const namespace = "@nocobase/plugin-ai";
36
+ const toolPermissionErrorMessages = {
37
+ INVALID_PERMISSION: "Invalid MCP tool permission",
38
+ TOOL_NOT_FOUND_OR_AMBIGUOUS: "MCP tool not found or ambiguous"
39
+ };
40
+ const stdioMessage = "Stdio MCP servers can only be configured in storage/ai/mcp/servers.json.";
41
+ const protectedMessage = "This MCP server is managed by deployment configuration. Only its enabled state can be changed.";
42
+ const isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
43
+ async function protectMCPWrites(ctx, next) {
44
+ const { actionName, params } = ctx.action;
45
+ if (!["create", "update", "destroy", "firstOrCreate", "updateOrCreate"].includes(actionName)) {
46
+ return next();
47
+ }
48
+ const repository = ctx.db.getRepository("aiMcpClients");
49
+ if (actionName === "destroy") {
50
+ const matches = await repository.find({
51
+ filter: params.filter,
52
+ filterByTk: params.filterByTk,
53
+ fields: ["name", "transport", "fromFile"]
54
+ });
55
+ if (matches.some((record) => record.get("transport") === "stdio" || record.get("fromFile") === true)) {
56
+ ctx.throw(403, ctx.t(protectedMessage, { ns: namespace }));
57
+ }
58
+ return next();
59
+ }
60
+ const rawValues = params.values;
61
+ const rows = Array.isArray(rawValues) ? rawValues : [rawValues];
62
+ const sanitizedRows = [];
63
+ for (const row of rows) {
64
+ if (!isRecord(row)) {
65
+ ctx.throw(400, ctx.t("Invalid MCP configuration", { ns: namespace }));
66
+ }
67
+ const values = { ...row };
68
+ delete values.fromFile;
69
+ sanitizedRows.push(values);
70
+ }
71
+ params.values = Array.isArray(rawValues) ? sanitizedRows : sanitizedRows[0];
72
+ for (const values of sanitizedRows) {
73
+ let matches = [];
74
+ if (actionName === "update") {
75
+ matches = await repository.find({
76
+ filter: Array.isArray(rawValues) ? void 0 : params.filter,
77
+ filterByTk: Array.isArray(rawValues) ? values.name : params.filterByTk,
78
+ fields: ["name", "transport", "fromFile"]
79
+ });
80
+ } else if (actionName === "firstOrCreate" || actionName === "updateOrCreate") {
81
+ const match = await repository.findOne({ filter: import_database.Repository.valuesToFilter(values, params.filterKeys) });
82
+ matches = match ? [match] : [];
83
+ if (actionName === "firstOrCreate" && match) {
84
+ continue;
85
+ }
86
+ }
87
+ if (values.transport === "stdio") {
88
+ ctx.throw(403, ctx.t(stdioMessage, { ns: namespace }));
89
+ }
90
+ const enabledOnly = Object.keys(values).length === 1 && Object.hasOwn(values, "enabled");
91
+ if (!enabledOnly && matches.some((record) => record.get("transport") === "stdio" || record.get("fromFile") === true)) {
92
+ ctx.throw(403, ctx.t(protectedMessage, { ns: namespace }));
93
+ }
94
+ }
95
+ await next();
96
+ }
33
97
  const aiMcpClients = {
34
98
  name: "aiMcpClients",
99
+ middleware: protectMCPWrites,
35
100
  actions: {
36
101
  testConnection: async (ctx, next) => {
37
- const values = ctx.action.params.values;
38
- if (!values) {
102
+ const { filterByTk, values } = ctx.action.params;
103
+ let options = values;
104
+ if (filterByTk != null) {
105
+ if (typeof filterByTk !== "string" || !filterByTk) {
106
+ ctx.throw(403, ctx.t(stdioMessage, { ns: namespace }));
107
+ }
108
+ const record = await ctx.db.getRepository("aiMcpClients").findOne({ filterByTk });
109
+ if (!record) {
110
+ ctx.throw(404, ctx.t("MCP server not found", { ns: namespace }));
111
+ }
112
+ if (record.get("transport") === "stdio") {
113
+ options = record.toJSON();
114
+ if (!options.command) {
115
+ ctx.body = {
116
+ success: false,
117
+ error: ctx.t("Command is required for stdio transport", { ns: namespace })
118
+ };
119
+ await next();
120
+ return;
121
+ }
122
+ } else if ((options == null ? void 0 : options.transport) === "stdio") {
123
+ ctx.throw(403, ctx.t(stdioMessage, { ns: namespace }));
124
+ }
125
+ } else if ((options == null ? void 0 : options.transport) === "stdio") {
126
+ ctx.throw(403, ctx.t(stdioMessage, { ns: namespace }));
127
+ }
128
+ if (!options) {
39
129
  ctx.body = {
40
130
  success: false,
41
- error: "No configuration provided"
131
+ error: ctx.t("No configuration provided", { ns: namespace })
42
132
  };
43
133
  await next();
44
134
  return;
45
135
  }
46
136
  const plugin = ctx.app.pm.get("ai");
47
- const result = await plugin.ai.mcpManager.testConnection(values, ctx);
48
- ctx.body = result;
137
+ ctx.body = await plugin.ai.mcpManager.testConnection(options, ctx);
49
138
  await next();
50
139
  },
51
140
  rebuildClient: async (ctx, next) => {
@@ -60,12 +149,20 @@ const aiMcpClients = {
60
149
  await next();
61
150
  },
62
151
  updateToolPermission: async (ctx, next) => {
63
- const { toolName, permission } = ctx.action.params.values || {};
64
- if (!toolName || !permission) {
65
- ctx.throw(400, "toolName and permission are required");
152
+ const values = ctx.action.params.values;
153
+ if (!isRecord(values) || typeof values.toolName !== "string" || !values.toolName.trim() || values.permission !== "ASK" && values.permission !== "ALLOW") {
154
+ return ctx.throw(400, ctx.t("Invalid MCP tool permission", { ns: namespace }));
66
155
  }
156
+ const { toolName, permission } = values;
67
157
  const plugin = ctx.app.pm.get("ai");
68
- await plugin.ai.mcpManager.updateMCPToolPermission(toolName, permission);
158
+ try {
159
+ await plugin.ai.mcpManager.updateMCPToolPermission(toolName, permission, ctx);
160
+ } catch (error) {
161
+ if (error instanceof import_ai.MCPToolPermissionError) {
162
+ return ctx.throw(400, ctx.t(toolPermissionErrorMessages[error.code], { ns: namespace }));
163
+ }
164
+ throw error;
165
+ }
69
166
  ctx.body = { success: true };
70
167
  await next();
71
168
  }