@nocobase/plugin-ai 2.1.0-alpha.12 → 2.1.0-alpha.14
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/ai-employees/atlas/index.d.ts +10 -0
- package/dist/ai/ai-employees/atlas/index.js +56 -0
- package/dist/ai/ai-employees/atlas/prompt.md +84 -0
- package/dist/ai/ai-employees/vera.js +1 -1
- package/dist/ai/tools/chartGenerator.js +1 -0
- package/dist/ai/tools/getSkill.js +1 -1
- package/dist/ai/tools/sub-agents/dispatch-sub-agent-task.d.ts +10 -0
- package/dist/ai/tools/sub-agents/dispatch-sub-agent-task.js +108 -0
- package/dist/ai/tools/sub-agents/get-ai-employee.d.ts +10 -0
- package/dist/ai/tools/sub-agents/get-ai-employee.js +67 -0
- package/dist/ai/tools/sub-agents/list-ai-employees.d.ts +10 -0
- package/dist/ai/tools/sub-agents/list-ai-employees.js +64 -0
- package/dist/ai/tools/sub-agents/shared.d.ts +33 -0
- package/dist/ai/tools/sub-agents/shared.js +169 -0
- package/dist/ai/tools/suggestions.js +2 -2
- package/dist/client/7237366e104efa7a.js +10 -0
- package/dist/client/748fbb87c1013c6e.js +10 -0
- package/dist/client/ai-employees/built-in/utils.d.ts +1 -0
- package/dist/client/ai-employees/chatbox/AIEmployeeSwitch.d.ts +0 -1
- package/dist/client/ai-employees/chatbox/hooks/useChatBoxActions.d.ts +5 -3
- package/dist/client/ai-employees/chatbox/roles.d.ts +1 -0
- package/dist/client/ai-employees/chatbox/stores/chat-messages.d.ts +8 -0
- package/dist/client/ai-employees/chatbox/utils.d.ts +15 -1
- package/dist/client/ai-employees/sub-agents/tools/index.d.ts +10 -0
- package/dist/client/ai-employees/sub-agents/ui/SubAgentDispatchCard.d.ts +21 -0
- package/dist/client/ai-employees/types.d.ts +19 -0
- package/dist/client/index.js +7 -7
- package/dist/externalVersion.js +16 -15
- package/dist/locale/en-US.json +10 -1
- package/dist/locale/zh-CN.json +10 -1
- package/dist/node_modules/fast-glob/package.json +1 -1
- package/dist/node_modules/flexsearch/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/ai-employees/ai-conversations.d.ts +64 -0
- package/dist/server/ai-employees/ai-conversations.js +285 -0
- package/dist/server/ai-employees/ai-employee.d.ts +85 -9
- package/dist/server/ai-employees/ai-employee.js +264 -149
- package/dist/server/ai-employees/middleware/conversation.d.ts +2 -0
- package/dist/server/ai-employees/middleware/conversation.js +38 -5
- package/dist/server/ai-employees/middleware/tools.js +37 -10
- package/dist/server/ai-employees/prompts.d.ts +9 -1
- package/dist/server/ai-employees/prompts.js +24 -2
- package/dist/server/ai-employees/sub-agents/dispatcher.d.ts +36 -0
- package/dist/server/ai-employees/sub-agents/dispatcher.js +225 -0
- package/dist/server/ai-employees/sub-agents/index.d.ts +9 -0
- package/dist/server/ai-employees/sub-agents/index.js +36 -0
- package/dist/server/collections/ai-conversations.js +6 -0
- package/dist/server/llm-providers/anthropic.d.ts +1 -0
- package/dist/server/llm-providers/anthropic.js +2 -1
- package/dist/server/llm-providers/dashscope.d.ts +3 -0
- package/dist/server/llm-providers/dashscope.js +16 -2
- package/dist/server/llm-providers/deepseek.d.ts +1 -0
- package/dist/server/llm-providers/deepseek.js +5 -2
- package/dist/server/llm-providers/google-genai.d.ts +1 -0
- package/dist/server/llm-providers/google-genai.js +2 -1
- package/dist/server/llm-providers/kimi/provider.d.ts +1 -0
- package/dist/server/llm-providers/openai/responses.d.ts +1 -0
- package/dist/server/llm-providers/openai/responses.js +2 -1
- package/dist/server/llm-providers/provider.d.ts +1 -10
- package/dist/server/llm-providers/provider.js +3 -34
- package/dist/server/migrations/20260319000000-add-ai-conversations-from.d.ts +14 -0
- package/dist/server/migrations/20260319000000-add-ai-conversations-from.js +63 -0
- package/dist/server/plugin.d.ts +4 -0
- package/dist/server/plugin.js +4 -0
- package/dist/server/resource/aiConversations.d.ts +3 -3
- package/dist/server/resource/aiConversations.js +125 -159
- package/dist/server/types/ai-chat-conversation.type.d.ts +8 -2
- package/dist/server/types/ai-message.type.d.ts +7 -0
- package/dist/server/utils.d.ts +3 -0
- package/dist/server/utils.js +25 -1
- package/package.json +4 -2
- package/dist/client/27539a4356faebb1.js +0 -10
package/dist/externalVersion.js
CHANGED
|
@@ -8,21 +8,22 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/plugin-acl": "2.1.0-alpha.
|
|
12
|
-
"@nocobase/plugin-workflow": "2.1.0-alpha.
|
|
13
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
14
|
-
"@nocobase/utils": "2.1.0-alpha.
|
|
15
|
-
"@nocobase/database": "2.1.0-alpha.
|
|
16
|
-
"@nocobase/server": "2.1.0-alpha.
|
|
17
|
-
"@nocobase/plugin-file-manager": "2.1.0-alpha.
|
|
11
|
+
"@nocobase/plugin-acl": "2.1.0-alpha.14",
|
|
12
|
+
"@nocobase/plugin-workflow": "2.1.0-alpha.14",
|
|
13
|
+
"@nocobase/client": "2.1.0-alpha.14",
|
|
14
|
+
"@nocobase/utils": "2.1.0-alpha.14",
|
|
15
|
+
"@nocobase/database": "2.1.0-alpha.14",
|
|
16
|
+
"@nocobase/server": "2.1.0-alpha.14",
|
|
17
|
+
"@nocobase/plugin-file-manager": "2.1.0-alpha.14",
|
|
18
18
|
"axios": "1.7.7",
|
|
19
|
-
"@nocobase/actions": "2.1.0-alpha.
|
|
20
|
-
"@nocobase/ai": "2.1.0-alpha.
|
|
19
|
+
"@nocobase/actions": "2.1.0-alpha.14",
|
|
20
|
+
"@nocobase/ai": "2.1.0-alpha.14",
|
|
21
|
+
"langchain": "1.2.24",
|
|
21
22
|
"react": "18.2.0",
|
|
22
23
|
"antd": "5.24.2",
|
|
23
24
|
"@formily/core": "2.3.7",
|
|
24
25
|
"@formily/react": "2.3.7",
|
|
25
|
-
"@nocobase/flow-engine": "2.1.0-alpha.
|
|
26
|
+
"@nocobase/flow-engine": "2.1.0-alpha.14",
|
|
26
27
|
"@ant-design/icons": "5.6.1",
|
|
27
28
|
"@formily/antd-v5": "1.2.3",
|
|
28
29
|
"react-router-dom": "6.30.1",
|
|
@@ -30,7 +31,6 @@ module.exports = {
|
|
|
30
31
|
"@formily/reactive": "2.3.7",
|
|
31
32
|
"lodash": "4.17.21",
|
|
32
33
|
"@langchain/core": "1.1.24",
|
|
33
|
-
"langchain": "1.2.24",
|
|
34
34
|
"@langchain/langgraph": "1.1.4",
|
|
35
35
|
"@langchain/community": "1.1.15",
|
|
36
36
|
"@langchain/anthropic": "1.3.17",
|
|
@@ -38,12 +38,13 @@ module.exports = {
|
|
|
38
38
|
"@langchain/deepseek": "1.0.11",
|
|
39
39
|
"@langchain/google-genai": "2.1.18",
|
|
40
40
|
"@langchain/ollama": "1.2.2",
|
|
41
|
-
"@nocobase/acl": "2.1.0-alpha.
|
|
42
|
-
"@nocobase/resourcer": "2.1.0-alpha.
|
|
41
|
+
"@nocobase/acl": "2.1.0-alpha.14",
|
|
42
|
+
"@nocobase/resourcer": "2.1.0-alpha.14",
|
|
43
43
|
"@emotion/css": "11.13.0",
|
|
44
|
+
"dayjs": "1.11.13",
|
|
44
45
|
"react-i18next": "11.18.6",
|
|
45
|
-
"@nocobase/plugin-data-source-manager": "2.1.0-alpha.
|
|
46
|
+
"@nocobase/plugin-data-source-manager": "2.1.0-alpha.14",
|
|
46
47
|
"ahooks": "3.7.8",
|
|
47
48
|
"@langchain/langgraph-checkpoint": "1.0.0",
|
|
48
|
-
"@nocobase/data-source-manager": "2.1.0-alpha.
|
|
49
|
+
"@nocobase/data-source-manager": "2.1.0-alpha.14"
|
|
49
50
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -89,6 +89,8 @@
|
|
|
89
89
|
"Diagnose and fix the error": "Diagnose and fix the error",
|
|
90
90
|
"Direction": "Direction",
|
|
91
91
|
"Disable search": "Disable search",
|
|
92
|
+
"Switching to {{ nickname }}": "Switching to {{ nickname }}",
|
|
93
|
+
"{{ nickname }} has completed the work": "{{ nickname }} has completed the work",
|
|
92
94
|
"Displays the AI employee’s assigned tasks on the profile when hovering over the button.": "Displays the AI employee’s assigned tasks on the profile when hovering over the button.",
|
|
93
95
|
"Down": "Down",
|
|
94
96
|
"Edit AI employee": "Edit AI employee",
|
|
@@ -339,5 +341,12 @@
|
|
|
339
341
|
"Hello, I'm Cole. I have access to the NocoBase knowledge base. Ask me anything about setting up or using the platform.": "Hello, I'm Cole. I have access to the NocoBase knowledge base. Ask me anything about setting up or using the platform.",
|
|
340
342
|
"Frontend code engineer": "Frontend code engineer",
|
|
341
343
|
"An frontend engineer specializing in JavaScript, HTML, and CSS.": "An frontend engineer specializing in JavaScript, HTML, and CSS.",
|
|
342
|
-
"Hello, I'm Nathan, your frontend code engineer. I'll generate high-quality JavaScript / HTML / CSS code for you. What would you like me to build today?": "Hello, I'm Nathan, your frontend code engineer. I'll generate high-quality JavaScript / HTML / CSS code for you. What would you like me to build today?"
|
|
344
|
+
"Hello, I'm Nathan, your frontend code engineer. I'll generate high-quality JavaScript / HTML / CSS code for you. What would you like me to build today?": "Hello, I'm Nathan, your frontend code engineer. I'll generate high-quality JavaScript / HTML / CSS code for you. What would you like me to build today?",
|
|
345
|
+
"AI employee task dispatching": "AI employee task dispatching",
|
|
346
|
+
"Awaken and assign specific tasks to ai employees": "Awaken and assign specific tasks to ai employees",
|
|
347
|
+
"List AI employee": "List AI employee",
|
|
348
|
+
"Get the list of available AI employees": "Get the list of available AI employees",
|
|
349
|
+
"Get AI employee": "Get AI employee",
|
|
350
|
+
"Get the detailed definition of AI employee": "Get the detailed definition of AI employee",
|
|
351
|
+
"Done in {{ durationText }}": "Done in {{ durationText }}"
|
|
343
352
|
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -89,6 +89,8 @@
|
|
|
89
89
|
"Diagnose and fix the error": "诊断并修复错误",
|
|
90
90
|
"Direction": "排序方向",
|
|
91
91
|
"Disable search": "禁用搜索",
|
|
92
|
+
"Switching to {{ nickname }}": "切换为 {{ nickname }}",
|
|
93
|
+
"{{ nickname }} has completed the work": "{{ nickname }} 已完成工作",
|
|
92
94
|
"Displays the AI employee’s assigned tasks on the profile when hovering over the button.": "当鼠标悬停在按钮上时,会在员工资料卡片上显示任务描述。",
|
|
93
95
|
"Down": "下移",
|
|
94
96
|
"Edit AI employee": "编辑 AI 员工",
|
|
@@ -345,5 +347,12 @@
|
|
|
345
347
|
"Hello, I'm Cole. I have access to the NocoBase knowledge base. Ask me anything about setting up or using the platform.": "你好,我是Cole。我可以进入NocoBase的知识库。问我任何关于设置或使用平台的问题。",
|
|
346
348
|
"Frontend code engineer": "前端工程师",
|
|
347
349
|
"An frontend engineer specializing in JavaScript, HTML, and CSS.": "一个擅长 JavaScript、HTML 和 CSS 的前端工程师。",
|
|
348
|
-
"Hello, I'm Nathan, your frontend code engineer. I'll generate high-quality JavaScript / HTML / CSS code for you. What would you like me to build today?": "嗨,我是 Nathan,你的前端工程师。我将为您生成高质量 JavaScript / HTML / CSS 代码。今天您想创建什么?"
|
|
350
|
+
"Hello, I'm Nathan, your frontend code engineer. I'll generate high-quality JavaScript / HTML / CSS code for you. What would you like me to build today?": "嗨,我是 Nathan,你的前端工程师。我将为您生成高质量 JavaScript / HTML / CSS 代码。今天您想创建什么?",
|
|
351
|
+
"AI employee task dispatching": "AI员工任务分派",
|
|
352
|
+
"Awaken and assign specific tasks to ai employees": "唤醒 AI 员工并分派具体任务",
|
|
353
|
+
"List AI employee": "列出 AI 员工",
|
|
354
|
+
"Get the list of available AI employees": "获取可用的 AI 员工列表",
|
|
355
|
+
"Get AI employee": "获取 AI 员工",
|
|
356
|
+
"Get the detailed definition of AI employee": "获取 AI 员工的详细定义",
|
|
357
|
+
"Done in {{ durationText }}": "已完成 {{ durationText }}"
|
|
349
358
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"fast-glob","version":"3.3.2","description":"It's a very fast and efficient glob library for Node.js","license":"MIT","repository":"mrmlnc/fast-glob","author":{"name":"Denis Malinochkin","url":"https://mrmlnc.com"},"engines":{"node":">=8.6.0"},"main":"out/index.js","typings":"out/index.d.ts","files":["out","!out/{benchmark,tests}","!out/**/*.map","!out/**/*.spec.*"],"keywords":["glob","patterns","fast","implementation"],"devDependencies":{"@nodelib/fs.macchiato":"^1.0.1","@types/glob-parent":"^5.1.0","@types/merge2":"^1.1.4","@types/micromatch":"^4.0.0","@types/mocha":"^5.2.7","@types/node":"^14.18.53","@types/picomatch":"^2.3.0","@types/sinon":"^7.5.0","bencho":"^0.1.1","eslint":"^6.5.1","eslint-config-mrmlnc":"^1.1.0","execa":"^7.1.1","fast-glob":"^3.0.4","fdir":"^6.0.1","glob":"^10.0.0","hereby":"^1.8.1","mocha":"^6.2.1","rimraf":"^5.0.0","sinon":"^7.5.0","snap-shot-it":"^7.9.10","typescript":"^4.9.5"},"dependencies":{"@nodelib/fs.stat":"^2.0.2","@nodelib/fs.walk":"^1.2.3","glob-parent":"^5.1.2","merge2":"^1.3.0","micromatch":"^4.0.4"},"scripts":{"clean":"rimraf out","lint":"eslint \"src/**/*.ts\" --cache","compile":"tsc","test":"mocha \"out/**/*.spec.js\" -s 0","test:e2e":"mocha \"out/**/*.e2e.js\" -s 0","test:e2e:sync":"mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(sync\\)\"","test:e2e:async":"mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(async\\)\"","test:e2e:stream":"mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(stream\\)\"","build":"npm run clean && npm run compile && npm run lint && npm test","watch":"npm run clean && npm run compile -- --sourceMap --watch","bench:async":"npm run bench:product:async && npm run bench:regression:async","bench:stream":"npm run bench:product:stream && npm run bench:regression:stream","bench:sync":"npm run bench:product:sync && npm run bench:regression:sync","bench:product":"npm run bench:product:async && npm run bench:product:sync && npm run bench:product:stream","bench:product:async":"hereby bench:product:async","bench:product:sync":"hereby bench:product:sync","bench:product:stream":"hereby bench:product:stream","bench:regression":"npm run bench:regression:async && npm run bench:regression:sync && npm run bench:regression:stream","bench:regression:async":"hereby bench:regression:async","bench:regression:sync":"hereby bench:regression:sync","bench:regression:stream":"hereby bench:regression:stream"},"_lastModified":"2026-
|
|
1
|
+
{"name":"fast-glob","version":"3.3.2","description":"It's a very fast and efficient glob library for Node.js","license":"MIT","repository":"mrmlnc/fast-glob","author":{"name":"Denis Malinochkin","url":"https://mrmlnc.com"},"engines":{"node":">=8.6.0"},"main":"out/index.js","typings":"out/index.d.ts","files":["out","!out/{benchmark,tests}","!out/**/*.map","!out/**/*.spec.*"],"keywords":["glob","patterns","fast","implementation"],"devDependencies":{"@nodelib/fs.macchiato":"^1.0.1","@types/glob-parent":"^5.1.0","@types/merge2":"^1.1.4","@types/micromatch":"^4.0.0","@types/mocha":"^5.2.7","@types/node":"^14.18.53","@types/picomatch":"^2.3.0","@types/sinon":"^7.5.0","bencho":"^0.1.1","eslint":"^6.5.1","eslint-config-mrmlnc":"^1.1.0","execa":"^7.1.1","fast-glob":"^3.0.4","fdir":"^6.0.1","glob":"^10.0.0","hereby":"^1.8.1","mocha":"^6.2.1","rimraf":"^5.0.0","sinon":"^7.5.0","snap-shot-it":"^7.9.10","typescript":"^4.9.5"},"dependencies":{"@nodelib/fs.stat":"^2.0.2","@nodelib/fs.walk":"^1.2.3","glob-parent":"^5.1.2","merge2":"^1.3.0","micromatch":"^4.0.4"},"scripts":{"clean":"rimraf out","lint":"eslint \"src/**/*.ts\" --cache","compile":"tsc","test":"mocha \"out/**/*.spec.js\" -s 0","test:e2e":"mocha \"out/**/*.e2e.js\" -s 0","test:e2e:sync":"mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(sync\\)\"","test:e2e:async":"mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(async\\)\"","test:e2e:stream":"mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(stream\\)\"","build":"npm run clean && npm run compile && npm run lint && npm test","watch":"npm run clean && npm run compile -- --sourceMap --watch","bench:async":"npm run bench:product:async && npm run bench:regression:async","bench:stream":"npm run bench:product:stream && npm run bench:regression:stream","bench:sync":"npm run bench:product:sync && npm run bench:regression:sync","bench:product":"npm run bench:product:async && npm run bench:product:sync && npm run bench:product:stream","bench:product:async":"hereby bench:product:async","bench:product:sync":"hereby bench:product:sync","bench:product:stream":"hereby bench:product:stream","bench:regression":"npm run bench:regression:async && npm run bench:regression:sync && npm run bench:regression:stream","bench:regression:async":"hereby bench:regression:async","bench:regression:sync":"hereby bench:regression:sync","bench:regression:stream":"hereby bench:regression:stream"},"_lastModified":"2026-04-07T15:55:27.966Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"public":true,"preferGlobal":false,"name":"flexsearch","version":"0.8.212","description":"Next-Generation full-text search library for Browser and Node.js","homepage":"https://github.com/nextapps-de/flexsearch/","author":"Thomas Wilkerling","copyright":"Nextapps GmbH","license":"Apache-2.0","readme":"README.md","keywords":["fulltext search","elastic search","fastest search","contextual search","document search","fuzzy search","fuzzy match","search engine"],"repository":{"type":"git","url":"https://github.com/nextapps-de/flexsearch.git"},"bugs":{"url":"https://github.com/nextapps-de/flexsearch/issues","email":"info@nextapps.de"},"main":"dist/flexsearch.bundle.min.js","module":"dist/flexsearch.bundle.module.min.mjs","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./dist/flexsearch.bundle.module.min.mjs","require":"./dist/flexsearch.bundle.min.js"},"./lang/*":{"import":"./dist/module/lang/*.js","require":"./dist/lang/*.min.js"},"./db/*":{"import":"./dist/module/db/*/index.js","require":"./dist/db/*/index.cjs"},"./debug":{"import":"./dist/flexsearch.bundle.module.debug.mjs","require":"./dist/flexsearch.bundle.debug.js"}},"browser":{"flexsearch":"./dist/flexsearch.bundle.module.min.mjs","flexsearch/debug":"./dist/flexsearch.bundle.module.debug.mjs","dist/flexsearch.bundle.min.js":"./dist/flexsearch.bundle.min.js","dist/flexsearch.bundle.module.min.js":"./dist/flexsearch.bundle.module.min.mjs","dist/flexsearch.bundle.module.min.mjs":"./dist/flexsearch.bundle.module.min.mjs","worker_threads":false,"path":false,"clickhouse":false,"mongodb":false,"pg-promise":false,"redis":false,"sqlite3":false},"scripts":{"build":"npm run build:bundle && npm run build:bundle:debug && exit 0","build:bundle":"node task/build RELEASE=bundle DEBUG=false PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false","build:bundle:debug":"node task/build RELEASE=bundle DEBUG=true PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:compact":"node task/build RELEASE=compact DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false","build:compact:debug":"node task/build RELEASE=compact DEBUG=true PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:light":"node task/build RELEASE=light DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=false SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false","build:light:debug":"node task/build RELEASE=light DEBUG=true PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=false SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:es5":"node task/build RELEASE=es5 DEBUG=false PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=true SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false LANGUAGE_OUT=ECMASCRIPT5_STRICT","build:es5:debug":"node task/build RELEASE=es5 DEBUG=true PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=true SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT LANGUAGE_OUT=ECMASCRIPT5_STRICT","build:lang":"node task/build RELEASE=lang","build:db":"npx rollup tmp/db/indexeddb/index.js --file dist/db/indexeddb/index.cjs --format cjs && npx rollup tmp/db/postgres/index.js --file dist/db/postgres/index.cjs --format cjs && npx rollup tmp/db/sqlite/index.js --file dist/db/sqlite/index.cjs --format cjs && npx rollup tmp/db/mongodb/index.js --file dist/db/mongodb/index.cjs --format cjs && npx rollup tmp/db/redis/index.js --file dist/db/redis/index.cjs --format cjs && npx rollup tmp/db/clickhouse/index.js --file dist/db/clickhouse/index.cjs --format cjs","build:module":"node task/babel && exit 0","build:module:debug":"node task/babel DEBUG=true && exit 0","build:module:min":"node task/babel RELEASE=min && exit 0","build:module:bundle":"node task/build RELEASE=bundle.module DEBUG=false PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false","build:module:bundle:debug":"node task/build RELEASE=bundle.module DEBUG=true PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:module:compact":"node task/build RELEASE=compact.module DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false","build:module:compact:debug":"node task/build RELEASE=compact.module DEBUG=true PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:module:light":"node task/build RELEASE=light.module DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=false SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false","build:module:light:debug":"node task/build RELEASE=light.module DEBUG=true PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=false SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:all":"npm run build:bundle && npm run build:bundle:debug && npm run build:light && npm run build:light:debug && npm run build:compact && npm run build:compact:debug && npm run build:module:bundle && npm run build:module:bundle:debug && npm run build:module:light && npm run build:module:light:debug && npm run build:module:compact && npm run build:module:compact:debug && npm run build:es5 && npm run build:es5:debug && npm run build:lang && npm run build:module && npm run build:module:debug && npm run build:module:min && npm run build:db","build:custom":"node task/build RELEASE=custom","test":"mocha test/*.js --exit","test:coverage":"c8 -c test/.c8rc.json mocha test/*.js --exit","test:keystore":"set NODE_OPTIONS=--max-old-space-size=16000 && c8 -c test/.c8rc.json mocha test/keystore.js --exit","test:db":"c8 -c test/.c8rc.json mocha test/persistent.*.js --exit","test:all":"npx mocha test/*.js --exit module/bundle && npx mocha test/*.js --exit module-debug/bundle && npx mocha test/*.js --exit module-min/bundle && npx mocha test/*.js --exit flexsearch.bundle.debug && npx mocha test/*.js --exit flexsearch.bundle.min && npx mocha test/*.js --exit flexsearch.bundle.module.debug && npx mocha test/*.js --exit flexsearch.bundle.module.min && npx mocha test/*.js --exit flexsearch.compact.debug && npx mocha test/*.js --exit flexsearch.compact.min && npx mocha test/*.js --exit flexsearch.compact.module.debug && npx mocha test/*.js --exit flexsearch.compact.module.min && npx mocha test/*.js --exit flexsearch.es5.debug && npx mocha test/*.js --exit flexsearch.es5.min && npx mocha test/*.js --exit flexsearch.light.debug && npx mocha test/*.js --exit flexsearch.light.min && npx mocha test/*.js --exit flexsearch.light.module.debug && npx mocha test/*.js --exit flexsearch.light.module.min","release":"npm version --no-git-tag-version patch && npm run build:all && npm run test:all"},"files":["dist/**","src/**","task/**","index.d.ts","README.md","CHANGELOG.md","LICENSE"],"devDependencies":{"babel-cli":"^6.26.0","babel-plugin-conditional-compile":"^0.0.5","babel-plugin-minify-constant-folding":"^0.5.0","babel-plugin-minify-dead-code-elimination":"^0.5.2","babel-plugin-minify-flip-comparisons":"^0.4.3","babel-plugin-minify-guarded-expressions":"^0.4.4","babel-plugin-minify-infinity":"^0.4.3","babel-plugin-minify-mangle-names":"^0.5.1","babel-plugin-minify-replace":"^0.5.0","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-minify-type-constructors":"^0.4.3","babel-plugin-transform-member-expression-literals":"^6.9.4","babel-plugin-transform-merge-sibling-variables":"^6.9.5","babel-plugin-transform-minify-booleans":"^6.9.4","babel-plugin-transform-property-literals":"^6.9.4","babel-plugin-transform-simplify-comparison-operators":"^6.9.4","babel-plugin-transform-undefined-to-void":"^6.9.4","c8":"^10.1.3","chai":"^5.2.0","clickhouse":"^2.6.0","google-closure-compiler":"^20250520.0.0","mocha":"^11.1.0","mongodb":"^6.13.0","pg-promise":"^11.13.0","redis":"^5.1.0","rollup":"^4.35.0","sqlite3":"^5.1.7"},"funding":[{"type":"github","url":"https://github.com/ts-thomas"},{"type":"paypal","url":"https://www.paypal.com/donate/?hosted_button_id=GEVR88FC9BWRW"},{"type":"opencollective","url":"https://opencollective.com/flexsearch"},{"type":"patreon","url":"https://patreon.com/user?u=96245532"},{"type":"liberapay","url":"https://liberapay.com/ts-thomas"}],"_lastModified":"2026-03-25T14:11:17.925Z"}
|
|
1
|
+
{"public":true,"preferGlobal":false,"name":"flexsearch","version":"0.8.212","description":"Next-Generation full-text search library for Browser and Node.js","homepage":"https://github.com/nextapps-de/flexsearch/","author":"Thomas Wilkerling","copyright":"Nextapps GmbH","license":"Apache-2.0","readme":"README.md","keywords":["fulltext search","elastic search","fastest search","contextual search","document search","fuzzy search","fuzzy match","search engine"],"repository":{"type":"git","url":"https://github.com/nextapps-de/flexsearch.git"},"bugs":{"url":"https://github.com/nextapps-de/flexsearch/issues","email":"info@nextapps.de"},"main":"dist/flexsearch.bundle.min.js","module":"dist/flexsearch.bundle.module.min.mjs","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./dist/flexsearch.bundle.module.min.mjs","require":"./dist/flexsearch.bundle.min.js"},"./lang/*":{"import":"./dist/module/lang/*.js","require":"./dist/lang/*.min.js"},"./db/*":{"import":"./dist/module/db/*/index.js","require":"./dist/db/*/index.cjs"},"./debug":{"import":"./dist/flexsearch.bundle.module.debug.mjs","require":"./dist/flexsearch.bundle.debug.js"}},"browser":{"flexsearch":"./dist/flexsearch.bundle.module.min.mjs","flexsearch/debug":"./dist/flexsearch.bundle.module.debug.mjs","dist/flexsearch.bundle.min.js":"./dist/flexsearch.bundle.min.js","dist/flexsearch.bundle.module.min.js":"./dist/flexsearch.bundle.module.min.mjs","dist/flexsearch.bundle.module.min.mjs":"./dist/flexsearch.bundle.module.min.mjs","worker_threads":false,"path":false,"clickhouse":false,"mongodb":false,"pg-promise":false,"redis":false,"sqlite3":false},"scripts":{"build":"npm run build:bundle && npm run build:bundle:debug && exit 0","build:bundle":"node task/build RELEASE=bundle DEBUG=false PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false","build:bundle:debug":"node task/build RELEASE=bundle DEBUG=true PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:compact":"node task/build RELEASE=compact DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false","build:compact:debug":"node task/build RELEASE=compact DEBUG=true PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:light":"node task/build RELEASE=light DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=false SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false","build:light:debug":"node task/build RELEASE=light DEBUG=true PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=false SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:es5":"node task/build RELEASE=es5 DEBUG=false PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=true SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false LANGUAGE_OUT=ECMASCRIPT5_STRICT","build:es5:debug":"node task/build RELEASE=es5 DEBUG=true PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=true SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT LANGUAGE_OUT=ECMASCRIPT5_STRICT","build:lang":"node task/build RELEASE=lang","build:db":"npx rollup tmp/db/indexeddb/index.js --file dist/db/indexeddb/index.cjs --format cjs && npx rollup tmp/db/postgres/index.js --file dist/db/postgres/index.cjs --format cjs && npx rollup tmp/db/sqlite/index.js --file dist/db/sqlite/index.cjs --format cjs && npx rollup tmp/db/mongodb/index.js --file dist/db/mongodb/index.cjs --format cjs && npx rollup tmp/db/redis/index.js --file dist/db/redis/index.cjs --format cjs && npx rollup tmp/db/clickhouse/index.js --file dist/db/clickhouse/index.cjs --format cjs","build:module":"node task/babel && exit 0","build:module:debug":"node task/babel DEBUG=true && exit 0","build:module:min":"node task/babel RELEASE=min && exit 0","build:module:bundle":"node task/build RELEASE=bundle.module DEBUG=false PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false","build:module:bundle:debug":"node task/build RELEASE=bundle.module DEBUG=true PROFILER=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=true SUPPORT_RESOLVER=true SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=true SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:module:compact":"node task/build RELEASE=compact.module DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false","build:module:compact:debug":"node task/build RELEASE=compact.module DEBUG=true PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=true SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:module:light":"node task/build RELEASE=light.module DEBUG=false PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=false SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false","build:module:light:debug":"node task/build RELEASE=light.module DEBUG=true PROFILER=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CHARSET=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false SUPPORT_PERSISTENT=false SUPPORT_RESOLVER=false SUPPORT_HIGHLIGHTING=false SUPPORT_KEYSTORE=false SUPPORT_COMPRESSION=false FORMATTING=PRETTY_PRINT","build:all":"npm run build:bundle && npm run build:bundle:debug && npm run build:light && npm run build:light:debug && npm run build:compact && npm run build:compact:debug && npm run build:module:bundle && npm run build:module:bundle:debug && npm run build:module:light && npm run build:module:light:debug && npm run build:module:compact && npm run build:module:compact:debug && npm run build:es5 && npm run build:es5:debug && npm run build:lang && npm run build:module && npm run build:module:debug && npm run build:module:min && npm run build:db","build:custom":"node task/build RELEASE=custom","test":"mocha test/*.js --exit","test:coverage":"c8 -c test/.c8rc.json mocha test/*.js --exit","test:keystore":"set NODE_OPTIONS=--max-old-space-size=16000 && c8 -c test/.c8rc.json mocha test/keystore.js --exit","test:db":"c8 -c test/.c8rc.json mocha test/persistent.*.js --exit","test:all":"npx mocha test/*.js --exit module/bundle && npx mocha test/*.js --exit module-debug/bundle && npx mocha test/*.js --exit module-min/bundle && npx mocha test/*.js --exit flexsearch.bundle.debug && npx mocha test/*.js --exit flexsearch.bundle.min && npx mocha test/*.js --exit flexsearch.bundle.module.debug && npx mocha test/*.js --exit flexsearch.bundle.module.min && npx mocha test/*.js --exit flexsearch.compact.debug && npx mocha test/*.js --exit flexsearch.compact.min && npx mocha test/*.js --exit flexsearch.compact.module.debug && npx mocha test/*.js --exit flexsearch.compact.module.min && npx mocha test/*.js --exit flexsearch.es5.debug && npx mocha test/*.js --exit flexsearch.es5.min && npx mocha test/*.js --exit flexsearch.light.debug && npx mocha test/*.js --exit flexsearch.light.min && npx mocha test/*.js --exit flexsearch.light.module.debug && npx mocha test/*.js --exit flexsearch.light.module.min","release":"npm version --no-git-tag-version patch && npm run build:all && npm run test:all"},"files":["dist/**","src/**","task/**","index.d.ts","README.md","CHANGELOG.md","LICENSE"],"devDependencies":{"babel-cli":"^6.26.0","babel-plugin-conditional-compile":"^0.0.5","babel-plugin-minify-constant-folding":"^0.5.0","babel-plugin-minify-dead-code-elimination":"^0.5.2","babel-plugin-minify-flip-comparisons":"^0.4.3","babel-plugin-minify-guarded-expressions":"^0.4.4","babel-plugin-minify-infinity":"^0.4.3","babel-plugin-minify-mangle-names":"^0.5.1","babel-plugin-minify-replace":"^0.5.0","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-minify-type-constructors":"^0.4.3","babel-plugin-transform-member-expression-literals":"^6.9.4","babel-plugin-transform-merge-sibling-variables":"^6.9.5","babel-plugin-transform-minify-booleans":"^6.9.4","babel-plugin-transform-property-literals":"^6.9.4","babel-plugin-transform-simplify-comparison-operators":"^6.9.4","babel-plugin-transform-undefined-to-void":"^6.9.4","c8":"^10.1.3","chai":"^5.2.0","clickhouse":"^2.6.0","google-closure-compiler":"^20250520.0.0","mocha":"^11.1.0","mongodb":"^6.13.0","pg-promise":"^11.13.0","redis":"^5.1.0","rollup":"^4.35.0","sqlite3":"^5.1.7"},"funding":[{"type":"github","url":"https://github.com/ts-thomas"},{"type":"paypal","url":"https://www.paypal.com/donate/?hosted_button_id=GEVR88FC9BWRW"},{"type":"opencollective","url":"https://opencollective.com/flexsearch"},{"type":"patreon","url":"https://patreon.com/user?u=96245532"},{"type":"liberapay","url":"https://liberapay.com/ts-thomas"}],"_lastModified":"2026-04-07T15:55:28.361Z"}
|
|
@@ -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-
|
|
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-04-07T15:55:27.440Z"}
|
|
@@ -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-
|
|
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-04-07T15:55:24.826Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"openai","version":"6.22.0","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"},"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"},"./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-
|
|
1
|
+
{"name":"openai","version":"6.22.0","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"},"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"},"./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-04-07T15:55:27.277Z"}
|
|
@@ -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-
|
|
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-04-07T15:55:25.779Z"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Model } from '@nocobase/database';
|
|
10
|
+
import PluginAIServer from '../plugin';
|
|
11
|
+
import { AIMessage, SubAgentConversationMetadata, UserDecision } from '../types';
|
|
12
|
+
export type AIConversationsOptions = {
|
|
13
|
+
systemMessage?: unknown;
|
|
14
|
+
skillSettings?: unknown;
|
|
15
|
+
conversationSettings?: unknown;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
export type AIConversationFilterParams = {
|
|
19
|
+
filter: {
|
|
20
|
+
userId: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type CreateAIConversationParams = {
|
|
24
|
+
userId: string;
|
|
25
|
+
aiEmployee: {
|
|
26
|
+
username: string;
|
|
27
|
+
};
|
|
28
|
+
title?: string;
|
|
29
|
+
options?: AIConversationsOptions;
|
|
30
|
+
from?: 'main-agent' | 'sub-agent';
|
|
31
|
+
};
|
|
32
|
+
export type UpdateAIConversationParams = {
|
|
33
|
+
userId: string;
|
|
34
|
+
sessionId: string;
|
|
35
|
+
title?: string;
|
|
36
|
+
options?: AIConversationsOptions;
|
|
37
|
+
};
|
|
38
|
+
export type GetAIConversationMessagesParams = {
|
|
39
|
+
userId: string;
|
|
40
|
+
sessionId: string;
|
|
41
|
+
cursor?: string;
|
|
42
|
+
paginate?: boolean;
|
|
43
|
+
};
|
|
44
|
+
export type ParsedMessageRow = AIMessage & Model;
|
|
45
|
+
export type GetAIConversationMessagesResult = {
|
|
46
|
+
rows: any[];
|
|
47
|
+
hasMore?: boolean;
|
|
48
|
+
cursor?: string | null;
|
|
49
|
+
};
|
|
50
|
+
export declare class AIConversationsManager {
|
|
51
|
+
protected plugin: PluginAIServer;
|
|
52
|
+
constructor(plugin: PluginAIServer);
|
|
53
|
+
create({ userId, aiEmployee, title, options, from }: CreateAIConversationParams): Promise<any>;
|
|
54
|
+
update({ userId, sessionId, title, options: inputOptions }: UpdateAIConversationParams): Promise<any>;
|
|
55
|
+
getMessages({ userId, sessionId, cursor, paginate, }: GetAIConversationMessagesParams): Promise<GetAIConversationMessagesResult>;
|
|
56
|
+
getUserDecisions(messageId: string): Promise<{
|
|
57
|
+
interruptId?: string;
|
|
58
|
+
decisions: UserDecision[];
|
|
59
|
+
} | null>;
|
|
60
|
+
resolveSubAgentConversation(sessionId: string, toolCallId: string): Promise<SubAgentConversationMetadata>;
|
|
61
|
+
private get aiConversationsRepo();
|
|
62
|
+
private get aiMessagesRepo();
|
|
63
|
+
private get aiToolMessagesRepo();
|
|
64
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
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_conversations_exports = {};
|
|
28
|
+
__export(ai_conversations_exports, {
|
|
29
|
+
AIConversationsManager: () => AIConversationsManager
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(ai_conversations_exports);
|
|
32
|
+
var import_database = require("@nocobase/database");
|
|
33
|
+
var import_utils = require("../utils");
|
|
34
|
+
class AIConversationsManager {
|
|
35
|
+
constructor(plugin) {
|
|
36
|
+
this.plugin = plugin;
|
|
37
|
+
}
|
|
38
|
+
async create({ userId, aiEmployee, title, options = {}, from = "main-agent" }) {
|
|
39
|
+
return await this.aiConversationsRepo.create({
|
|
40
|
+
values: {
|
|
41
|
+
userId,
|
|
42
|
+
title,
|
|
43
|
+
aiEmployee,
|
|
44
|
+
options,
|
|
45
|
+
thread: 1,
|
|
46
|
+
from
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async update({ userId, sessionId, title, options: inputOptions }) {
|
|
51
|
+
const conversation = await this.aiConversationsRepo.findOne({
|
|
52
|
+
filter: {
|
|
53
|
+
sessionId,
|
|
54
|
+
userId
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
if (!conversation) {
|
|
58
|
+
throw new Error("invalid sessionId");
|
|
59
|
+
}
|
|
60
|
+
const { systemMessage, skillSettings, conversationSettings } = inputOptions ?? {};
|
|
61
|
+
const options = conversation.options ?? {};
|
|
62
|
+
if (systemMessage) {
|
|
63
|
+
options["systemMessage"] = systemMessage;
|
|
64
|
+
}
|
|
65
|
+
if (skillSettings) {
|
|
66
|
+
options["skillSettings"] = skillSettings;
|
|
67
|
+
}
|
|
68
|
+
if (conversationSettings) {
|
|
69
|
+
options["conversationSettings"] = conversationSettings;
|
|
70
|
+
}
|
|
71
|
+
const values = { options };
|
|
72
|
+
if (title) {
|
|
73
|
+
values.title = title;
|
|
74
|
+
}
|
|
75
|
+
return await this.aiConversationsRepo.update({
|
|
76
|
+
filter: {
|
|
77
|
+
userId,
|
|
78
|
+
sessionId
|
|
79
|
+
},
|
|
80
|
+
values
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
async getMessages({
|
|
84
|
+
userId,
|
|
85
|
+
sessionId,
|
|
86
|
+
cursor,
|
|
87
|
+
paginate = true
|
|
88
|
+
}) {
|
|
89
|
+
const conversation = await this.aiConversationsRepo.findOne({
|
|
90
|
+
filter: {
|
|
91
|
+
sessionId,
|
|
92
|
+
userId
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
if (!conversation) {
|
|
96
|
+
throw new Error("invalid sessionId");
|
|
97
|
+
}
|
|
98
|
+
const pageSize = 10;
|
|
99
|
+
const maxLimit = 200;
|
|
100
|
+
const messageRepository = this.plugin.db.getRepository("aiConversations.messages", sessionId);
|
|
101
|
+
const filter = {
|
|
102
|
+
role: {
|
|
103
|
+
$notIn: ["tool"]
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
if (paginate && cursor) {
|
|
107
|
+
filter["messageId"] = {
|
|
108
|
+
$lt: cursor
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const rows = await messageRepository.find({
|
|
112
|
+
sort: ["-messageId"],
|
|
113
|
+
limit: paginate ? pageSize + 1 : maxLimit,
|
|
114
|
+
filter
|
|
115
|
+
});
|
|
116
|
+
const hasMore = paginate && rows.length > pageSize;
|
|
117
|
+
const data = hasMore ? rows.slice(0, -1) : rows;
|
|
118
|
+
const newCursor = data.length ? data[data.length - 1].messageId : null;
|
|
119
|
+
const subAgentConversations = data.filter((row) => {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
return ((_b = (_a = row.metadata) == null ? void 0 : _a.subAgentConversations) == null ? void 0 : _b.length) ?? 0 > 0;
|
|
122
|
+
}).flatMap((row) => row.metadata.subAgentConversations);
|
|
123
|
+
const subAgentConversationSessionIds = [...new Set(subAgentConversations.map((item) => item.sessionId))];
|
|
124
|
+
const subAgentConversationMessages = subAgentConversationSessionIds.length ? await this.aiMessagesRepo.find({
|
|
125
|
+
sort: ["messageId"],
|
|
126
|
+
filter: {
|
|
127
|
+
sessionId: {
|
|
128
|
+
$in: subAgentConversationSessionIds
|
|
129
|
+
},
|
|
130
|
+
role: {
|
|
131
|
+
$notIn: ["tool"]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}) : [];
|
|
135
|
+
const subAgentConversationMessageMap = /* @__PURE__ */ new Map();
|
|
136
|
+
const toolCallIds = [
|
|
137
|
+
...data.filter((row) => {
|
|
138
|
+
var _a;
|
|
139
|
+
return ((_a = row == null ? void 0 : row.toolCalls) == null ? void 0 : _a.length) ?? 0 > 0;
|
|
140
|
+
}).flatMap((row) => row.toolCalls).map((toolCall) => toolCall.id),
|
|
141
|
+
...subAgentConversationMessages.filter((row) => {
|
|
142
|
+
var _a;
|
|
143
|
+
return ((_a = row == null ? void 0 : row.toolCalls) == null ? void 0 : _a.length) ?? 0 > 0;
|
|
144
|
+
}).flatMap((row) => row.toolCalls).map((toolCall) => toolCall.id)
|
|
145
|
+
];
|
|
146
|
+
const toolMessages = await this.aiToolMessagesRepo.find({
|
|
147
|
+
filter: {
|
|
148
|
+
toolCallId: {
|
|
149
|
+
$in: toolCallIds
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
const toolMessageKey = (messageId, toolCallId) => `${messageId}:${toolCallId}`;
|
|
154
|
+
const toolMessageMap = new Map(
|
|
155
|
+
toolMessages.map((toolMessage) => [
|
|
156
|
+
toolMessageKey(toolMessage.messageId, toolMessage.toolCallId),
|
|
157
|
+
toolMessage
|
|
158
|
+
])
|
|
159
|
+
);
|
|
160
|
+
const toolsList = await this.plugin.aiManager.toolManager.listTools();
|
|
161
|
+
const toolsMap = new Map(
|
|
162
|
+
toolsList.map((group) => group.tools).flat().map((tool) => [tool.name, tool])
|
|
163
|
+
);
|
|
164
|
+
const parseMessageRow = (row) => {
|
|
165
|
+
var _a, _b;
|
|
166
|
+
if (((_a = row == null ? void 0 : row.toolCalls) == null ? void 0 : _a.length) ?? 0 > 0) {
|
|
167
|
+
for (const toolCall of row.toolCalls) {
|
|
168
|
+
const tool = toolsMap.get(toolCall.name);
|
|
169
|
+
const toolMessage = toolMessageMap.get(toolMessageKey(row.messageId, toolCall.id));
|
|
170
|
+
toolCall.invokeStatus = toolMessage == null ? void 0 : toolMessage.invokeStatus;
|
|
171
|
+
toolCall.auto = toolMessage == null ? void 0 : toolMessage.auto;
|
|
172
|
+
toolCall.status = toolMessage == null ? void 0 : toolMessage.status;
|
|
173
|
+
toolCall.content = toolMessage == null ? void 0 : toolMessage.content;
|
|
174
|
+
toolCall.execution = tool == null ? void 0 : tool.execution;
|
|
175
|
+
toolCall.willInterrupt = (tool == null ? void 0 : tool.execution) === "frontend" || (toolMessage == null ? void 0 : toolMessage.auto) === false;
|
|
176
|
+
toolCall.defaultPermission = tool == null ? void 0 : tool.defaultPermission;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const providerOptions = this.plugin.aiManager.llmProviders.get((_b = row.metadata) == null ? void 0 : _b.provider);
|
|
180
|
+
if (!providerOptions) {
|
|
181
|
+
return (0, import_utils.parseResponseMessage)(row);
|
|
182
|
+
}
|
|
183
|
+
const Provider = providerOptions.provider;
|
|
184
|
+
const provider = new Provider({
|
|
185
|
+
app: this.plugin.app
|
|
186
|
+
});
|
|
187
|
+
return provider.parseResponseMessage(row);
|
|
188
|
+
};
|
|
189
|
+
for (const row of subAgentConversationMessages) {
|
|
190
|
+
const sessionMessages = subAgentConversationMessageMap.get(row.sessionId) ?? [];
|
|
191
|
+
sessionMessages.push(parseMessageRow(row));
|
|
192
|
+
sessionMessages.forEach((it) => it.content.from = "sub-agent");
|
|
193
|
+
subAgentConversationMessageMap.set(row.sessionId, sessionMessages);
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
rows: data.map((row) => {
|
|
197
|
+
var _a;
|
|
198
|
+
const parsedRow = parseMessageRow(row);
|
|
199
|
+
const subAgentConversationItems = ((_a = row.metadata) == null ? void 0 : _a.subAgentConversations) ?? [];
|
|
200
|
+
if (subAgentConversationItems.length) {
|
|
201
|
+
parsedRow.content.subAgentConversations = subAgentConversationItems.map((item) => ({
|
|
202
|
+
sessionId: item.sessionId,
|
|
203
|
+
toolCallId: item.toolCallId,
|
|
204
|
+
status: item.status,
|
|
205
|
+
messages: subAgentConversationMessageMap.get(item.sessionId) ?? []
|
|
206
|
+
}));
|
|
207
|
+
}
|
|
208
|
+
parsedRow.content.from = "main-agent";
|
|
209
|
+
return parsedRow;
|
|
210
|
+
}),
|
|
211
|
+
...paginate && {
|
|
212
|
+
hasMore,
|
|
213
|
+
cursor: newCursor
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
async getUserDecisions(messageId) {
|
|
218
|
+
var _a;
|
|
219
|
+
const allInterruptedToolCall = await this.aiToolMessagesRepo.find({
|
|
220
|
+
filter: {
|
|
221
|
+
messageId,
|
|
222
|
+
interruptActionOrder: { [import_database.Op.not]: null }
|
|
223
|
+
},
|
|
224
|
+
order: [["interruptActionOrder", "ASC"]]
|
|
225
|
+
});
|
|
226
|
+
if (!allInterruptedToolCall.every((t) => t.invokeStatus === "waiting")) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
const message = await this.aiMessagesRepo.findOne({
|
|
230
|
+
filter: {
|
|
231
|
+
messageId
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
const interruptId = (_a = message == null ? void 0 : message.get("metadata")) == null ? void 0 : _a.interruptId;
|
|
235
|
+
return {
|
|
236
|
+
interruptId,
|
|
237
|
+
decisions: allInterruptedToolCall.map((item) => item.userDecision)
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
async resolveSubAgentConversation(sessionId, toolCallId) {
|
|
241
|
+
var _a, _b;
|
|
242
|
+
if (!sessionId || !toolCallId) {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
const toolMessage = await this.aiToolMessagesRepo.findOne({
|
|
246
|
+
filter: {
|
|
247
|
+
sessionId,
|
|
248
|
+
toolCallId
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
if (!toolMessage) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
const aiMessage = await this.aiMessagesRepo.findOne({
|
|
255
|
+
filter: {
|
|
256
|
+
sessionId,
|
|
257
|
+
messageId: toolMessage.messageId
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
if (!aiMessage) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
if (!((_b = (_a = aiMessage.metadata) == null ? void 0 : _a.subAgentConversations) == null ? void 0 : _b.length)) {
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
const subAgentConversation = aiMessage.metadata.subAgentConversations.find((it) => it.toolCallId == toolCallId);
|
|
267
|
+
if (!subAgentConversation) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
return subAgentConversation;
|
|
271
|
+
}
|
|
272
|
+
get aiConversationsRepo() {
|
|
273
|
+
return this.plugin.db.getRepository("aiConversations");
|
|
274
|
+
}
|
|
275
|
+
get aiMessagesRepo() {
|
|
276
|
+
return this.plugin.db.getRepository("aiMessages");
|
|
277
|
+
}
|
|
278
|
+
get aiToolMessagesRepo() {
|
|
279
|
+
return this.plugin.db.getRepository("aiToolMessages");
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
283
|
+
0 && (module.exports = {
|
|
284
|
+
AIConversationsManager
|
|
285
|
+
});
|