create-windy 0.2.33 → 0.3.0

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 (284) hide show
  1. package/dist/cli.js +173 -17
  2. package/package.json +1 -1
  3. package/template/.agents/skills/windy-business-module/SKILL.md +10 -1
  4. package/template/.windy-template.json +2 -2
  5. package/template/AGENTS.md +9 -0
  6. package/template/README.md +3 -1
  7. package/template/apps/agent-server/Dockerfile +1 -0
  8. package/template/apps/agent-server/README.md +28 -5
  9. package/template/apps/agent-server/adk_web_agents/__init__.py +1 -0
  10. package/template/apps/agent-server/adk_web_agents/safe_debug/__init__.py +3 -0
  11. package/template/apps/agent-server/adk_web_agents/safe_debug/agent.py +40 -0
  12. package/template/apps/agent-server/pyproject.toml +1 -1
  13. package/template/apps/agent-server/src/southwind_agent_server/adk_adapter.py +191 -16
  14. package/template/apps/agent-server/src/southwind_agent_server/adk_failure.py +13 -0
  15. package/template/apps/agent-server/src/southwind_agent_server/adk_model.py +225 -0
  16. package/template/apps/agent-server/src/southwind_agent_server/adk_tools.py +76 -0
  17. package/template/apps/agent-server/src/southwind_agent_server/app.py +63 -3
  18. package/template/apps/agent-server/src/southwind_agent_server/contracts.py +35 -0
  19. package/template/apps/agent-server/src/southwind_agent_server/engine.py +2 -0
  20. package/template/apps/agent-server/src/southwind_agent_server/openai_engine.py +31 -3
  21. package/template/apps/agent-server/src/southwind_agent_server/openai_provider.py +22 -9
  22. package/template/apps/agent-server/src/southwind_agent_server/provider_audit.py +144 -0
  23. package/template/apps/agent-server/src/southwind_agent_server/provider_governance.py +227 -0
  24. package/template/apps/agent-server/src/southwind_agent_server/service.py +1 -0
  25. package/template/apps/agent-server/tests/test_adk_adapter.py +305 -0
  26. package/template/apps/agent-server/tests/test_adk_web_agent.py +12 -0
  27. package/template/apps/agent-server/tests/test_api.py +16 -1
  28. package/template/apps/agent-server/tests/test_openai_provider.py +79 -0
  29. package/template/apps/agent-server/tests/test_provider_governance.py +215 -0
  30. package/template/apps/server/package.json +4 -1
  31. package/template/apps/server/src/agent/provider-input-governance.test.ts +82 -0
  32. package/template/apps/server/src/agent/provider-input-governance.ts +140 -0
  33. package/template/apps/server/src/agent/remote-runtime.test.ts +22 -0
  34. package/template/apps/server/src/agent/remote-runtime.ts +1 -0
  35. package/template/apps/server/src/agent/run-contracts.ts +2 -0
  36. package/template/apps/server/src/agent/run-facade.test.ts +52 -2
  37. package/template/apps/server/src/agent/run-facade.ts +38 -9
  38. package/template/apps/server/src/agent/tool-registry.ts +2 -6
  39. package/template/apps/server/src/application-services.ts +50 -0
  40. package/template/apps/server/src/audit/drizzle-log-store.ts +25 -0
  41. package/template/apps/server/src/audit/search-summary.ts +2 -6
  42. package/template/apps/server/src/auth/credential-restriction.ts +1 -0
  43. package/template/apps/server/src/auth/password.ts +30 -21
  44. package/template/apps/server/src/auth/routes.test.ts +44 -3
  45. package/template/apps/server/src/auth/routes.ts +6 -1
  46. package/template/apps/server/src/auth/runtime.ts +4 -1
  47. package/template/apps/server/src/auth/service.ts +25 -7
  48. package/template/apps/server/src/configuration/bootstrap.ts +20 -1
  49. package/template/apps/server/src/configuration/definition.test.ts +71 -0
  50. package/template/apps/server/src/configuration/definition.ts +242 -12
  51. package/template/apps/server/src/configuration/drizzle-repository.ts +36 -2
  52. package/template/apps/server/src/configuration/repository.ts +27 -2
  53. package/template/apps/server/src/configuration/routes.ts +4 -1
  54. package/template/apps/server/src/configuration/service.test.ts +100 -0
  55. package/template/apps/server/src/configuration/service.ts +50 -10
  56. package/template/apps/server/src/data-access/scoped-repository.integration.test.ts +3 -2
  57. package/template/apps/server/src/data-governance/export/service.ts +2 -6
  58. package/template/apps/server/src/example-modules.ts +4 -1
  59. package/template/apps/server/src/guards.ts +18 -5
  60. package/template/apps/server/src/http/request-source.test.ts +85 -0
  61. package/template/apps/server/src/http/request-source.ts +90 -0
  62. package/template/apps/server/src/index.ts +45 -45
  63. package/template/apps/server/src/license/routes.ts +2 -0
  64. package/template/apps/server/src/license/runtime-service.ts +10 -11
  65. package/template/apps/server/src/module-bootstrap.ts +2 -2
  66. package/template/apps/server/src/module-host/initialize-contracts.ts +6 -0
  67. package/template/apps/server/src/module-host/initialize.ts +30 -44
  68. package/template/apps/server/src/module-host/request-context.ts +29 -23
  69. package/template/apps/server/src/module-host/resource-file-policies.test.ts +197 -0
  70. package/template/apps/server/src/module-host/resource-file-policies.ts +108 -0
  71. package/template/apps/server/src/module-host/route-declaration.ts +45 -0
  72. package/template/apps/server/src/module-host/route-installer.ts +27 -3
  73. package/template/apps/server/src/module-host/storage-port.test.ts +170 -1
  74. package/template/apps/server/src/module-host/storage-port.ts +134 -1
  75. package/template/apps/server/src/module-host/storage-scope.ts +89 -0
  76. package/template/apps/server/src/module-host/tool-handlers.test.ts +305 -0
  77. package/template/apps/server/src/module-host/tool-handlers.ts +38 -4
  78. package/template/apps/server/src/module-host/user-directory-composition.test.ts +126 -0
  79. package/template/apps/server/src/module-host/user-directory-port.test.ts +238 -0
  80. package/template/apps/server/src/module-host/user-directory-port.ts +139 -0
  81. package/template/apps/server/src/module-host.ts +4 -0
  82. package/template/apps/server/src/notification/channel-adapter.ts +46 -0
  83. package/template/apps/server/src/notification/delivery-policy.test.ts +59 -0
  84. package/template/apps/server/src/notification/delivery-policy.ts +37 -0
  85. package/template/apps/server/src/notification/delivery-repository.ts +198 -0
  86. package/template/apps/server/src/notification/delivery-worker.test.ts +87 -0
  87. package/template/apps/server/src/notification/delivery-worker.ts +88 -0
  88. package/template/apps/server/src/notification/drizzle-management.ts +180 -0
  89. package/template/apps/server/src/notification/drizzle-query.ts +160 -0
  90. package/template/apps/server/src/notification/drizzle-repository.integration.test.ts +301 -0
  91. package/template/apps/server/src/notification/drizzle-repository.ts +156 -90
  92. package/template/apps/server/src/notification/extension-routes.test.ts +119 -0
  93. package/template/apps/server/src/notification/extension-routes.ts +111 -0
  94. package/template/apps/server/src/notification/memory-delivery-repository.ts +137 -0
  95. package/template/apps/server/src/notification/memory-support.ts +72 -0
  96. package/template/apps/server/src/notification/preference-repository.ts +95 -0
  97. package/template/apps/server/src/notification/recipient-directory.ts +104 -0
  98. package/template/apps/server/src/notification/repository.test.ts +171 -0
  99. package/template/apps/server/src/notification/repository.ts +179 -32
  100. package/template/apps/server/src/notification/revision-routes.test.ts +186 -0
  101. package/template/apps/server/src/notification/route-support.ts +225 -0
  102. package/template/apps/server/src/notification/routes.test.ts +182 -0
  103. package/template/apps/server/src/notification/routes.ts +225 -132
  104. package/template/apps/server/src/notification/service.test.ts +104 -0
  105. package/template/apps/server/src/notification/service.ts +140 -0
  106. package/template/apps/server/src/notification/smtp-adapter.test.ts +65 -0
  107. package/template/apps/server/src/notification/smtp-adapter.ts +68 -0
  108. package/template/apps/server/src/persistence.integration.test.ts +41 -2
  109. package/template/apps/server/src/route-guards.ts +1 -0
  110. package/template/apps/server/src/runtime-audit-list.test.ts +39 -0
  111. package/template/apps/server/src/runtime-development.ts +2 -0
  112. package/template/apps/server/src/runtime.test.ts +23 -9
  113. package/template/apps/server/src/runtime.ts +39 -2
  114. package/template/apps/server/src/scheduler/audit.ts +2 -11
  115. package/template/apps/server/src/scheduler/definitions.test.ts +6 -0
  116. package/template/apps/server/src/scheduler/definitions.ts +7 -0
  117. package/template/apps/server/src/scheduler/recovery-service.ts +2 -11
  118. package/template/apps/server/src/scheduler/routes.ts +2 -7
  119. package/template/apps/server/src/search/opensearch-client.test.ts +45 -0
  120. package/template/apps/server/src/search/opensearch-client.ts +145 -0
  121. package/template/apps/server/src/search/service.ts +2 -6
  122. package/template/apps/server/src/settings/routes.ts +15 -3
  123. package/template/apps/server/src/settings/runtime.ts +10 -1
  124. package/template/apps/server/src/storage/runtime.ts +13 -0
  125. package/template/apps/server/src/system/audit-query.ts +33 -4
  126. package/template/apps/server/src/system/audit-routes.test.ts +58 -4
  127. package/template/apps/server/src/system/audit-routes.ts +6 -5
  128. package/template/apps/server/src/system/built-in-roles.ts +1 -0
  129. package/template/apps/server/src/system/department-organization.ts +320 -0
  130. package/template/apps/server/src/system/department-routes.test.ts +207 -48
  131. package/template/apps/server/src/system/department-routes.ts +114 -33
  132. package/template/apps/server/src/system/drizzle-repository.ts +15 -7
  133. package/template/apps/server/src/system/drizzle-scoped-repository.ts +5 -3
  134. package/template/apps/server/src/system/drizzle-system.ts +37 -9
  135. package/template/apps/server/src/system/drizzle-transaction-context.ts +14 -0
  136. package/template/apps/server/src/system/identity-route-config.ts +7 -2
  137. package/template/apps/server/src/system/mutation-runner.ts +23 -0
  138. package/template/apps/server/src/system/organization-postgres.integration.test.ts +176 -0
  139. package/template/apps/server/src/system/resource-access-response.ts +12 -6
  140. package/template/apps/server/src/system/role-department-scope-policy.ts +55 -0
  141. package/template/apps/server/src/system/route-helpers.ts +2 -5
  142. package/template/apps/server/src/system/route-types.ts +12 -3
  143. package/template/apps/server/src/system/routes-validation.test.ts +26 -0
  144. package/template/apps/server/src/system/routes.test.ts +10 -2
  145. package/template/apps/server/src/system/routes.ts +70 -36
  146. package/template/apps/server/src/system/seed.ts +7 -0
  147. package/template/apps/server/src/work-order/data-scope.integration.test.ts +9 -2
  148. package/template/apps/server/src/work-order/opensearch-index.test.ts +97 -0
  149. package/template/apps/server/src/work-order/opensearch-index.ts +313 -0
  150. package/template/apps/server/src/work-order/search-provider.ts +60 -1
  151. package/template/apps/server/src/work-order/service.ts +42 -10
  152. package/template/apps/web/src/app/error-pages.ts +9 -0
  153. package/template/apps/web/src/components/auth/PasswordChangeForm.vue +16 -11
  154. package/template/apps/web/src/components/auth/PasswordChangeForm.webtest.ts +14 -0
  155. package/template/apps/web/src/components/common/FormDialog.vue +16 -2
  156. package/template/apps/web/src/components/common/ModalLayout.webtest.ts +20 -1
  157. package/template/apps/web/src/composables/useGlobalSearch.ts +68 -0
  158. package/template/apps/web/src/composables/usePlatformSettings.ts +8 -7
  159. package/template/apps/web/src/layout/GlobalSearchResults.vue +58 -0
  160. package/template/apps/web/src/layout/NavigationSearchDialog.vue +42 -6
  161. package/template/apps/web/src/layout/NavigationSearchDialog.webtest.ts +71 -0
  162. package/template/apps/web/src/layout/NotificationMenu.vue +73 -31
  163. package/template/apps/web/src/layout/NotificationMenu.webtest.ts +44 -1
  164. package/template/apps/web/src/layout/NotificationMenuItem.vue +61 -0
  165. package/template/apps/web/src/layout/NotificationPreferencesDialog.vue +181 -0
  166. package/template/apps/web/src/layout/NotificationPreferencesDialog.webtest.ts +80 -0
  167. package/template/apps/web/src/lib/date-time.ts +22 -10
  168. package/template/apps/web/src/lib/date-time.webtest.ts +9 -1
  169. package/template/apps/web/src/main.ts +14 -1
  170. package/template/apps/web/src/pages/auth/ChangePasswordPage.vue +16 -1
  171. package/template/apps/web/src/pages/configuration/components/ModuleConfigVersionList.vue +1 -0
  172. package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.vue +10 -0
  173. package/template/apps/web/src/pages/configuration/components/ModuleConfigurationWorkbench.vue +37 -6
  174. package/template/apps/web/src/pages/errors/PlatformErrorPage.vue +115 -0
  175. package/template/apps/web/src/pages/errors/PlatformErrorPage.webtest.ts +44 -0
  176. package/template/apps/web/src/pages/errors/error-page-extension.ts +26 -0
  177. package/template/apps/web/src/pages/system/SystemNotificationsPage.vue +136 -68
  178. package/template/apps/web/src/pages/system/SystemNotificationsPage.webtest.ts +224 -12
  179. package/template/apps/web/src/pages/system/audit-log-presenter.ts +86 -0
  180. package/template/apps/web/src/pages/system/audit-time-range.ts +28 -0
  181. package/template/apps/web/src/pages/system/components/AuditActionCell.vue +10 -69
  182. package/template/apps/web/src/pages/system/components/AuditActionCell.webtest.ts +20 -27
  183. package/template/apps/web/src/pages/system/components/AuditLogDetailDialog.vue +134 -0
  184. package/template/apps/web/src/pages/system/components/AuditLogDetailDialog.webtest.ts +76 -0
  185. package/template/apps/web/src/pages/system/components/AuditLogFilters.vue +116 -52
  186. package/template/apps/web/src/pages/system/components/AuditLogFilters.webtest.ts +52 -15
  187. package/template/apps/web/src/pages/system/components/NotificationHistoryDialog.vue +129 -0
  188. package/template/apps/web/src/pages/system/components/NotificationManagementCard.vue +91 -0
  189. package/template/apps/web/src/pages/system/components/NotificationPublishDialog.vue +121 -0
  190. package/template/apps/web/src/pages/system/components/NotificationPublishForm.vue +162 -1
  191. package/template/apps/web/src/pages/system/components/SystemResourceActions.vue +68 -0
  192. package/template/apps/web/src/pages/system/components/SystemResourceEditor.vue +74 -0
  193. package/template/apps/web/src/pages/system/components/SystemResourceFilters.vue +3 -4
  194. package/template/apps/web/src/pages/system/components/SystemResourcePage.vue +91 -98
  195. package/template/apps/web/src/pages/system/components/SystemResourcePage.webtest.ts +68 -0
  196. package/template/apps/web/src/pages/system/components/SystemResourceTable.vue +20 -1
  197. package/template/apps/web/src/pages/system/components/SystemResourceTable.webtest.ts +28 -7
  198. package/template/apps/web/src/pages/system/components/department/DepartmentOrganizationForm.vue +210 -0
  199. package/template/apps/web/src/pages/system/components/department/DepartmentTransitionDialog.vue +112 -0
  200. package/template/apps/web/src/pages/system/components/user-account/UserAccountForm.vue +17 -4
  201. package/template/apps/web/src/pages/system/composables/useDepartmentTransitions.ts +79 -0
  202. package/template/apps/web/src/pages/system/composables/useNotificationPermissions.ts +14 -0
  203. package/template/apps/web/src/pages/system/composables/useSystemResource.ts +2 -0
  204. package/template/apps/web/src/pages/system/composables/useSystemResource.webtest.ts +15 -2
  205. package/template/apps/web/src/pages/system/resource-config.ts +12 -4
  206. package/template/apps/web/src/router/error-navigation.ts +50 -0
  207. package/template/apps/web/src/router/error-navigation.webtest.ts +106 -0
  208. package/template/apps/web/src/router/index.ts +71 -0
  209. package/template/apps/web/src/router/index.webtest.ts +29 -0
  210. package/template/apps/web/src/router/manifest-routes.webtest.ts +4 -0
  211. package/template/apps/web/src/router/shared-scaffold-neutrality.webtest.ts +12 -0
  212. package/template/apps/web/src/services/auth-api.ts +5 -0
  213. package/template/apps/web/src/services/http.ts +43 -6
  214. package/template/apps/web/src/services/http.webtest.ts +70 -0
  215. package/template/apps/web/src/services/notification-api.ts +85 -2
  216. package/template/apps/web/src/services/notification-api.webtest.ts +110 -0
  217. package/template/apps/web/src/services/search-api.ts +39 -0
  218. package/template/apps/web/src/services/system-api.ts +18 -0
  219. package/template/apps/web/vitest.config.ts +1 -0
  220. package/template/docker-compose.yml +68 -0
  221. package/template/docs/architecture/ai-egress.md +49 -7
  222. package/template/docs/architecture/ai-runtime.md +34 -6
  223. package/template/docs/architecture/data-scope-query-enforcement.md +4 -0
  224. package/template/docs/architecture/object-storage.md +22 -2
  225. package/template/docs/architecture/search-provider-protocol.md +38 -2
  226. package/template/docs/development/custom-error-pages.md +78 -0
  227. package/template/docs/development/custom-login-page.md +3 -3
  228. package/template/docs/platform/agent-runtime.md +76 -7
  229. package/template/docs/platform/audit-reliability.md +46 -2
  230. package/template/docs/platform/business-user-directory.md +82 -0
  231. package/template/docs/platform/module-configuration.md +13 -4
  232. package/template/docs/platform/notifications.md +67 -11
  233. package/template/docs/platform/organization-membership.md +17 -3
  234. package/template/docs/platform/system-crud-api.md +16 -0
  235. package/template/docs/platform/web-system-crud.md +6 -2
  236. package/template/package.json +4 -0
  237. package/template/packages/config/index.test.ts +45 -0
  238. package/template/packages/config/package.json +1 -1
  239. package/template/packages/config/src/platform.ts +169 -48
  240. package/template/packages/database/drizzle/0035_material_nightshade.sql +10 -0
  241. package/template/packages/database/drizzle/0036_hesitant_speed.sql +35 -0
  242. package/template/packages/database/drizzle/0037_absent_nick_fury.sql +2 -0
  243. package/template/packages/database/drizzle/0038_uneven_wasp.sql +38 -0
  244. package/template/packages/database/drizzle/meta/0035_snapshot.json +7331 -0
  245. package/template/packages/database/drizzle/meta/0036_snapshot.json +7436 -0
  246. package/template/packages/database/drizzle/meta/0037_snapshot.json +7457 -0
  247. package/template/packages/database/drizzle/meta/0038_snapshot.json +7749 -0
  248. package/template/packages/database/drizzle/meta/_journal.json +28 -0
  249. package/template/packages/database/package.json +1 -1
  250. package/template/packages/database/src/schema/identity.ts +7 -0
  251. package/template/packages/database/src/schema/notifications.ts +135 -0
  252. package/template/packages/database/src/schema-notification-delivery.test.ts +54 -0
  253. package/template/packages/database/src/schema-workflow-notification.test.ts +40 -1
  254. package/template/packages/modules/package.json +1 -1
  255. package/template/packages/modules/src/ai-operation-composition.test.ts +68 -0
  256. package/template/packages/modules/src/ai-operation-composition.ts +115 -0
  257. package/template/packages/modules/src/manifest.ts +26 -0
  258. package/template/packages/modules/src/provider-data-policy-composition.test.ts +74 -0
  259. package/template/packages/modules/src/system-api-permissions.ts +54 -0
  260. package/template/packages/modules/src/system-audit-actions.ts +15 -0
  261. package/template/packages/modules/src/system-features.ts +6 -1
  262. package/template/packages/modules/src/system-module-catalog.test.ts +16 -0
  263. package/template/packages/modules/src/system-module-catalog.ts +28 -4
  264. package/template/packages/modules/src/system-modules.test.ts +13 -1
  265. package/template/packages/modules/src/system-modules.ts +12 -0
  266. package/template/packages/modules/src/system-permissions.ts +11 -5
  267. package/template/packages/server-sdk/index.ts +11 -0
  268. package/template/packages/server-sdk/package.json +3 -2
  269. package/template/packages/server-sdk/src/ai-operation-registration.ts +2 -1
  270. package/template/packages/server-sdk/src/module-host.ts +8 -0
  271. package/template/packages/server-sdk/src/request-context.ts +2 -0
  272. package/template/packages/server-sdk/src/storage-port.ts +66 -0
  273. package/template/packages/server-sdk/src/tool-registration.ts +6 -0
  274. package/template/packages/server-sdk/src/user-directory-port.ts +42 -0
  275. package/template/packages/shared/package.json +1 -1
  276. package/template/packages/shared/src/audit.ts +25 -0
  277. package/template/packages/shared/src/module-configuration.ts +5 -0
  278. package/template/packages/shared/src/notification.ts +92 -1
  279. package/template/packages/shared/src/password.ts +7 -2
  280. package/template/packages/shared/src/platform-settings.ts +2 -0
  281. package/template/packages/storage/package.json +1 -1
  282. package/template/packages/storage/src/upload-service.test.ts +16 -0
  283. package/template/packages/storage/src/upload-service.ts +5 -1
  284. package/template/scripts/notification-postgres-regression.ts +27 -0
package/dist/cli.js CHANGED
@@ -248,6 +248,7 @@ var optionalModuleManifests = [
248
248
  "apps/server/src/agent",
249
249
  "apps/server/src/mcp",
250
250
  "apps/server/src/module-host/tool-handlers.ts",
251
+ "apps/server/src/module-host/tool-handlers.test.ts",
251
252
  "packages/modules/src/system-agent-tools.ts"
252
253
  ],
253
254
  documentation: [
@@ -298,21 +299,48 @@ var optionalModuleManifests = [
298
299
  ]
299
300
  },
300
301
  {
301
- ...module("system.notification", "站内通知", "通知发布、阅读和归档。", [
302
- "system",
303
- "system.identity"
304
- ]),
302
+ ...module("system.notification", "站内通知", "通知定向与定时发布、用户偏好、外部渠道投递、修改历史、阅读、收藏和归档。", ["system", "system.identity", "system.scheduler"]),
303
+ registryDependencies: [
304
+ {
305
+ sourceName: "nodemailer",
306
+ name: "nodemailer",
307
+ version: "^9.0.3"
308
+ },
309
+ {
310
+ sourceName: "@types/nodemailer",
311
+ name: "@types/nodemailer",
312
+ version: "^8.0.1"
313
+ }
314
+ ],
305
315
  fileRoots: [
306
316
  "apps/server/src/notification",
307
317
  "apps/web/src/layout/NotificationMenu.vue",
318
+ "apps/web/src/layout/NotificationMenuItem.vue",
308
319
  "apps/web/src/layout/NotificationMenu.webtest.ts",
320
+ "apps/web/src/layout/NotificationPreferencesDialog.vue",
321
+ "apps/web/src/layout/NotificationPreferencesDialog.webtest.ts",
322
+ "apps/web/src/services/notification-api.ts",
309
323
  "apps/web/src/pages/system/SystemNotificationsPage.vue",
310
324
  "apps/web/src/pages/system/SystemNotificationsPage.webtest.ts",
311
- "apps/web/src/pages/system/components/NotificationPublishForm.vue"
325
+ "apps/web/src/pages/system/components/NotificationPublishForm.vue",
326
+ "apps/web/src/pages/system/components/NotificationPublishDialog.vue",
327
+ "apps/web/src/pages/system/components/NotificationManagementCard.vue",
328
+ "apps/web/src/pages/system/components/NotificationHistoryDialog.vue",
329
+ "apps/web/src/pages/system/composables/useNotificationPermissions.ts",
330
+ "apps/web/src/services/notification-api.webtest.ts",
331
+ "scripts/notification-postgres-regression.ts",
332
+ "packages/database/src/schema-notification-delivery.test.ts"
312
333
  ],
313
334
  documentation: ["docs/platform/notifications.md"],
314
335
  schemaFiles: ["packages/database/src/schema/notifications.ts"],
315
- databaseTables: ["platform_notifications", "notification_reads"]
336
+ databaseTables: [
337
+ "platform_notifications",
338
+ "notification_reads",
339
+ "notification_favorites",
340
+ "notification_revisions",
341
+ "notification_preferences",
342
+ "notification_delivery_outbox"
343
+ ]
316
344
  },
317
345
  {
318
346
  ...module("system.workflow", "审批工作流", "审批、转交、超时和补偿。", [
@@ -354,8 +382,11 @@ var optionalModuleManifests = [
354
382
  fileRoots: [
355
383
  "apps/server/src/search",
356
384
  "apps/server/src/module-host/search-providers.ts",
385
+ "apps/web/src/composables/useGlobalSearch.ts",
357
386
  "apps/web/src/layout/NavigationSearchDialog.vue",
358
- "apps/web/src/layout/NavigationSearchDialog.webtest.ts"
387
+ "apps/web/src/layout/NavigationSearchDialog.webtest.ts",
388
+ "apps/web/src/layout/GlobalSearchResults.vue",
389
+ "apps/web/src/services/search-api.ts"
359
390
  ],
360
391
  documentation: ["docs/architecture/search-provider-protocol.md"]
361
392
  },
@@ -476,7 +507,7 @@ var platformModules = [
476
507
  {
477
508
  sourceName: "@southwind-ai/license",
478
509
  name: "@southwind-ai/license",
479
- version: "^0.1.1"
510
+ version: "^0.1.3"
480
511
  }
481
512
  ],
482
513
  fileRoots: [
@@ -533,8 +564,12 @@ var platformModules = [
533
564
  "apps/server/src/persistence.integration.test.ts",
534
565
  "apps/server/src/system/audit-routes.ts",
535
566
  "apps/server/src/system/audit-routes.test.ts",
567
+ "apps/web/src/pages/system/audit-log-presenter.ts",
568
+ "apps/web/src/pages/system/audit-time-range.ts",
536
569
  "apps/web/src/pages/system/components/AuditActionCell.vue",
537
570
  "apps/web/src/pages/system/components/AuditActionCell.webtest.ts",
571
+ "apps/web/src/pages/system/components/AuditLogDetailDialog.vue",
572
+ "apps/web/src/pages/system/components/AuditLogDetailDialog.webtest.ts",
538
573
  "apps/web/src/pages/system/components/AuditLogFilters.vue",
539
574
  "apps/web/src/pages/system/components/AuditLogFilters.webtest.ts"
540
575
  ],
@@ -1529,6 +1564,7 @@ var starterComposeBase = `services:
1529
1564
  AGENT_SERVER_URL: http://agent-server:8080
1530
1565
  AGENT_TOOL_HOST_URL: http://server:9747
1531
1566
  AGENT_SERVER_INTERNAL_TOKEN: \${AGENT_SERVER_INTERNAL_TOKEN:-}
1567
+ __OPENSEARCH_SERVER_ENV__
1532
1568
  ports:
1533
1569
  - "9747:9747"
1534
1570
  volumes:
@@ -1539,6 +1575,7 @@ var starterComposeBase = `services:
1539
1575
  migrate:
1540
1576
  condition: service_completed_successfully
1541
1577
 
1578
+ __OPENSEARCH_SERVICE__
1542
1579
  web:
1543
1580
  build:
1544
1581
  context: .
@@ -1572,7 +1609,30 @@ var starterComposeBase = `services:
1572
1609
  volumes:
1573
1610
  postgres-data:
1574
1611
  server-audit-data:
1575
- __AGENT_VOLUME__
1612
+ __OPTIONAL_VOLUMES__
1613
+ `;
1614
+ var openSearchComposeService = ` opensearch:
1615
+ profiles: ["search"]
1616
+ image: opensearchproject/opensearch:2.19.3
1617
+ environment:
1618
+ discovery.type: single-node
1619
+ DISABLE_INSTALL_DEMO_CONFIG: "true"
1620
+ DISABLE_SECURITY_PLUGIN: "true"
1621
+ OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
1622
+ ports:
1623
+ - "127.0.0.1:19200:9200"
1624
+ volumes:
1625
+ - opensearch-data:/usr/share/opensearch/data
1626
+ healthcheck:
1627
+ test:
1628
+ [
1629
+ "CMD-SHELL",
1630
+ "curl -fsS http://127.0.0.1:9200/_cluster/health?wait_for_status=yellow",
1631
+ ]
1632
+ interval: 10s
1633
+ timeout: 5s
1634
+ retries: 12
1635
+
1576
1636
  `;
1577
1637
  var agentComposeService = ` agent-server:
1578
1638
  profiles: ["agent"]
@@ -1582,6 +1642,8 @@ var agentComposeService = ` agent-server:
1582
1642
  environment:
1583
1643
  AGENT_SERVER_INTERNAL_TOKEN: \${AGENT_SERVER_INTERNAL_TOKEN:-}
1584
1644
  AGENT_RUN_STORE_PATH: /app/data/agent/runs.sqlite3
1645
+ AI_PROVIDER_AUDIT_STORE_PATH: /app/data/agent/provider-audit.sqlite3
1646
+ AI_PROVIDER_AUDIT_RETENTION_DAYS: \${AI_PROVIDER_AUDIT_RETENTION_DAYS:-90}
1585
1647
  QWEN_API_URL: \${QWEN_API_URL:-}
1586
1648
  QWEN_API_KEY: \${QWEN_API_KEY:-}
1587
1649
  QWEN_MODEL: \${QWEN_MODEL:-}
@@ -1595,36 +1657,91 @@ var agentComposeService = ` agent-server:
1595
1657
  server:
1596
1658
  condition: service_started
1597
1659
 
1660
+ adk-web-debug:
1661
+ profiles: ["agent-debug"]
1662
+ build:
1663
+ context: .
1664
+ dockerfile: apps/agent-server/Dockerfile
1665
+ command:
1666
+ [
1667
+ "adk",
1668
+ "web",
1669
+ "--host",
1670
+ "0.0.0.0",
1671
+ "--port",
1672
+ "8000",
1673
+ "--no-reload",
1674
+ "--session_service_uri",
1675
+ "memory://",
1676
+ "--artifact_service_uri",
1677
+ "memory://",
1678
+ "--logo-text",
1679
+ "Windy ADK 开发调试(无业务工具)",
1680
+ "--logo-image-url",
1681
+ "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%2F%3E",
1682
+ "/app/apps/agent-server/adk_web_agents",
1683
+ ]
1684
+ ports:
1685
+ - "127.0.0.1:8000:8000"
1686
+ healthcheck:
1687
+ test:
1688
+ [
1689
+ "CMD",
1690
+ "python",
1691
+ "-c",
1692
+ "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/', timeout=3)",
1693
+ ]
1694
+ interval: 10s
1695
+ timeout: 5s
1696
+ retries: 5
1697
+
1598
1698
  `;
1599
- function starterComposeFor(includeAgent) {
1699
+ function starterComposeFor(includeAgent, includeSearch = true) {
1600
1700
  return starterComposeBase.replace(` web:
1601
1701
  `, `${includeAgent ? agentComposeService : ""} web:
1602
- `).replace("__AGENT_VOLUME__", includeAgent ? " agent-run-data:" : "");
1702
+ `).replace("__OPENSEARCH_SERVER_ENV__", includeSearch ? ` OPENSEARCH_URL: \${OPENSEARCH_URL:-}
1703
+ OPENSEARCH_USERNAME: \${OPENSEARCH_USERNAME:-}
1704
+ OPENSEARCH_PASSWORD: \${OPENSEARCH_PASSWORD:-}
1705
+ OPENSEARCH_WORK_ORDER_INDEX: \${OPENSEARCH_WORK_ORDER_INDEX:-windy-work-orders-v1}` : "").replace("__OPENSEARCH_SERVICE__", includeSearch ? openSearchComposeService : "").replace("__OPTIONAL_VOLUMES__", [
1706
+ includeAgent ? " agent-run-data:" : "",
1707
+ includeSearch ? " opensearch-data:" : ""
1708
+ ].filter(Boolean).join(`
1709
+ `));
1603
1710
  }
1604
1711
  var starterCompose = starterComposeFor(true);
1605
- function environmentExample(includeExample, includeAgent = true) {
1712
+ function environmentExample(includeExample, includeAgent = true, includeSearch = true) {
1606
1713
  return `# 复制为 .env 后填写。不要提交真实密码。
1607
1714
  POSTGRES_PASSWORD=
1608
1715
  WINDY_BOOTSTRAP_ADMIN_PASSWORD=
1609
1716
  ${includeAgent ? `
1610
1717
  # Agent profile 仅由服务端 Agent Runtime 读取;不要使用 VITE_ 前缀。
1718
+ # ADK Web 调试 profile 不读取以下变量,也不能调用真实业务 Operation 或 Tool。
1611
1719
  PLATFORM_ENABLE_AI=false
1612
1720
  AGENT_SERVER_INTERNAL_TOKEN=
1613
1721
  QWEN_API_URL=
1614
1722
  QWEN_API_KEY=
1615
1723
  QWEN_MODEL=
1616
1724
  AI_PROVIDER_HTTPS_HOST_ALLOWLIST=
1725
+ # AI_PROVIDER_AUDIT_RETENTION_DAYS=90
1617
1726
  # AI_PROVIDER_CONNECT_TIMEOUT_MS=5000
1618
1727
  # AI_PROVIDER_REQUEST_TIMEOUT_MS=60000
1619
1728
  # AI_PROVIDER_MAX_RESPONSE_BYTES=2097152
1620
1729
  ` : ""}
1621
1730
 
1731
+ ${includeSearch ? `# OpenSearch profile 默认不启动;bun run dev:search 会只向 Server 注入容器内地址。
1732
+ OPENSEARCH_URL=
1733
+ OPENSEARCH_USERNAME=
1734
+ OPENSEARCH_PASSWORD=
1735
+ # OPENSEARCH_REQUEST_TIMEOUT_MS=3000
1736
+ # OPENSEARCH_WORK_ORDER_INDEX=windy-work-orders-v1
1737
+
1622
1738
  # 可选搜索配置;不配置时启用 Manifest 中默认开启的 Provider。${includeExample ? `
1623
1739
  # SEARCH_PROVIDER_KEYS=work-order.ticket.search` : `
1624
1740
  # 当前 core profile 没有业务 SearchProvider;接入业务模块后再配置 Key。`}
1625
1741
  # SEARCH_PROVIDER_TIMEOUT_MS=800
1626
1742
  # SEARCH_HEALTH_TIMEOUT_MS=500
1627
1743
  # SEARCH_MAX_REQUESTS_PER_MINUTE=30
1744
+ ` : ""}
1628
1745
  `;
1629
1746
  }
1630
1747
  // src/project-files.ts
@@ -1647,6 +1764,7 @@ ${includeAgent ? "- Agent:[Agent Runtime 接入](./platform/agent-runtime.md)
1647
1764
  function starterReadme(projectName, includeExample = true, includeOxc = true, projectLicense = "UNLICENSED", selectedModules = []) {
1648
1765
  const selected = new Set(selectedModules);
1649
1766
  const includeAgent = selected.has("system.agent");
1767
+ const includeSearch = selected.has("system.search");
1650
1768
  const moduleRows = moduleDistributionCatalog.map(({ name, description, selection }) => `| \`${name}\` | ${selected.has(name) ? "已包含" : "未包含"} | ${selection === "required" ? "H0" : "H2"} | ${description} |`).join(`
1651
1769
  `);
1652
1770
  return `# ${projectName}
@@ -1722,6 +1840,32 @@ bun run dev:agent
1722
1840
  MCP 客户端使用 \`http://localhost:9747/api/mcp\`,并通过平台 Bearer Token 或 Session
1723
1841
  Cookie 鉴权。该入口只发现当前账号获准的只读 Tool;每次调用都会重新执行 Feature、
1724
1842
  RBAC 和数据范围校验。
1843
+
1844
+ ADK Web 仅用于本机开发调试:
1845
+
1846
+ \`\`\`bash
1847
+ bun run dev:adk-web
1848
+ \`\`\`
1849
+
1850
+ 访问 \`http://127.0.0.1:8000\`。该独立 \`agent-debug\` profile 只加载无 Provider、
1851
+ 无业务 Tool 的受控调试 Agent,不接收 Actor 或 Execution Grant,也不能代表真实业务
1852
+ Operation;普通 \`dev\`、\`agent\` profile 和生产部署均不会启动或暴露它。
1853
+ ` : ""}
1854
+ ${includeSearch ? `
1855
+ ## OpenSearch 搜索 profile
1856
+
1857
+ 全局搜索默认使用各业务模块自己的 Repository Provider,不依赖外部搜索服务。需要验证
1858
+ 可重建索引 Adapter 时运行:
1859
+
1860
+ \`\`\`bash
1861
+ bun run dev:search
1862
+ \`\`\`
1863
+
1864
+ 该命令显式启动 OpenSearch 并只向 Server 注入容器内地址;普通 \`bun run dev\` 不会
1865
+ 启动 OpenSearch。OpenSearch 只保存可重建的业务搜索投影,PostgreSQL 仍是事实源,最终
1866
+ 结果会再次经过目标资源权限与 dataScope 校验。宿主机调试端口仅绑定
1867
+ \`127.0.0.1:19200\`,不要直接暴露到客户网络。接入细节见
1868
+ [SearchProvider 协议](./docs/architecture/search-provider-protocol.md)。
1725
1869
  ` : ""}
1726
1870
 
1727
1871
  ## 页面与登录
@@ -1777,6 +1921,7 @@ bun run dev
1777
1921
  bun run dev:build
1778
1922
  bun run dev:web
1779
1923
  bun run dev:server
1924
+ ${includeSearch ? "bun run dev:search" : ""}
1780
1925
  bun run typecheck
1781
1926
  bun run test
1782
1927
  bun run build
@@ -1850,7 +1995,13 @@ function createStarterPackage(source, projectName, includeOxc = true, projectLic
1850
1995
  dev: "docker compose up",
1851
1996
  "docker:sync": "create-windy sync-docker",
1852
1997
  "dev:build": "bun run docker:sync && docker compose up --build",
1853
- ...selectedModules.includes("system.agent") ? { "dev:agent": "docker compose --profile agent up --build" } : {},
1998
+ ...selectedModules.includes("system.search") ? {
1999
+ "dev:search": "OPENSEARCH_URL=http://opensearch:9200 docker compose --profile search up --build"
2000
+ } : {},
2001
+ ...selectedModules.includes("system.agent") ? {
2002
+ "dev:agent": "docker compose --profile agent up --build",
2003
+ "dev:adk-web": "docker compose --profile agent-debug up --build adk-web-debug"
2004
+ } : {},
1854
2005
  ...generatorVersion ? { windy: "create-windy" } : {},
1855
2006
  "dev:web": "bun run --cwd apps/web dev",
1856
2007
  "dev:server": "bun run --cwd apps/server dev",
@@ -1895,7 +2046,8 @@ var templateRootFiles = [
1895
2046
  "docker-compose.yml",
1896
2047
  "drizzle.config.ts",
1897
2048
  "module-schema.lineages.json",
1898
- "package.json"
2049
+ "package.json",
2050
+ "scripts/notification-postgres-regression.ts"
1899
2051
  ];
1900
2052
  var templateDirectories = [
1901
2053
  ".agents/skills/windy-business-module",
@@ -1927,6 +2079,7 @@ var templateDocumentationFiles = [
1927
2079
  "docs/architecture/object-storage.md",
1928
2080
  "docs/architecture/search-provider-protocol.md",
1929
2081
  "docs/development/crud-generator.md",
2082
+ "docs/development/custom-error-pages.md",
1930
2083
  "docs/development/custom-login-page.md",
1931
2084
  "docs/license/license-offline-activation-code.md",
1932
2085
  "docs/operations/observability.md",
@@ -1934,6 +2087,7 @@ var templateDocumentationFiles = [
1934
2087
  "docs/platform/agent-runtime.md",
1935
2088
  "docs/platform/audit-reliability.md",
1936
2089
  "docs/platform/bulk-data-jobs.md",
2090
+ "docs/platform/business-user-directory.md",
1937
2091
  "docs/platform/data-access-control.md",
1938
2092
  "docs/platform/module-configuration.md",
1939
2093
  "docs/platform/navigation-registry.md",
@@ -2146,8 +2300,8 @@ async function generateProject(input) {
2146
2300
  const packageJson = JSON.parse(await readFile10(packagePath, "utf8"));
2147
2301
  await writeFile9(packagePath, `${JSON.stringify(createStarterPackage(packageJson, input.projectName, includeOxc, projectLicense, selectedModules, templateMetadata.generatorVersion), null, 2)}
2148
2302
  `);
2149
- await writeFile9(join10(input.targetDirectory, "docker-compose.yml"), starterComposeFor(selectedModules.includes("system.agent")));
2150
- await writeFile9(join10(input.targetDirectory, ".env.example"), environmentExample(includeExample, selectedModules.includes("system.agent")));
2303
+ await writeFile9(join10(input.targetDirectory, "docker-compose.yml"), starterComposeFor(selectedModules.includes("system.agent"), selectedModules.includes("system.search")));
2304
+ await writeFile9(join10(input.targetDirectory, ".env.example"), environmentExample(includeExample, selectedModules.includes("system.agent"), selectedModules.includes("system.search")));
2151
2305
  await writeFile9(join10(input.targetDirectory, "README.md"), starterReadme(input.projectName, includeExample, includeOxc, projectLicense, selectedModules));
2152
2306
  await writeFile9(join10(input.targetDirectory, "docs/README.md"), starterDocsReadme(selectedModules.includes("system.license"), selectedModules.includes("system.agent")));
2153
2307
  await reflectCodeQualityChoice(input.targetDirectory, includeOxc);
@@ -4364,7 +4518,9 @@ var recipes = [
4364
4518
  { id: "starter-0.2.29-to-0.2.30", from: "0.2.29", to: "0.2.30" },
4365
4519
  { id: "starter-0.2.30-to-0.2.31", from: "0.2.30", to: "0.2.31" },
4366
4520
  { id: "starter-0.2.31-to-0.2.32", from: "0.2.31", to: "0.2.32" },
4367
- { id: "starter-0.2.32-to-0.2.33", from: "0.2.32", to: "0.2.33" }
4521
+ { id: "starter-0.2.32-to-0.2.33", from: "0.2.32", to: "0.2.33" },
4522
+ { id: "starter-0.2.33-to-0.2.34", from: "0.2.33", to: "0.2.34" },
4523
+ { id: "starter-0.2.34-to-0.3.0", from: "0.2.34", to: "0.3.0" }
4368
4524
  ];
4369
4525
  function resolveRecipeChain(sourceVersion, targetVersion) {
4370
4526
  if (sourceVersion === targetVersion)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-windy",
3
- "version": "0.2.33",
3
+ "version": "0.3.0",
4
4
  "description": "创建单组织、单租户、私有部署优先的 Windy 企业 Dashboard Starter",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,14 +18,23 @@ description: "Windy 业务模块、Manifest、Repository、Service、Agent Tool
18
18
  其它模块只能通过 Service、公开 Port 或模块注册机制协作。
19
19
  4. Server 通过 `InstallableServerModule` 和 `ModuleHost` 注册 Guarded Route、Task、
20
20
  Provider 或 Tool Handler。Handler 调用 Service,不直接访问其它模块 Repository。
21
+ 需要选择启用用户时使用 `ModuleRequestContext.userDirectory`;不要导入用户 Admin
22
+ Repository。业务 RolePreset 不能注册平台 Permission,部署管理员须显式向业务角色
23
+ 授予 `system.user-directory.read` 并配置数据范围。
21
24
  5. Tool 输入输出只使用 Manifest 已注册的顶层 object JSON Schema。Actor、Permission、
22
25
  Feature、License 和 Data Scope 只来自 `ModuleToolContext` 与平台 Runtime。
26
+ Tool 或 Route 需要读取同业务范围内其他用户上传的文件时,在 Host 注册精确
27
+ `purpose + resourceType` 的 `registerResourceFileAccessPolicies()`;Resolver 必须用
28
+ project-owned Repository 回查资源与 fileId 绑定及对象级授权,只返回布尔判定,
29
+ 再通过 `context.storage.openResourceFile()` 取得最小元数据与流。禁止注入
30
+ UploadRepository、BlobStore 或申请平台 manage Repository。
23
31
  6. 若项目包含 `system.agent`,`operation=query` 的 Tool 会由同一 Registry 自动进入
24
32
  MCP;不要编辑 MCP Adapter 或复制 Tool 定义。写操作在幂等、审批和结果追踪闭环前
25
33
  不通过 MCP 暴露。
26
34
  7. 补 Manifest/Composition、Repository/Service、Guard 拒绝和 Handler 契约测试。
27
35
  涉及 Tool 时还要覆盖 Schema 拒绝、数据范围与未授权发现/调用;涉及可选模块时覆盖
28
- Starter 的文件、依赖和数据库裁剪。
36
+ Starter 的文件、依赖和数据库裁剪。涉及资源文件时还要覆盖跨上传者成功、资源绑定/
37
+ purpose/Feature/Permission/Scope 任一拒绝、最小元数据与成功/拒绝审计。
29
38
  8. 更新长期文档,运行受影响测试、`bun run typecheck` 和 `bun run lint`,按一个完整
30
39
  小切片提交。
31
40
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "templateCommit": "395761d19b6dac6f4135547bedf996e3a53249a7",
4
- "generatorVersion": "0.2.33",
3
+ "templateCommit": "c6c39b2cac4c74ed6352c50e89a4bcddab0eafc7",
4
+ "generatorVersion": "0.3.0",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",
@@ -44,6 +44,13 @@
44
44
  `apps/web/src/pages/auth/LoginPage.vue` 或 Router。业务页面复用
45
45
  `useLoginFlow`、`DevelopmentAuthWarning` 和平台品牌设置,保留安全
46
46
  `returnTo`、真实认证与开发认证提示。
47
+ - 定制 404、500、维护中或网络异常页时,只修改 project-owned 的
48
+ `apps/web/src/app/error-pages.ts`,并把业务 SFC 放在 `apps/web/src/app/`;
49
+ 保留四个类型化注册项,不要为换视觉修改 Router、HTTP 核心或平台默认错误页。
50
+ - 业务 Agent Operation 开启 Provider 出网时,必须在 Manifest 同时声明最小
51
+ `providerDataPolicy.inputFields` JSON Pointer allowlist 与
52
+ `envelopeFields`;raw input 会在进入 `prepare` 前裁剪并执行 DLP。接入与升级
53
+ 诊断见 `docs/platform/agent-runtime.md`。
47
54
 
48
55
  ## 常用入口
49
56
 
@@ -51,6 +58,8 @@
51
58
  或 MCP 暴露时使用的仓库内开发流程。
52
59
  - `docs/development/custom-login-page.md`:完整替换登录页的 ownership、认证复用和
53
60
  升级迁移说明。
61
+ - `docs/development/custom-error-pages.md`:统一错误语义、Request ID 与业务页面
62
+ 替换方式。
54
63
  - `bun run dev`:复用 Docker 镜像启动 PostgreSQL、自动 migration、Server 与支持热更新的 Web。
55
64
  - `bun run dev:build`:依赖、Dockerfile 或 lockfile 变化后重建并启动开发环境。
56
65
  - `bun run dev:web`:启动 Web 开发服务。
@@ -53,6 +53,7 @@ bun run dev:server
53
53
  `DATABASE_URL` 时使用内存模式。
54
54
 
55
55
 
56
+
56
57
  ## 页面与登录
57
58
 
58
59
  全新数据库的初始平台账号为 `admin`。初始密码不是所有项目共用的固定值,而是
@@ -100,7 +101,7 @@ create-windy 在本机 `.env` 中随机生成的 `WINDY_BOOTSTRAP_ADMIN_PASSWORD
100
101
  | `system.storage` | 未包含 | H2 | 上传、下载和对象生命周期。 |
101
102
  | `system.agent` | 未包含 | H2 | 受控 Agent 工具宿主。 |
102
103
  | `system.scheduler` | 未包含 | H2 | 任务、重试、历史和恢复。 |
103
- | `system.notification` | 未包含 | H2 | 通知发布、阅读和归档。 |
104
+ | `system.notification` | 未包含 | H2 | 通知定向与定时发布、用户偏好、外部渠道投递、修改历史、阅读、收藏和归档。 |
104
105
  | `system.workflow` | 未包含 | H2 | 审批、转交、超时和补偿。 |
105
106
  | `system.bulk-data` | 未包含 | H2 | 批量导入导出与结果留存。 |
106
107
  | `system.search` | 未包含 | H2 | 权限感知搜索与 Provider 聚合。 |
@@ -121,6 +122,7 @@ bun run dev
121
122
  bun run dev:build
122
123
  bun run dev:web
123
124
  bun run dev:server
125
+
124
126
  bun run typecheck
125
127
  bun run test
126
128
  bun run build
@@ -8,6 +8,7 @@ RUN pip install --no-cache-dir uv==0.9.27 \
8
8
  COPY apps/agent-server/pyproject.toml apps/agent-server/uv.lock ./
9
9
  RUN uv sync --frozen --no-dev --no-install-project
10
10
  COPY apps/agent-server/src ./src
11
+ COPY apps/agent-server/adk_web_agents ./adk_web_agents
11
12
  RUN uv sync --frozen --no-dev
12
13
 
13
14
  ENV PATH="/app/apps/agent-server/.venv/bin:${PATH}"
@@ -1,8 +1,9 @@
1
1
  # Southwind AI Agent Server
2
2
 
3
3
  Python 3.12 Agent Runtime。HTTP 层只公开 Southwind AI canonical Agent
4
- contracts。当前可用 Adapter 连接 OpenAI-compatible `/chat/completions`;Google ADK
5
- 仍只是未配置 Provider 时安全拒绝的内部 Adapter。
4
+ contracts。真实业务 Run 在内部通过 Google ADK 2.5 的 Runner、Session、LlmAgent 和
5
+ Event 执行;ADK 类型不会越过 `AgentEngineAdapter`。模型调用继续复用受治理的
6
+ OpenAI-compatible `/chat/completions` Provider。
6
7
 
7
8
  ```bash
8
9
  uv sync --frozen
@@ -23,7 +24,7 @@ Run 创建使用 `Idempotency-Key`。事件以 SSE 传输,支持 `Last-Event-I
23
24
  断线重放,并周期发送 comment heartbeat。Provider 或框架异常只会映射为 canonical
24
25
  安全错误,不会把原始异常正文暴露给调用方。
25
26
 
26
- 配置以下仅服务端可见的环境变量后,默认运行 OpenAI-compatible Adapter:
27
+ 配置以下仅服务端可见的环境变量后,默认运行 ADK Adapter:
27
28
 
28
29
  ```bash
29
30
  export AGENT_SERVER_INTERNAL_TOKEN='<random-token>'
@@ -32,17 +33,39 @@ export QWEN_API_KEY='<server-secret>'
32
33
  export QWEN_MODEL='qwen-plus'
33
34
  export AI_PROVIDER_HTTPS_HOST_ALLOWLIST='dashscope-intl.aliyuncs.com'
34
35
  export AGENT_RUN_STORE_PATH='.data/agent-runs.sqlite3'
36
+ export AI_PROVIDER_AUDIT_STORE_PATH='.data/provider-audit.sqlite3'
37
+ export AI_PROVIDER_AUDIT_RETENTION_DAYS='90'
35
38
  uv run uvicorn southwind_agent_server.app:app
36
39
  ```
37
40
 
38
41
  公网 URL 必须使用 HTTPS 且 Host 精确命中 allowlist;本机、容器服务名和内网地址允许
39
42
  HTTP。Provider 请求包含连接和总超时、响应大小限制、错误脱敏与 `/models`
40
43
  readiness。缺少 URL/Model 时回退
41
- `AdkEngineAdapter` 并返回 unavailable,不调用模型。测试另使用
42
- `DeterministicEngineAdapter`。
44
+ 未配置的 `AdkEngineAdapter` 并返回 unavailable,不调用模型。测试另使用
45
+ `DeterministicEngineAdapter`。每个 ADK Tool 只声明 Operation 已允许的 Key;其执行
46
+ 函数只回调 Southwind AI Tool Host,并携带当前 Run 的 opaque Execution Grant。
43
47
 
44
48
  未设置 `AGENT_RUN_STORE_PATH` 时使用的 `InMemoryRunStore` **仅用于 deterministic
45
49
  测试**。配置路径后使用有界 SQLite Store,可在单副本重启后保留 Run/Event/Result 和
46
50
  cursor;多副本部署仍必须替换为共享 Store。Execution Grant 与 Tool 授权由
47
51
  Southwind AI Server 签发和复核,Agent Server 不能自行扩大 Operation 的
48
52
  `allowedToolKeys`。
53
+
54
+ 每次实际 `/chat/completions` HTTP 调用前,Runtime 会对 Manifest 允许的输入 JSON
55
+ Pointer 与 Provider outbound envelope 字段执行 DLP,并将 deployment、operation、
56
+ run、attempt、分类集合、实际序列化请求字节数和 allow/redact/reject 决策写入独立
57
+ SQLite append-only 表。审计不保存 prompt、请求正文或 Secret;审计写入失败时禁止
58
+ 出网。记录到期后只由配置的 TTL 清理,清理计数可通过需内部 Token 的
59
+ `GET /health/provider-governance` 查看。SQLite 实现仅支持单副本;多副本部署必须替换
60
+ 为共享、并发安全的审计 Adapter。
61
+
62
+ 开发者可单独启动 ADK Web:
63
+
64
+ ```bash
65
+ bun run dev:adk-web
66
+ ```
67
+
68
+ 访问 `http://127.0.0.1:8000`。该 `agent-debug` profile 不读取 Qwen、内部 Token 或
69
+ 业务配置,只加载无 Provider、无业务 Tool 的确定性调试 Agent。它用于检查 ADK Web、
70
+ Session 和 Event 交互,不能复现带 Actor/Execution Grant 的真实 Operation,也不能
71
+ 作为生产调用入口。
@@ -0,0 +1 @@
1
+ """Developer-only ADK Web agents."""
@@ -0,0 +1,3 @@
1
+ from .agent import root_agent
2
+
3
+ __all__ = ["root_agent"]
@@ -0,0 +1,40 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import AsyncGenerator
4
+
5
+ from google.adk.agents import LlmAgent
6
+ from google.adk.models.base_llm import BaseLlm
7
+ from google.adk.models.llm_request import LlmRequest
8
+ from google.adk.models.llm_response import LlmResponse
9
+ from google.genai import types
10
+
11
+
12
+ class SafeDebugLlm(BaseLlm):
13
+ async def generate_content_async(
14
+ self,
15
+ llm_request: LlmRequest,
16
+ stream: bool = False,
17
+ ) -> AsyncGenerator[LlmResponse, None]:
18
+ del llm_request, stream
19
+ text = (
20
+ "这是 Windy 的 ADK 开发调试 Agent。"
21
+ "它不连接业务 Repository、Tool Host 或模型 Provider,"
22
+ "不能代表生产业务 Operation。"
23
+ )
24
+ yield LlmResponse(
25
+ content=types.Content(
26
+ role="model",
27
+ parts=[types.Part(text=text)],
28
+ ),
29
+ partial=False,
30
+ )
31
+
32
+
33
+ root_agent = LlmAgent(
34
+ name="safe_debug",
35
+ model=SafeDebugLlm(model="windy-safe-debug"),
36
+ instruction=(
37
+ "仅说明开发调试边界;不访问业务数据,不调用 Tool,不连接模型 Provider。"
38
+ ),
39
+ tools=[],
40
+ )
@@ -21,7 +21,7 @@ dev = [
21
21
 
22
22
  [tool.pytest.ini_options]
23
23
  asyncio_mode = "auto"
24
- pythonpath = ["src"]
24
+ pythonpath = [".", "src"]
25
25
  testpaths = ["tests"]
26
26
 
27
27
  [tool.ruff]