@nocobase/plugin-ai 2.2.0-alpha.7 → 2.2.0-alpha.8
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/docs/nocobase/multi-app/multi-app-vs-multi-portal-vs-multi-space.md +159 -0
- package/dist/ai/docs/nocobase/multi-app/multi-portal/index.md +195 -0
- package/dist/ai/tools/formFiller.js +4 -3
- package/dist/client/372.40eb52905e3f3049.js +10 -0
- package/dist/client/index.js +2 -2
- package/dist/client-v2/372.8cc3fde09c9bec77.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/client-v2/pages/EmployeesPage.d.ts +9 -0
- package/dist/externalVersion.js +15 -15
- package/dist/locale/en-US.json +1 -0
- package/dist/locale/zh-CN.json +1 -0
- 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/tool-call-sanitizer.d.ts +1 -0
- package/dist/server/ai-employees/tool-call-sanitizer.js +2 -1
- package/dist/server/ai-employees/utils.js +11 -5
- package/dist/server/manager/ai-context-datasource-manager.js +34 -7
- package/package.json +2 -2
- package/dist/client/372.da38fe350bf841f4.js +0 -10
- package/dist/client-v2/372.d76ea1ceed2be2a4.js +0 -10
|
@@ -19,6 +19,14 @@ type KnowledgeBaseOption = {
|
|
|
19
19
|
key: string;
|
|
20
20
|
name: string;
|
|
21
21
|
};
|
|
22
|
+
type EmployeeToolSetting = {
|
|
23
|
+
name: string;
|
|
24
|
+
autoCall?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type EmployeeSkillSettings = {
|
|
27
|
+
skills?: string[];
|
|
28
|
+
tools?: EmployeeToolSetting[];
|
|
29
|
+
};
|
|
22
30
|
type SettingsAIEmployee = ChatAIEmployee & {
|
|
23
31
|
about?: string | null;
|
|
24
32
|
dataSourceSettings?: unknown;
|
|
@@ -49,5 +57,6 @@ export declare function deleteAIEmployee(apiClient: APIClientLike, username: str
|
|
|
49
57
|
export declare function updateAIEmployeeEnabled(apiClient: APIClientLike, username: string, enabled: boolean): Promise<void>;
|
|
50
58
|
export declare function isKnowledgeBaseEnabled(apiClient: APIClientLike): Promise<boolean>;
|
|
51
59
|
export declare function listKnowledgeBases(apiClient: APIClientLike): Promise<KnowledgeBaseOption[]>;
|
|
60
|
+
export declare const normalizeSkillSettings: (value: unknown) => EmployeeSkillSettings;
|
|
52
61
|
export declare const EmployeesPage: React.FC;
|
|
53
62
|
export default EmployeesPage;
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/plugin-acl": "2.2.0-alpha.
|
|
12
|
-
"@nocobase/plugin-workflow": "2.2.0-alpha.
|
|
13
|
-
"@nocobase/client": "2.2.0-alpha.
|
|
14
|
-
"@nocobase/utils": "2.2.0-alpha.
|
|
15
|
-
"@nocobase/flow-engine": "2.2.0-alpha.
|
|
16
|
-
"@nocobase/client-v2": "2.2.0-alpha.
|
|
17
|
-
"@nocobase/database": "2.2.0-alpha.
|
|
18
|
-
"@nocobase/server": "2.2.0-alpha.
|
|
19
|
-
"@nocobase/plugin-file-manager": "2.2.0-alpha.
|
|
20
|
-
"@nocobase/actions": "2.2.0-alpha.
|
|
21
|
-
"@nocobase/ai": "2.2.0-alpha.
|
|
11
|
+
"@nocobase/plugin-acl": "2.2.0-alpha.8",
|
|
12
|
+
"@nocobase/plugin-workflow": "2.2.0-alpha.8",
|
|
13
|
+
"@nocobase/client": "2.2.0-alpha.8",
|
|
14
|
+
"@nocobase/utils": "2.2.0-alpha.8",
|
|
15
|
+
"@nocobase/flow-engine": "2.2.0-alpha.8",
|
|
16
|
+
"@nocobase/client-v2": "2.2.0-alpha.8",
|
|
17
|
+
"@nocobase/database": "2.2.0-alpha.8",
|
|
18
|
+
"@nocobase/server": "2.2.0-alpha.8",
|
|
19
|
+
"@nocobase/plugin-file-manager": "2.2.0-alpha.8",
|
|
20
|
+
"@nocobase/actions": "2.2.0-alpha.8",
|
|
21
|
+
"@nocobase/ai": "2.2.0-alpha.8",
|
|
22
22
|
"langchain": "1.2.39",
|
|
23
23
|
"react": "18.2.0",
|
|
24
24
|
"antd": "5.24.2",
|
|
@@ -30,18 +30,18 @@ module.exports = {
|
|
|
30
30
|
"lodash": "4.18.1",
|
|
31
31
|
"@langchain/core": "1.1.49",
|
|
32
32
|
"@langchain/langgraph": "1.4.4",
|
|
33
|
-
"@nocobase/cache": "2.2.0-alpha.
|
|
33
|
+
"@nocobase/cache": "2.2.0-alpha.8",
|
|
34
34
|
"@langchain/anthropic": "1.3.17",
|
|
35
35
|
"@langchain/openai": "1.4.7",
|
|
36
36
|
"@langchain/deepseek": "1.0.27",
|
|
37
37
|
"@langchain/google-genai": "2.1.18",
|
|
38
38
|
"@langchain/ollama": "1.2.7",
|
|
39
|
-
"@nocobase/acl": "2.2.0-alpha.
|
|
40
|
-
"@nocobase/
|
|
39
|
+
"@nocobase/acl": "2.2.0-alpha.8",
|
|
40
|
+
"@nocobase/data-source-manager": "2.2.0-alpha.8",
|
|
41
|
+
"@nocobase/resourcer": "2.2.0-alpha.8",
|
|
41
42
|
"dayjs": "1.11.13",
|
|
42
43
|
"react-dom": "18.2.0",
|
|
43
44
|
"@langchain/langgraph-checkpoint": "1.1.2",
|
|
44
|
-
"@nocobase/data-source-manager": "2.2.0-alpha.7",
|
|
45
45
|
"@dnd-kit/core": "6.1.0",
|
|
46
46
|
"axios": "1.7.7"
|
|
47
47
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -133,6 +133,7 @@
|
|
|
133
133
|
"Fields": "Fields",
|
|
134
134
|
"Files": "Files",
|
|
135
135
|
"Files storage": "Files storage",
|
|
136
|
+
"Fill form fields with the given content. This tool only writes values into the form UI; it does not submit or save the form.": "Fill form fields with the given content. This tool only writes values into the form UI; it does not submit or save the form.",
|
|
136
137
|
"Fill the form with the given content": "Fill the form with the given content",
|
|
137
138
|
"Filter": "Filter",
|
|
138
139
|
"Filter group": "Filter group",
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -133,6 +133,7 @@
|
|
|
133
133
|
"Fields": "字段",
|
|
134
134
|
"Files": "文件",
|
|
135
135
|
"Files storage": "文件存储",
|
|
136
|
+
"Fill form fields with the given content. This tool only writes values into the form UI; it does not submit or save the form.": "用给定内容填写表单字段。此工具只会把值写入表单界面,不会提交或保存表单。",
|
|
136
137
|
"Fill the form with the given content": "用给定内容填写表单",
|
|
137
138
|
"Filter": "筛选",
|
|
138
139
|
"Filter group": "条件分组",
|
|
@@ -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-07-
|
|
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-07-12T22:53:59.974Z"}
|
|
@@ -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-07-
|
|
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-07-12T22:54:02.649Z"}
|
|
@@ -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-07-
|
|
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-07-12T22:54:02.817Z"}
|
|
@@ -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-07-
|
|
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-07-12T22:54:08.581Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"just-bash","version":"2.14.3","description":"A simulated bash environment with virtual filesystem","repository":{"type":"git","url":"git+https://github.com/vercel-labs/just-bash.git"},"homepage":"https://github.com/vercel-labs/just-bash#readme","bugs":{"url":"https://github.com/vercel-labs/just-bash/issues"},"type":"module","main":"dist/bundle/index.js","types":"dist/index.d.ts","exports":{".":{"browser":"./dist/bundle/browser.js","require":{"types":"./dist/index.d.cts","default":"./dist/bundle/index.cjs"},"import":{"types":"./dist/index.d.ts","default":"./dist/bundle/index.js"}},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/bundle/browser.js"}},"files":["dist/bundle/","dist/bin/","dist/*.d.ts","dist/*.d.cts","dist/ast/*.d.ts","dist/commands/**/*.d.ts","dist/fs/**/*.d.ts","dist/interpreter/**/*.d.ts","dist/network/**/*.d.ts","dist/parser/*.d.ts","dist/sandbox/*.d.ts","dist/utils/*.d.ts","vendor/cpython-emscripten/","README.md","CHANGELOG.md","dist/AGENTS.md"],"bin":{"just-bash":"./dist/bin/just-bash.js","just-bash-shell":"./dist/bin/shell/shell.js"},"publishConfig":{"access":"public"},"keywords":[],"author":"Malte and Claude","license":"Apache-2.0","devDependencies":{"@types/ini":"^4.1.1","@types/node":"^25.0.3","@types/papaparse":"^5.5.2","@types/sprintf-js":"^1.1.4","@types/sql.js":"^1.4.9","@types/turndown":"^5.0.6","@vitest/coverage-v8":"^4.0.18","esbuild":"^0.27.2","fast-check":"^3.23.2","knip":"^5.41.1","typescript":"^5.9.3","vitest":"^4.0.16"},"dependencies":{"seek-bzip":"^2.0.0","diff":"^8.0.2","fast-xml-parser":"5.3.3","file-type":"^21.2.0","ini":"^6.0.0","minimatch":"^10.1.1","modern-tar":"^0.7.3","papaparse":"^5.5.3","quickjs-emscripten":"^0.32.0","re2js":"^1.2.1","smol-toml":"^1.6.0","sprintf-js":"^1.1.3","sql.js":"^1.13.0","turndown":"^7.2.2","yaml":"^2.8.2"},"optionalDependencies":{"@mongodb-js/zstd":"^7.0.0","node-liblzma":"^2.0.3"},"scripts":{"build":"rm -rf dist && tsc && pnpm build:lib && pnpm build:lib:cjs && pnpm build:browser && pnpm build:cli && pnpm build:shell && pnpm build:worker && pnpm build:clean && cp dist/index.d.ts dist/index.d.cts && sed '1,/^-->/d' AGENTS.npm.md > dist/AGENTS.md","build:clean":"find dist -name '*.test.js' -delete && find dist -name '*.test.d.ts' -delete","build:worker":"esbuild src/commands/python3/worker.ts --bundle --platform=node --format=esm --outfile=src/commands/python3/worker.js --external:../../../vendor/cpython-emscripten/* && cp src/commands/python3/worker.js dist/commands/python3/worker.js && mkdir -p dist/bin/chunks && cp src/commands/python3/worker.js dist/bin/chunks/worker.js && mkdir -p dist/bundle/chunks && cp src/commands/python3/worker.js dist/bundle/chunks/worker.js && esbuild src/commands/js-exec/js-exec-worker.ts --bundle --platform=node --format=esm --outfile=src/commands/js-exec/js-exec-worker.js --external:quickjs-emscripten && cp src/commands/js-exec/js-exec-worker.js dist/commands/js-exec/js-exec-worker.js && cp src/commands/js-exec/js-exec-worker.js dist/bin/chunks/js-exec-worker.js && cp src/commands/js-exec/js-exec-worker.js dist/bundle/chunks/js-exec-worker.js","build:lib":"esbuild dist/index.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bundle --chunk-names=chunks/[name]-[hash] --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:lib:cjs":"esbuild dist/index.js --bundle --platform=node --format=cjs --minify --outfile=dist/bundle/index.cjs --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:browser":"esbuild dist/browser.js --bundle --platform=browser --format=esm --minify --outfile=dist/bundle/browser.js --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:node:zlib --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip --define:__BROWSER__=true --alias:node:dns=./src/shims/browser-unsupported.js","build:cli":"esbuild dist/cli/just-bash.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:shell":"esbuild dist/cli/shell.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin/shell --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","validate":"pnpm lint && pnpm knip && pnpm typecheck && pnpm build && pnpm check:worker-sync && pnpm test:run && pnpm test:wasm && pnpm test:dist","typecheck":"tsc --noEmit","lint":"pnpm lint:banned","check:worker-sync":"node scripts/check-worker-sync.js","lint:banned":"node scripts/check-banned-patterns.js","lint:fix":"pnpm --workspace-root lint:fix","knip":"knip","test":"vitest","test:run":"vitest run --exclude src/security/fuzzing/ --exclude src/commands/python3/ --exclude src/commands/sqlite3/ --exclude src/commands/js-exec/ --exclude src/agent-examples/python-scripting.test.ts","test:dist":"vitest run src/cli/just-bash.bundle.test.ts","test:unit":"vitest run --config vitest.unit.config.ts","test:wasm":"vitest run --config vitest.wasm.config.ts","test:comparison":"vitest run --config vitest.comparison.config.ts","test:comparison:record":"RECORD_FIXTURES=1 vitest run --config vitest.comparison.config.ts","test:coverage":"vitest run --coverage","test:coverage:unit":"vitest run --config vitest.unit.config.ts --coverage","test:fuzz":"vitest run src/security/fuzzing/","test:fuzz:long":"FUZZ_RUNS=10000 vitest run src/security/fuzzing/","shell":"npx tsx src/cli/shell.ts","dev:exec":"npx tsx src/cli/exec.ts"},"_lastModified":"2026-07-
|
|
1
|
+
{"name":"just-bash","version":"2.14.3","description":"A simulated bash environment with virtual filesystem","repository":{"type":"git","url":"git+https://github.com/vercel-labs/just-bash.git"},"homepage":"https://github.com/vercel-labs/just-bash#readme","bugs":{"url":"https://github.com/vercel-labs/just-bash/issues"},"type":"module","main":"dist/bundle/index.js","types":"dist/index.d.ts","exports":{".":{"browser":"./dist/bundle/browser.js","require":{"types":"./dist/index.d.cts","default":"./dist/bundle/index.cjs"},"import":{"types":"./dist/index.d.ts","default":"./dist/bundle/index.js"}},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/bundle/browser.js"}},"files":["dist/bundle/","dist/bin/","dist/*.d.ts","dist/*.d.cts","dist/ast/*.d.ts","dist/commands/**/*.d.ts","dist/fs/**/*.d.ts","dist/interpreter/**/*.d.ts","dist/network/**/*.d.ts","dist/parser/*.d.ts","dist/sandbox/*.d.ts","dist/utils/*.d.ts","vendor/cpython-emscripten/","README.md","CHANGELOG.md","dist/AGENTS.md"],"bin":{"just-bash":"./dist/bin/just-bash.js","just-bash-shell":"./dist/bin/shell/shell.js"},"publishConfig":{"access":"public"},"keywords":[],"author":"Malte and Claude","license":"Apache-2.0","devDependencies":{"@types/ini":"^4.1.1","@types/node":"^25.0.3","@types/papaparse":"^5.5.2","@types/sprintf-js":"^1.1.4","@types/sql.js":"^1.4.9","@types/turndown":"^5.0.6","@vitest/coverage-v8":"^4.0.18","esbuild":"^0.27.2","fast-check":"^3.23.2","knip":"^5.41.1","typescript":"^5.9.3","vitest":"^4.0.16"},"dependencies":{"seek-bzip":"^2.0.0","diff":"^8.0.2","fast-xml-parser":"5.3.3","file-type":"^21.2.0","ini":"^6.0.0","minimatch":"^10.1.1","modern-tar":"^0.7.3","papaparse":"^5.5.3","quickjs-emscripten":"^0.32.0","re2js":"^1.2.1","smol-toml":"^1.6.0","sprintf-js":"^1.1.3","sql.js":"^1.13.0","turndown":"^7.2.2","yaml":"^2.8.2"},"optionalDependencies":{"@mongodb-js/zstd":"^7.0.0","node-liblzma":"^2.0.3"},"scripts":{"build":"rm -rf dist && tsc && pnpm build:lib && pnpm build:lib:cjs && pnpm build:browser && pnpm build:cli && pnpm build:shell && pnpm build:worker && pnpm build:clean && cp dist/index.d.ts dist/index.d.cts && sed '1,/^-->/d' AGENTS.npm.md > dist/AGENTS.md","build:clean":"find dist -name '*.test.js' -delete && find dist -name '*.test.d.ts' -delete","build:worker":"esbuild src/commands/python3/worker.ts --bundle --platform=node --format=esm --outfile=src/commands/python3/worker.js --external:../../../vendor/cpython-emscripten/* && cp src/commands/python3/worker.js dist/commands/python3/worker.js && mkdir -p dist/bin/chunks && cp src/commands/python3/worker.js dist/bin/chunks/worker.js && mkdir -p dist/bundle/chunks && cp src/commands/python3/worker.js dist/bundle/chunks/worker.js && esbuild src/commands/js-exec/js-exec-worker.ts --bundle --platform=node --format=esm --outfile=src/commands/js-exec/js-exec-worker.js --external:quickjs-emscripten && cp src/commands/js-exec/js-exec-worker.js dist/commands/js-exec/js-exec-worker.js && cp src/commands/js-exec/js-exec-worker.js dist/bin/chunks/js-exec-worker.js && cp src/commands/js-exec/js-exec-worker.js dist/bundle/chunks/js-exec-worker.js","build:lib":"esbuild dist/index.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bundle --chunk-names=chunks/[name]-[hash] --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:lib:cjs":"esbuild dist/index.js --bundle --platform=node --format=cjs --minify --outfile=dist/bundle/index.cjs --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:browser":"esbuild dist/browser.js --bundle --platform=browser --format=esm --minify --outfile=dist/bundle/browser.js --external:diff --external:minimatch --external:sprintf-js --external:turndown --external:node:zlib --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip --define:__BROWSER__=true --alias:node:dns=./src/shims/browser-unsupported.js","build:cli":"esbuild dist/cli/just-bash.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","build:shell":"esbuild dist/cli/shell.js --bundle --splitting --platform=node --format=esm --minify --outdir=dist/bin/shell --entry-names=[name] --chunk-names=chunks/[name]-[hash] --banner:js='#!/usr/bin/env node' --external:sql.js --external:quickjs-emscripten --external:@mongodb-js/zstd --external:node-liblzma --external:seek-bzip","validate":"pnpm lint && pnpm knip && pnpm typecheck && pnpm build && pnpm check:worker-sync && pnpm test:run && pnpm test:wasm && pnpm test:dist","typecheck":"tsc --noEmit","lint":"pnpm lint:banned","check:worker-sync":"node scripts/check-worker-sync.js","lint:banned":"node scripts/check-banned-patterns.js","lint:fix":"pnpm --workspace-root lint:fix","knip":"knip","test":"vitest","test:run":"vitest run --exclude src/security/fuzzing/ --exclude src/commands/python3/ --exclude src/commands/sqlite3/ --exclude src/commands/js-exec/ --exclude src/agent-examples/python-scripting.test.ts","test:dist":"vitest run src/cli/just-bash.bundle.test.ts","test:unit":"vitest run --config vitest.unit.config.ts","test:wasm":"vitest run --config vitest.wasm.config.ts","test:comparison":"vitest run --config vitest.comparison.config.ts","test:comparison:record":"RECORD_FIXTURES=1 vitest run --config vitest.comparison.config.ts","test:coverage":"vitest run --coverage","test:coverage:unit":"vitest run --config vitest.unit.config.ts --coverage","test:fuzz":"vitest run src/security/fuzzing/","test:fuzz:long":"FUZZ_RUNS=10000 vitest run src/security/fuzzing/","shell":"npx tsx src/cli/shell.ts","dev:exec":"npx tsx src/cli/exec.ts"},"_lastModified":"2026-07-12T22:54:08.417Z"}
|
|
@@ -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-07-
|
|
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-07-12T22:53:49.497Z"}
|
|
@@ -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-07-
|
|
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-07-12T22:53:52.479Z"}
|
|
@@ -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-07-
|
|
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-07-12T22:53:50.492Z"}
|
|
@@ -20,6 +20,7 @@ type SanitizeAdditionalKwargsOptions = {
|
|
|
20
20
|
type SanitizeAdditionalKwargsResult = {
|
|
21
21
|
changed: boolean;
|
|
22
22
|
additionalKwargs?: AdditionalKwargs;
|
|
23
|
+
malformedToolCalls?: unknown[];
|
|
23
24
|
};
|
|
24
25
|
export declare const sanitizeAdditionalKwargsForToolCalls: (additionalKwargs: AdditionalKwargs | undefined, parsedToolCalls?: unknown[] | null, options?: SanitizeAdditionalKwargsOptions) => SanitizeAdditionalKwargsResult;
|
|
25
26
|
export declare const sanitizeLangChainAIMessage: (message: AIMessage, options?: SanitizeAdditionalKwargsOptions) => AIMessage<import("@langchain/core/dist/messages/message").MessageStructure<import("@langchain/core/dist/messages/message").MessageToolSet>>;
|
|
@@ -65,7 +65,8 @@ const sanitizeAdditionalKwargsForToolCalls = (additionalKwargs, parsedToolCalls,
|
|
|
65
65
|
delete sanitized.tool_calls;
|
|
66
66
|
return {
|
|
67
67
|
changed: true,
|
|
68
|
-
additionalKwargs: Object.keys(sanitized).length > 0 ? sanitized : void 0
|
|
68
|
+
additionalKwargs: Object.keys(sanitized).length > 0 ? sanitized : void 0,
|
|
69
|
+
malformedToolCalls: rawToolCalls
|
|
69
70
|
};
|
|
70
71
|
};
|
|
71
72
|
const sanitizeLangChainAIMessage = (message, options = {}) => {
|
|
@@ -40,7 +40,7 @@ const convertAIMessage = ({
|
|
|
40
40
|
model,
|
|
41
41
|
aiMessage
|
|
42
42
|
}) => {
|
|
43
|
-
var _a;
|
|
43
|
+
var _a, _b;
|
|
44
44
|
const message = aiMessage.content;
|
|
45
45
|
const toolCalls = aiMessage.tool_calls;
|
|
46
46
|
const tools = (_a = aiEmployee.skillSettings) == null ? void 0 : _a.tools;
|
|
@@ -91,20 +91,26 @@ const convertAIMessage = ({
|
|
|
91
91
|
if (aiMessage.response_metadata) {
|
|
92
92
|
values.metadata.response_metadata = aiMessage.response_metadata;
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const sanitizedToolCalls = (0, import_tool_call_sanitizer.sanitizeAdditionalKwargsForToolCalls)(aiMessage.additional_kwargs, toolCalls, {
|
|
95
95
|
onDiscard: (info) => {
|
|
96
|
-
var _a2,
|
|
97
|
-
(
|
|
96
|
+
var _a2, _b2;
|
|
97
|
+
(_b2 = aiEmployee.logger) == null ? void 0 : _b2.warn("Discard malformed raw tool calls from AI message", {
|
|
98
98
|
phase: "convertAIMessage",
|
|
99
99
|
messageId: aiMessage.id,
|
|
100
100
|
invalidToolCallCount: ((_a2 = aiMessage.invalid_tool_calls) == null ? void 0 : _a2.length) ?? 0,
|
|
101
101
|
...info
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
})
|
|
104
|
+
});
|
|
105
|
+
const additionalKwargs = sanitizedToolCalls.additionalKwargs;
|
|
105
106
|
if (additionalKwargs) {
|
|
106
107
|
values.metadata.additional_kwargs = additionalKwargs;
|
|
107
108
|
}
|
|
109
|
+
if ((_b = sanitizedToolCalls.malformedToolCalls) == null ? void 0 : _b.length) {
|
|
110
|
+
values.metadata.diagnostics = {
|
|
111
|
+
malformedToolCalls: sanitizedToolCalls.malformedToolCalls
|
|
112
|
+
};
|
|
113
|
+
}
|
|
108
114
|
providerInstance.reshapeAIMessage({ aiMessage, values });
|
|
109
115
|
return values;
|
|
110
116
|
};
|
|
@@ -60,6 +60,34 @@ function serializeQueryFieldValue(value) {
|
|
|
60
60
|
}
|
|
61
61
|
return value;
|
|
62
62
|
}
|
|
63
|
+
function getRecordFieldValue(record, field) {
|
|
64
|
+
return field.split(".").reduce((current, key) => {
|
|
65
|
+
if (current === null || current === void 0) {
|
|
66
|
+
return current;
|
|
67
|
+
}
|
|
68
|
+
if (typeof current.get === "function") {
|
|
69
|
+
return current.get(key);
|
|
70
|
+
}
|
|
71
|
+
return current[key];
|
|
72
|
+
}, record);
|
|
73
|
+
}
|
|
74
|
+
function getQueryFieldOptions(collection, field) {
|
|
75
|
+
const parts = field.split(".");
|
|
76
|
+
let currentCollection = collection;
|
|
77
|
+
for (const [index, part] of parts.entries()) {
|
|
78
|
+
const currentField = currentCollection == null ? void 0 : currentCollection.getField(part);
|
|
79
|
+
if (!currentField) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (index === parts.length - 1) {
|
|
83
|
+
return currentField.options;
|
|
84
|
+
}
|
|
85
|
+
if (!currentField.isRelationField()) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
currentCollection = currentField.targetCollection();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
63
91
|
class AIContextDatasourceManager {
|
|
64
92
|
constructor(plugin) {
|
|
65
93
|
this.plugin = plugin;
|
|
@@ -149,17 +177,16 @@ class AIContextDatasourceManager {
|
|
|
149
177
|
}
|
|
150
178
|
});
|
|
151
179
|
}
|
|
152
|
-
const { fields, filter, sort, offset, limit } = options;
|
|
153
|
-
const result = await collection.repository.find({ fields, filter, sort, offset: offset ?? 0, limit });
|
|
180
|
+
const { fields, appends, filter, sort, offset, limit } = options;
|
|
181
|
+
const result = await collection.repository.find({ fields, appends, filter, sort, offset: offset ?? 0, limit });
|
|
154
182
|
const total = await collection.repository.count({ fields, filter });
|
|
155
183
|
const records = result.map(
|
|
156
184
|
(x) => fields.map((field) => {
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
const value = serializeQueryFieldValue(x[field]);
|
|
185
|
+
const { name, type } = getQueryFieldOptions(collection, field) || {};
|
|
186
|
+
const value = serializeQueryFieldValue(getRecordFieldValue(x, field));
|
|
160
187
|
return {
|
|
161
|
-
name,
|
|
162
|
-
type,
|
|
188
|
+
name: field.includes(".") ? field : name || field,
|
|
189
|
+
type: type || "unknown",
|
|
163
190
|
value
|
|
164
191
|
};
|
|
165
192
|
})
|
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.0-alpha.
|
|
9
|
+
"version": "2.2.0-alpha.8",
|
|
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": "810c81e5963966bda7ec03b6453a3a80fe60e027"
|
|
70
70
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
"use strict";(self.webpackChunk_nocobase_plugin_ai=self.webpackChunk_nocobase_plugin_ai||[]).push([["372"],{1735:function(e,t,n){n.r(t),n.d(t,{EMPLOYEE_PROMPT_VARIABLE_NAMESPACES:function(){return B},EmployeesPage:function(){return ed},createAIEmployee:function(){return H},deleteAIEmployee:function(){return V},isKnowledgeBaseEnabled:function(){return q},listAIEmployees:function(){return G},listKnowledgeBases:function(){return X},moveAIEmployee:function(){return _},updateAIEmployee:function(){return N},updateAIEmployeeEnabled:function(){return U}});var r=n(9155),l=n.n(r),a=n(2059),o=n(7375),i=n(5428),u=n(5477),c=n(3485),s=n(7694),m=n(9488),d=n(4196),f=n(3617),p=n(9312),y=n(8666);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function g(e){if(Array.isArray(e))return e}function h(e,t,n,r,l,a,o){try{var i=e[a](o),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,l)}function v(e){return function(){var t=this,n=arguments;return new Promise(function(r,l){var a=e.apply(t,n);function o(e){h(a,r,l,o,i,"next",e)}function i(e){h(a,r,l,o,i,"throw",e)}o(void 0)})}}function E(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function S(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function k(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function I(e,t){return g(e)||function(e,t){var n,r,l=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var a=[],o=!0,i=!1;try{for(l=l.call(e);!(o=(n=l.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw r}}return a}}(e,t)||C(e,t)||S()}function A(e){return function(e){if(Array.isArray(e))return b(e)}(e)||E(e)||C(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}function F(e,t){var n,r,l,a={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(o,"next",{value:u(0)}),i(o,"throw",{value:u(1)}),i(o,"return",{value:u(2)}),"function"==typeof Symbol&&i(o,Symbol.iterator,{value:function(){return this}}),o;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(l=2&c[0]?r.return:c[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,c[1])).done)return l;switch(r=0,l&&(c=[2&c[0],l.value]),c[0]){case 0:case 1:l=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(l=(l=a.trys).length>0&&l[l.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!l||c[1]>l[0]&&c[1]<l[3])){a.label=c[1];break}if(6===c[0]&&a.label<l[1]){a.label=l[1],l=c;break}if(l&&a.label<l[2]){a.label=l[2],a.ops.push(c);break}l[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=l=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function x(){var e,t,n=(e=["\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n\n .ant-spin-nested-loading,\n .ant-spin-container,\n .ant-table,\n .ant-table-container {\n min-height: 0;\n flex: 1;\n display: flex;\n flex-direction: column;\n }\n\n .ant-table-content {\n flex: 1;\n min-height: 0;\n }\n\n .ant-table-body {\n flex: 1;\n min-height: 0;\n }\n\n .ant-table-thead > tr > th {\n white-space: nowrap;\n }\n\n .ant-pagination {\n flex: 0 0 auto;\n }\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return x=function(){return n},n}var T=Object.keys(d.B)[0],O="sort",B=["user","roleName","locale","now","timestamp"],M=function(e){return"".concat(e,":")},P=(0,u.css)(x()),j=function(e){return null!==e&&(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"&&!Array.isArray(e)},L=function(e){var t;if(j(e))return null==(t=e.data)?void 0:t.data},R=function(e){if(!j(e))return{};var t=e.data;return j(t)?t:{}},K=function(e){return j(e)&&"string"==typeof e.username},z=function(e){return j(e)&&"string"==typeof e.key&&"string"==typeof e.name},W=function(e,t,n,r){return v(function(){var l;return F(this,function(a){if("function"!=typeof(l=e.resource(t)[n]))throw Error("Missing resource action: ".concat(t,".").concat(n));return[2,l(r)]})})()},D=function(e,t){var n=w({},e);return t.edit&&("system"===e._aboutMode&&(n.about=null),delete n._aboutMode,delete n.enabled),n};function G(e,t){return v(function(){var n,r,l;return F(this,function(a){switch(a.label){case 0:return[4,W(e,"aiEmployees","list",{page:t.page,pageSize:t.pageSize,filter:{category:t.category},sort:[O]})];case 1:return r=L(n=a.sent()),l=R(n),[2,{data:Array.isArray(r)?r.filter(K):[],total:"number"==typeof l.count?l.count:void 0}]}})})()}function _(e,t,n){return v(function(){return F(this,function(r){switch(r.label){case 0:return[4,W(e,"aiEmployees","move",{sourceId:t,targetId:n,sortField:O})];case 1:return r.sent(),[2]}})})()}function H(e,t){return v(function(){return F(this,function(n){switch(n.label){case 0:return[4,W(e,"aiEmployees","create",{values:D(t,{edit:!1})})];case 1:return n.sent(),[2]}})})()}function N(e,t){return v(function(){return F(this,function(n){switch(n.label){case 0:if(!t.username)throw Error("Missing AI employee username.");return[4,W(e,"aiEmployees","update",{values:D(t,{edit:!0}),filterByTk:t.username})];case 1:return n.sent(),[2]}})})()}function V(e,t){return v(function(){return F(this,function(n){switch(n.label){case 0:return[4,W(e,"aiEmployees","destroy",{filterByTk:t})];case 1:return n.sent(),[2]}})})()}function U(e,t,n){return v(function(){return F(this,function(r){switch(r.label){case 0:return[4,W(e,"aiEmployees","update",{filterByTk:t,values:{enabled:n}})];case 1:return r.sent(),[2]}})})()}function q(e){return v(function(){var t;return F(this,function(n){switch(n.label){case 0:return[4,W(e,"aiSettings","isKnowledgeBaseEnabled")];case 1:return[2,j(t=L(n.sent()))&&!0===t.enabled]}})})()}function X(e){return v(function(){var t;return F(this,function(n){switch(n.label){case 0:return[4,W(e,"aiKnowledgeBase","list",{fields:["key","name"],filter:{enabled:!0}})];case 1:return[2,Array.isArray(t=L(n.sent()))?t.filter(z):[]]}})})()}var Y=function(e){var t=e.disabled,n=e.value,o=e.onChange,i=a.theme.useToken().token,u=n||T,c=(0,r.useMemo)(function(){return Object.keys(d.B).map(function(e){return{seed:e,uri:(0,d.H)(e)}})},[]);return l().createElement(l().Fragment,null,l().createElement("div",{style:{marginBottom:i.marginLG+i.margin}},l().createElement(a.Avatar,{size:2*i.controlHeightLG+i.paddingSM+2*i.lineWidth,src:(0,d.H)(u)})),t?null:l().createElement(a.List,{grid:{gutter:i.margin,column:10},dataSource:c,renderItem:function(e){return l().createElement(a.List.Item,null,l().createElement("button",{"aria-label":e.seed,type:"button",onClick:function(){return null==o?void 0:o(e.seed)},onKeyDown:function(t){("Enter"===t.key||" "===t.key)&&(t.preventDefault(),null==o||o(e.seed))},style:{background:"transparent",borderColor:u===e.seed?i.colorPrimary:"transparent",borderStyle:"solid",borderWidth:2*i.lineWidth,borderRadius:"50%",cursor:"pointer",display:"inline-flex",padding:0}},l().createElement(a.Avatar,{size:i.controlHeightLG+i.paddingSM+2*i.lineWidth,src:e.uri})))}}))},Q=function(e){var t=e.edit,n=e.builtIn,r=(0,m.kj)();return l().createElement(l().Fragment,null,l().createElement(a.Form.Item,{name:"username",label:M(r("Username")),rules:[{required:!0}],preserve:!0},l().createElement(a.Input,{disabled:t})),l().createElement(a.Form.Item,{name:"nickname",label:M(r("Nickname")),rules:[{required:!0}],preserve:!0},l().createElement(a.Input,{disabled:n})),l().createElement(a.Form.Item,{name:"position",label:M(r("Position")),extra:r("Position description"),preserve:!0},l().createElement(a.Input,{disabled:n,placeholder:r("Position placeholder")})),l().createElement(a.Form.Item,{name:"avatar",label:M(r("Avatar")),preserve:!0},l().createElement(Y,{disabled:n})),l().createElement(a.Form.Item,{name:"bio",label:M(r("Bio")),preserve:!0},l().createElement(a.Input.TextArea,{disabled:n,placeholder:r("Bio placeholder")})),l().createElement(a.Form.Item,{name:"greeting",label:M(r("Greeting message")),preserve:!0},l().createElement(a.Input.TextArea,{disabled:n,placeholder:r("Greeting message placeholder")})))},$=function(e){var t,n=e.builtIn,o=e.record,i=(0,m.kj)(),u=a.theme.useToken().token,s=a.Form.useFormInstance(),d=null!=(t=a.Form.useWatch("_aboutMode",s))?t:(null==o?void 0:o.about)?"custom":"system";return(0,r.useEffect)(function(){n&&!s.getFieldValue("_aboutMode")&&s.setFieldValue("_aboutMode",(null==o?void 0:o.about)?"custom":"system")},[n,s,null==o?void 0:o.about]),l().createElement(l().Fragment,null,l().createElement(a.Alert,{message:i("Role setting description"),type:"info",showIcon:!0}),n?l().createElement(a.Form.Item,{name:"_aboutMode",preserve:!0},l().createElement(a.Radio.Group,null,l().createElement(a.Radio,{value:"system"},i("System default")),l().createElement(a.Radio,{value:"custom"},i("Custom")))):null,n&&"system"===d?l().createElement(a.Typography.Paragraph,{copyable:!0,style:{backgroundColor:u.colorFillQuaternary,borderColor:u.colorBorder,borderRadius:u.borderRadius,borderStyle:"solid",borderWidth:u.lineWidth,margin:0,maxHeight:12*u.controlHeightLG,overflowY:"auto",paddingBlock:u.paddingSM,paddingInline:u.padding,whiteSpace:"pre-wrap",wordBreak:"break-word"}},(null==o?void 0:o.defaultPrompt)||""):l().createElement(a.Form.Item,{name:"about",label:M(i("Role setting")),preserve:!0},l().createElement(c.VariableTextArea,{namespaces:B,placeholder:i("Role setting placeholder"),rows:15})))},J=function(e){var t,n=g(t=e.split(":"))||E(t)||C(t)||S();return{llmService:n[0],model:n.slice(1).join(":")}},Z=function(e){return e.llmService&&e.model?"".concat(e.llmService,":").concat(e.model):void 0},ee=function(e){return j(e)?e:{}},et=function(e){return j(e)?e:{}},en=function(){var e=(0,f.M)(),t=I((0,r.useState)(!1),2),n=t[0],l=t[1];return(0,r.useEffect)(function(){var t=!1;return v(function(){return F(this,function(n){switch(n.label){case 0:l(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,e.getLLMServices()];case 2:return n.sent(),[3,5];case 3:return console.error(n.sent()),[3,5];case 4:return t||l(!1),[7];case 5:return[2]}})})().catch(function(e){console.error(e)}),function(){t=!0}},[e]),{services:e.llmServices,loading:n||e.llmServicesLoading}},er=(0,s.observer)(function(){var e=(0,m.kj)(),t=a.Form.useFormInstance(),n=a.Form.useWatch("modelSettings",t),o=I((0,r.useState)(function(){return ee(t.getFieldValue("modelSettings"))}),2),i=o[0],u=o[1],c=en(),s=c.services,d=c.loading,f=!!i.enabled,p=(0,r.useMemo)(function(){var e=Array.isArray(i.models)?i.models:[];if(e.length)return e.map(Z).filter(function(e){return!!e});var t=Z(i);return t?[t]:[]},[i]),y=(0,r.useMemo)(function(){return s.map(function(e){return{label:e.llmServiceTitle,options:e.enabledModels.map(function(t){return{label:"".concat(e.llmServiceTitle," / ").concat(t.label),value:"".concat(e.llmService,":").concat(t.value)}})}})},[s]),b=(0,r.useMemo)(function(){var e=new Map;return y.forEach(function(t){t.options.forEach(function(t){return e.set(t.value,t.label)})}),e},[y]),g=(0,r.useCallback)(function(e){var n=w({},ee(t.getFieldValue("modelSettings")),e);u(n),t.setFieldsValue({modelSettings:n})},[t]);return(0,r.useEffect)(function(){u(ee(n))},[n]),(0,r.useEffect)(function(){if(f&&!p.length&&y.length){var e,t,n,r=null==(n=y[0])||null==(t=n.options)||null==(e=t[0])?void 0:e.value;r&&g({models:[J(r)]})}},[f,y,p.length,g]),l().createElement(l().Fragment,null,l().createElement(a.Alert,{type:"info",showIcon:!0,message:e("Restrict this AI employee to the selected models.")}),l().createElement(a.Form.Item,{label:l().createElement(a.Typography.Text,{strong:!0},M(e("Enable dedicated model configuration"))),preserve:!0},l().createElement(a.Switch,{checked:f,onChange:function(e){return g({enabled:e})}})),l().createElement(a.Form.Item,{label:l().createElement(a.Typography.Text,{strong:!0},M(e("Models"))),preserve:!0},l().createElement(a.Select,{allowClear:!0,disabled:!f,loading:d,mode:"multiple",notFoundContent:d?l().createElement(a.Spin,{size:"small"}):null,optionFilterProp:"label",options:y,placeholder:e("Select models"),showSearch:!0,tagRender:function(e){return l().createElement(a.Tag,{closable:e.closable,onClose:e.onClose},b.get(String(e.value))||e.label)},value:p,onChange:function(e){e.length?g({llmService:void 0,model:void 0,models:e.map(J)}):g({llmService:void 0,model:void 0,models:[]})}})))}),el=function(){var e=(0,m.kj)();return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?e(t):n}},ea=function(e){var t=e.title,n=e.description,r=a.theme.useToken().token;return l().createElement("div",null,l().createElement("div",{style:{fontWeight:r.fontWeightStrong,fontSize:r.fontSizeSM}},t),l().createElement("div",{style:{color:r.colorTextSecondary,fontSize:r.fontSizeSM}},n))},eo=(0,s.observer)(function(e){var t,n=e.builtIn,o=(0,m.kj)(),i=el(),u=(0,f.M)(),c=a.Form.useFormInstance(),s=null!=(t=a.Form.useWatch("skillSettings",c))?t:{},d=Array.isArray(s.skills)?s.skills:[];(0,r.useEffect)(function(){u.getAISkills().catch(function(e){console.error(e)})},[u]);var p=new Map(u.aiSkills.map(function(e){return[e.name,e]})),y=u.aiSkills.filter(function(e){return"GENERAL"===e.scope}),b=d.map(function(e){return p.get(e)}).filter(function(e){return!!e&&"SPECIFIED"===e.scope}),g=function(e){var t,n;return l().createElement(a.List.Item,{key:e.name},l().createElement("div",null,i(null!=(t=e.title)?t:e.name,e.name)),l().createElement(a.Typography.Text,{type:"secondary"},i(null!=(n=e.about)?n:e.description)))},h=[{key:"general-skills",label:l().createElement(ea,{title:o("General skills"),description:o("Shared by all AI employees.")}),children:l().createElement(a.List,{itemLayout:"vertical",size:"small",dataSource:y,renderItem:g})}];return n&&b.length&&h.push({key:"specific-skills",label:l().createElement(ea,{title:o("Employee-specific skills"),description:o("Only available to this AI employee.")}),children:l().createElement(a.List,{itemLayout:"vertical",size:"small",dataSource:b,renderItem:g})}),u.aiSkillsLoading?l().createElement(a.Spin,null):l().createElement(a.Collapse,{ghost:!0,size:"small",defaultActiveKey:[],items:h})}),ei=function(e,t){return"CUSTOM"===e.scope?(null==t?void 0:t.autoCall)?"ALLOW":"ASK":"ALLOW"===e.defaultPermission?"ALLOW":"ASK"},eu=(0,s.observer)(function(e){var t=e.builtIn,n=(0,m.kj)(),i=a.theme.useToken().token,u=el(),c=(0,f.M)(),s=a.Form.useFormInstance(),d=a.Form.useWatch("skillSettings",s),p=I((0,r.useState)(function(){return et(s.getFieldValue("skillSettings"))}),2),y=p[0],b=p[1],g=Array.isArray(y.tools)?y.tools:[],h=I((0,r.useState)(t&&!g.length?[]:["custom-tools"]),2),v=h[0],E=h[1],S=l().useRef(g.length),C=[{label:n("Ask"),value:"ASK"},{label:n("Allow"),value:"ALLOW"}];(0,r.useEffect)(function(){c.getAITools().catch(function(e){console.error(e)})},[c]),(0,r.useEffect)(function(){b(et(d))},[d]);var F=function(e){var t=k(w({},et(s.getFieldValue("skillSettings"))),{tools:e});b(t),s.setFieldsValue({skillSettings:t})},x=new Set(g.map(function(e){return e.name})),T=new Map(c.aiTools.map(function(e){return[e.definition.name,e]})),O=c.aiTools.filter(function(e){return"GENERAL"===e.scope&&"loader"===e.from}),B=g.filter(function(e){var t=T.get(e.name);return t&&"GENERAL"!==t.scope&&"CUSTOM"!==t.scope}),M=g.filter(function(e){var t;return(null==(t=T.get(e.name))?void 0:t.scope)==="CUSTOM"});(0,r.useEffect)(function(){var e=0===S.current;t&&0===M.length?E([]):e&&M.length>0&&E(["custom-tools"]),S.current=M.length},[t,M.length]);var P=c.aiTools.filter(function(e){return"CUSTOM"===e.scope&&!x.has(e.definition.name)}).map(function(e){var t,n,r,o;return{key:e.definition.name,label:l().createElement("div",{style:{maxWidth:8*i.controlHeightLG,minWidth:4*i.controlHeightLG}},l().createElement(a.Flex,{justify:"space-between"},l().createElement("div",null,u(null!=(t=null==(r=e.introduction)?void 0:r.title)?t:e.definition.name,e.definition.name))),l().createElement(a.Typography.Text,{type:"secondary"},u(null!=(n=null==(o=e.introduction)?void 0:o.about)?n:e.definition.description))),onClick:function(){var t=et(s.getFieldValue("skillSettings")),n=Array.isArray(t.tools)?t.tools:[];n.some(function(t){return t.name===e.definition.name})||F(A(n).concat([{name:e.definition.name,autoCall:!1}]))}}}),j=function(e){var t,r,o,i,c="definition"in e?e:T.get(e.name);if(!c)return null;var s="definition"in e?void 0:e;return l().createElement(a.List.Item,{key:c.definition.name,extra:l().createElement(a.Flex,{vertical:!0,justify:"end"},l().createElement(a.Space,null,l().createElement(a.Typography.Text,{type:"secondary"},n("Permission")),l().createElement(a.Segmented,{size:"small",options:C,value:ei(c,s),disabled:!0})))},l().createElement("div",null,u(null!=(t=null==(o=c.introduction)?void 0:o.title)?t:c.definition.name,c.definition.name)),l().createElement(a.Typography.Text,{type:"secondary"},u(null!=(r=null==(i=c.introduction)?void 0:i.about)?r:c.definition.description)))},L=[{key:"general-tools",label:l().createElement(ea,{title:n("General tools"),description:n("Shared by all AI employees.")}),children:l().createElement(a.List,{itemLayout:"vertical",size:"small",dataSource:O,renderItem:j})}];return t&&B.length&&L.push({key:"specific-tools",label:l().createElement(ea,{title:n("Employee-specific tools"),description:n("Only available to this AI employee.")}),children:l().createElement(a.List,{itemLayout:"vertical",size:"small",dataSource:B,renderItem:j})}),L.push({key:"custom-tools",label:l().createElement(ea,{title:n("Custom tools"),description:n("Created by workflow. You can add/remove and set default permissions.")}),extra:l().createElement("div",{onClick:function(e){e.stopPropagation()},onKeyDown:function(e){e.stopPropagation()}},l().createElement(a.Dropdown,{menu:{items:P},disabled:!(null==P?void 0:P.length),placement:"bottomRight"},l().createElement(a.Button,{type:"primary",icon:l().createElement(o.PlusOutlined,null),disabled:!(null==P?void 0:P.length),style:{pointerEvents:(null==P?void 0:P.length)?void 0:"none"}},n("Add tool")))),children:l().createElement(a.List,{itemLayout:"vertical",bordered:!0,dataSource:M,renderItem:function(e){var t,r,i,c,s=T.get(e.name);return s?l().createElement(a.List.Item,{key:e.name,extra:l().createElement(a.Space,null,l().createElement(a.Typography.Text,null,n("Permission")),l().createElement(a.Segmented,{size:"small",options:C,value:ei(s,e),onChange:function(t){F(g.map(function(n){return n.name===e.name?k(w({},n),{autoCall:"ALLOW"===t}):n}))}}),l().createElement(a.Button,{"aria-label":n("Delete"),icon:l().createElement(o.DeleteOutlined,null),type:"text",onClick:function(){F(g.filter(function(t){return t.name!==e.name}))}}))},l().createElement("div",null,u(null!=(t=null==(i=s.introduction)?void 0:i.title)?t:s.definition.name,s.definition.name)),l().createElement(a.Typography.Text,{type:"secondary"},u(null!=(r=null==(c=s.introduction)?void 0:c.about)?r:s.definition.description))):null}})}),c.aiToolsLoading?l().createElement(a.Spin,null):l().createElement(a.Collapse,{ghost:!0,size:"small",activeKey:v,onChange:function(e){return E(Array.isArray(e)?e.map(String):[String(e)])},items:L})}),ec=function(e){var t=e.apiClient,n=(0,m.kj)(),o=a.Form.useFormInstance(),i=a.Form.useWatch("enableKnowledgeBase",o),u=I((0,r.useState)([]),2),c=u[0],s=u[1],d=I((0,r.useState)(!1),2),f=d[0],p=d[1];return(0,r.useEffect)(function(){var e=!1;return v(function(){var n;return F(this,function(r){switch(r.label){case 0:p(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,X(t)];case 2:return n=r.sent(),e||s(n),[3,5];case 3:return console.error(r.sent()),[3,5];case 4:return e||p(!1),[7];case 5:return[2]}})})().catch(function(e){console.error(e)}),function(){e=!0}},[t]),l().createElement(l().Fragment,null,l().createElement(a.Form.Item,{name:"enableKnowledgeBase",label:M(n("Enable Knowledge Base")),valuePropName:"checked",preserve:!0},l().createElement(a.Switch,null)),l().createElement(a.Form.Item,{name:"knowledgeBasePrompt",label:M(n("Knowledge Base Prompt")),rules:[{required:!0}],preserve:!0},l().createElement(a.Input.TextArea,{disabled:!i,autoSize:{minRows:5}})),l().createElement(a.Form.Item,{name:["knowledgeBase","knowledgeBaseKeys"],label:M(n("Knowledge Base")),rules:[{required:!!i}],preserve:!0},l().createElement(a.Select,{disabled:!i,fieldNames:{label:"name",value:"key"},loading:f,mode:"multiple",options:c})),l().createElement(a.Form.Item,{name:["knowledgeBase","topK"],label:M(n("Top K")),rules:[{required:!0}],preserve:!0},l().createElement(a.InputNumber,{disabled:!i,min:1,max:100})),l().createElement(a.Form.Item,{name:["knowledgeBase","score"],label:M(n("Score")),rules:[{required:!0}],preserve:!0},l().createElement(a.InputNumber,{disabled:!i,min:0,max:1,step:.1})))},es=function(e){var t,n=e.apiClient,r=e.activeTab,o=e.edit,i=e.onTabChange,u=e.record,c=e.knowledgeBaseEnabled,s=(0,m.kj)(),d=a.Form.useFormInstance(),f=null!=(t=a.Form.useWatch("chatSettings",d))?t:{},p=!!(null==u?void 0:u.builtIn),y=!1!==f.enableSkills,b=!1!==f.enableTools;return l().createElement(a.Tabs,{activeKey:r,onChange:i,items:[{key:"profile",label:s("Profile"),children:l().createElement(Q,{edit:o,builtIn:p}),forceRender:!0},{key:"roleSetting",label:s("Role setting"),children:l().createElement($,{builtIn:p,record:u}),forceRender:!0},{key:"modelSettings",label:s("Model settings"),children:l().createElement(er,null),forceRender:!0}].concat(A(y?[{key:"skills",label:s("Skills"),children:l().createElement(eo,{builtIn:p}),forceRender:!0}]:[]),A(b?[{key:"tools",label:s("Tools"),children:l().createElement(eu,{builtIn:p}),forceRender:!0}]:[]),A(c?[{key:"knowledgeBase",label:s("KnowledgeBase"),children:l().createElement(ec,{apiClient:n}),forceRender:!0}]:[]))})},em=function(e){var t=e.record,n=e.onUpdated,o=(0,c.useApp)(),i=(0,m.kj)(),u=a.App.useApp().message,s=(0,f.M)(),d=I((0,r.useState)(!1),2),p=d[0],y=d[1];return l().createElement(a.Switch,{checked:!!t.enabled,onChange:function(e){return v(function(){return F(this,function(r){switch(r.label){case 0:y(!0),r.label=1;case 1:return r.trys.push([1,5,6,7]),[4,U(o.apiClient,t.username,e)];case 2:return r.sent(),u.success(i("Saved successfully")),[4,n()];case 3:return r.sent(),[4,s.refreshAIEmployees()];case 4:return r.sent(),[3,7];case 5:return console.error(r.sent()),u.error(i("Failed to update")),[3,7];case 6:return y(!1),[7];case 7:return[2]}})})()},loading:p,size:"small"})},ed=function(){var e=(0,c.useApp)(),t=(0,s.useFlowContext)(),n=(0,m.kj)(),u=a.theme.useToken().token,y=a.App.useApp().message,b=(0,f.M)(),g=I((0,r.useState)("business"),2),h=g[0],E=g[1],S=I((0,r.useState)([]),2),w=S[0],k=S[1],A=I((0,r.useState)(!1),2),C=A[0],x=A[1],T=I((0,r.useState)(!1),2),O=T[0],B=T[1],M=I((0,r.useState)([]),2),j=M[0],L=M[1],R=e.apiClient.auth,K=(null==R?void 0:R.role)==="root",z=(0,r.useMemo)(function(){return{color:u.colorPrimary,marginInline:-u.paddingSM,paddingBlock:u.paddingSM,paddingInlineEnd:u.paddingXS+u.paddingSM,paddingInlineStart:u.paddingSM}},[u.colorPrimary,u.paddingSM,u.paddingXS]),W=(0,r.useCallback)(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h;return v(function(){return F(this,function(n){switch(n.label){case 0:x(!0),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,G(e.apiClient,{category:t})];case 2:return k(n.sent().data),[3,4];case 3:return x(!1),[7];case 4:return[2]}})})()},[e.apiClient,h]);(0,r.useEffect)(function(){W().catch(function(e){console.error(e),x(!1)})},[W]),(0,r.useEffect)(function(){v(function(){return F(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,q(e.apiClient)];case 1:return B.apply(void 0,[t.sent()]),[3,3];case 2:return console.error(t.sent()),[3,3];case 3:return[2]}})})().catch(function(e){console.error(e)})},[e.apiClient]);var D=function(e){t.viewer.open({type:"drawer",width:p.o,closable:!0,content:l().createElement(ef,{editingRecord:e,knowledgeBaseEnabled:O,onSubmitted:function(){return v(function(){return F(this,function(e){switch(e.label){case 0:return[4,W()];case 1:return e.sent(),[4,b.refreshAIEmployees()];case 2:return e.sent(),[2]}})})()}})})},H=[{title:n("Avatar"),dataIndex:"avatar",render:function(e){return e?l().createElement(a.Avatar,{shape:"circle",size:"large",src:(0,d.H)(e)}):null}},{title:n("Username"),dataIndex:"username",render:function(e,t){var r=t.missingKnowledgeBaseKeys||[];return r.length?l().createElement(a.Space,{size:"small"},l().createElement("span",null,e),l().createElement(a.Tooltip,{title:n("Missing knowledge base configuration for keys: {{keys}}. Create knowledge bases with the same keys to enable this employee normally.",{keys:r.join(", ")})},l().createElement(o.ExclamationCircleOutlined,null))):e}},{title:n("Nickname"),dataIndex:"nickname"},{title:n("Position"),dataIndex:"position"},{title:n("Enabled"),dataIndex:"enabled",render:function(e,t){return l().createElement(em,{record:t,onUpdated:function(){return W()}})}},{title:n("Actions"),key:"actions",render:function(t,r){return l().createElement(a.Space,{size:u.marginXS},l().createElement("a",{style:z,onClick:function(){return D(r)}},n("Edit")),l().createElement(a.Popconfirm,{title:n("Delete AI employee"),description:n("Are you sure you want to delete this AI employee?"),onConfirm:function(){return v(function(){return F(this,function(t){switch(t.label){case 0:if(r.builtIn&&!K)return y.warning(n("Cannot delete built-in ai employees")),[2];return[4,V(e.apiClient,r.username)];case 1:return t.sent(),y.success(n("Saved successfully")),[4,W()];case 2:return t.sent(),[4,b.refreshAIEmployees()];case 3:return t.sent(),[2]}})})()}},l().createElement("a",{style:z},n("Delete"))))}}];return l().createElement(a.Card,{style:{display:"flex",flexDirection:"column",minHeight:"100%"},styles:{body:{display:"flex",flex:1,flexDirection:"column",minHeight:0}}},l().createElement(a.Flex,{vertical:!0,gap:"middle",style:{flex:1,minHeight:0}},l().createElement(a.Flex,{justify:"space-between",wrap:"wrap",gap:"middle"},l().createElement(a.Radio.Group,{optionType:"button",value:h,options:[{label:n("Business"),value:"business"},{label:n("Developer"),value:"developer"}],onChange:function(e){return E(e.target.value)}}),l().createElement(a.Space,null,l().createElement(a.Button,{icon:l().createElement(o.ReloadOutlined,null),onClick:function(){return W()}},n("Refresh")),l().createElement(a.Button,{type:"primary",icon:l().createElement(o.PlusOutlined,null),onClick:function(){t.viewer.open({type:"drawer",width:p.o,closable:!0,content:l().createElement(ef,{knowledgeBaseEnabled:O,onSubmitted:function(){return v(function(){return F(this,function(e){switch(e.label){case 0:return[4,W()];case 1:return e.sent(),[4,b.refreshAIEmployees()];case 2:return e.sent(),[2]}})})()}})})}},n("New AI employee")))),l().createElement("div",{style:{display:"flex",flex:1,flexDirection:"column",minHeight:0}},l().createElement(c.Table,{rowKey:"username",loading:C,columns:H,dataSource:w,className:P,isDraggable:!0,onSortEnd:function(t,r){return v(function(){var l,a,o;return F(this,function(u){switch(u.label){case 0:if(!t.username||!r.username||t.username===r.username)return[2];l=w,a=w.findIndex(function(e){return e.username===t.username}),o=w.findIndex(function(e){return e.username===r.username}),a>=0&&o>=0&&k((0,i.arrayMove)(w,a,o)),u.label=1;case 1:return u.trys.push([1,5,,6]),[4,_(e.apiClient,t.username,r.username)];case 2:return u.sent(),y.success(n("Saved successfully")),[4,W()];case 3:return u.sent(),[4,b.refreshAIEmployees()];case 4:return u.sent(),[3,6];case 5:return console.error(u.sent()),k(l),y.error(n("Failed to update")),[3,6];case 6:return[2]}})})()},rowSelection:{selectedRowKeys:j,onChange:L},pagination:{defaultPageSize:20,showTotal:function(e){return n("Total {{count}} items",{count:e})}},scroll:{x:"max-content",y:"100%"}}))))},ef=function(e){var t=e.editingRecord,n=e.knowledgeBaseEnabled,o=e.onSubmitted,i=(0,c.useApp)(),u=(0,s.useFlowContext)(),d=(0,m.kj)(),f=a.App.useApp().message,p=I(a.Form.useForm(),1)[0],b=I((0,r.useState)(!1),2),g=b[0],h=b[1],E=I((0,r.useState)("profile"),2),S=E[0],A=E[1],C=I((0,r.useState)(!1),2),x=C[0],O=C[1],B=(0,r.useMemo)(function(){return t?k(w({},t),{_aboutMode:t.builtIn?t.about?"custom":"system":void 0}):{username:(0,s.randomId)(),enabled:!0,enableKnowledgeBase:!1,knowledgeBase:{knowledgeBaseKeys:[],topK:3,score:"0.6"},knowledgeBasePrompt:d("knowledge Base Prompt default"),avatar:T,builtIn:!1,category:"business"}},[t,d]),M=u.view,P=M.Header,j=M.Footer;(0,r.useEffect)(function(){p.setFieldsValue(B)},[p,B]);var L=(0,y.C)({view:u.view,form:p,initialValues:B,dirty:x,title:d("Unsaved changes"),content:d("Are you sure you don't want to save?")});return l().createElement(l().Fragment,null,l().createElement(P,{title:t?d("Edit AI employee"):d("New AI employee")}),l().createElement(a.Spin,{spinning:g},l().createElement(a.Form,{form:p,layout:"vertical",onFinish:function(e){return v(function(){return F(this,function(n){switch(n.label){case 0:h(!0),n.label=1;case 1:if(n.trys.push([1,,8,9]),!t)return[3,3];return[4,N(i.apiClient,e)];case 2:return n.sent(),[3,5];case 3:return[4,H(i.apiClient,e)];case 4:n.sent(),n.label=5;case 5:return f.success(d("Saved successfully")),[4,o()];case 6:return n.sent(),[4,u.view.close(void 0,!0)];case 7:return n.sent(),[3,9];case 8:return h(!1),[7];case 9:return[2]}})})()},onValuesChange:function(){return O(!0)}},l().createElement(es,{apiClient:i.apiClient,activeTab:S,edit:!!t,onTabChange:A,record:t,knowledgeBaseEnabled:n}))),l().createElement(j,null,l().createElement(a.Flex,{justify:"end",gap:"small"},l().createElement(a.Button,{onClick:L},d("Cancel")),l().createElement(a.Button,{type:"primary",loading:g,onClick:function(){return p.submit()}},d("Submit")))))};t.default=ed}}]);
|