@nocobase/plugin-ai 3.0.0-alpha.1 → 3.0.0-alpha.11

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 (261) hide show
  1. package/dist/ai/docs/nocobase/ai/ai-quick-start.md +1 -1
  2. package/dist/ai/docs/nocobase/ai/claude-code/index.md +1 -1
  3. package/dist/ai/docs/nocobase/ai/codex/index.md +1 -1
  4. package/dist/ai/docs/nocobase/ai/hermes-agent/index.md +1 -1
  5. package/dist/ai/docs/nocobase/ai/index.md +6 -25
  6. package/dist/ai/docs/nocobase/ai/install-nocobase-app.md +1 -1
  7. package/dist/ai/docs/nocobase/ai/openclaw/index.md +1 -1
  8. package/dist/ai/docs/nocobase/ai/opencode/index.md +1 -1
  9. package/dist/ai/docs/nocobase/ai/quick-start.mdx +9 -7
  10. package/dist/ai/docs/nocobase/ai/workbuddy/index.md +1 -1
  11. package/dist/ai/docs/nocobase/ai-builder/ai-portal/agent-workflow.md +153 -0
  12. package/dist/ai/docs/nocobase/ai-builder/ai-portal/components.md +134 -0
  13. package/dist/ai/docs/nocobase/ai-builder/ai-portal/deploy.md +164 -0
  14. package/dist/ai/docs/nocobase/ai-builder/ai-portal/index.md +144 -0
  15. package/dist/ai/docs/nocobase/ai-builder/ai-portal/model-selection.md +120 -0
  16. package/dist/ai/docs/nocobase/ai-builder/ai-portal/project-structure.md +128 -0
  17. package/dist/ai/docs/nocobase/ai-builder/index.md +73 -32
  18. package/dist/ai/docs/nocobase/ai-builder/ui-builder.md +2 -0
  19. package/dist/ai/docs/nocobase/ai-dev/index.md +2 -1
  20. package/dist/ai/docs/nocobase/ai-dev/watermark-plugin.md +2 -0
  21. package/dist/ai/docs/nocobase/ai-employees/dev/ai-employee/complete-example.md +206 -0
  22. package/dist/ai/docs/nocobase/ai-employees/dev/ai-employee/define-ai-employee.md +149 -0
  23. package/dist/ai/docs/nocobase/ai-employees/dev/ai-employee/define-skill.md +138 -0
  24. package/dist/ai/docs/nocobase/ai-employees/dev/ai-employee/define-tool.md +189 -0
  25. package/dist/ai/docs/nocobase/ai-employees/dev/ai-employee/frontend-tool-ui.md +296 -0
  26. package/dist/ai/docs/nocobase/ai-employees/dev/ai-employee/index.md +126 -0
  27. package/dist/ai/docs/nocobase/ai-employees/dev/ai-employee/internationalization.md +88 -0
  28. package/dist/ai/docs/nocobase/ai-employees/dev/ai-employee/troubleshooting.md +86 -0
  29. package/dist/ai/docs/nocobase/ai-employees/{knowledge-base/dev → dev/knowledge-base}/external-knowledge-base.md +2 -2
  30. package/dist/ai/docs/nocobase/ai-employees/knowledge-base/knowledge-base/index.md +1 -1
  31. package/dist/ai/docs/nocobase/ai-employees/knowledge-base/rag.md +43 -13
  32. package/dist/ai/docs/nocobase/api/cli/api/resource/create.md +4 -3
  33. package/dist/ai/docs/nocobase/api/cli/index.md +1 -1
  34. package/dist/ai/docs/nocobase/api/cli/portal/config.md +5 -3
  35. package/dist/ai/docs/nocobase/api/cli/portal/create.md +3 -6
  36. package/dist/ai/docs/nocobase/api/cli/portal/deploy.md +1 -1
  37. package/dist/ai/docs/nocobase/api/cli/portal/destroy.md +6 -4
  38. package/dist/ai/docs/nocobase/api/cli/portal/dev.md +21 -9
  39. package/dist/ai/docs/nocobase/api/cli/portal/index.md +19 -13
  40. package/dist/ai/docs/nocobase/api/cli/portal/info.md +3 -3
  41. package/dist/ai/docs/nocobase/api/cli/portal/list.md +5 -5
  42. package/dist/ai/docs/nocobase/api/cli/portal/pull.md +11 -1
  43. package/dist/ai/docs/nocobase/api/cli/portal/push.md +1 -1
  44. package/dist/ai/docs/nocobase/development/index.md +1 -1
  45. package/dist/ai/docs/nocobase/file-manager/file-preview/index.md +44 -3
  46. package/dist/ai/docs/nocobase/file-manager/storage/aliyun-oss.md +100 -3
  47. package/dist/ai/docs/nocobase/nocobase-cli/installation/cli.md +1 -1
  48. package/dist/ai/docs/nocobase/plugin-development/build.md +10 -4
  49. package/dist/ai/docs/nocobase/plugin-development/client/appendix/faq.md +1 -1
  50. package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-action.md +2 -0
  51. package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-block.md +2 -0
  52. package/dist/ai/docs/nocobase/plugin-development/client/examples/custom-field.md +2 -0
  53. package/dist/ai/docs/nocobase/plugin-development/client/examples/fullstack-plugin.md +2 -0
  54. package/dist/ai/docs/nocobase/plugin-development/client/examples/settings-page.md +2 -0
  55. package/dist/ai/docs/nocobase/plugin-development/common/i18n.md +3 -3
  56. package/dist/ai/docs/nocobase/plugin-development/server/cache.md +1 -1
  57. package/dist/ai/docs/nocobase/plugin-development/server/collections.md +0 -6
  58. package/dist/ai/docs/nocobase/plugin-development/server/command.md +2 -2
  59. package/dist/ai/docs/nocobase/plugin-development/server/context.md +2 -2
  60. package/dist/ai/docs/nocobase/plugin-development/server/i18n.md +4 -4
  61. package/dist/ai/docs/nocobase/plugin-development/write-your-first-plugin.md +91 -43
  62. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-bulk-edit/index.md +1 -1
  63. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-bulk-update/index.md +1 -1
  64. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-custom-request/index.md +1 -1
  65. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-duplicate/index.md +1 -1
  66. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-export/index.md +1 -1
  67. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-import/index.md +1 -1
  68. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-action-print/index.md +1 -1
  69. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ai/index.md +1 -1
  70. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ai-gigachat/index.md +1 -1
  71. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-api-doc/index.md +1 -1
  72. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-api-keys/index.md +1 -1
  73. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-async-task-manager/index.md +1 -1
  74. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-audit-logs/index.md +1 -1
  75. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth/index.md +1 -1
  76. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-auth-sms/index.md +1 -1
  77. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-backup-restore/index.md +1 -1
  78. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-backups/index.md +1 -1
  79. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-comment/index.md +1 -1
  80. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-grid-card/index.md +1 -1
  81. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-iframe/index.md +1 -1
  82. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-list/index.md +1 -1
  83. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-markdown/index.md +1 -1
  84. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-multi-step-form/index.md +1 -1
  85. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-template/index.md +1 -1
  86. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-tree/index.md +1 -1
  87. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-block-workbench/index.md +1 -1
  88. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-calendar/index.md +1 -1
  89. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-charts/index.md +1 -1
  90. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-client/index.md +1 -1
  91. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-fdw/index.md +1 -1
  92. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-sql/index.md +1 -1
  93. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-collection-tree/index.md +1 -1
  94. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-comments/index.md +1 -1
  95. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-custom-variables/index.md +1 -1
  96. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-main/index.md +1 -1
  97. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-source-manager/index.md +1 -1
  98. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-visualization/index.md +1 -1
  99. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-data-visualization-echarts/index.md +1 -1
  100. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-departments/index.md +1 -1
  101. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-embed/index.md +1 -1
  102. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-environment-variables/index.md +1 -1
  103. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-error-handler/index.md +1 -1
  104. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-attachment-url/index.md +1 -1
  105. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-china-region/index.md +1 -1
  106. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-code/index.md +1 -1
  107. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-formula/index.md +1 -1
  108. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-m2m-array/index.md +1 -1
  109. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-markdown-vditor/index.md +1 -1
  110. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-sequence/index.md +1 -1
  111. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-field-sort/index.md +1 -1
  112. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-file-manager/index.md +1 -1
  113. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-file-previewer-office/index.md +1 -1
  114. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-flow-engine/index.md +1 -1
  115. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-form-drafts/index.md +1 -1
  116. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-gantt/index.md +1 -1
  117. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-graph-collection-manager/index.md +1 -1
  118. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-idp-oauth/index.md +1 -1
  119. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-kanban/index.md +1 -1
  120. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-license/index.md +1 -1
  121. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-locale-tester/index.md +1 -1
  122. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-localization/index.md +1 -1
  123. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-logger/index.md +1 -1
  124. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-map/index.md +1 -1
  125. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mcp-server/index.md +1 -1
  126. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mobile/index.md +1 -1
  127. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-mobile-client/index.md +1 -1
  128. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-app-manager/index.md +1 -1
  129. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-app-share-collection/index.md +1 -1
  130. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-multi-keyword-filter/index.md +1 -1
  131. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-email/index.md +1 -1
  132. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-in-app-message/index.md +1 -1
  133. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-notification-manager/index.md +1 -1
  134. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-public-forms/index.md +1 -1
  135. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-snapshot-field/index.md +1 -1
  136. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-system-settings/index.md +1 -1
  137. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-text-copy/index.md +1 -1
  138. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-theme-editor/index.md +1 -1
  139. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-layout/index.md +1 -1
  140. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-schema-storage/index.md +1 -1
  141. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-ui-templates/index.md +1 -1
  142. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-user-data-sync/index.md +1 -1
  143. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-users/index.md +1 -1
  144. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-verification/index.md +1 -1
  145. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow/index.md +1 -1
  146. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-action-trigger/index.md +1 -1
  147. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-aggregate/index.md +1 -1
  148. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-cc/index.md +1 -1
  149. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-custom-action-trigger/index.md +1 -1
  150. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-date-calculation/index.md +1 -1
  151. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-delay/index.md +1 -1
  152. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-dynamic-calculation/index.md +1 -1
  153. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-javascript/index.md +1 -1
  154. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-json-variable-mapping/index.md +1 -1
  155. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-loop/index.md +1 -1
  156. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-mailer/index.md +1 -1
  157. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-manual/index.md +1 -1
  158. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-notification/index.md +1 -1
  159. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-parallel/index.md +1 -1
  160. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-request/index.md +1 -1
  161. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-request-interceptor/index.md +1 -1
  162. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-response-message/index.md +1 -1
  163. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-sql/index.md +1 -1
  164. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-test/index.md +1 -1
  165. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-workflow-variable/index.md +1 -1
  166. package/dist/ai/docs/nocobase/users-permissions/sync/index.md +8 -1
  167. package/dist/ai/docs/nocobase/users-permissions/sync/sources/dingtalk.md +138 -0
  168. package/dist/ai/docs/nocobase/users-permissions/sync/sources/ldap.md +87 -0
  169. package/dist/ai/docs/nocobase/workflow/nodes/javascript.md +21 -1
  170. package/dist/ai/tools/knowledge-base-retrieve.js +3 -1
  171. package/dist/client/244.276308c9b2090ec2.js +10 -0
  172. package/dist/client/{264.cc98933ef65608b6.js → 264.6ca5f2eeb4173d86.js} +1 -1
  173. package/dist/client/{705.19b642db34de438a.js → 705.a4fe26945d175e8a.js} +1 -1
  174. package/dist/client/index.js +3 -3
  175. package/dist/client-v2/244.e85b8d4659ca66c0.js +10 -0
  176. package/dist/client-v2/{264.be92ff6a4d2612f1.js → 264.3c7d8e90aa7f46ee.js} +1 -1
  177. package/dist/client-v2/420.a5b929a5e7f330be.js +10 -0
  178. package/dist/client-v2/{705.8dc34d43f02f322c.js → 705.f2e1b26a3f000075.js} +1 -1
  179. package/dist/client-v2/ai-employees/chatbox/hooks/reasoning-stream.d.ts +10 -0
  180. package/dist/client-v2/ai-employees/chatbox/stores/chat-box.d.ts +0 -2
  181. package/dist/client-v2/index.js +3 -3
  182. package/dist/client-v2/llm-providers/forms.d.ts +2 -0
  183. package/dist/client-v2/llm-providers/index.d.ts +1 -0
  184. package/dist/client-v2/models/ai-employees/AIEmployeeShortcutModel.d.ts +3 -0
  185. package/dist/client-v2/pages/EmployeesPage.d.ts +10 -0
  186. package/dist/client-v2/pages/LLMServicesPage.d.ts +9 -4
  187. package/dist/client-v2/repositories/AIConfigRepository.d.ts +2 -0
  188. package/dist/collections/ai-employees.d.ts +1 -0
  189. package/dist/collections/ai-employees.js +1 -0
  190. package/dist/externalVersion.js +18 -16
  191. package/dist/locale/de-DE.json +2 -1
  192. package/dist/locale/en-US.json +18 -5
  193. package/dist/locale/es-ES.json +2 -1
  194. package/dist/locale/fr-FR.json +2 -1
  195. package/dist/locale/hu-HU.json +2 -1
  196. package/dist/locale/id-ID.json +2 -1
  197. package/dist/locale/it-IT.json +2 -1
  198. package/dist/locale/ja-JP.json +2 -1
  199. package/dist/locale/ko-KR.json +2 -1
  200. package/dist/locale/nl-NL.json +2 -1
  201. package/dist/locale/pt-BR.json +2 -1
  202. package/dist/locale/ru-RU.json +2 -1
  203. package/dist/locale/tr-TR.json +2 -1
  204. package/dist/locale/uk-UA.json +2 -1
  205. package/dist/locale/vi-VN.json +2 -1
  206. package/dist/locale/zh-CN.json +18 -5
  207. package/dist/locale/zh-TW.json +2 -1
  208. package/dist/node_modules/@langchain/mistralai/package.json +1 -1
  209. package/dist/node_modules/@langchain/xai/package.json +1 -1
  210. package/dist/node_modules/fs-extra/package.json +1 -1
  211. package/dist/node_modules/jsonrepair/package.json +1 -1
  212. package/dist/node_modules/just-bash/package.json +1 -1
  213. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  214. package/dist/node_modules/openai/package.json +1 -1
  215. package/dist/node_modules/zod/package.json +1 -1
  216. package/dist/server/ai-employees/ai-conversations.d.ts +2 -1
  217. package/dist/server/ai-employees/ai-conversations.js +2 -0
  218. package/dist/server/ai-employees/ai-employee.d.ts +2 -0
  219. package/dist/server/ai-employees/ai-employee.js +86 -40
  220. package/dist/server/ai-employees/ai-knowledge-base.d.ts +21 -1
  221. package/dist/server/ai-employees/ai-knowledge-base.js +76 -8
  222. package/dist/server/ai-employees/reasoning-stream-state.d.ts +23 -0
  223. package/dist/server/ai-employees/reasoning-stream-state.js +63 -0
  224. package/dist/server/collections/ai-conversations.js +5 -0
  225. package/dist/server/features/knowledge-base.d.ts +2 -0
  226. package/dist/server/llm-providers/common/reasoning.js +18 -10
  227. package/dist/{client-v2/ai-employees/chatbox/components/DebugPanel.d.ts → server/llm-providers/deepseek/index.d.ts} +2 -2
  228. package/dist/server/llm-providers/deepseek/index.js +32 -0
  229. package/dist/server/llm-providers/deepseek/provider.d.ts +57 -0
  230. package/dist/server/llm-providers/deepseek/provider.js +320 -0
  231. package/dist/server/llm-providers/deepseek/reasoning.d.ts +83 -0
  232. package/dist/server/llm-providers/deepseek/reasoning.js +285 -0
  233. package/dist/server/llm-providers/mistral.d.ts +1 -1
  234. package/dist/server/llm-providers/provider.d.ts +1 -0
  235. package/dist/server/llm-providers/provider.js +3 -0
  236. package/dist/server/llm-providers/shengsuanyun.d.ts +29 -0
  237. package/dist/server/llm-providers/shengsuanyun.js +114 -0
  238. package/dist/server/manager/ai-feature-manager.js +1 -1
  239. package/dist/server/manager/ai-manager.d.ts +3 -0
  240. package/dist/server/manager/ai-manager.js +7 -2
  241. package/dist/server/migrations/20260501000000-ai-employee-knowledge-base-retrieval-strategy.d.ts +14 -0
  242. package/dist/server/migrations/20260501000000-ai-employee-knowledge-base-retrieval-strategy.js +49 -0
  243. package/dist/server/migrations/20260803185305-migrate-ai-conversations-portal-name.d.ts +14 -0
  244. package/dist/server/migrations/20260803185305-migrate-ai-conversations-portal-name.js +52 -0
  245. package/dist/server/plugin.js +6 -0
  246. package/dist/server/resource/aiConversations.js +14 -2
  247. package/dist/server/resource/aiEmployees.js +8 -0
  248. package/dist/server/types/ai-message.type.d.ts +4 -0
  249. package/dist/server/types/knowledge-base.type.d.ts +2 -1
  250. package/dist/swagger/index.d.ts +29 -0
  251. package/dist/swagger/llm.d.ts +8 -0
  252. package/dist/swagger/llm.js +8 -0
  253. package/dist/swagger/schemas.d.ts +21 -0
  254. package/dist/swagger/schemas.js +11 -0
  255. package/package.json +2 -2
  256. package/dist/client/244.8631eb5cf3f05e21.js +0 -10
  257. package/dist/client-v2/244.c428e645ecb94414.js +0 -10
  258. package/dist/client-v2/420.b2aedb1ff71fca0e.js +0 -10
  259. package/dist/client-v2/debug-logger.d.ts +0 -52
  260. package/dist/server/llm-providers/deepseek.d.ts +0 -40
  261. package/dist/server/llm-providers/deepseek.js +0 -174
@@ -1,29 +1,59 @@
1
+ ---
2
+ pkg: "@nocobase/plugin-ai-knowledge-base"
3
+ title: "RAG Retrieval-Augmented Generation"
4
+ description: "Enable RAG for AI employees, configure the Knowledge Base, Retrieval strategy, Top K, and Score, and control knowledge-base access through user roles."
5
+ keywords: "RAG,retrieval-augmented generation,knowledge-base retrieval,Retrieval strategy,knowledge-base permissions,Top K,NocoBase"
6
+ ---
7
+
1
8
  # RAG Retrieval
2
9
 
3
10
  ## Introduction
4
11
 
5
- After configuring the knowledge base, you can enable the RAG feature in the AI employee settings.
12
+ In NocoBase, **RAG (Retrieval-Augmented Generation)** enables an AI employee to retrieve relevant content from knowledge bases before answering a question.
13
+
14
+ The knowledge bases an AI employee can actually use are determined by both the employee's `Knowledge Base` configuration and the knowledge-base permissions of the current user's roles. Only knowledge bases included in both scopes are searched.
15
+
16
+ ## Configure an AI employee's knowledge bases
17
+
18
+ Go to the `AI employees` configuration page, select the AI employee for which you want to enable RAG, and click `Edit`. In the edit drawer, open the `Knowledge Base` tab and turn on `Enable`.
19
+
20
+ ![](https://static-docs.nocobase.com/ai-employee-knowledge-base-settings-202608171620.png)
21
+
22
+ The available settings are:
23
+
24
+ - `Knowledge Base` — Optional. If left empty, the AI employee searches all enabled knowledge bases accessible to the current user's roles. If you select knowledge bases, it searches only the selected knowledge bases that the user is allowed to access
25
+ - `Retrieval strategy` — Controls when knowledge-base retrieval runs:
26
+ - `Retrieve on demand` — The AI employee retrieves knowledge-base content only when it determines that the current question requires it. New AI employees use this strategy by default, and it is the recommended option for most cases
27
+ - `Automatically retrieve for every question` — Retrieval runs before every user question is sent to the AI employee. Use this when every turn depends on knowledge-base content
28
+ - `Knowledge Base Prompt` — Defines how retrieved content is provided to the AI employee. `{knowledgeBaseData}` is a fixed placeholder; do not remove or modify it
29
+ - `Top K` — The maximum number of knowledge-base results returned by each retrieval. The range is 1–100, and the default is 3
30
+ - `Score` — The minimum similarity score required for a result. The range is 0–1, and the default is 0.6. A higher value returns more relevant content, but may produce fewer results
31
+
32
+ Click `Submit` to save the configuration.
33
+
34
+ ## Configure knowledge-base permissions
6
35
 
7
- With RAG enabled, when a user chats with an AI employee, the AI employee will use RAG retrieval to fetch documents from the knowledge base based on the user's message and reply based on the retrieved documents.
36
+ Selecting knowledge bases for an AI employee does not give every user access to them. Go to `Users & Permissions / Roles & Permissions`, select the role assigned to the user, and then open `Permissions / Knowledge bases`.
8
37
 
9
- ## Enable RAG
38
+ Select `Available` for each knowledge base that the role should be allowed to access. To automatically grant this role access to knowledge bases created later, select `New knowledge bases are allowed by default`.
10
39
 
11
- Go to the AI employee plugin configuration page, click the `AI employees` tab to enter the AI employee management page.
40
+ ![](https://static-docs.nocobase.com/knowledge-base-role-permissions-202608171620.png)
12
41
 
42
+ :::warning Note
13
43
 
14
- ![20251023010811](https://static-docs.nocobase.com/20251023010811.png)
44
+ The knowledge-base scope available to an AI employee is the intersection of its `Knowledge Base` configuration and the current user's role permissions. Unauthorized knowledge bases are automatically excluded.
15
45
 
46
+ :::
16
47
 
17
- Select the AI employee for which you want to enable RAG, click the `Edit` button to enter the AI employee editing page.
48
+ ## When the user has no knowledge-base access
18
49
 
19
- In the `Knowledge base` tab, turn on the `Enable` switch.
50
+ If knowledge bases are enabled for an AI employee but its configured scope has no overlap with the current user's role permissions, the AI employee first answers with information that does not depend on a knowledge base. It then appends a prominent notice explaining that no knowledge-base content was used because the user does not have access and advising the user to contact an administrator.
20
51
 
21
- - In `Knowledge Base Prompt`, enter the prompt for referencing the knowledge base. `{knowledgeBaseData}` is a fixed placeholder and should not be modified.
22
- - In `Knowledge Base`, select the configured knowledge base. See: [Knowledge Base](./knowledge-base/).
23
- - In the `Top K` input box, enter the number of documents to retrieve, the default is 3.
24
- - In the `Score` input box, enter the document relevance threshold for retrieval.
52
+ ![](https://static-docs.nocobase.com/ai-employee-no-knowledge-base-access-side-panel-202608171653.png)
25
53
 
26
- Click the `Submit` button to save the AI employee settings.
54
+ If the user can access at least one knowledge base but the current question returns no relevant content, the no-permission notice is not displayed.
27
55
 
56
+ ## Related links
28
57
 
29
- ![20251023010844](https://static-docs.nocobase.com/20251023010844.png)
58
+ - [Knowledge Base](./knowledge-base/index.md) — Create and maintain knowledge bases used for RAG retrieval
59
+ - [Roles and permissions](../../users-permissions/acl/permissions.md) — Configure system, menu, and data access for roles
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  title: "nb api resource create"
3
- description: "nb api resource create command reference: create a record in a selected NocoBase resource."
3
+ description: "nb api resource create command reference: create one or more records in a selected NocoBase resource."
4
4
  keywords: "nb api resource create,NocoBase CLI,create record,CRUD"
5
5
  ---
6
6
 
7
7
  # nb api resource create
8
8
 
9
- Create a record in a selected resource. Pass record data as a JSON object through `--values`.
9
+ Create records in a selected resource. Pass record data as a JSON object through `--values`, or as a JSON array of objects to create multiple records in a single request.
10
10
 
11
11
  ## Usage
12
12
 
@@ -21,7 +21,7 @@ nb api resource create --resource <resource> --values <json> [flags]
21
21
  | `--resource` | string | Resource name, required |
22
22
  | `--data-source` | string | Data source key, default `main` |
23
23
  | `--source-id` | string | Source record ID for association resources |
24
- | `--values` | string | Data for the new record as a JSON object, required |
24
+ | `--values` | string | Data for the new records: a JSON object, or a JSON array of objects to create multiple records; required |
25
25
  | `--whitelist` | string[] | Fields allowed to write; repeatable or pass a JSON array |
26
26
  | `--blacklist` | string[] | Fields forbidden to write; repeatable or pass a JSON array |
27
27
 
@@ -31,6 +31,7 @@ Also supports common connection parameters from [`nb api resource`](./index.md).
31
31
 
32
32
  ```bash
33
33
  nb api resource create --resource users --values '{"nickname":"Ada"}'
34
+ nb api resource create --resource users --values '[{"nickname":"Ada"},{"nickname":"Grace"}]'
34
35
  nb api resource create --resource posts.comments --source-id 1 --values '{"content":"Hello"}'
35
36
  ```
36
37
 
@@ -39,7 +39,7 @@ The following command groups are shown in `nb --help`:
39
39
  | [`nb env`](./env/index.md) | Manage NocoBase project environments, the current env, status, details, and runtime commands. |
40
40
  | [`nb license`](./license/index.md) | Manage commercial licenses and licensed plugins. |
41
41
  | [`nb plugin`](./plugin/index.md) | Manage plugins in the selected NocoBase env. |
42
- | [`nb portal`](./portal/index.md) | Manage portals: configure, create, develop, sync source, deploy, and destroy. |
42
+ | [`nb portal`](./portal/index.md) | Manage a Portal's local source directory: configure, create, develop, sync source, deploy, and destroy. |
43
43
  | [`nb scaffold`](./scaffold/index.md) | Generate scaffolding for NocoBase plugin development. |
44
44
  | [`nb self`](./self/index.md) | Check or update NocoBase CLI itself. |
45
45
  | [`nb session`](./session/index.md) | Configure `NB_SESSION_ID` so the current env is isolated by shell or agent runtime. |
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  title: "nb portal config"
3
- description: "nb portal config command reference: update source storage and Git source configuration for a portal."
3
+ description: "nb portal config command reference: update the development path, source storage, and Git source configuration for a portal."
4
4
  keywords: "nb portal config,NocoBase CLI,Portal"
5
5
  ---
6
6
 
7
7
  # nb portal config
8
8
 
9
- Update the local portal source configuration and sync it to the remote portal record when possible
9
+ Update the portal development path, source storage, and Git source configuration
10
10
 
11
11
  ## Usage
12
12
 
@@ -21,6 +21,7 @@ nb portal config <portal> [flags]
21
21
  | `<portal>` | string | Portal name or slug |
22
22
  | `--env`, `-e` | string | CLI env name. If omitted, the current env is used. |
23
23
  | `--yes`, `-y` | boolean | Skip cross-env confirmation. |
24
+ | `--path` | string | Portal development workspace directory. |
24
25
  | `--source-storage` | `nocobase` \| `git` | Where portal source code is managed. |
25
26
  | `--git-repo` | string | Git repository URL used with `--source-storage=git`. |
26
27
  | `--git-branch` | string | Git branch used with `--source-storage=git`. |
@@ -29,6 +30,7 @@ nb portal config <portal> [flags]
29
30
  ## Examples
30
31
 
31
32
  ```bash
33
+ nb portal config customer --path ./portals/customer
32
34
  nb portal config customer --source-storage nocobase
33
35
  nb portal config customer --source-storage git --git-repo git@github.com:nocobase/customer-portal.git
34
36
  nb portal config customer --git-branch main --git-path portals/customer
@@ -36,7 +38,7 @@ nb portal config customer --git-branch main --git-path portals/customer
36
38
 
37
39
  ## Notes
38
40
 
39
- Pass at least one configuration flag. The local workspace must already exist; use `nb portal create` or `nb portal pull` first. If the remote portal record exists, the configuration is synced to it; otherwise only `portal.config.json` is updated locally.
41
+ Pass at least one configuration flag. `--path` updates the selected CLI env config. `--source-storage` and `--git-*` update the remote portal record options.
40
42
 
41
43
  ## Related Commands
42
44
 
@@ -23,24 +23,21 @@ nb portal create <portal> [flags]
23
23
  | `--env`, `-e` | string | CLI env name. If omitted, the current env is used. |
24
24
  | `--yes`, `-y` | boolean | Skip cross-env confirmation. |
25
25
  | `--title` | string | Portal display title. |
26
+ | `--path` | string | Portal workspace directory. Default: `./<portal>`. |
26
27
  | `--force` | boolean | Delete the existing workspace and recreate it. |
27
- | `--source-storage` | `nocobase` \| `git` | Where portal source code is managed. Default: `nocobase`. |
28
- | `--git-repo` | string | Git repository URL used with `--source-storage=git`. |
29
- | `--git-branch` | string | Git branch used with `--source-storage=git`. |
30
- | `--git-path` | string | Directory inside the Git repository; defaults to the repository root (`.`). |
31
28
 
32
29
  ## Examples
33
30
 
34
31
  ```bash
35
32
  nb portal create customer
33
+ nb portal create customer --path ./portals/customer
36
34
  nb portal create customer --template @nocobase/portal-template-default
37
35
  nb portal create customer --env dev --yes
38
- nb portal create customer --source-storage git --git-repo git@github.com:nocobase/customer-portal.git
39
36
  ```
40
37
 
41
38
  ## Notes
42
39
 
43
- The command writes `.env`, `.env.local`, and `portal.config.json`. If the template contains `package.json`, it runs `pnpm install`. Portal names must use lowercase letters, numbers, underscores, or hyphens, and start with a lowercase letter or number.
40
+ The command writes `.env` and `.env.local`, stores the workspace path in the selected CLI env config, and runs `pnpm install` when the template contains `package.json`. Portal names must use lowercase letters, numbers, underscores, or hyphens, and start with a lowercase letter or number.
44
41
 
45
42
  ## Related Commands
46
43
 
@@ -31,7 +31,7 @@ nb portal deploy customer --env dev --yes
31
31
 
32
32
  ## Notes
33
33
 
34
- The command refreshes `.env` and `.env.local`, runs `pnpm build`, and expects `dist/index.html`. For `local` and `docker` envs, it syncs the portal record and uses the local or volume-mounted `dist`; for `http` envs, it uploads the packed `dist` through the API.
34
+ The command refreshes `.env` and `.env.local`, builds from the development path stored in the selected CLI env config, and syncs deployment output to the target app storage. Source storage and Git settings are managed by `nb portal config` in the remote portal record.
35
35
 
36
36
  ## Related Commands
37
37
 
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  title: "nb portal destroy"
3
- description: "nb portal destroy command reference: delete a portal record and its local workspace."
3
+ description: "nb portal destroy command reference: delete a portal record and its deployed files."
4
4
  keywords: "nb portal destroy,NocoBase CLI,Portal"
5
5
  ---
6
6
 
7
7
  # nb portal destroy
8
8
 
9
- Delete the portal record and local workspace
9
+ Delete the portal record and deployed files.
10
10
 
11
11
  ## Usage
12
12
 
@@ -21,19 +21,21 @@ nb portal destroy <portal> [flags]
21
21
  | `<portal>` | string | Portal name or slug. |
22
22
  | `--env`, `-e` | string | CLI env name. If omitted, the current env is used. |
23
23
  | `--yes`, `-y` | boolean | Skip confirmation prompts. |
24
- | `--force` | boolean | Ignore missing portal records or workspace directories. |
24
+ | `--force` | boolean | Ignore missing portal records or deployment directories. |
25
+ | `--delete-dev-path`, `-D` | boolean | Delete the portal development directory in addition to the deployed portal. |
25
26
 
26
27
  ## Examples
27
28
 
28
29
  ```bash
29
30
  nb portal destroy customer --yes
31
+ nb portal destroy customer --delete-dev-path --yes
30
32
  nb portal destroy customer --env dev --yes
31
33
  nb portal destroy customer --force --yes
32
34
  ```
33
35
 
34
36
  ## Notes
35
37
 
36
- This command affects both the remote portal record and the local workspace. In non-interactive mode, pass `--yes`. Use `--force` to ignore missing records or local files.
38
+ This command deletes the remote portal record and deployed files. The development directory is retained by default; pass `--delete-dev-path` to delete it as well. In non-interactive mode, pass `--yes`. Use `--force` to ignore missing records or deployment files.
37
39
 
38
40
  ## Related Commands
39
41
 
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  title: "nb portal dev"
3
- description: "nb portal dev command reference: start a portal in development mode."
4
- keywords: "nb portal dev,NocoBase CLI,Portal"
3
+ description: "nb portal dev command reference: start development mode for a Portal's local source directory."
4
+ keywords: "nb portal dev,NocoBase CLI,Portal,development mode,local development"
5
5
  ---
6
6
 
7
7
  # nb portal dev
8
8
 
9
- Start development mode for the specified portal
9
+ Start development mode for the specified Portal's local source directory. It is normally used after [`nb portal create`](./create.md) or [`nb portal pull`](./pull.md).
10
+
11
+ It refreshes `.env` and `.env.local` in the local source directory, then runs `pnpm dev` there.
10
12
 
11
13
  ## Usage
12
14
 
@@ -18,22 +20,32 @@ nb portal dev <portal> [flags]
18
20
 
19
21
  | Flag | Type | Description |
20
22
  | --- | --- | --- |
21
- | `<portal>` | string | Portal name or slug. |
22
- | `--env`, `-e` | string | CLI env name. If omitted, the current env is used. |
23
- | `--yes`, `-y` | boolean | Skip cross-env confirmation. |
23
+ | `<portal>` | string | Portal name or slug |
24
+ | `--env`, `-e` | string | CLI env name. If omitted, the current env is used |
25
+ | `--yes`, `-y` | boolean | Skip the interactive confirmation when an explicit `--env` differs from the current env |
24
26
 
25
27
  ## Examples
26
28
 
29
+ Start development mode for a Portal in the current env:
30
+
27
31
  ```bash
28
32
  nb portal dev customer
33
+ ```
34
+
35
+ Start development mode for a Portal in a specified env:
36
+
37
+ ```bash
29
38
  nb portal dev customer --env dev --yes
30
39
  ```
31
40
 
32
41
  ## Notes
33
42
 
34
- The workspace must contain `package.json`. The command refreshes `.env` and `.env.local`, then runs `pnpm dev`. `ssh` envs are not supported in the current version.
43
+ `dev` starts the dev server from the Portal's local source directory. It doesn't create a Portal record, and it doesn't pull remote source; if the local source directory doesn't exist, use [`nb portal create`](./create.md) or [`nb portal pull`](./pull.md) first.
44
+
45
+ The local source directory must contain `package.json`. `ssh` envs don't support starting Portal development mode yet.
35
46
 
36
47
  ## Related Commands
37
48
 
38
- - [`nb portal`](./index.md)
39
- - [`nb env`](../env/index.md)
49
+ - [`nb portal create`](./create.md)
50
+ - [`nb portal pull`](./pull.md)
51
+ - [`nb portal deploy`](./deploy.md)
@@ -20,14 +20,14 @@ nb portal <command>
20
20
 
21
21
  | Command | Description |
22
22
  | --- | --- |
23
- | [`nb portal config`](./config.md) | Update the local portal source configuration and sync it to the remote portal record when possible |
24
- | [`nb portal create`](./create.md) | Create a local portal from a template and create or update the portal record |
25
- | [`nb portal deploy`](./deploy.md) | Build and deploy the specified portal |
26
- | [`nb portal destroy`](./destroy.md) | Delete the portal record and local workspace |
23
+ | [`nb portal config`](./config.md) | Update portal source configuration |
24
+ | [`nb portal create`](./create.md) | Create a local AI portal from a template |
25
+ | [`nb portal deploy`](./deploy.md) | Build and deploy a portal |
26
+ | [`nb portal destroy`](./destroy.md) | Destroy a portal record and deployed files |
27
27
  | [`nb portal dev`](./dev.md) | Start development mode for the specified portal |
28
- | [`nb portal info`](./info.md) | Show details for the specified portal record and local workspace |
29
- | [`nb portal list`](./list.md) | List portal records and local workspace sync status |
30
- | [`nb portal pull`](./pull.md) | Pull portal source from source storage into the local workspace |
28
+ | [`nb portal info`](./info.md) | Show portal record and local file details |
29
+ | [`nb portal list`](./list.md) | List portal records and development paths |
30
+ | [`nb portal pull`](./pull.md) | Pull portal source into local files |
31
31
  | [`nb portal push`](./push.md) | Push local portal source changes to source storage |
32
32
 
33
33
  ## Typical Flow
@@ -75,7 +75,7 @@ nb portal push customer -e dev --yes --message "Move customer portal source to G
75
75
 
76
76
  ## source storage
77
77
 
78
- When creating a portal, choose where the source code is managed:
78
+ Portal source storage is stored in the remote portal record options:
79
79
 
80
80
  | Mode | Description |
81
81
  | --- | --- |
@@ -84,7 +84,7 @@ When creating a portal, choose where the source code is managed:
84
84
 
85
85
  For quick creation and development, the default `nocobase` storage is usually enough. Use `git` when the portal source should be reviewed, versioned, or built through an existing team workflow.
86
86
 
87
- Source configuration is written to `portal.config.json` in the local workspace. `create`, `pull`, and `config` maintain this file; `push` and `deploy` read it to sync source or deployment output.
87
+ `nb portal config` updates source storage and Git settings in the remote portal record. The development workspace path is stored separately in the CLI env config as `portals.<portal>.path`, maintained by `create`, `pull --path`, or `config --path`.
88
88
 
89
89
  ## Env Types
90
90
 
@@ -92,15 +92,21 @@ Source configuration is written to `portal.config.json` in the local workspace.
92
92
 
93
93
  | Mode | Description |
94
94
  | --- | --- |
95
- | `local` | The workspace and app storage are on the current machine. With default `nocobase` storage, `pull`/`push` usually do not need extra sync. |
96
- | `docker` | The workspace is shared with the app through a Docker volume. With default `nocobase` storage, `pull`/`push` usually do not need extra sync. |
95
+ | `local` | The workspace and app storage are on the current machine. `pull` writes source to the development path, and `deploy` builds from that path before syncing deployment output. |
96
+ | `docker` | The workspace is shared with the app through a Docker volume. `pull` writes source to the development path, and `deploy` builds from that path before syncing deployment output. |
97
97
  | `http` | Source and deployment output are synced through APIs. `pull` downloads a source archive, and `push` uploads one. |
98
98
 
99
99
  `ssh` envs do not support portal management in the current version.
100
100
 
101
- ## Local Workspace Path
101
+ ## Development And Deployment Paths
102
102
 
103
- Portals are stored under the selected env storage:
103
+ Portal development workspaces are created under the current working directory by default:
104
+
105
+ ```text
106
+ ./<portal>
107
+ ```
108
+
109
+ Use `--path` with `create`, `pull`, or `config` to choose a different development path. Deployment output is still stored under the target app storage:
104
110
 
105
111
  ```text
106
112
  <storagePath>/portals/<app>/<portal>
@@ -21,19 +21,19 @@ nb portal info <portal> [flags]
21
21
  | `<portal>` | string | Portal name or slug. |
22
22
  | `--env`, `-e` | string | CLI env name. If omitted, the current env is used. |
23
23
  | `--yes`, `-y` | boolean | Skip cross-env confirmation. |
24
- | `--json-output`, `-j` | boolean | Print portal details as JSON. |
24
+ | `--json-output`, `--json`, `-j` | boolean | Print portal details as JSON. |
25
25
 
26
26
  ## Examples
27
27
 
28
28
  ```bash
29
29
  nb portal info customer
30
30
  nb portal info customer --env dev --yes
31
- nb portal info customer --json-output
31
+ nb portal info customer --json
32
32
  ```
33
33
 
34
34
  ## Notes
35
35
 
36
- Text output includes name, URL, portal type, local path, enabled status, and local sync status. `--json-output` prints `name`, `url`, `portalType`, `localPath`, `enabled`, `sourceStorage`, and `localSynced`. You can query by `routeName` or `uid`.
36
+ Text output includes name, URL, portal type, development path, deployment path, and enabled status. `--json-output` and its alias `--json` print `name`, `url`, `portalType`, `developmentPath`, `deploymentPath`, `enabled`, `isDefault`, and `sourceStorage`. You can query by `routeName` or `uid`.
37
37
 
38
38
  ## Related Commands
39
39
 
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  title: "nb portal list"
3
- description: "nb portal list command reference: list portal records and local workspace sync status."
3
+ description: "nb portal list command reference: list portal records and development paths."
4
4
  keywords: "nb portal list,NocoBase CLI,Portal"
5
5
  ---
6
6
 
7
7
  # nb portal list
8
8
 
9
- List portal records and local workspace sync status
9
+ List portal records and development paths
10
10
 
11
11
  ## Usage
12
12
 
@@ -20,19 +20,19 @@ nb portal list [flags]
20
20
  | --- | --- | --- |
21
21
  | `--env`, `-e` | string | CLI env name. If omitted, the current env is used. |
22
22
  | `--yes`, `-y` | boolean | Skip cross-env confirmation. |
23
- | `--json-output`, `-j` | boolean | Print portal records as JSON. |
23
+ | `--json-output`, `--json`, `-j` | boolean | Print portal records as JSON. |
24
24
 
25
25
  ## Examples
26
26
 
27
27
  ```bash
28
28
  nb portal list
29
29
  nb portal list --env dev --yes
30
- nb portal list --json-output
30
+ nb portal list --json
31
31
  ```
32
32
 
33
33
  ## Notes
34
34
 
35
- The list shows name, URL, portal type, source storage, local path, enabled status, and local sync status. Only `ai` portals have local workspace sync checks; other portal types show an empty sync status.
35
+ The list shows name, URL, portal type, source storage, development path, enabled status, and default status. `--json-output` and its alias `--json` print `name`, `url`, `portalType`, `developmentPath`, `deploymentPath`, `enabled`, `isDefault`, and `sourceStorage`.
36
36
 
37
37
  ## Related Commands
38
38
 
@@ -22,6 +22,10 @@ nb portal pull <portal> [flags]
22
22
  | `--env`, `-e` | string | CLI env name. If omitted, the current env is used. |
23
23
  | `--yes`, `-y` | boolean | Skip cross-env confirmation. |
24
24
  | `--force` | boolean | Delete the existing local workspace and pull it again. |
25
+ | `--path` | string | Portal workspace directory. Defaults to the saved path, then `./<portal>`. |
26
+ | `--git-repo` | string | Temporarily pull source from this Git repository without updating the portal source configuration. |
27
+ | `--git-branch` | string | Git branch for the temporary `--git-repo` pull. Defaults to `main`. |
28
+ | `--git-path` | string | Directory inside the temporary Git repository. Defaults to the repository root (`.`). |
25
29
  | `--install` / `--no-install` | boolean | Run `pnpm install` after pulling source. Enabled by default. |
26
30
 
27
31
  ## Examples
@@ -29,13 +33,19 @@ nb portal pull <portal> [flags]
29
33
  ```bash
30
34
  nb portal pull customer
31
35
  nb portal pull customer --env prod --yes
36
+ nb portal pull customer --path ./portals/customer
37
+ nb portal pull customer --git-repo git@github.com:nocobase/customer-portal.git --git-branch main --git-path portals/customer
32
38
  nb portal pull customer --force
33
39
  nb portal pull customer --no-install
34
40
  ```
35
41
 
36
42
  ## Notes
37
43
 
38
- When the pulled workspace contains `package.json`, `pnpm install` runs by default. Use `--no-install` to skip it. Git source storage clones the configured repo and branch, then copies `--git-path`. With default `nocobase` storage, `local` and `docker` envs are usually no-op; `http` envs download a source archive through the API.
44
+ When the pulled workspace contains `package.json`, `pnpm install` runs by default. Use `--no-install` to skip it.
45
+
46
+ Git source storage clones the configured repo and branch, then copies `--git-path`. To pull from a Git repo one time without changing the remote portal record, pass `--git-repo`; `--git-branch` and `--git-path` can only be used together with `--git-repo`. Use `nb portal config` when you want to persist Git source settings.
47
+
48
+ With default `nocobase` storage, `pull` downloads a source archive through the API and writes it to the development workspace. After a successful pull, the development workspace path is saved to the CLI env config as `portals.<portal>.path`.
39
49
 
40
50
  ## Related Commands
41
51
 
@@ -33,7 +33,7 @@ nb portal push customer --message "Update customer portal"
33
33
 
34
34
  ## Notes
35
35
 
36
- The command reads `portal.config.json` and syncs that configuration to the remote portal record first. Git source storage clones the configured repo, copies the local workspace into `--git-path`, commits, and pushes. With default `nocobase` storage, `local` and `docker` envs are usually no-op; `http` envs upload a source archive through the API.
36
+ The command reads source storage and Git settings from the remote portal record, then reads local source from the development path stored in the selected CLI env config. Git source storage clones the configured repo, copies the local workspace into `--git-path`, commits, and pushes. With default `nocobase` storage, `local` and `docker` envs are usually no-op; `http` envs upload a source archive through the API.
37
37
 
38
38
  ## Related Commands
39
39
 
@@ -52,5 +52,5 @@ features:
52
52
  link: /file-manager/development
53
53
  - title: Knowledge Base Extension
54
54
  details: Connect external knowledge bases or custom retrieval services to extend RAG retrieval sources for AI employees.
55
- link: /ai-employees/knowledge-base/dev/external-knowledge-base
55
+ link: /ai-employees/dev/knowledge-base/external-knowledge-base
56
56
  ---
@@ -8,12 +8,53 @@ For file types that do not support native preview, you can enable preview functi
8
8
 
9
9
  Currently, NocoBase provides the following file preview plugins:
10
10
 
11
- * [Office File Preview Plugin](../file-preview/ms-office.md)
11
+ - [Office File Preview Plugin](./ms-office.md)
12
12
 
13
- ## PDF preview with external storage
13
+ ## PDF preview mechanism
14
14
 
15
- NocoBase previews PDFs through a browser iframe. Some browsers or PDF readers may support scripts, forms, or other interactive content inside PDF files. If the previewed file comes from an untrusted source, pay attention to the security boundary for script execution.
15
+ NocoBase selects the PDF preview method according to whether the file URL has the same origin as the current page:
16
+
17
+ | File URL | Common storage type | Preview method | CORS requirement |
18
+ | --- | --- | --- | --- |
19
+ | Same origin as NocoBase | Local storage | NocoBase reads the file and renders it with the built-in PDF.js viewer | No cross-origin CORS involved |
20
+ | Cross-origin | Third-party storage such as OSS, S3, COS, or a CDN | The browser opens the file URL in an iframe | The iframe preview itself does not require CORS |
21
+
22
+ :::tip What determines the preview method
23
+
24
+ The preview method depends on whether the file URL is same-origin, not directly on the storage engine name. Local storage served from a separate file domain is treated as cross-origin. Third-party storage accessed through a same-origin NocoBase proxy is treated as same-origin.
25
+
26
+ :::
27
+
28
+ ### Local storage or a same-origin URL
29
+
30
+ Local storage URLs usually start with `/storage/uploads/` and have the same origin as the NocoBase page. During preview, NocoBase reads the PDF data and passes it to the built-in PDF.js viewer to render pages and text.
31
+
32
+ This method does not depend on the browser's built-in PDF reader. Even if the file response uses `Content-Disposition: attachment` for security, NocoBase can still read and render the file in the preview component. The file URL must remain accessible with the current login state.
33
+
34
+ ### Third-party storage or a cross-origin URL
35
+
36
+ Third-party storage such as OSS, S3, COS, and CDNs usually uses a separate domain. NocoBase places this PDF URL in an iframe, so the browser and the storage service's response headers determine the result.
37
+
38
+ To open a PDF in the iframe, the storage service should normally return `Content-Type: application/pdf` and must not force a download with `Content-Disposition: attachment`. If the response requests a download, the browser downloads the file directly and NocoBase cannot override that behavior in the frontend.
39
+
40
+ Loading a cross-origin PDF in an iframe does not itself require CORS. However, the download button in the preview component reads the file with `fetch` and creates a Blob, so cross-origin downloads still require the storage service to allow CORS requests from the NocoBase site.
41
+
42
+ ### Notes for Aliyun OSS
43
+
44
+ In some cases, the default Aliyun OSS domain forces a download by returning `Content-Disposition: attachment` and `x-oss-force-download: true`. Images may still preview normally, while a PDF placed in an iframe is downloaded.
45
+
46
+ You can usually resolve this by binding a custom domain to the bucket and configuring NocoBase to access files through that domain. See [Aliyun OSS troubleshooting](../storage/aliyun-oss.md#common-issues) for configuration and diagnostic steps.
47
+
48
+ ### Security boundary for cross-origin previews
49
+
50
+ Some browsers or PDF readers may support scripts, forms, or other interactive content inside PDF files. If the previewed file comes from an untrusted source, pay attention to the security boundary for script execution.
16
51
 
17
52
  We recommend isolating the file access domain from the NocoBase site and API domains. For example, serve files from OSS, S3, COS, or a CDN through a dedicated domain, instead of sharing the same origin with the NocoBase frontend or API.
18
53
 
19
54
  If the file domain is different from the API domain, and the API does not enable CORS access for the file domain, scripts running in the PDF preview environment are usually restricted by the browser's same-origin policy. They cannot directly read the NocoBase page, browser storage, or API responses.
55
+
56
+ ## Related links
57
+
58
+ - [Office File Preview Plugin](./ms-office.md)
59
+ - [Aliyun OSS](../storage/aliyun-oss.md)
60
+ - [S3 Pro](../storage/s3-pro.md)