create-windy 0.2.34 → 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 (237) hide show
  1. package/dist/cli.js +167 -17
  2. package/package.json +1 -1
  3. package/template/.windy-template.json +2 -2
  4. package/template/AGENTS.md +5 -0
  5. package/template/README.md +3 -1
  6. package/template/apps/agent-server/Dockerfile +1 -0
  7. package/template/apps/agent-server/README.md +18 -5
  8. package/template/apps/agent-server/adk_web_agents/__init__.py +1 -0
  9. package/template/apps/agent-server/adk_web_agents/safe_debug/__init__.py +3 -0
  10. package/template/apps/agent-server/adk_web_agents/safe_debug/agent.py +40 -0
  11. package/template/apps/agent-server/pyproject.toml +1 -1
  12. package/template/apps/agent-server/src/southwind_agent_server/adk_adapter.py +191 -16
  13. package/template/apps/agent-server/src/southwind_agent_server/adk_failure.py +13 -0
  14. package/template/apps/agent-server/src/southwind_agent_server/adk_model.py +225 -0
  15. package/template/apps/agent-server/src/southwind_agent_server/adk_tools.py +76 -0
  16. package/template/apps/agent-server/src/southwind_agent_server/app.py +1 -2
  17. package/template/apps/agent-server/tests/test_adk_adapter.py +305 -0
  18. package/template/apps/agent-server/tests/test_adk_web_agent.py +12 -0
  19. package/template/apps/server/package.json +4 -1
  20. package/template/apps/server/src/agent/run-facade.ts +2 -7
  21. package/template/apps/server/src/agent/tool-registry.ts +2 -6
  22. package/template/apps/server/src/application-services.ts +50 -0
  23. package/template/apps/server/src/audit/drizzle-log-store.ts +25 -0
  24. package/template/apps/server/src/audit/search-summary.ts +2 -6
  25. package/template/apps/server/src/auth/credential-restriction.ts +1 -0
  26. package/template/apps/server/src/auth/password.ts +30 -21
  27. package/template/apps/server/src/auth/routes.test.ts +44 -3
  28. package/template/apps/server/src/auth/routes.ts +6 -1
  29. package/template/apps/server/src/auth/runtime.ts +4 -1
  30. package/template/apps/server/src/auth/service.ts +25 -7
  31. package/template/apps/server/src/configuration/bootstrap.ts +20 -1
  32. package/template/apps/server/src/configuration/definition.test.ts +71 -0
  33. package/template/apps/server/src/configuration/definition.ts +242 -12
  34. package/template/apps/server/src/configuration/drizzle-repository.ts +36 -2
  35. package/template/apps/server/src/configuration/repository.ts +27 -2
  36. package/template/apps/server/src/configuration/routes.ts +4 -1
  37. package/template/apps/server/src/configuration/service.test.ts +100 -0
  38. package/template/apps/server/src/configuration/service.ts +50 -10
  39. package/template/apps/server/src/data-access/scoped-repository.integration.test.ts +3 -2
  40. package/template/apps/server/src/data-governance/export/service.ts +2 -6
  41. package/template/apps/server/src/example-modules.ts +4 -1
  42. package/template/apps/server/src/guards.ts +18 -5
  43. package/template/apps/server/src/http/request-source.test.ts +85 -0
  44. package/template/apps/server/src/http/request-source.ts +90 -0
  45. package/template/apps/server/src/index.ts +23 -6
  46. package/template/apps/server/src/license/routes.ts +2 -0
  47. package/template/apps/server/src/license/runtime-service.ts +10 -11
  48. package/template/apps/server/src/module-bootstrap.ts +2 -2
  49. package/template/apps/server/src/module-host/request-context.ts +6 -6
  50. package/template/apps/server/src/module-host/storage-scope.ts +2 -9
  51. package/template/apps/server/src/module-host/user-directory-port.ts +2 -6
  52. package/template/apps/server/src/notification/channel-adapter.ts +46 -0
  53. package/template/apps/server/src/notification/delivery-policy.test.ts +59 -0
  54. package/template/apps/server/src/notification/delivery-policy.ts +37 -0
  55. package/template/apps/server/src/notification/delivery-repository.ts +198 -0
  56. package/template/apps/server/src/notification/delivery-worker.test.ts +87 -0
  57. package/template/apps/server/src/notification/delivery-worker.ts +88 -0
  58. package/template/apps/server/src/notification/drizzle-management.ts +180 -0
  59. package/template/apps/server/src/notification/drizzle-query.ts +160 -0
  60. package/template/apps/server/src/notification/drizzle-repository.integration.test.ts +301 -0
  61. package/template/apps/server/src/notification/drizzle-repository.ts +156 -90
  62. package/template/apps/server/src/notification/extension-routes.test.ts +119 -0
  63. package/template/apps/server/src/notification/extension-routes.ts +111 -0
  64. package/template/apps/server/src/notification/memory-delivery-repository.ts +137 -0
  65. package/template/apps/server/src/notification/memory-support.ts +72 -0
  66. package/template/apps/server/src/notification/preference-repository.ts +95 -0
  67. package/template/apps/server/src/notification/recipient-directory.ts +104 -0
  68. package/template/apps/server/src/notification/repository.test.ts +171 -0
  69. package/template/apps/server/src/notification/repository.ts +179 -32
  70. package/template/apps/server/src/notification/revision-routes.test.ts +186 -0
  71. package/template/apps/server/src/notification/route-support.ts +225 -0
  72. package/template/apps/server/src/notification/routes.test.ts +182 -0
  73. package/template/apps/server/src/notification/routes.ts +225 -132
  74. package/template/apps/server/src/notification/service.test.ts +104 -0
  75. package/template/apps/server/src/notification/service.ts +140 -0
  76. package/template/apps/server/src/notification/smtp-adapter.test.ts +65 -0
  77. package/template/apps/server/src/notification/smtp-adapter.ts +68 -0
  78. package/template/apps/server/src/persistence.integration.test.ts +41 -2
  79. package/template/apps/server/src/route-guards.ts +1 -0
  80. package/template/apps/server/src/runtime-audit-list.test.ts +39 -0
  81. package/template/apps/server/src/runtime-development.ts +1 -0
  82. package/template/apps/server/src/runtime.test.ts +23 -9
  83. package/template/apps/server/src/runtime.ts +39 -2
  84. package/template/apps/server/src/scheduler/audit.ts +2 -11
  85. package/template/apps/server/src/scheduler/definitions.test.ts +6 -0
  86. package/template/apps/server/src/scheduler/definitions.ts +7 -0
  87. package/template/apps/server/src/scheduler/recovery-service.ts +2 -11
  88. package/template/apps/server/src/scheduler/routes.ts +2 -7
  89. package/template/apps/server/src/search/opensearch-client.test.ts +45 -0
  90. package/template/apps/server/src/search/opensearch-client.ts +145 -0
  91. package/template/apps/server/src/search/service.ts +2 -6
  92. package/template/apps/server/src/settings/routes.ts +15 -3
  93. package/template/apps/server/src/settings/runtime.ts +10 -1
  94. package/template/apps/server/src/storage/runtime.ts +13 -0
  95. package/template/apps/server/src/system/audit-query.ts +33 -4
  96. package/template/apps/server/src/system/audit-routes.test.ts +58 -4
  97. package/template/apps/server/src/system/audit-routes.ts +6 -5
  98. package/template/apps/server/src/system/department-organization.ts +320 -0
  99. package/template/apps/server/src/system/department-routes.test.ts +207 -48
  100. package/template/apps/server/src/system/department-routes.ts +114 -33
  101. package/template/apps/server/src/system/drizzle-repository.ts +15 -7
  102. package/template/apps/server/src/system/drizzle-scoped-repository.ts +5 -3
  103. package/template/apps/server/src/system/drizzle-system.ts +37 -9
  104. package/template/apps/server/src/system/drizzle-transaction-context.ts +14 -0
  105. package/template/apps/server/src/system/identity-route-config.ts +7 -2
  106. package/template/apps/server/src/system/mutation-runner.ts +23 -0
  107. package/template/apps/server/src/system/organization-postgres.integration.test.ts +176 -0
  108. package/template/apps/server/src/system/resource-access-response.ts +12 -6
  109. package/template/apps/server/src/system/role-department-scope-policy.ts +55 -0
  110. package/template/apps/server/src/system/route-helpers.ts +2 -5
  111. package/template/apps/server/src/system/route-types.ts +12 -3
  112. package/template/apps/server/src/system/routes-validation.test.ts +26 -0
  113. package/template/apps/server/src/system/routes.test.ts +10 -2
  114. package/template/apps/server/src/system/routes.ts +70 -36
  115. package/template/apps/server/src/system/seed.ts +7 -0
  116. package/template/apps/server/src/work-order/data-scope.integration.test.ts +9 -2
  117. package/template/apps/server/src/work-order/opensearch-index.test.ts +97 -0
  118. package/template/apps/server/src/work-order/opensearch-index.ts +313 -0
  119. package/template/apps/server/src/work-order/search-provider.ts +60 -1
  120. package/template/apps/server/src/work-order/service.ts +42 -10
  121. package/template/apps/web/src/app/error-pages.ts +9 -0
  122. package/template/apps/web/src/components/auth/PasswordChangeForm.vue +16 -11
  123. package/template/apps/web/src/components/auth/PasswordChangeForm.webtest.ts +14 -0
  124. package/template/apps/web/src/components/common/FormDialog.vue +16 -2
  125. package/template/apps/web/src/components/common/ModalLayout.webtest.ts +20 -1
  126. package/template/apps/web/src/composables/useGlobalSearch.ts +68 -0
  127. package/template/apps/web/src/composables/usePlatformSettings.ts +8 -7
  128. package/template/apps/web/src/layout/GlobalSearchResults.vue +58 -0
  129. package/template/apps/web/src/layout/NavigationSearchDialog.vue +42 -6
  130. package/template/apps/web/src/layout/NavigationSearchDialog.webtest.ts +71 -0
  131. package/template/apps/web/src/layout/NotificationMenu.vue +73 -31
  132. package/template/apps/web/src/layout/NotificationMenu.webtest.ts +44 -1
  133. package/template/apps/web/src/layout/NotificationMenuItem.vue +61 -0
  134. package/template/apps/web/src/layout/NotificationPreferencesDialog.vue +181 -0
  135. package/template/apps/web/src/layout/NotificationPreferencesDialog.webtest.ts +80 -0
  136. package/template/apps/web/src/lib/date-time.ts +22 -10
  137. package/template/apps/web/src/lib/date-time.webtest.ts +9 -1
  138. package/template/apps/web/src/main.ts +14 -1
  139. package/template/apps/web/src/pages/auth/ChangePasswordPage.vue +16 -1
  140. package/template/apps/web/src/pages/configuration/components/ModuleConfigVersionList.vue +1 -0
  141. package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.vue +10 -0
  142. package/template/apps/web/src/pages/configuration/components/ModuleConfigurationWorkbench.vue +37 -6
  143. package/template/apps/web/src/pages/errors/PlatformErrorPage.vue +115 -0
  144. package/template/apps/web/src/pages/errors/PlatformErrorPage.webtest.ts +44 -0
  145. package/template/apps/web/src/pages/errors/error-page-extension.ts +26 -0
  146. package/template/apps/web/src/pages/system/SystemNotificationsPage.vue +136 -68
  147. package/template/apps/web/src/pages/system/SystemNotificationsPage.webtest.ts +224 -12
  148. package/template/apps/web/src/pages/system/audit-log-presenter.ts +86 -0
  149. package/template/apps/web/src/pages/system/audit-time-range.ts +28 -0
  150. package/template/apps/web/src/pages/system/components/AuditActionCell.vue +10 -69
  151. package/template/apps/web/src/pages/system/components/AuditActionCell.webtest.ts +20 -27
  152. package/template/apps/web/src/pages/system/components/AuditLogDetailDialog.vue +134 -0
  153. package/template/apps/web/src/pages/system/components/AuditLogDetailDialog.webtest.ts +76 -0
  154. package/template/apps/web/src/pages/system/components/AuditLogFilters.vue +116 -52
  155. package/template/apps/web/src/pages/system/components/AuditLogFilters.webtest.ts +52 -15
  156. package/template/apps/web/src/pages/system/components/NotificationHistoryDialog.vue +129 -0
  157. package/template/apps/web/src/pages/system/components/NotificationManagementCard.vue +91 -0
  158. package/template/apps/web/src/pages/system/components/NotificationPublishDialog.vue +121 -0
  159. package/template/apps/web/src/pages/system/components/NotificationPublishForm.vue +162 -1
  160. package/template/apps/web/src/pages/system/components/SystemResourceActions.vue +68 -0
  161. package/template/apps/web/src/pages/system/components/SystemResourceEditor.vue +74 -0
  162. package/template/apps/web/src/pages/system/components/SystemResourceFilters.vue +3 -4
  163. package/template/apps/web/src/pages/system/components/SystemResourcePage.vue +91 -98
  164. package/template/apps/web/src/pages/system/components/SystemResourcePage.webtest.ts +68 -0
  165. package/template/apps/web/src/pages/system/components/SystemResourceTable.vue +20 -1
  166. package/template/apps/web/src/pages/system/components/SystemResourceTable.webtest.ts +28 -7
  167. package/template/apps/web/src/pages/system/components/department/DepartmentOrganizationForm.vue +210 -0
  168. package/template/apps/web/src/pages/system/components/department/DepartmentTransitionDialog.vue +112 -0
  169. package/template/apps/web/src/pages/system/components/user-account/UserAccountForm.vue +17 -4
  170. package/template/apps/web/src/pages/system/composables/useDepartmentTransitions.ts +79 -0
  171. package/template/apps/web/src/pages/system/composables/useNotificationPermissions.ts +14 -0
  172. package/template/apps/web/src/pages/system/composables/useSystemResource.ts +2 -0
  173. package/template/apps/web/src/pages/system/composables/useSystemResource.webtest.ts +15 -2
  174. package/template/apps/web/src/pages/system/resource-config.ts +12 -4
  175. package/template/apps/web/src/router/error-navigation.ts +50 -0
  176. package/template/apps/web/src/router/error-navigation.webtest.ts +106 -0
  177. package/template/apps/web/src/router/index.ts +71 -0
  178. package/template/apps/web/src/router/index.webtest.ts +29 -0
  179. package/template/apps/web/src/router/manifest-routes.webtest.ts +4 -0
  180. package/template/apps/web/src/router/shared-scaffold-neutrality.webtest.ts +12 -0
  181. package/template/apps/web/src/services/auth-api.ts +5 -0
  182. package/template/apps/web/src/services/http.ts +43 -6
  183. package/template/apps/web/src/services/http.webtest.ts +70 -0
  184. package/template/apps/web/src/services/notification-api.ts +85 -2
  185. package/template/apps/web/src/services/notification-api.webtest.ts +110 -0
  186. package/template/apps/web/src/services/search-api.ts +39 -0
  187. package/template/apps/web/src/services/system-api.ts +18 -0
  188. package/template/apps/web/vitest.config.ts +1 -0
  189. package/template/docker-compose.yml +66 -0
  190. package/template/docs/architecture/ai-runtime.md +14 -5
  191. package/template/docs/architecture/search-provider-protocol.md +38 -2
  192. package/template/docs/development/custom-error-pages.md +78 -0
  193. package/template/docs/development/custom-login-page.md +3 -3
  194. package/template/docs/platform/agent-runtime.md +32 -6
  195. package/template/docs/platform/audit-reliability.md +46 -2
  196. package/template/docs/platform/module-configuration.md +13 -4
  197. package/template/docs/platform/notifications.md +67 -11
  198. package/template/docs/platform/organization-membership.md +17 -3
  199. package/template/docs/platform/system-crud-api.md +16 -0
  200. package/template/docs/platform/web-system-crud.md +6 -2
  201. package/template/package.json +4 -0
  202. package/template/packages/config/index.test.ts +45 -0
  203. package/template/packages/config/package.json +1 -1
  204. package/template/packages/config/src/platform.ts +169 -48
  205. package/template/packages/database/drizzle/0035_material_nightshade.sql +10 -0
  206. package/template/packages/database/drizzle/0036_hesitant_speed.sql +35 -0
  207. package/template/packages/database/drizzle/0037_absent_nick_fury.sql +2 -0
  208. package/template/packages/database/drizzle/0038_uneven_wasp.sql +38 -0
  209. package/template/packages/database/drizzle/meta/0035_snapshot.json +7331 -0
  210. package/template/packages/database/drizzle/meta/0036_snapshot.json +7436 -0
  211. package/template/packages/database/drizzle/meta/0037_snapshot.json +7457 -0
  212. package/template/packages/database/drizzle/meta/0038_snapshot.json +7749 -0
  213. package/template/packages/database/drizzle/meta/_journal.json +28 -0
  214. package/template/packages/database/package.json +1 -1
  215. package/template/packages/database/src/schema/identity.ts +7 -0
  216. package/template/packages/database/src/schema/notifications.ts +135 -0
  217. package/template/packages/database/src/schema-notification-delivery.test.ts +54 -0
  218. package/template/packages/database/src/schema-workflow-notification.test.ts +40 -1
  219. package/template/packages/modules/package.json +1 -1
  220. package/template/packages/modules/src/system-api-permissions.ts +54 -0
  221. package/template/packages/modules/src/system-audit-actions.ts +10 -0
  222. package/template/packages/modules/src/system-features.ts +1 -1
  223. package/template/packages/modules/src/system-module-catalog.ts +2 -1
  224. package/template/packages/modules/src/system-modules.test.ts +13 -1
  225. package/template/packages/modules/src/system-modules.ts +12 -0
  226. package/template/packages/modules/src/system-permissions.ts +9 -5
  227. package/template/packages/server-sdk/package.json +1 -1
  228. package/template/packages/shared/package.json +1 -1
  229. package/template/packages/shared/src/audit.ts +25 -0
  230. package/template/packages/shared/src/module-configuration.ts +5 -0
  231. package/template/packages/shared/src/notification.ts +92 -1
  232. package/template/packages/shared/src/password.ts +7 -2
  233. package/template/packages/shared/src/platform-settings.ts +2 -0
  234. package/template/packages/storage/package.json +1 -1
  235. package/template/packages/storage/src/upload-service.test.ts +16 -0
  236. package/template/packages/storage/src/upload-service.ts +5 -1
  237. package/template/scripts/notification-postgres-regression.ts +27 -0
package/dist/cli.js CHANGED
@@ -299,21 +299,48 @@ var optionalModuleManifests = [
299
299
  ]
300
300
  },
301
301
  {
302
- ...module("system.notification", "站内通知", "通知发布、阅读和归档。", [
303
- "system",
304
- "system.identity"
305
- ]),
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
+ ],
306
315
  fileRoots: [
307
316
  "apps/server/src/notification",
308
317
  "apps/web/src/layout/NotificationMenu.vue",
318
+ "apps/web/src/layout/NotificationMenuItem.vue",
309
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",
310
323
  "apps/web/src/pages/system/SystemNotificationsPage.vue",
311
324
  "apps/web/src/pages/system/SystemNotificationsPage.webtest.ts",
312
- "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"
313
333
  ],
314
334
  documentation: ["docs/platform/notifications.md"],
315
335
  schemaFiles: ["packages/database/src/schema/notifications.ts"],
316
- 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
+ ]
317
344
  },
318
345
  {
319
346
  ...module("system.workflow", "审批工作流", "审批、转交、超时和补偿。", [
@@ -355,8 +382,11 @@ var optionalModuleManifests = [
355
382
  fileRoots: [
356
383
  "apps/server/src/search",
357
384
  "apps/server/src/module-host/search-providers.ts",
385
+ "apps/web/src/composables/useGlobalSearch.ts",
358
386
  "apps/web/src/layout/NavigationSearchDialog.vue",
359
- "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"
360
390
  ],
361
391
  documentation: ["docs/architecture/search-provider-protocol.md"]
362
392
  },
@@ -477,7 +507,7 @@ var platformModules = [
477
507
  {
478
508
  sourceName: "@southwind-ai/license",
479
509
  name: "@southwind-ai/license",
480
- version: "^0.1.1"
510
+ version: "^0.1.3"
481
511
  }
482
512
  ],
483
513
  fileRoots: [
@@ -534,8 +564,12 @@ var platformModules = [
534
564
  "apps/server/src/persistence.integration.test.ts",
535
565
  "apps/server/src/system/audit-routes.ts",
536
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",
537
569
  "apps/web/src/pages/system/components/AuditActionCell.vue",
538
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",
539
573
  "apps/web/src/pages/system/components/AuditLogFilters.vue",
540
574
  "apps/web/src/pages/system/components/AuditLogFilters.webtest.ts"
541
575
  ],
@@ -1530,6 +1564,7 @@ var starterComposeBase = `services:
1530
1564
  AGENT_SERVER_URL: http://agent-server:8080
1531
1565
  AGENT_TOOL_HOST_URL: http://server:9747
1532
1566
  AGENT_SERVER_INTERNAL_TOKEN: \${AGENT_SERVER_INTERNAL_TOKEN:-}
1567
+ __OPENSEARCH_SERVER_ENV__
1533
1568
  ports:
1534
1569
  - "9747:9747"
1535
1570
  volumes:
@@ -1540,6 +1575,7 @@ var starterComposeBase = `services:
1540
1575
  migrate:
1541
1576
  condition: service_completed_successfully
1542
1577
 
1578
+ __OPENSEARCH_SERVICE__
1543
1579
  web:
1544
1580
  build:
1545
1581
  context: .
@@ -1573,7 +1609,30 @@ var starterComposeBase = `services:
1573
1609
  volumes:
1574
1610
  postgres-data:
1575
1611
  server-audit-data:
1576
- __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
+
1577
1636
  `;
1578
1637
  var agentComposeService = ` agent-server:
1579
1638
  profiles: ["agent"]
@@ -1598,19 +1657,65 @@ var agentComposeService = ` agent-server:
1598
1657
  server:
1599
1658
  condition: service_started
1600
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
+
1601
1698
  `;
1602
- function starterComposeFor(includeAgent) {
1699
+ function starterComposeFor(includeAgent, includeSearch = true) {
1603
1700
  return starterComposeBase.replace(` web:
1604
1701
  `, `${includeAgent ? agentComposeService : ""} web:
1605
- `).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
+ `));
1606
1710
  }
1607
1711
  var starterCompose = starterComposeFor(true);
1608
- function environmentExample(includeExample, includeAgent = true) {
1712
+ function environmentExample(includeExample, includeAgent = true, includeSearch = true) {
1609
1713
  return `# 复制为 .env 后填写。不要提交真实密码。
1610
1714
  POSTGRES_PASSWORD=
1611
1715
  WINDY_BOOTSTRAP_ADMIN_PASSWORD=
1612
1716
  ${includeAgent ? `
1613
1717
  # Agent profile 仅由服务端 Agent Runtime 读取;不要使用 VITE_ 前缀。
1718
+ # ADK Web 调试 profile 不读取以下变量,也不能调用真实业务 Operation 或 Tool。
1614
1719
  PLATFORM_ENABLE_AI=false
1615
1720
  AGENT_SERVER_INTERNAL_TOKEN=
1616
1721
  QWEN_API_URL=
@@ -1623,12 +1728,20 @@ AI_PROVIDER_HTTPS_HOST_ALLOWLIST=
1623
1728
  # AI_PROVIDER_MAX_RESPONSE_BYTES=2097152
1624
1729
  ` : ""}
1625
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
+
1626
1738
  # 可选搜索配置;不配置时启用 Manifest 中默认开启的 Provider。${includeExample ? `
1627
1739
  # SEARCH_PROVIDER_KEYS=work-order.ticket.search` : `
1628
1740
  # 当前 core profile 没有业务 SearchProvider;接入业务模块后再配置 Key。`}
1629
1741
  # SEARCH_PROVIDER_TIMEOUT_MS=800
1630
1742
  # SEARCH_HEALTH_TIMEOUT_MS=500
1631
1743
  # SEARCH_MAX_REQUESTS_PER_MINUTE=30
1744
+ ` : ""}
1632
1745
  `;
1633
1746
  }
1634
1747
  // src/project-files.ts
@@ -1651,6 +1764,7 @@ ${includeAgent ? "- Agent:[Agent Runtime 接入](./platform/agent-runtime.md)
1651
1764
  function starterReadme(projectName, includeExample = true, includeOxc = true, projectLicense = "UNLICENSED", selectedModules = []) {
1652
1765
  const selected = new Set(selectedModules);
1653
1766
  const includeAgent = selected.has("system.agent");
1767
+ const includeSearch = selected.has("system.search");
1654
1768
  const moduleRows = moduleDistributionCatalog.map(({ name, description, selection }) => `| \`${name}\` | ${selected.has(name) ? "已包含" : "未包含"} | ${selection === "required" ? "H0" : "H2"} | ${description} |`).join(`
1655
1769
  `);
1656
1770
  return `# ${projectName}
@@ -1726,6 +1840,32 @@ bun run dev:agent
1726
1840
  MCP 客户端使用 \`http://localhost:9747/api/mcp\`,并通过平台 Bearer Token 或 Session
1727
1841
  Cookie 鉴权。该入口只发现当前账号获准的只读 Tool;每次调用都会重新执行 Feature、
1728
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)。
1729
1869
  ` : ""}
1730
1870
 
1731
1871
  ## 页面与登录
@@ -1781,6 +1921,7 @@ bun run dev
1781
1921
  bun run dev:build
1782
1922
  bun run dev:web
1783
1923
  bun run dev:server
1924
+ ${includeSearch ? "bun run dev:search" : ""}
1784
1925
  bun run typecheck
1785
1926
  bun run test
1786
1927
  bun run build
@@ -1854,7 +1995,13 @@ function createStarterPackage(source, projectName, includeOxc = true, projectLic
1854
1995
  dev: "docker compose up",
1855
1996
  "docker:sync": "create-windy sync-docker",
1856
1997
  "dev:build": "bun run docker:sync && docker compose up --build",
1857
- ...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
+ } : {},
1858
2005
  ...generatorVersion ? { windy: "create-windy" } : {},
1859
2006
  "dev:web": "bun run --cwd apps/web dev",
1860
2007
  "dev:server": "bun run --cwd apps/server dev",
@@ -1899,7 +2046,8 @@ var templateRootFiles = [
1899
2046
  "docker-compose.yml",
1900
2047
  "drizzle.config.ts",
1901
2048
  "module-schema.lineages.json",
1902
- "package.json"
2049
+ "package.json",
2050
+ "scripts/notification-postgres-regression.ts"
1903
2051
  ];
1904
2052
  var templateDirectories = [
1905
2053
  ".agents/skills/windy-business-module",
@@ -1931,6 +2079,7 @@ var templateDocumentationFiles = [
1931
2079
  "docs/architecture/object-storage.md",
1932
2080
  "docs/architecture/search-provider-protocol.md",
1933
2081
  "docs/development/crud-generator.md",
2082
+ "docs/development/custom-error-pages.md",
1934
2083
  "docs/development/custom-login-page.md",
1935
2084
  "docs/license/license-offline-activation-code.md",
1936
2085
  "docs/operations/observability.md",
@@ -2151,8 +2300,8 @@ async function generateProject(input) {
2151
2300
  const packageJson = JSON.parse(await readFile10(packagePath, "utf8"));
2152
2301
  await writeFile9(packagePath, `${JSON.stringify(createStarterPackage(packageJson, input.projectName, includeOxc, projectLicense, selectedModules, templateMetadata.generatorVersion), null, 2)}
2153
2302
  `);
2154
- await writeFile9(join10(input.targetDirectory, "docker-compose.yml"), starterComposeFor(selectedModules.includes("system.agent")));
2155
- 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")));
2156
2305
  await writeFile9(join10(input.targetDirectory, "README.md"), starterReadme(input.projectName, includeExample, includeOxc, projectLicense, selectedModules));
2157
2306
  await writeFile9(join10(input.targetDirectory, "docs/README.md"), starterDocsReadme(selectedModules.includes("system.license"), selectedModules.includes("system.agent")));
2158
2307
  await reflectCodeQualityChoice(input.targetDirectory, includeOxc);
@@ -4370,7 +4519,8 @@ var recipes = [
4370
4519
  { id: "starter-0.2.30-to-0.2.31", from: "0.2.30", to: "0.2.31" },
4371
4520
  { id: "starter-0.2.31-to-0.2.32", from: "0.2.31", to: "0.2.32" },
4372
4521
  { id: "starter-0.2.32-to-0.2.33", from: "0.2.32", to: "0.2.33" },
4373
- { id: "starter-0.2.33-to-0.2.34", from: "0.2.33", to: "0.2.34" }
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" }
4374
4524
  ];
4375
4525
  function resolveRecipeChain(sourceVersion, targetVersion) {
4376
4526
  if (sourceVersion === targetVersion)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-windy",
3
- "version": "0.2.34",
3
+ "version": "0.3.0",
4
4
  "description": "创建单组织、单租户、私有部署优先的 Windy 企业 Dashboard Starter",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "templateCommit": "28f6b738276d5138a514a4ab374d60884b94e769",
4
- "generatorVersion": "0.2.34",
3
+ "templateCommit": "c6c39b2cac4c74ed6352c50e89a4bcddab0eafc7",
4
+ "generatorVersion": "0.3.0",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",
@@ -44,6 +44,9 @@
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 核心或平台默认错误页。
47
50
  - 业务 Agent Operation 开启 Provider 出网时,必须在 Manifest 同时声明最小
48
51
  `providerDataPolicy.inputFields` JSON Pointer allowlist 与
49
52
  `envelopeFields`;raw input 会在进入 `prepare` 前裁剪并执行 DLP。接入与升级
@@ -55,6 +58,8 @@
55
58
  或 MCP 暴露时使用的仓库内开发流程。
56
59
  - `docs/development/custom-login-page.md`:完整替换登录页的 ownership、认证复用和
57
60
  升级迁移说明。
61
+ - `docs/development/custom-error-pages.md`:统一错误语义、Request ID 与业务页面
62
+ 替换方式。
58
63
  - `bun run dev`:复用 Docker 镜像启动 PostgreSQL、自动 migration、Server 与支持热更新的 Web。
59
64
  - `bun run dev:build`:依赖、Dockerfile 或 lockfile 变化后重建并启动开发环境。
60
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>'
@@ -40,8 +41,9 @@ uv run uvicorn southwind_agent_server.app:app
40
41
  公网 URL 必须使用 HTTPS 且 Host 精确命中 allowlist;本机、容器服务名和内网地址允许
41
42
  HTTP。Provider 请求包含连接和总超时、响应大小限制、错误脱敏与 `/models`
42
43
  readiness。缺少 URL/Model 时回退
43
- `AdkEngineAdapter` 并返回 unavailable,不调用模型。测试另使用
44
- `DeterministicEngineAdapter`。
44
+ 未配置的 `AdkEngineAdapter` 并返回 unavailable,不调用模型。测试另使用
45
+ `DeterministicEngineAdapter`。每个 ADK Tool 只声明 Operation 已允许的 Key;其执行
46
+ 函数只回调 Southwind AI Tool Host,并携带当前 Run 的 opaque Execution Grant。
45
47
 
46
48
  未设置 `AGENT_RUN_STORE_PATH` 时使用的 `InMemoryRunStore` **仅用于 deterministic
47
49
  测试**。配置路径后使用有界 SQLite Store,可在单副本重启后保留 Run/Event/Result 和
@@ -56,3 +58,14 @@ SQLite append-only 表。审计不保存 prompt、请求正文或 Secret;审
56
58
  出网。记录到期后只由配置的 TTL 清理,清理计数可通过需内部 Token 的
57
59
  `GET /health/provider-governance` 查看。SQLite 实现仅支持单副本;多副本部署必须替换
58
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]