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.
- package/dist/cli.js +167 -17
- package/package.json +1 -1
- package/template/.windy-template.json +2 -2
- package/template/AGENTS.md +5 -0
- package/template/README.md +3 -1
- package/template/apps/agent-server/Dockerfile +1 -0
- package/template/apps/agent-server/README.md +18 -5
- package/template/apps/agent-server/adk_web_agents/__init__.py +1 -0
- package/template/apps/agent-server/adk_web_agents/safe_debug/__init__.py +3 -0
- package/template/apps/agent-server/adk_web_agents/safe_debug/agent.py +40 -0
- package/template/apps/agent-server/pyproject.toml +1 -1
- package/template/apps/agent-server/src/southwind_agent_server/adk_adapter.py +191 -16
- package/template/apps/agent-server/src/southwind_agent_server/adk_failure.py +13 -0
- package/template/apps/agent-server/src/southwind_agent_server/adk_model.py +225 -0
- package/template/apps/agent-server/src/southwind_agent_server/adk_tools.py +76 -0
- package/template/apps/agent-server/src/southwind_agent_server/app.py +1 -2
- package/template/apps/agent-server/tests/test_adk_adapter.py +305 -0
- package/template/apps/agent-server/tests/test_adk_web_agent.py +12 -0
- package/template/apps/server/package.json +4 -1
- package/template/apps/server/src/agent/run-facade.ts +2 -7
- package/template/apps/server/src/agent/tool-registry.ts +2 -6
- package/template/apps/server/src/application-services.ts +50 -0
- package/template/apps/server/src/audit/drizzle-log-store.ts +25 -0
- package/template/apps/server/src/audit/search-summary.ts +2 -6
- package/template/apps/server/src/auth/credential-restriction.ts +1 -0
- package/template/apps/server/src/auth/password.ts +30 -21
- package/template/apps/server/src/auth/routes.test.ts +44 -3
- package/template/apps/server/src/auth/routes.ts +6 -1
- package/template/apps/server/src/auth/runtime.ts +4 -1
- package/template/apps/server/src/auth/service.ts +25 -7
- package/template/apps/server/src/configuration/bootstrap.ts +20 -1
- package/template/apps/server/src/configuration/definition.test.ts +71 -0
- package/template/apps/server/src/configuration/definition.ts +242 -12
- package/template/apps/server/src/configuration/drizzle-repository.ts +36 -2
- package/template/apps/server/src/configuration/repository.ts +27 -2
- package/template/apps/server/src/configuration/routes.ts +4 -1
- package/template/apps/server/src/configuration/service.test.ts +100 -0
- package/template/apps/server/src/configuration/service.ts +50 -10
- package/template/apps/server/src/data-access/scoped-repository.integration.test.ts +3 -2
- package/template/apps/server/src/data-governance/export/service.ts +2 -6
- package/template/apps/server/src/example-modules.ts +4 -1
- package/template/apps/server/src/guards.ts +18 -5
- package/template/apps/server/src/http/request-source.test.ts +85 -0
- package/template/apps/server/src/http/request-source.ts +90 -0
- package/template/apps/server/src/index.ts +23 -6
- package/template/apps/server/src/license/routes.ts +2 -0
- package/template/apps/server/src/license/runtime-service.ts +10 -11
- package/template/apps/server/src/module-bootstrap.ts +2 -2
- package/template/apps/server/src/module-host/request-context.ts +6 -6
- package/template/apps/server/src/module-host/storage-scope.ts +2 -9
- package/template/apps/server/src/module-host/user-directory-port.ts +2 -6
- package/template/apps/server/src/notification/channel-adapter.ts +46 -0
- package/template/apps/server/src/notification/delivery-policy.test.ts +59 -0
- package/template/apps/server/src/notification/delivery-policy.ts +37 -0
- package/template/apps/server/src/notification/delivery-repository.ts +198 -0
- package/template/apps/server/src/notification/delivery-worker.test.ts +87 -0
- package/template/apps/server/src/notification/delivery-worker.ts +88 -0
- package/template/apps/server/src/notification/drizzle-management.ts +180 -0
- package/template/apps/server/src/notification/drizzle-query.ts +160 -0
- package/template/apps/server/src/notification/drizzle-repository.integration.test.ts +301 -0
- package/template/apps/server/src/notification/drizzle-repository.ts +156 -90
- package/template/apps/server/src/notification/extension-routes.test.ts +119 -0
- package/template/apps/server/src/notification/extension-routes.ts +111 -0
- package/template/apps/server/src/notification/memory-delivery-repository.ts +137 -0
- package/template/apps/server/src/notification/memory-support.ts +72 -0
- package/template/apps/server/src/notification/preference-repository.ts +95 -0
- package/template/apps/server/src/notification/recipient-directory.ts +104 -0
- package/template/apps/server/src/notification/repository.test.ts +171 -0
- package/template/apps/server/src/notification/repository.ts +179 -32
- package/template/apps/server/src/notification/revision-routes.test.ts +186 -0
- package/template/apps/server/src/notification/route-support.ts +225 -0
- package/template/apps/server/src/notification/routes.test.ts +182 -0
- package/template/apps/server/src/notification/routes.ts +225 -132
- package/template/apps/server/src/notification/service.test.ts +104 -0
- package/template/apps/server/src/notification/service.ts +140 -0
- package/template/apps/server/src/notification/smtp-adapter.test.ts +65 -0
- package/template/apps/server/src/notification/smtp-adapter.ts +68 -0
- package/template/apps/server/src/persistence.integration.test.ts +41 -2
- package/template/apps/server/src/route-guards.ts +1 -0
- package/template/apps/server/src/runtime-audit-list.test.ts +39 -0
- package/template/apps/server/src/runtime-development.ts +1 -0
- package/template/apps/server/src/runtime.test.ts +23 -9
- package/template/apps/server/src/runtime.ts +39 -2
- package/template/apps/server/src/scheduler/audit.ts +2 -11
- package/template/apps/server/src/scheduler/definitions.test.ts +6 -0
- package/template/apps/server/src/scheduler/definitions.ts +7 -0
- package/template/apps/server/src/scheduler/recovery-service.ts +2 -11
- package/template/apps/server/src/scheduler/routes.ts +2 -7
- package/template/apps/server/src/search/opensearch-client.test.ts +45 -0
- package/template/apps/server/src/search/opensearch-client.ts +145 -0
- package/template/apps/server/src/search/service.ts +2 -6
- package/template/apps/server/src/settings/routes.ts +15 -3
- package/template/apps/server/src/settings/runtime.ts +10 -1
- package/template/apps/server/src/storage/runtime.ts +13 -0
- package/template/apps/server/src/system/audit-query.ts +33 -4
- package/template/apps/server/src/system/audit-routes.test.ts +58 -4
- package/template/apps/server/src/system/audit-routes.ts +6 -5
- package/template/apps/server/src/system/department-organization.ts +320 -0
- package/template/apps/server/src/system/department-routes.test.ts +207 -48
- package/template/apps/server/src/system/department-routes.ts +114 -33
- package/template/apps/server/src/system/drizzle-repository.ts +15 -7
- package/template/apps/server/src/system/drizzle-scoped-repository.ts +5 -3
- package/template/apps/server/src/system/drizzle-system.ts +37 -9
- package/template/apps/server/src/system/drizzle-transaction-context.ts +14 -0
- package/template/apps/server/src/system/identity-route-config.ts +7 -2
- package/template/apps/server/src/system/mutation-runner.ts +23 -0
- package/template/apps/server/src/system/organization-postgres.integration.test.ts +176 -0
- package/template/apps/server/src/system/resource-access-response.ts +12 -6
- package/template/apps/server/src/system/role-department-scope-policy.ts +55 -0
- package/template/apps/server/src/system/route-helpers.ts +2 -5
- package/template/apps/server/src/system/route-types.ts +12 -3
- package/template/apps/server/src/system/routes-validation.test.ts +26 -0
- package/template/apps/server/src/system/routes.test.ts +10 -2
- package/template/apps/server/src/system/routes.ts +70 -36
- package/template/apps/server/src/system/seed.ts +7 -0
- package/template/apps/server/src/work-order/data-scope.integration.test.ts +9 -2
- package/template/apps/server/src/work-order/opensearch-index.test.ts +97 -0
- package/template/apps/server/src/work-order/opensearch-index.ts +313 -0
- package/template/apps/server/src/work-order/search-provider.ts +60 -1
- package/template/apps/server/src/work-order/service.ts +42 -10
- package/template/apps/web/src/app/error-pages.ts +9 -0
- package/template/apps/web/src/components/auth/PasswordChangeForm.vue +16 -11
- package/template/apps/web/src/components/auth/PasswordChangeForm.webtest.ts +14 -0
- package/template/apps/web/src/components/common/FormDialog.vue +16 -2
- package/template/apps/web/src/components/common/ModalLayout.webtest.ts +20 -1
- package/template/apps/web/src/composables/useGlobalSearch.ts +68 -0
- package/template/apps/web/src/composables/usePlatformSettings.ts +8 -7
- package/template/apps/web/src/layout/GlobalSearchResults.vue +58 -0
- package/template/apps/web/src/layout/NavigationSearchDialog.vue +42 -6
- package/template/apps/web/src/layout/NavigationSearchDialog.webtest.ts +71 -0
- package/template/apps/web/src/layout/NotificationMenu.vue +73 -31
- package/template/apps/web/src/layout/NotificationMenu.webtest.ts +44 -1
- package/template/apps/web/src/layout/NotificationMenuItem.vue +61 -0
- package/template/apps/web/src/layout/NotificationPreferencesDialog.vue +181 -0
- package/template/apps/web/src/layout/NotificationPreferencesDialog.webtest.ts +80 -0
- package/template/apps/web/src/lib/date-time.ts +22 -10
- package/template/apps/web/src/lib/date-time.webtest.ts +9 -1
- package/template/apps/web/src/main.ts +14 -1
- package/template/apps/web/src/pages/auth/ChangePasswordPage.vue +16 -1
- package/template/apps/web/src/pages/configuration/components/ModuleConfigVersionList.vue +1 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.vue +10 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationWorkbench.vue +37 -6
- package/template/apps/web/src/pages/errors/PlatformErrorPage.vue +115 -0
- package/template/apps/web/src/pages/errors/PlatformErrorPage.webtest.ts +44 -0
- package/template/apps/web/src/pages/errors/error-page-extension.ts +26 -0
- package/template/apps/web/src/pages/system/SystemNotificationsPage.vue +136 -68
- package/template/apps/web/src/pages/system/SystemNotificationsPage.webtest.ts +224 -12
- package/template/apps/web/src/pages/system/audit-log-presenter.ts +86 -0
- package/template/apps/web/src/pages/system/audit-time-range.ts +28 -0
- package/template/apps/web/src/pages/system/components/AuditActionCell.vue +10 -69
- package/template/apps/web/src/pages/system/components/AuditActionCell.webtest.ts +20 -27
- package/template/apps/web/src/pages/system/components/AuditLogDetailDialog.vue +134 -0
- package/template/apps/web/src/pages/system/components/AuditLogDetailDialog.webtest.ts +76 -0
- package/template/apps/web/src/pages/system/components/AuditLogFilters.vue +116 -52
- package/template/apps/web/src/pages/system/components/AuditLogFilters.webtest.ts +52 -15
- package/template/apps/web/src/pages/system/components/NotificationHistoryDialog.vue +129 -0
- package/template/apps/web/src/pages/system/components/NotificationManagementCard.vue +91 -0
- package/template/apps/web/src/pages/system/components/NotificationPublishDialog.vue +121 -0
- package/template/apps/web/src/pages/system/components/NotificationPublishForm.vue +162 -1
- package/template/apps/web/src/pages/system/components/SystemResourceActions.vue +68 -0
- package/template/apps/web/src/pages/system/components/SystemResourceEditor.vue +74 -0
- package/template/apps/web/src/pages/system/components/SystemResourceFilters.vue +3 -4
- package/template/apps/web/src/pages/system/components/SystemResourcePage.vue +91 -98
- package/template/apps/web/src/pages/system/components/SystemResourcePage.webtest.ts +68 -0
- package/template/apps/web/src/pages/system/components/SystemResourceTable.vue +20 -1
- package/template/apps/web/src/pages/system/components/SystemResourceTable.webtest.ts +28 -7
- package/template/apps/web/src/pages/system/components/department/DepartmentOrganizationForm.vue +210 -0
- package/template/apps/web/src/pages/system/components/department/DepartmentTransitionDialog.vue +112 -0
- package/template/apps/web/src/pages/system/components/user-account/UserAccountForm.vue +17 -4
- package/template/apps/web/src/pages/system/composables/useDepartmentTransitions.ts +79 -0
- package/template/apps/web/src/pages/system/composables/useNotificationPermissions.ts +14 -0
- package/template/apps/web/src/pages/system/composables/useSystemResource.ts +2 -0
- package/template/apps/web/src/pages/system/composables/useSystemResource.webtest.ts +15 -2
- package/template/apps/web/src/pages/system/resource-config.ts +12 -4
- package/template/apps/web/src/router/error-navigation.ts +50 -0
- package/template/apps/web/src/router/error-navigation.webtest.ts +106 -0
- package/template/apps/web/src/router/index.ts +71 -0
- package/template/apps/web/src/router/index.webtest.ts +29 -0
- package/template/apps/web/src/router/manifest-routes.webtest.ts +4 -0
- package/template/apps/web/src/router/shared-scaffold-neutrality.webtest.ts +12 -0
- package/template/apps/web/src/services/auth-api.ts +5 -0
- package/template/apps/web/src/services/http.ts +43 -6
- package/template/apps/web/src/services/http.webtest.ts +70 -0
- package/template/apps/web/src/services/notification-api.ts +85 -2
- package/template/apps/web/src/services/notification-api.webtest.ts +110 -0
- package/template/apps/web/src/services/search-api.ts +39 -0
- package/template/apps/web/src/services/system-api.ts +18 -0
- package/template/apps/web/vitest.config.ts +1 -0
- package/template/docker-compose.yml +66 -0
- package/template/docs/architecture/ai-runtime.md +14 -5
- package/template/docs/architecture/search-provider-protocol.md +38 -2
- package/template/docs/development/custom-error-pages.md +78 -0
- package/template/docs/development/custom-login-page.md +3 -3
- package/template/docs/platform/agent-runtime.md +32 -6
- package/template/docs/platform/audit-reliability.md +46 -2
- package/template/docs/platform/module-configuration.md +13 -4
- package/template/docs/platform/notifications.md +67 -11
- package/template/docs/platform/organization-membership.md +17 -3
- package/template/docs/platform/system-crud-api.md +16 -0
- package/template/docs/platform/web-system-crud.md +6 -2
- package/template/package.json +4 -0
- package/template/packages/config/index.test.ts +45 -0
- package/template/packages/config/package.json +1 -1
- package/template/packages/config/src/platform.ts +169 -48
- package/template/packages/database/drizzle/0035_material_nightshade.sql +10 -0
- package/template/packages/database/drizzle/0036_hesitant_speed.sql +35 -0
- package/template/packages/database/drizzle/0037_absent_nick_fury.sql +2 -0
- package/template/packages/database/drizzle/0038_uneven_wasp.sql +38 -0
- package/template/packages/database/drizzle/meta/0035_snapshot.json +7331 -0
- package/template/packages/database/drizzle/meta/0036_snapshot.json +7436 -0
- package/template/packages/database/drizzle/meta/0037_snapshot.json +7457 -0
- package/template/packages/database/drizzle/meta/0038_snapshot.json +7749 -0
- package/template/packages/database/drizzle/meta/_journal.json +28 -0
- package/template/packages/database/package.json +1 -1
- package/template/packages/database/src/schema/identity.ts +7 -0
- package/template/packages/database/src/schema/notifications.ts +135 -0
- package/template/packages/database/src/schema-notification-delivery.test.ts +54 -0
- package/template/packages/database/src/schema-workflow-notification.test.ts +40 -1
- package/template/packages/modules/package.json +1 -1
- package/template/packages/modules/src/system-api-permissions.ts +54 -0
- package/template/packages/modules/src/system-audit-actions.ts +10 -0
- package/template/packages/modules/src/system-features.ts +1 -1
- package/template/packages/modules/src/system-module-catalog.ts +2 -1
- package/template/packages/modules/src/system-modules.test.ts +13 -1
- package/template/packages/modules/src/system-modules.ts +12 -0
- package/template/packages/modules/src/system-permissions.ts +9 -5
- package/template/packages/server-sdk/package.json +1 -1
- package/template/packages/shared/package.json +1 -1
- package/template/packages/shared/src/audit.ts +25 -0
- package/template/packages/shared/src/module-configuration.ts +5 -0
- package/template/packages/shared/src/notification.ts +92 -1
- package/template/packages/shared/src/password.ts +7 -2
- package/template/packages/shared/src/platform-settings.ts +2 -0
- package/template/packages/storage/package.json +1 -1
- package/template/packages/storage/src/upload-service.test.ts +16 -0
- package/template/packages/storage/src/upload-service.ts +5 -1
- 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
|
-
|
|
304
|
-
|
|
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: [
|
|
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.
|
|
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
|
-
|
|
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("
|
|
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.
|
|
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
package/template/AGENTS.md
CHANGED
|
@@ -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 开发服务。
|
package/template/README.md
CHANGED
|
@@ -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
|
|
5
|
-
|
|
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
|
-
配置以下仅服务端可见的环境变量后,默认运行
|
|
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,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
|
+
)
|