@nocobase/plugin-ai 2.3.0-alpha.1 → 2.3.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/dist/ai/docs/nocobase/ai-dev/watermark-plugin.md +2 -0
  2. package/dist/ai/docs/nocobase/ai-employees/block/ai-chat-box.md +133 -0
  3. package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/documents.md +1 -1
  4. package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/index.md +11 -7
  5. package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/settings.md +12 -8
  6. package/dist/ai/docs/nocobase/ai-employees/knowledge-base/rag.md +43 -13
  7. package/dist/ai/docs/nocobase/ai-employees/knowledge-base/vector-database.md +3 -3
  8. package/dist/ai/docs/nocobase/ai-employees/workflow/nodes/knowledge/create-document.md +1 -1
  9. package/dist/ai/docs/nocobase/api/app/env.md +2 -0
  10. package/dist/ai/docs/nocobase/api/cli/api/resource/create.md +4 -3
  11. package/dist/ai/docs/nocobase/building-tips/ai-fill-js-block-form.md +1092 -0
  12. package/dist/ai/docs/nocobase/data-sources/calendar/calendar-collection.md +100 -3
  13. package/dist/ai/docs/nocobase/data-sources/collection-comment/index.md +92 -39
  14. package/dist/ai/docs/nocobase/data-sources/collection-sql/index.md +150 -29
  15. package/dist/ai/docs/nocobase/data-sources/collection-tree/index.md +93 -5
  16. package/dist/ai/docs/nocobase/data-sources/collection-view/index.md +226 -4
  17. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/china-region.md +122 -5
  18. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/collection-select.md +105 -4
  19. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/json.md +102 -4
  20. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/nano-id.md +104 -4
  21. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/snowflake-id.md +108 -4
  22. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/sort.md +3 -19
  23. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/advanced/uuid.md +104 -4
  24. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/associations/index.md +44 -8
  25. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/color.md +102 -4
  26. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/email.md +104 -4
  27. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/icon.md +102 -4
  28. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/input.md +112 -8
  29. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/integer.md +103 -4
  30. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/number.md +103 -4
  31. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/password.md +102 -4
  32. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/percent.md +104 -5
  33. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/phone.md +104 -4
  34. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/textarea.md +99 -8
  35. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/basic/url.md +103 -4
  36. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/checkbox-group.md +105 -3
  37. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/checkbox.md +102 -4
  38. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/china-region.md +108 -5
  39. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/multiple-select.md +103 -5
  40. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/radio-group.md +106 -4
  41. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/choices/select.md +103 -5
  42. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/date.md +102 -4
  43. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/datetime-without-tz.md +103 -5
  44. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/datetime.md +103 -5
  45. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/index.md +53 -47
  46. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/time.md +102 -4
  47. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/datetime/unix-timestamp.md +103 -5
  48. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/circle.md +102 -4
  49. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/line.md +103 -5
  50. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/point.md +102 -4
  51. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/geometric/polygon.md +102 -4
  52. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/index.md +62 -16
  53. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/media/markdown.md +104 -4
  54. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/media/rich-text.md +105 -5
  55. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/created-at.md +105 -5
  56. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/created-by.md +103 -5
  57. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/space.md +100 -6
  58. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/table-oid.md +102 -4
  59. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/updated-at.md +104 -5
  60. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/system-info/updated-by.md +104 -6
  61. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection-fields/validation.md +68 -58
  62. package/dist/ai/docs/nocobase/data-sources/data-modeling/collection.md +32 -13
  63. package/dist/ai/docs/nocobase/data-sources/data-modeling/index.md +41 -33
  64. package/dist/ai/docs/nocobase/data-sources/data-source-external-mariadb/index.md +114 -6
  65. package/dist/ai/docs/nocobase/data-sources/data-source-external-mssql/index.md +117 -6
  66. package/dist/ai/docs/nocobase/data-sources/data-source-external-mysql/index.md +103 -6
  67. package/dist/ai/docs/nocobase/data-sources/data-source-external-nocobase/index.md +75 -73
  68. package/dist/ai/docs/nocobase/data-sources/data-source-external-oracle/index.md +129 -11
  69. package/dist/ai/docs/nocobase/data-sources/data-source-external-postgres/index.md +110 -6
  70. package/dist/ai/docs/nocobase/data-sources/data-source-kingbase/index.md +75 -49
  71. package/dist/ai/docs/nocobase/data-sources/data-source-main/general-collection.md +116 -15
  72. package/dist/ai/docs/nocobase/data-sources/data-source-main/index.md +92 -62
  73. package/dist/ai/docs/nocobase/data-sources/data-source-main/inheritance-collection.md +97 -10
  74. package/dist/ai/docs/nocobase/data-sources/data-source-manager/external-database.md +97 -58
  75. package/dist/ai/docs/nocobase/data-sources/data-source-manager/index.md +32 -24
  76. package/dist/ai/docs/nocobase/data-sources/data-source-rest-api/index.md +115 -153
  77. package/dist/ai/docs/nocobase/data-sources/external/clickhouse.md +124 -0
  78. package/dist/ai/docs/nocobase/data-sources/external/doris.md +130 -0
  79. package/dist/ai/docs/nocobase/data-sources/external/index.md +140 -0
  80. package/dist/ai/docs/nocobase/data-sources/external/kingbase.md +129 -0
  81. package/dist/ai/docs/nocobase/data-sources/external/mariadb.md +126 -0
  82. package/dist/ai/docs/nocobase/data-sources/external/mssql.md +129 -0
  83. package/dist/ai/docs/nocobase/data-sources/external/mysql.md +115 -0
  84. package/dist/ai/docs/nocobase/data-sources/external/nocobase.md +159 -0
  85. package/dist/ai/docs/nocobase/data-sources/external/oceanbase.md +126 -0
  86. package/dist/ai/docs/nocobase/data-sources/external/oracle.md +158 -0
  87. package/dist/ai/docs/nocobase/data-sources/external/postgresql.md +122 -0
  88. package/dist/ai/docs/nocobase/data-sources/external/rest-api.md +245 -0
  89. package/dist/ai/docs/nocobase/data-sources/field-attachment-url/index.md +100 -12
  90. package/dist/ai/docs/nocobase/data-sources/field-encryption/index.md +48 -47
  91. package/dist/ai/docs/nocobase/data-sources/field-formula/index.md +99 -5
  92. package/dist/ai/docs/nocobase/data-sources/field-markdown-vditor/index.md +105 -5
  93. package/dist/ai/docs/nocobase/data-sources/field-sequence/index.md +102 -5
  94. package/dist/ai/docs/nocobase/data-sources/field-signature/index.md +18 -16
  95. package/dist/ai/docs/nocobase/data-sources/field-sort/index.md +76 -73
  96. package/dist/ai/docs/nocobase/data-sources/file-manager/field-attachment.md +101 -7
  97. package/dist/ai/docs/nocobase/data-sources/file-manager/file-collection.md +101 -14
  98. package/dist/ai/docs/nocobase/data-sources/index.md +49 -33
  99. package/dist/ai/docs/nocobase/data-sources/main/index.md +130 -0
  100. package/dist/ai/docs/nocobase/data-sources/main/kingbase.md +147 -0
  101. package/dist/ai/docs/nocobase/data-sources/main/mariadb.md +59 -0
  102. package/dist/ai/docs/nocobase/data-sources/main/mysql.md +59 -0
  103. package/dist/ai/docs/nocobase/data-sources/main/oceanbase.md +62 -0
  104. package/dist/ai/docs/nocobase/data-sources/main/postgresql.md +61 -0
  105. package/dist/ai/docs/nocobase/file-manager/file-preview/index.md +44 -3
  106. package/dist/ai/docs/nocobase/file-manager/stable-url.md +1 -1
  107. package/dist/ai/docs/nocobase/file-manager/storage/aliyun-oss.md +100 -3
  108. package/dist/ai/docs/nocobase/file-manager/storage/index.md +76 -26
  109. package/dist/ai/docs/nocobase/file-manager/storage/local.md +4 -2
  110. package/dist/ai/docs/nocobase/file-manager/storage/s3-pro.md +58 -7
  111. package/dist/ai/docs/nocobase/get-started/installation/docker-nginx.mdx +4 -1
  112. package/dist/ai/docs/nocobase/get-started/installation/docker.mdx +2 -0
  113. package/dist/ai/docs/nocobase/get-started/installation/env.md +13 -1
  114. package/dist/ai/docs/nocobase/nocobase-cli/production/reverse-proxy/caddy.md +28 -5
  115. package/dist/ai/docs/nocobase/nocobase-cli/production/reverse-proxy/nginx.md +25 -0
  116. package/dist/ai/docs/nocobase/ops-management/migration-manager/built-in-tables.md +1 -2
  117. package/dist/ai/docs/nocobase/plugin-development/build.md +10 -4
  118. package/dist/ai/docs/nocobase/plugin-development/client/appendix/faq.md +1 -1
  119. package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-action.md +2 -0
  120. package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-block.md +2 -0
  121. package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-field.md +2 -0
  122. package/dist/ai/docs/nocobase/plugin-development/client/examples/fullstack-plugin.md +2 -0
  123. package/dist/ai/docs/nocobase/plugin-development/client/examples/settings-page.md +2 -0
  124. package/dist/ai/docs/nocobase/plugin-development/common/i18n.md +3 -3
  125. package/dist/ai/docs/nocobase/plugin-development/server/cache.md +1 -1
  126. package/dist/ai/docs/nocobase/plugin-development/server/collections.md +0 -6
  127. package/dist/ai/docs/nocobase/plugin-development/server/command.md +2 -2
  128. package/dist/ai/docs/nocobase/plugin-development/server/context.md +2 -2
  129. package/dist/ai/docs/nocobase/plugin-development/server/i18n.md +4 -4
  130. package/dist/ai/docs/nocobase/plugin-development/write-your-first-plugin.md +91 -43
  131. package/dist/ai/docs/nocobase/runjs/context/ai.md +194 -4
  132. package/dist/ai/docs/nocobase/security/guide.md +17 -2
  133. package/dist/ai/docs/nocobase/users-permissions/sync/index.md +8 -1
  134. package/dist/ai/docs/nocobase/users-permissions/sync/sources/dingtalk.md +138 -0
  135. package/dist/ai/docs/nocobase/users-permissions/sync/sources/ldap.md +87 -0
  136. package/dist/ai/docs/nocobase/workflow/nodes/javascript.md +21 -1
  137. package/dist/ai/tools/executeFrontendTool.d.ts +10 -0
  138. package/dist/ai/tools/executeFrontendTool.js +86 -0
  139. package/dist/ai/tools/getSkill.js +1 -1
  140. package/dist/ai/tools/knowledge-base-retrieve.js +3 -1
  141. package/dist/ai/tools/loadFrontendTool.d.ts +10 -0
  142. package/dist/ai/tools/loadFrontendTool.js +99 -0
  143. package/dist/client/244.aeb24ce76c510b34.js +10 -0
  144. package/dist/client/{525.203778500aca5d05.js → 525.94dd4136c1361477.js} +1 -1
  145. package/dist/client/681.6ffbc9329b9ac242.js +10 -0
  146. package/dist/client/705.1d735e63c25f66a8.js +10 -0
  147. package/dist/client/index.d.ts +1 -3
  148. package/dist/client/index.js +8 -8
  149. package/dist/client-v2/244.ee9ec45eac0eb99f.js +10 -0
  150. package/dist/client-v2/420.a5b929a5e7f330be.js +10 -0
  151. package/dist/client-v2/681.6890caa389564ff7.js +10 -0
  152. package/dist/client-v2/705.00c101bef403fb44.js +10 -0
  153. package/dist/client-v2/ai-employees/AIEmployeeShortcut.d.ts +2 -0
  154. package/dist/client-v2/ai-employees/AddContextButton.d.ts +2 -0
  155. package/dist/client-v2/ai-employees/chatbox/components/AIEmployeeSwitcher.d.ts +1 -0
  156. package/dist/client-v2/ai-employees/chatbox/components/ChatBoxUnreadBadge.d.ts +17 -0
  157. package/dist/client-v2/ai-employees/chatbox/components/Conversations.d.ts +9 -1
  158. package/dist/client-v2/ai-employees/chatbox/components/MessageRenderers.d.ts +1 -1
  159. package/dist/client-v2/ai-employees/chatbox/components/Messages.d.ts +5 -1
  160. package/dist/client-v2/ai-employees/chatbox/components/ModelSwitcher.d.ts +4 -0
  161. package/dist/client-v2/ai-employees/chatbox/components/Sender.d.ts +33 -1
  162. package/dist/client-v2/ai-employees/chatbox/components/index.d.ts +1 -0
  163. package/dist/client-v2/ai-employees/chatbox/hooks/reasoning-stream.d.ts +10 -0
  164. package/dist/client-v2/ai-employees/chatbox/hooks/useChat.d.ts +8 -5
  165. package/dist/client-v2/ai-employees/chatbox/hooks/useChatBoxActions.d.ts +3 -2
  166. package/dist/client-v2/ai-employees/chatbox/hooks/useChatBoxEffect.d.ts +2 -1
  167. package/dist/client-v2/ai-employees/chatbox/hooks/useChatConversationActions.d.ts +3 -2
  168. package/dist/client-v2/ai-employees/chatbox/hooks/useChatMessageActions.d.ts +4 -2
  169. package/dist/client-v2/ai-employees/chatbox/hooks/useToolCallActions.d.ts +3 -1
  170. package/dist/client-v2/ai-employees/chatbox/hooks/useUploadFiles.d.ts +13 -3
  171. package/dist/client-v2/ai-employees/chatbox/hooks/useWorkflowTasks.d.ts +3 -2
  172. package/dist/client-v2/ai-employees/chatbox/index.d.ts +17 -0
  173. package/dist/client-v2/ai-employees/chatbox/roles.d.ts +2 -153
  174. package/dist/client-v2/ai-employees/chatbox/stores/chat-box.d.ts +46 -33
  175. package/dist/client-v2/ai-employees/chatbox/stores/chat-conversations.d.ts +7 -7
  176. package/dist/client-v2/ai-employees/chatbox/stores/chat-messages.d.ts +23 -18
  177. package/dist/client-v2/ai-employees/chatbox/stores/chat-sender.d.ts +43 -0
  178. package/dist/client-v2/ai-employees/chatbox/stores/chat-tool-call.d.ts +6 -5
  179. package/dist/client-v2/ai-employees/chatbox/stores/chat-tools.d.ts +11 -5
  180. package/dist/client-v2/ai-employees/chatbox/stores/mounted-chat-boxes.d.ts +20 -0
  181. package/dist/client-v2/ai-employees/chatbox/stores/runtime.d.ts +43 -0
  182. package/dist/client-v2/ai-employees/chatbox/stores/workflow-tasks.d.ts +22 -10
  183. package/dist/client-v2/ai-employees/chatbox/upload.d.ts +19 -0
  184. package/dist/client-v2/ai-employees/chatbox/utils.d.ts +28 -4
  185. package/dist/client-v2/ai-employees/frontend-tools.d.ts +11 -0
  186. package/dist/client-v2/ai-employees/tools/SuggestionsOptionsCard.d.ts +1 -1
  187. package/dist/client-v2/ai-employees/tools/WorkflowTaskOutputCard.d.ts +1 -1
  188. package/dist/client-v2/ai-employees/types.d.ts +30 -0
  189. package/dist/client-v2/block/ai-chat-box/AIChatBoxBlockModel.d.ts +21 -0
  190. package/dist/client-v2/block/ai-chat-box/AIChatBoxCoreModel.d.ts +13 -0
  191. package/dist/client-v2/{ai-employees/chatbox/components/DebugPanel.d.ts → block/ai-chat-box/components/AIChatBoxCoreView.d.ts} +1 -1
  192. package/dist/client-v2/block/ai-chat-box/components/AIChatBoxView.d.ts +12 -0
  193. package/dist/client-v2/block/ai-chat-box/index.d.ts +14 -0
  194. package/dist/client-v2/block/ai-chat-box/settings.d.ts +12 -0
  195. package/dist/client-v2/block/ai-chat-box/sub-models.d.ts +26 -0
  196. package/dist/client-v2/block/ai-chat-box/types.d.ts +38 -0
  197. package/dist/client-v2/block/ai-chat-box/utils.d.ts +26 -0
  198. package/dist/client-v2/index.d.ts +3 -5
  199. package/dist/client-v2/index.js +3 -3
  200. package/dist/client-v2/llm-providers/forms.d.ts +2 -0
  201. package/dist/client-v2/llm-providers/index.d.ts +1 -0
  202. package/dist/client-v2/llm-services/model-select.d.ts +33 -0
  203. package/dist/client-v2/llm-services/utils.d.ts +1 -0
  204. package/dist/client-v2/manager/ai-manager.d.ts +10 -3
  205. package/dist/client-v2/manager/frontend-tool-registry.d.ts +30 -0
  206. package/dist/client-v2/models/ai-employees/AIEmployeeActionModel.d.ts +4 -1
  207. package/dist/client-v2/models/ai-employees/AIEmployeeShortcutModel.d.ts +8 -0
  208. package/dist/client-v2/pages/EmployeesPage.d.ts +12 -0
  209. package/dist/client-v2/pages/LLMServicesPage.d.ts +9 -4
  210. package/dist/client-v2/repositories/AIConfigRepository.d.ts +2 -0
  211. package/dist/client-v2/runjs/registerAIEmployeeRunJSFacade.d.ts +1 -0
  212. package/dist/client-v2/workflow/types.d.ts +1 -0
  213. package/dist/collections/ai-employees.d.ts +1 -0
  214. package/dist/collections/ai-employees.js +1 -0
  215. package/dist/common/ai-employee-validation.d.ts +17 -0
  216. package/dist/common/ai-employee-validation.js +67 -0
  217. package/dist/common/error-codes.d.ts +14 -0
  218. package/dist/common/error-codes.js +51 -0
  219. package/dist/common/frontend-tools.d.ts +26 -0
  220. package/dist/common/frontend-tools.js +57 -0
  221. package/dist/common/llm-service-models.d.ts +16 -0
  222. package/dist/common/llm-service-models.js +84 -0
  223. package/dist/externalVersion.js +19 -17
  224. package/dist/locale/de-DE.json +2 -1
  225. package/dist/locale/en-US.json +87 -5
  226. package/dist/locale/es-ES.json +2 -1
  227. package/dist/locale/fr-FR.json +2 -1
  228. package/dist/locale/hu-HU.json +2 -1
  229. package/dist/locale/id-ID.json +2 -1
  230. package/dist/locale/it-IT.json +2 -1
  231. package/dist/locale/ja-JP.json +2 -1
  232. package/dist/locale/ko-KR.json +2 -1
  233. package/dist/locale/nl-NL.json +2 -1
  234. package/dist/locale/pt-BR.json +2 -1
  235. package/dist/locale/ru-RU.json +2 -1
  236. package/dist/locale/tr-TR.json +2 -1
  237. package/dist/locale/uk-UA.json +2 -1
  238. package/dist/locale/vi-VN.json +2 -1
  239. package/dist/locale/zh-CN.json +87 -5
  240. package/dist/locale/zh-TW.json +2 -1
  241. package/dist/node_modules/@langchain/mistralai/package.json +1 -1
  242. package/dist/node_modules/@langchain/xai/package.json +1 -1
  243. package/dist/node_modules/fs-extra/package.json +1 -1
  244. package/dist/node_modules/jsonrepair/package.json +1 -1
  245. package/dist/node_modules/just-bash/package.json +1 -1
  246. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  247. package/dist/node_modules/openai/package.json +1 -1
  248. package/dist/node_modules/zod/package.json +1 -1
  249. package/dist/server/ai-employees/ai-conversations.d.ts +4 -1
  250. package/dist/server/ai-employees/ai-conversations.js +2 -0
  251. package/dist/server/ai-employees/ai-employee.d.ts +32 -2
  252. package/dist/server/ai-employees/ai-employee.js +367 -79
  253. package/dist/server/ai-employees/ai-knowledge-base.d.ts +21 -1
  254. package/dist/server/ai-employees/ai-knowledge-base.js +87 -12
  255. package/dist/server/ai-employees/middleware/conversation.js +28 -22
  256. package/dist/server/ai-employees/middleware/index.d.ts +1 -0
  257. package/dist/server/ai-employees/middleware/index.js +2 -0
  258. package/dist/server/ai-employees/middleware/tool-result-integrity.d.ts +22 -0
  259. package/dist/server/ai-employees/middleware/tool-result-integrity.js +211 -0
  260. package/dist/server/ai-employees/reasoning-stream-state.d.ts +23 -0
  261. package/dist/server/ai-employees/reasoning-stream-state.js +63 -0
  262. package/dist/server/collections/ai-conversations.js +5 -0
  263. package/dist/server/document-loader/constants.js +1 -1
  264. package/dist/server/features/knowledge-base.d.ts +2 -0
  265. package/dist/server/frontend-tools.d.ts +25 -0
  266. package/dist/server/frontend-tools.js +171 -0
  267. package/dist/server/llm-providers/common/reasoning.js +18 -10
  268. package/dist/server/llm-providers/deepseek/index.d.ts +10 -0
  269. package/dist/server/llm-providers/deepseek/index.js +32 -0
  270. package/dist/server/llm-providers/deepseek/provider.d.ts +57 -0
  271. package/dist/server/llm-providers/deepseek/provider.js +320 -0
  272. package/dist/server/llm-providers/deepseek/reasoning.d.ts +83 -0
  273. package/dist/server/llm-providers/deepseek/reasoning.js +285 -0
  274. package/dist/server/llm-providers/mistral.d.ts +1 -1
  275. package/dist/server/llm-providers/provider.d.ts +1 -0
  276. package/dist/server/llm-providers/provider.js +3 -0
  277. package/dist/server/llm-providers/shengsuanyun.d.ts +29 -0
  278. package/dist/server/llm-providers/shengsuanyun.js +114 -0
  279. package/dist/server/manager/ai-feature-manager.js +1 -1
  280. package/dist/server/manager/ai-manager.d.ts +3 -0
  281. package/dist/server/manager/ai-manager.js +7 -2
  282. package/dist/server/manager/work-context-handler.js +10 -3
  283. package/dist/server/migrations/20260501000000-ai-employee-knowledge-base-retrieval-strategy.d.ts +14 -0
  284. package/dist/server/migrations/20260501000000-ai-employee-knowledge-base-retrieval-strategy.js +49 -0
  285. package/dist/server/plugin.d.ts +1 -0
  286. package/dist/server/plugin.js +31 -0
  287. package/dist/server/resource/aiConversations.d.ts +2 -0
  288. package/dist/server/resource/aiConversations.js +33 -3
  289. package/dist/server/resource/aiEmployees.d.ts +2 -0
  290. package/dist/server/resource/aiEmployees.js +96 -0
  291. package/dist/server/resource/aiWorkflowTasks.js +9 -1
  292. package/dist/server/resource/llmServices.d.ts +11 -0
  293. package/dist/server/resource/llmServices.js +85 -0
  294. package/dist/server/types/ai-message.type.d.ts +4 -0
  295. package/dist/server/types/knowledge-base.type.d.ts +8 -3
  296. package/dist/server/workflow/nodes/employee/files.d.ts +1 -1
  297. package/dist/server/workflow/nodes/employee/files.js +48 -1
  298. package/dist/server/workflow/nodes/employee/index.js +7 -2
  299. package/dist/server/workflow/nodes/employee/types.d.ts +1 -0
  300. package/dist/swagger/common.d.ts +143 -0
  301. package/dist/swagger/common.js +144 -0
  302. package/dist/swagger/employees.d.ts +301 -0
  303. package/dist/swagger/employees.js +131 -0
  304. package/dist/swagger/index.d.ts +1617 -0
  305. package/dist/swagger/index.js +62 -0
  306. package/dist/swagger/llm.d.ts +563 -0
  307. package/dist/swagger/llm.js +255 -0
  308. package/dist/swagger/schemas.d.ts +757 -0
  309. package/dist/swagger/schemas.js +392 -0
  310. package/package.json +2 -2
  311. package/dist/ai/docs/nocobase/ai-employees/knowledge-base/vector-store.md +0 -24
  312. package/dist/ai/docs/nocobase/data-sources/development/index.md +0 -6
  313. package/dist/client/372.40eb52905e3f3049.js +0 -10
  314. package/dist/client/681.399948c18d753667.js +0 -10
  315. package/dist/client/705.380279da896021fb.js +0 -10
  316. package/dist/client-v2/372.8cc3fde09c9bec77.js +0 -10
  317. package/dist/client-v2/406.341be51205c674e0.js +0 -10
  318. package/dist/client-v2/681.082f4f1c7b841983.js +0 -10
  319. package/dist/client-v2/705.1d10027ff8cfdf79.js +0 -10
  320. package/dist/client-v2/ai-employees/chatbox/stores/create-selectors.d.ts +0 -46
  321. package/dist/client-v2/ai-employees/chatbox/utils/normalizeTriggerTaskOptions.d.ts +0 -19
  322. package/dist/client-v2/debug-logger.d.ts +0 -52
  323. package/dist/server/llm-providers/deepseek.d.ts +0 -40
  324. package/dist/server/llm-providers/deepseek.js +0 -174
@@ -12,7 +12,7 @@ Building on the File Manager plugin, this adds support for S3 protocol-compatibl
12
12
 
13
13
  1. Client-side upload: The file upload process does not go through the NocoBase server, but directly connects to the file storage service, providing a more efficient and faster upload experience.
14
14
 
15
- 2. Private access: When accessing files, all URLs are signed temporary authorized addresses, ensuring the security and timeliness of file access.
15
+ 2. Private access: Signed URLs with an expiration are used by default. Unsigned URLs can also be generated for public buckets.
16
16
 
17
17
 
18
18
  ## Use Cases
@@ -39,6 +39,57 @@ Building on the File Manager plugin, this adds support for S3 protocol-compatibl
39
39
 
40
40
  ![](https://static-docs.nocobase.com/20250413190828536.png)
41
41
 
42
+ ## URL Configuration
43
+
44
+ In addition to the File Manager's common NocoBase URL, Original URL, and Allow public access options, S3 Pro lets you configure upload and access URL formats separately and choose whether to use signed URLs. See [Storage Engine Overview](./index.md#file-urls-and-access-control) for the common options.
45
+
46
+ These options control different stages:
47
+
48
+ - NocoBase URL / Original URL controls which address the file record returns
49
+ - Allow public access controls whether file record view permissions are checked when a NocoBase URL is accessed
50
+ - Do not use signed URL controls whether the object storage service validates a URL signature
51
+
52
+ These settings can be combined independently. The recommended default is NocoBase URL, Allow public access unchecked, and signed URLs enabled.
53
+
54
+ ![S3 Pro URL configuration](https://static-docs.nocobase.com/20260723221441.png)
55
+
56
+ ### How to choose
57
+
58
+ | Use case | File URL | Allow public access | Do not use signed URL |
59
+ | --- | --- | --- | --- |
60
+ | Files must follow role and data permissions while the bucket remains private | NocoBase URL | Unchecked | Unchecked |
61
+ | A public NocoBase file address is required while the bucket remains private | NocoBase URL | Checked | Unchecked |
62
+ | An external service needs temporary access to the storage address | Original URL | Not applicable | Unchecked; configure Access URL expiration |
63
+ | A public bucket or CDN requires an unsigned original address | Original URL | Not applicable | Checked |
64
+
65
+ ### Upload URL format
66
+
67
+ Upload URL format controls the S3 URL used by the client when uploading files. Select the format supported by your storage service. The configuration form displays an example based on the current Endpoint, Bucket, and path:
68
+
69
+ - Bucket as subdomain: `https://bucket-name.s3.example.com/path/to/object`
70
+ - Bucket as subpath: `https://s3.example.com/bucket-name/path/to/object`
71
+ - Ignore bucket: `https://upload.example.com/path/to/object`
72
+
73
+ ### Access URL format
74
+
75
+ Access URL format controls whether the Bucket appears in the domain, in the path, or not at all when S3 Pro generates a file access address. It provides the same three formats as Upload URL format, but can be configured separately—for example, uploads can use an S3 Endpoint while access uses a CDN domain that does not include the Bucket.
76
+
77
+ This option affects Original URLs and the storage address that a NocoBase URL ultimately redirects to, but it does not change the NocoBase URL format itself.
78
+
79
+ ### Do not use signed URL
80
+
81
+ S3 Pro uses signed URLs by default. A generated Original URL includes signature parameters, for example:
82
+
83
+ ```text
84
+ https://bucket-name.s3.example.com/path/to/object?X-Amz-Signature=xxxx
85
+ ```
86
+
87
+ The signed URL remains valid for the configured Access URL expiration, and the bucket can remain private. When NocoBase URL is used, NocoBase generates or redirects to a signed address after the permission check succeeds.
88
+
89
+ When Do not use signed URL is checked, S3 Pro generates an address without signature parameters. The bucket and uploaded objects must then allow public read access, and Access URL expiration no longer takes effect.
90
+
91
+ Do not use signed URL only controls whether the storage service validates a signature; it does not change NocoBase file record permissions. If NocoBase URL is selected and Allow public access is unchecked, the request must still pass the NocoBase permission check first.
92
+
42
93
 
43
94
 
44
95
  ## Service Provider Configuration
@@ -146,9 +197,9 @@ Building on the File Manager plugin, this adds support for S3 protocol-compatibl
146
197
  ![](https://static-docs.nocobase.com/file-storage-s3-pro-1735355971345.png)
147
198
 
148
199
 
149
- #### Public Access (Optional)
200
+ #### Unsigned Public Access (Optional)
150
201
 
151
- This is an optional configuration. Configure it when you need to make uploaded files completely public.
202
+ Configure this only when unsigned URLs are required, because the Bucket and uploaded objects must allow public read access. If you only need to share a public NocoBase URL, check Allow public access and keep signed URLs enabled; the Bucket does not need to be public.
152
203
 
153
204
  1. Go to the Permissions panel, scroll down to Object Ownership, click edit, and enable ACLs.
154
205
 
@@ -162,7 +213,7 @@ This is an optional configuration. Configure it when you need to make uploaded f
162
213
  ![](https://static-docs.nocobase.com/file-storage-s3-pro-1735355971668.png)
163
214
 
164
215
 
165
- 3. Check Public access in NocoBase.
216
+ 3. Check Do not use signed URL in NocoBase.
166
217
 
167
218
 
168
219
  #### Thumbnail Configuration (Optional)
@@ -193,7 +244,7 @@ This configuration is optional and is used to optimize image preview size or eff
193
244
  5. In the NocoBase configuration, there are several points to note:
194
245
  1. `Thumbnail rule`: Fill in image processing-related parameters, for example, `?width=100`. For details, refer to the [AWS documentation](https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/use-supported-query-param-edits.html).
195
246
  2. `Access endpoint`: Fill in the value of Outputs -> ApiEndpoint after deployment.
196
- 3. `Full access URL style`: You need to check **Ignore** (because the bucket name was already filled in during configuration, it is no longer needed for access).
247
+ 3. Access URL format: Select **Ignore bucket** because the bucket name is already included in the configuration and is not needed in the access URL.
197
248
 
198
249
 
199
250
  ![](https://static-docs.nocobase.com/20250414152135514.png)
@@ -312,7 +363,7 @@ This configuration is optional and should only be used when you need to optimize
312
363
 
313
364
  1. Fill in the `Thumbnail rule` related parameters. For specific parameter settings, refer to [Image Processing Parameters](https://www.alibabacloud.com/help/en/object-storage-service/latest/process-images).
314
365
 
315
- 2. `Full upload URL style` and `Full access URL style` can be kept the same.
366
+ 2. Upload URL format and Access URL format can use the same setting.
316
367
 
317
368
  #### Configuration Example
318
369
 
@@ -357,7 +408,7 @@ This configuration is optional and should only be used when you need to optimize
357
408
  - **AccessKey ID** and **AccessKey Secret** are the values saved in the previous step.
358
409
  - **Region**: A self-hosted MinIO does not have the concept of a Region, so it can be configured as "auto".
359
410
  - **Endpoint**: Fill in the domain name or IP address of your deployment.
360
- - Full access URL style must be set to Path-Style.
411
+ - Set Access URL format to Bucket as subpath.
361
412
 
362
413
  #### Configuration Example
363
414
 
@@ -96,8 +96,11 @@ services:
96
96
  - `./storage` must be mounted into both the `app` and `nginx` containers so they can share proxy config, static assets, and uploaded files
97
97
  - The `nginx` container should wait until `nocobase.conf` is generated, then link it to `/etc/nginx/conf.d/default.conf` with `ln -sf`
98
98
  - The generated config forwards both the `/files/` route under `APP_PUBLIC_PATH` and the root-level `/files/` route to NocoBase for authenticated file previews and downloads
99
+ - Before Nginx returns a legacy `/storage/uploads/` file through `alias`, the generated config uses `auth_request` to ask NocoBase to verify the login state; anonymous access returns `401` by default
99
100
  - If you use an external Nginx container, let the `nginx` container handle the host port mapping. For testing, you can start with `13000:80`; in production, you usually expose the host `80` and `443` ports directly, while the `app` service does not need to expose its port to the host
100
101
 
102
+ If an existing program depends on anonymous access to `/storage/uploads/`, add `LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS=true` to `app.environment` and restart the application container. Do not remove or rewrite the `auth_request` in the generated config; the auth endpoint uses this variable to decide whether anonymous access is allowed. This variable does not change record-level permissions for `/files/`.
103
+
101
104
  ## If you use a local host Nginx
102
105
 
103
106
  If your Nginx is installed directly on the host instead of running in a Docker container, it is better to use a separate `docker-compose.yml`. In this setup, the `app` service must expose a host port directly, and the proxy-related environment variables should use host-side values.
@@ -171,7 +174,7 @@ sudo systemctl reload nginx
171
174
 
172
175
  If your host Nginx does not use the `conf.d` directory, replace the link target with your own config path. Usually it is safer to keep `nocobase.conf` as a file included from the `http {}` context instead of copying its content manually.
173
176
 
174
- If you maintain Nginx yourself instead of using the generated config, make sure `/files/` and the corresponding route under `APP_PUBLIC_PATH` are forwarded to NocoBase before the SPA fallback rules. See [Nginx Reverse Proxy](../../nocobase-cli/production/reverse-proxy/nginx.md) for a complete example.
177
+ If you maintain Nginx yourself instead of using the generated config, make sure `/files/` and the corresponding route under `APP_PUBLIC_PATH` are forwarded to NocoBase before the SPA fallback rules. When serving `/storage/uploads/` through `alias`, you must also configure `auth_request` so the static directory cannot bypass the application login check. See [Nginx Reverse Proxy](../../nocobase-cli/production/reverse-proxy/nginx.md) for a complete example.
175
178
 
176
179
  ## Related links
177
180
 
@@ -660,6 +660,8 @@ If you also want to enable HTTPS, configure `443` and the certificate on the hos
660
660
 
661
661
  The `location /` block in this root-path configuration also proxies `/api/`, `/ws`, and `/files/`. If you split static assets from application routes, make sure `/files/` is still forwarded to NocoBase and is not handled as a static directory.
662
662
 
663
+ Before returning a legacy `/storage/uploads/` file, the built-in Nginx asks NocoBase to verify the login state; anonymous access returns `401` by default. If a program already depended on anonymous access to these legacy URLs before an upgrade, add `LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS=true` to `app.environment` and restart the container. Keep forwarding this path from the host Nginx to the container. Do not expose the host upload directory directly with another `alias`, because that would bypass the check.
664
+
663
665
  ### Subpath deployment
664
666
 
665
667
  If you want to deploy the app under a subpath, such as `https://your_domain.com/nocobase/`, configure the `APP_PUBLIC_PATH` environment variable first:
@@ -107,6 +107,18 @@ NocoBase uses cookies to maintain login state and to authorize [stable file URLs
107
107
  Prefer serving the pages and the API from the same origin through a reverse proxy and leaving `API_BASE_URL` empty.
108
108
  :::
109
109
 
110
+ ### LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS
111
+
112
+ Controls whether legacy local file URLs under `/storage/uploads/` allow anonymous access. The default is `false`, so only signed-in users can access them.
113
+
114
+ If an existing integration depends on public access through these URLs, explicitly enable compatibility mode:
115
+
116
+ ```bash
117
+ LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS=true
118
+ ```
119
+
120
+ Restart the application after changing this variable. It affects only legacy `/storage/uploads/` URLs and does not change record-level permissions for `/files/`. Public access may expose uploaded files, so enable it only after confirming that the files are safe to publish.
121
+
110
122
  ### CORS_ORIGIN_WHITELIST
111
123
 
112
124
  Whitelist of origins allowed to access the API cross-origin with credentials (cookies). Multiple origins are separated by commas. Empty by default.
@@ -392,7 +404,7 @@ SERVER_REQUEST_WHITELIST=api.example.com,*.trusted.com,10.0.0.0/8,127.0.0.1
392
404
 
393
405
  **When not set**: All `http` / `https` outbound requests are allowed to keep existing behavior. However, if the target is a loopback, private, link-local, or metadata address, or if a domain resolves to one of these addresses, the server logs a warning.
394
406
 
395
- **When set**: Only requests whose host matches a whitelist entry are permitted; non-matching requests will raise an error. Future versions may gradually tighten the default behavior. If your deployment needs to access internal services, configure an explicit whitelist in advance.
407
+ **When set**: The initial request and every redirect destination must match a whitelist entry; non-matching requests will raise an error before the next request is sent. Future versions may gradually tighten the default behavior. If your deployment needs to access internal services, configure an explicit whitelist in advance.
396
408
 
397
409
  Supported formats:
398
410
 
@@ -135,7 +135,7 @@ Taking `test2` as an example, key directories related to Caddy usually include:
135
135
  In other words, handwritten configuration usually needs to cover at least the following types of entries:
136
136
 
137
137
  - `v`: Redirect `/v` to `/v/`
138
- - `uploads`: Expose upload directory
138
+ - `uploads`: Expose the upload directory after NocoBase authentication
139
139
  - `dist`: Expose the front-end build product directory
140
140
  - `oauth well-known`: Handle OAuth discovery paths
141
141
  - `openid well-known`: Handle OpenID discovery paths
@@ -164,10 +164,31 @@ c.local.nocobase.com {
164
164
  }
165
165
 
166
166
  handle_path /storage/uploads/* {
167
- root * NB_CLI_ROOT/test2/storage/uploads
168
- header Cache-Control public
169
- header X-Content-Type-Options nosniff
170
- file_server
167
+ route {
168
+ request_header -X-NocoBase-Auth-Set-Cookie
169
+ forward_auth host.docker.internal:56575 {
170
+ uri /api/auth:checkLegacyFileAccess
171
+ header_up X-App {query.__appName}
172
+ copy_headers Set-Cookie>X-NocoBase-Auth-Set-Cookie
173
+ }
174
+
175
+ @refreshedAuth header X-NocoBase-Auth-Set-Cookie *
176
+ header @refreshedAuth Set-Cookie {header.X-NocoBase-Auth-Set-Cookie}
177
+ header Cache-Control "private, no-store"
178
+ header Content-Security-Policy sandbox
179
+ header X-Content-Type-Options nosniff
180
+ header Content-Disposition inline
181
+
182
+ @activeUploadedContent path_regexp activeUploadedContent (?i)\.(?:htm|html|pdf|svg|svgz|xht|xhtml|xml|xsl|xslt)$
183
+ header @activeUploadedContent Content-Disposition attachment
184
+ @download query download=1
185
+ header @download Content-Disposition attachment
186
+ @markdown path_regexp markdown (?i)\.md$
187
+ header @markdown Content-Type text/markdown
188
+
189
+ root * NB_CLI_ROOT/test2/storage/uploads
190
+ file_server
191
+ }
171
192
  }
172
193
 
173
194
  handle_path /dist/* {
@@ -258,6 +279,8 @@ This is usually less likely to miss details related to `/files/`, WebSockets, st
258
279
 
259
280
  :::warning Note
260
281
 
282
+ URLs under `/storage/uploads/` are legacy local file URLs and must pass NocoBase sign-in authentication by default. Do not expose the upload directory with `file_server` alone, because that bypasses access control. The example above uses `forward_auth` to call the NocoBase auth endpoint before Caddy sends the file. Set `LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS=true` and restart the application only when anonymous access is explicitly required for compatibility.
283
+
261
284
  `/files/` is an application route that must pass through NocoBase authorization. Do not handle it as a static directory or let it fall through to the SPA fallback. Forward it to the NocoBase backend and place the rule before `handle_path /*` and other front-end fallback rules.
262
285
 
263
286
  If `APP_PUBLIC_PATH=/nocobase/` is configured, also forward `/nocobase/files/*`. Keep the root-level `/files/*` rule for compatibility with existing file URLs.
@@ -111,6 +111,7 @@ in:
111
111
  - `NB_CLI_ROOT/test2/storage/...` The following are the application's own static resources and upload directories
112
112
  - `app.conf` can be changed, but the NocoBase managed block must be retained
113
113
  - `index-v1.html` and `index-v2.html` will automatically rewrite resource addresses according to the current env subpath, active client version, and `CDN_BASE_URL`
114
+ - `maps-http.conf` and `uploads-location.conf` protect legacy `/storage/uploads/` URLs together: the former resolves the sub-application parameter, and the latter runs an `auth_request` login check before Nginx returns a local file
114
115
 
115
116
  :::warning note
116
117
 
@@ -154,6 +155,11 @@ location / {
154
155
  For a CLI-hosted application like `test2`, a structure closer to a real deployment would usually look like this:
155
156
 
156
157
  ```nginx
158
+ map $request_uri $legacy_file_app {
159
+ default "";
160
+ ~[?&]__appName=(?<legacy_file_app_name>[A-Za-z0-9_-]+)(?:&|$) $legacy_file_app_name;
161
+ }
162
+
157
163
  server {
158
164
  listen 80;
159
165
  server_name c.local.nocobase.com;
@@ -165,6 +171,19 @@ server {
165
171
  include NB_CLI_ROOT/.nocobase/proxy/nginx/snippets/mime-types.conf;
166
172
  include NB_CLI_ROOT/.nocobase/proxy/nginx/snippets/gzip.conf;
167
173
 
174
+ location = /_nocobase_legacy_file_auth {
175
+ internal;
176
+ proxy_pass http://127.0.0.1:56575/api/auth:checkLegacyFileAccess;
177
+ proxy_pass_request_body off;
178
+ proxy_set_header Content-Length "";
179
+ proxy_set_header Cookie $http_cookie;
180
+ proxy_set_header Authorization $http_authorization;
181
+ proxy_set_header X-App $legacy_file_app;
182
+ proxy_set_header X-Original-URI $request_uri;
183
+ proxy_set_header Host $final_host;
184
+ proxy_set_header X-Forwarded-Proto $upstream_x_forwarded_proto;
185
+ }
186
+
168
187
  location /storage/uploads/ {
169
188
  alias NB_CLI_ROOT/test2/storage/uploads/;
170
189
  include NB_CLI_ROOT/.nocobase/proxy/nginx/snippets/uploads-location.conf;
@@ -216,6 +235,8 @@ server {
216
235
  }
217
236
  ```
218
237
 
238
+ The `map` directive must be placed in Nginx's `http {}` context, not inside `server {}` or `location {}`. It identifies a sub-application from the `__appName` query parameter in a legacy file URL. The `/api/` segment in `proxy_pass` must match the application's actual `API_BASE_PATH`; when `APP_PUBLIC_PATH` is configured, use the same prefix for both the upload location and auth endpoint.
239
+
219
240
  There are two key points here:
220
241
 
221
242
  - `NB_CLI_ROOT/.nocobase/proxy/nginx/...` The following are agent auxiliary files maintained by CLI
@@ -243,6 +264,10 @@ This is usually less likely to miss details related to `/files/`, WebSockets, st
243
264
 
244
265
  If `APP_PUBLIC_PATH=/nocobase/` is configured, also forward `/nocobase/files/`. Keep the root-level `/files/` rule for compatibility with existing file URLs.
245
266
 
267
+ Legacy `/storage/uploads/` URLs also require sign-in by default. When serving files directly with `alias`, run an `auth_request` to NocoBase's `auth:checkLegacyFileAccess` endpoint first. Configuring only the static directory bypasses the login check. The `uploads-location.conf` snippet in the example already contains the `auth_request` directive; if you do not use the CLI snippets, add the equivalent logic to the upload location yourself.
268
+
269
+ If an existing integration must access legacy URLs anonymously, set `LEGACY_LOCAL_STORAGE_PUBLIC_ACCESS=true` for the NocoBase application and restart it. The auth endpoint evaluates this setting, so do not regenerate or remove the Nginx `auth_request` configuration. The switch affects only `/storage/uploads/` and does not change record-level permissions for `/files/`.
270
+
246
271
  :::
247
272
 
248
273
  ## How to handle HTTPS
@@ -336,9 +336,8 @@ The “Data type” column comes from built-in classification. System base data
336
336
  | Table | Description | Data type | Default migration strategy | Version control | Backup/restore |
337
337
  | --- | --- | --- | --- | --- | --- |
338
338
  | `aiKnowledgeBaseDocs` | Document chunks and index metadata stored in knowledge bases | Business runtime data | Schema-only | Not included | Backed up |
339
- | `aiKnowledgeBase` | Knowledge-base type, external ID, and base information | Business runtime data | Schema-only | Not included | Backed up |
339
+ | `aiKnowledgeBase` | Knowledge-base type, external ID, vector database, LLM service, embedding model, and base information | Business runtime data | Schema-only | Not included | Backed up |
340
340
  | `aiVectorDatabases` | Vector database service and connection configuration | Business runtime data | Schema-only | Not included | Backed up |
341
- | `aiVectorStoreConfig` | Relationship between vector database connections and embedding models | Business runtime data | Schema-only | Not included | Backed up |
342
341
 
343
342
  ### Environment variables
344
343
 
@@ -6,7 +6,7 @@ keywords: "plugin build,plugin package,yarn build,tar,build.config.ts,Rsbuild,ts
6
6
 
7
7
  # Build and Package
8
8
 
9
- After plugin development is complete, you need to go through two steps — build (compile source code) and package (generate `.tar.gz`) — before distributing it to other NocoBase applications.
9
+ After plugin development is complete, you need to go through two steps — build (compile source code) and package (generate `.tgz`) — before distributing it to other NocoBase applications.
10
10
 
11
11
  ## Build Plugin
12
12
 
@@ -26,13 +26,13 @@ If the plugin is created in a source code repository, the first build will trigg
26
26
 
27
27
  ## Package Plugin
28
28
 
29
- Packaging compresses the build artifacts into a `.tar.gz` file for easy upload to other environments:
29
+ Packaging compresses the build artifacts into a `.tgz` file for easy upload to other environments:
30
30
 
31
31
  ```bash
32
32
  yarn nocobase tar @my-project/plugin-hello
33
33
  ```
34
34
 
35
- The package file is output to `storage/tar/@my-project/plugin-hello.tar.gz` by default.
35
+ The package file is output to `storage/tar/` by default, named `<package-name>-<version>.tgz` — for example, `storage/tar/@my-project/plugin-hello-0.1.0.tgz`.
36
36
 
37
37
  You can also combine build and package into one step using the `--tar` flag:
38
38
 
@@ -42,7 +42,13 @@ yarn build @my-project/plugin-hello --tar
42
42
 
43
43
  ## Upload to Other NocoBase Applications
44
44
 
45
- Upload and extract the `.tar.gz` file to the target application's `./storage/plugins` directory. For detailed steps, see [Install and Upgrade Plugins](../get-started/install-upgrade-plugins.mdx).
45
+ Upload and extract the `.tgz` file to the target application's `./storage/plugins` directory. For detailed steps, see [Install and Upgrade Plugins](../get-started/install-upgrade-plugins.mdx).
46
+
47
+ If the target application was created with the NocoBase CLI (`nb init`), you can also import it directly with `nb plugin import` instead of extracting it manually:
48
+
49
+ ```bash
50
+ nb plugin import /your/path/plugin-hello-0.1.0.tgz
51
+ ```
46
52
 
47
53
  ### Enable a Plugin by Default
48
54
 
@@ -12,7 +12,7 @@ This page collects common pitfalls when developing client plugins. If you run in
12
12
 
13
13
  ### Plugin not visible in the Plugin Manager after creation
14
14
 
15
- Make sure you ran `yarn pm create` instead of manually creating the directory. `yarn pm create` not only generates files but also registers the plugin in the `applicationPlugins` database table. If you created the directory manually, run `yarn nocobase upgrade` to trigger a rescan.
15
+ Make sure you ran `yarn pm create` instead of manually creating the directory. Besides generating files, `yarn pm create` updates `tsconfig.paths.json` and runs `yarn postinstall`, which links the plugin into `node_modules` and regenerates the client plugin index so the application can discover it. A manually created directory skips that step — run `yarn nocobase upgrade` to rescan and register it in the `applicationPlugins` table.
16
16
 
17
17
  ### No changes on the page after enabling a plugin
18
18
 
@@ -49,6 +49,8 @@ yarn pm create @my-project/plugin-simple-action
49
49
 
50
50
  For detailed instructions, see [Writing Your First Plugin](../../write-your-first-plugin).
51
51
 
52
+ Next, start development mode so your code changes hot-reload: for a project created by `nb init`, run `nb source dev` from the project root (`<app-path>`); for a NocoBase source repository you cloned yourself, run `yarn dev` from the source root.
53
+
52
54
  ## Step 2: Create Action Models
53
55
 
54
56
  Each action needs to declare the scenario it appears in via the `static scene` property:
@@ -51,6 +51,8 @@ yarn pm create @my-project/plugin-simple-block
51
51
 
52
52
  This will generate a basic file structure under `packages/plugins/@my-project/plugin-simple-block`. For detailed instructions, see [Writing Your First Plugin](../../write-your-first-plugin).
53
53
 
54
+ Next, start development mode so your code changes hot-reload: for a project created by `nb init`, run `nb source dev` from the project root (`<app-path>`); for a NocoBase source repository you cloned yourself, run `yarn dev` from the source root.
55
+
54
56
  ## Step 2: Create the Block Model
55
57
 
56
58
  Create `src/client-v2/models/SimpleBlockModel.tsx`. This is the core of the entire plugin -- defining how the block renders and how it's configured.
@@ -52,6 +52,8 @@ yarn pm create @my-project/plugin-field-simple
52
52
 
53
53
  For detailed instructions, see [Writing Your First Plugin](../../write-your-first-plugin).
54
54
 
55
+ Next, start development mode so your code changes hot-reload: for a project created by `nb init`, run `nb source dev` from the project root (`<app-path>`); for a NocoBase source repository you cloned yourself, run `yarn dev` from the source root.
56
+
55
57
  ## Step 2: Create the Field Model
56
58
 
57
59
  Create `src/client-v2/models/DisplaySimpleFieldModel.tsx`. This is the core of the plugin -- defining how the field renders and which field interface it binds to.
@@ -55,6 +55,8 @@ yarn pm create @my-project/plugin-custom-table-block-resource
55
55
 
56
56
  For detailed instructions, see [Writing Your First Plugin](../../write-your-first-plugin).
57
57
 
58
+ Next, start development mode so your code changes hot-reload: for a project created by `nb init`, run `nb source dev` from the project root (`<app-path>`); for a NocoBase source repository you cloned yourself, run `yarn dev` from the source root.
59
+
58
60
  ## Step 2: Define the Data Table (Server-Side)
59
61
 
60
62
  Create `src/server/collections/todoItems.ts`. NocoBase will automatically load collection definitions from this directory:
@@ -52,6 +52,8 @@ yarn pm create @my-project/plugin-settings-page
52
52
 
53
53
  This will generate a basic file structure under `packages/plugins/@my-project/plugin-settings-page`, including `src/client-v2/`, `src/server/`, `src/locale/`, and other directories. For detailed instructions, see [Writing Your First Plugin](../../write-your-first-plugin).
54
54
 
55
+ Next, start development mode so your code changes hot-reload: for a project created by `nb init`, run `nb source dev` from the project root (`<app-path>`); for a NocoBase source repository you cloned yourself, run `yarn dev` from the source root.
56
+
55
57
  ## Step 2: Register the Settings Page
56
58
 
57
59
  Edit `src/client-v2/plugin.tsx`. In `load()`, use `this.pluginSettingsManager` to register the settings page. This is done in two steps -- first register the menu entry with `addMenuItem()`, then register the actual page with `addPageTabItem()`:
@@ -61,11 +61,11 @@ export class PluginSampleI18nServer extends Plugin {
61
61
  },
62
62
  ],
63
63
  });
64
- await this.app.changeLanguage(answer1);
64
+ await this.app.i18n.changeLanguage(answer1);
65
65
  const answer2 = await input({
66
- message: app.i18n.t('Enter your name'),
66
+ message: this.app.i18n.t('Enter your name'),
67
67
  });
68
- console.log(app.i18n.t(`Your name is {{name}}`, { name: answer2 }));
68
+ console.log(this.app.i18n.t(`Your name is {{name}}`, { name: answer2 }));
69
69
  });
70
70
  }
71
71
  }
@@ -212,7 +212,7 @@ export default class PluginCacheDemo extends Plugin {
212
212
  });
213
213
 
214
214
  // Create cache using newly registered store
215
- const redisCache = await this.app.createCache({
215
+ const redisCache = await this.app.cacheManager.createCache({
216
216
  name: 'redisCache',
217
217
  store: 'redis',
218
218
  prefix: 'app:',
@@ -197,12 +197,6 @@ When a plugin is first activated, the system will automatically synchronize Coll
197
197
  yarn nocobase upgrade
198
198
  ```
199
199
 
200
- If exceptions or dirty data occur during synchronization, you can rebuild the table structure by reinstalling the application:
201
-
202
- ```bash
203
- yarn nocobase install -f
204
- ```
205
-
206
200
  If you need to migrate existing data during plugin upgrades -- such as renaming fields, splitting tables, backfilling default values, etc. -- you should handle it through [Migration](./migration.md) scripts rather than manually modifying the database.
207
201
 
208
202
  ## Making a Collection Appear in the UI Data Table List
@@ -30,7 +30,7 @@ export default function (app: Application) {
30
30
  app
31
31
  .command('echo')
32
32
  .option('-v, --version')
33
- .action(async ([options]) => {
33
+ .action(async (options) => {
34
34
  console.log('Hello World!');
35
35
  if (options.version) {
36
36
  console.log('Current version:', await app.version.get());
@@ -68,7 +68,7 @@ export default class PluginHelloServer extends Plugin {
68
68
  app
69
69
  .command('echo')
70
70
  .option('-v, --version')
71
- .action(async ([options]) => {
71
+ .action(async (options) => {
72
72
  console.log('Hello World!');
73
73
  if (options.version) {
74
74
  console.log('Current version:', await app.version.get());
@@ -56,7 +56,7 @@ resourceManager.use(async (ctx) => {
56
56
 
57
57
  ```ts
58
58
  resourceManager.use(async (ctx) => {
59
- await ctx.cache.set('key', 'value', { ttl: 60 }); // Cache for 60 seconds
59
+ await ctx.cache.set('key', 'value', 60 * 1000); // Cache for 60 seconds (TTL is in milliseconds)
60
60
  const val = await ctx.cache.get('key');
61
61
  ctx.body = val;
62
62
  });
@@ -113,7 +113,7 @@ resourceManager.use(async (ctx) => {
113
113
 
114
114
  ```ts
115
115
  resourceManager.use(async (ctx) => {
116
- const canEdit = await ctx.can('edit', 'posts');
116
+ const canEdit = ctx.can({ resource: 'posts', action: 'edit' });
117
117
  if (!canEdit) {
118
118
  ctx.throw(403, 'Forbidden');
119
119
  }
@@ -68,13 +68,13 @@ export class PluginSampleI18nServer extends Plugin {
68
68
  ]
69
69
  });
70
70
 
71
- await this.app.changeLanguage(answer1);
71
+ await this.app.i18n.changeLanguage(answer1);
72
72
 
73
73
  const answer2 = await input({
74
- message: app.i18n.t('Enter your name')
74
+ message: this.app.i18n.t('Enter your name')
75
75
  });
76
76
 
77
- console.log(app.i18n.t('Your name is {{name}}', { name: answer2 }));
77
+ console.log(this.app.i18n.t('Your name is {{name}}', { name: answer2 }));
78
78
  });
79
79
  }
80
80
  }
@@ -129,7 +129,7 @@ export class PluginSampleI18nServer extends Plugin {
129
129
  load() {
130
130
  this.app.use(async (ctx, next) => {
131
131
  if (ctx.path === '/api/plugin-i18n') {
132
- ctx.body = this.plugin.t('Hello');
132
+ ctx.body = this.t('Hello');
133
133
  }
134
134
  await next();
135
135
  });