create-windy 0.9.1 → 0.10.1
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 +1691 -1151
- package/package.json +2 -2
- package/template/.agents/skills/windy-business-module/SKILL.md +33 -1
- package/template/.windy-template.json +6 -2
- package/template/AGENTS.md +4 -0
- package/template/README.md +2 -0
- package/template/apps/agent-server/Dockerfile +1 -1
- package/template/apps/agent-server/README.md +1 -1
- package/template/apps/agent-server/native/EXTENSIONS.md +2 -2
- package/template/apps/agent-server/native/parallel-harness.ts +2 -0
- package/template/apps/agent-server/native/storage-lifecycle.test.ts +2 -1
- package/template/apps/agent-server/package.json +42 -41
- package/template/apps/agent-server/plugins/downloads/README.md +1 -1
- package/template/apps/agent-server/plugins/drop-overlay/README.md +1 -1
- package/template/apps/agent-server/plugins/settings/README.md +1 -1
- package/template/apps/agent-server/plugins/skill-library/client-chunks.test.ts +4 -1
- package/template/apps/agent-server/plugins/theme/README.md +5 -1
- package/template/apps/agent-server/plugins/theme/source-tokens.ts +0 -1
- package/template/apps/agent-server/plugins/theme/tokens.json +0 -4
- package/template/apps/agent-server/plugins/tool-catalog/README.md +6 -3
- package/template/apps/agent-server/plugins/tool-catalog/discovery.mjs +13 -10
- package/template/apps/agent-server/plugins/tool-catalog/discovery.test.ts +68 -6
- package/template/apps/agent-server/runtime/compatibility.ts +7 -1
- package/template/apps/agent-server/runtime/dsh-engine.ts +2 -0
- package/template/apps/agent-server/runtime/questions-workflow.nodecheck.ts +2 -0
- package/template/apps/server/Dockerfile +2 -1
- package/template/apps/server/package.json +11 -11
- package/template/apps/server/scripts/validate-module-composition-once.ts +2 -0
- package/template/apps/server/scripts/validate-module-composition.ts +8 -4
- package/template/apps/server/src/admin/routes.test.ts +29 -1
- package/template/apps/server/src/admin/routes.ts +20 -2
- package/template/apps/server/src/agent/client-session/completion.ts +1 -1
- package/template/apps/server/src/agent/client-session/manifest-admission.ts +1 -1
- package/template/apps/server/src/agent/client-session/request.ts +1 -1
- package/template/apps/server/src/agent/context-version-routes.ts +37 -13
- package/template/apps/server/src/agent/run-facade.ts +1 -1
- package/template/apps/server/src/agent/run-input-verification.ts +1 -1
- package/template/apps/server/src/agent/run-routes.ts +1 -14
- package/template/apps/server/src/agent/run-start-preparation.ts +1 -1
- package/template/apps/server/src/agent/runtime-bootstrap-input.ts +2 -0
- package/template/apps/server/src/agent/runtime-bootstrap.ts +49 -157
- package/template/apps/server/src/agent/runtime-disabled-composition.ts +2 -1
- package/template/apps/server/src/agent/session-invalidation/authorization-revocation.ts +54 -0
- package/template/apps/server/src/agent/session-runtime-composition.ts +1 -51
- package/template/apps/server/src/agent/unavailable-routes.ts +13 -2
- package/template/apps/server/src/agent-workflow/runtime-composition.ts +3 -0
- package/template/apps/server/src/agent-workflow/service.ts +17 -1
- package/template/apps/server/src/ai-artifact/media-resource-route.test.ts +134 -0
- package/template/apps/server/src/ai-artifact/routes.ts +1 -1
- package/template/apps/server/src/ai-artifact/runtime.ts +12 -0
- package/template/apps/server/src/ai-runtime-readiness/operation-port.test-support.ts +1 -1
- package/template/apps/server/src/ai-runtime-readiness/operation-port.ts +8 -0
- package/template/apps/server/src/ai-runtime-security/internal-token.ts +14 -0
- package/template/apps/server/src/app/antivirus-composition.test.ts +63 -0
- package/template/apps/server/src/app/antivirus-composition.ts +29 -0
- package/template/apps/server/src/app/dsh-workbench-socket-audit.test.ts +2 -1
- package/template/apps/server/src/configuration/definition.ts +15 -11
- package/template/apps/server/src/document/facade-support.ts +2 -2
- package/template/apps/server/src/document/facade.ts +2 -2
- package/template/apps/server/src/document/output-artifact-composition.ts +9 -5
- package/template/apps/server/src/document/output-artifact.test-support.ts +1 -1
- package/template/apps/server/src/embedding/facade.ts +1 -1
- package/template/apps/server/src/embedding/input.ts +1 -1
- package/template/apps/server/src/embedding/routes.ts +1 -1
- package/template/apps/server/src/index.ts +60 -60
- package/template/apps/server/src/license/routes.ts +4 -1
- package/template/apps/server/src/license/runtime-business-access.test.ts +261 -0
- package/template/apps/server/src/media-runtime/composition.ts +157 -0
- package/template/apps/server/src/media-runtime/media-only-composition.ts +44 -0
- package/template/apps/server/src/media-runtime/module-ai-port-factory.test.ts +69 -0
- package/template/apps/server/src/media-runtime/module-ai-port-factory.ts +72 -0
- package/template/apps/server/src/{agent → media-runtime}/runtime-readiness-sources.ts +14 -6
- package/template/apps/server/src/media-runtime/shared-composition.ts +104 -0
- package/template/apps/server/src/module-composition.test.ts +22 -0
- package/template/apps/server/src/module-composition.ts +48 -0
- package/template/apps/server/src/module-host/ai-operation-port.ts +97 -30
- package/template/apps/server/src/module-host/ai-operation-speech-normalize.test.ts +1 -1
- package/template/apps/server/src/module-host/http-runtime.ts +9 -3
- package/template/apps/server/src/module-host/static-route-authorization.test.ts +6 -3
- package/template/apps/server/src/module-host/storage-authorization-binding.test.ts +4 -0
- package/template/apps/server/src/module-runtime-validation.ts +2 -0
- package/template/apps/server/src/observability/diagnostic-index.ts +26 -1
- package/template/apps/server/src/observability/diagnostic-repository.ts +40 -11
- package/template/apps/server/src/platform-http-runtime.ts +1 -1
- package/template/apps/server/src/runtime-feature.ts +5 -1
- package/template/apps/server/src/runtime.ts +3 -0
- package/template/apps/server/src/settings/drizzle-watermark-repository.ts +35 -4
- package/template/apps/server/src/settings/watermark-repository.ts +14 -0
- package/template/apps/server/src/settings/watermark-routes.test.ts +84 -2
- package/template/apps/server/src/settings/watermark-routes.ts +109 -0
- package/template/apps/server/src/settings/watermark-transfer.ts +79 -0
- package/template/apps/server/src/speech/facade-validation.ts +1 -1
- package/template/apps/server/src/speech/facade.ts +2 -2
- package/template/apps/server/src/startup-composition-validation.test.ts +32 -0
- package/template/apps/server/src/startup-finalization.ts +2 -0
- package/template/apps/server/src/startup-runtime.ts +77 -0
- package/template/apps/server/src/system/ai-runtime-build.ts +3 -0
- package/template/apps/server/src/system/ai-runtime-configuration.test.ts +36 -0
- package/template/apps/server/src/system/ai-runtime-configuration.ts +58 -0
- package/template/apps/server/src/system/diagnostic-routes.test.ts +45 -0
- package/template/apps/server/src/system/diagnostic-routes.ts +35 -0
- package/template/apps/server/src/system/environment-policy-reader.test.ts +74 -0
- package/template/apps/server/src/system/environment-policy-reader.ts +62 -0
- package/template/apps/server/src/system/feature-environment-assessment.test.ts +148 -0
- package/template/apps/server/src/system/feature-environment-assessment.ts +179 -0
- package/template/apps/server/src/system/host-diagnostics.test.ts +155 -0
- package/template/apps/server/src/system/host-diagnostics.ts +225 -0
- package/template/apps/server/src/system/menu-registry.test.ts +26 -0
- package/template/apps/server/src/system/menu-registry.ts +9 -7
- package/template/apps/server/src/system/operations.test.ts +5 -0
- package/template/apps/server/src/system/operations.ts +36 -12
- package/template/apps/server/src/system/role-authorization-postgres.integration.test.ts +181 -0
- package/template/apps/web/Dockerfile +7 -3
- package/template/apps/web/dev/dev-port.test.ts +6 -6
- package/template/apps/web/dev/dev-port.ts +1 -1
- package/template/apps/web/dev/start.ts +6 -1
- package/template/apps/web/index.html +1 -0
- package/template/apps/web/package.json +16 -16
- package/template/apps/web/runtime-server.test.ts +22 -1
- package/template/apps/web/runtime-server.ts +6 -0
- package/template/apps/web/src/App.vue +6 -3
- package/template/apps/web/src/assets/windy.svg +4 -0
- package/template/apps/web/src/components/auth/LoginForm.vue +2 -2
- package/template/apps/web/src/components/auth/PasswordChangeForm.vue +14 -3
- package/template/apps/web/src/components/common/FormDialog.vue +1 -1
- package/template/apps/web/src/components/license/LicenseFlow.webtest.ts +3 -0
- package/template/apps/web/src/components/license/LicenseMachineCodeQr.vue +99 -0
- package/template/apps/web/src/components/license/LicenseMachineCodeQr.webtest.ts +83 -0
- package/template/apps/web/src/components/license/LicensePairingCard.vue +1 -1
- package/template/apps/web/src/components/license/LicenseStatusCard.vue +14 -2
- package/template/apps/web/src/composables/useLoginFlow.ts +2 -2
- package/template/apps/web/src/composables/usePlatformSettings.ts +1 -1
- package/template/apps/web/src/composables/useWatermarkSettings.ts +1 -0
- package/template/apps/web/src/layout/AppSidebar.vue +5 -9
- package/template/apps/web/src/layout/AppSidebar.webtest.ts +4 -1
- package/template/apps/web/src/pages/auth/ChangePasswordPage.vue +67 -6
- package/template/apps/web/src/pages/auth/LoginPage.vue +3 -12
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.vue +30 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationWorkbench.vue +25 -14
- package/template/apps/web/src/pages/configuration/components/TimeZoneSelect.vue +55 -0
- package/template/apps/web/src/pages/profile/PersonalSettingsPage.vue +64 -11
- package/template/apps/web/src/pages/profile/PersonalSettingsPage.webtest.ts +21 -1
- package/template/apps/web/src/pages/settings/BrandingSettingsSection.vue +7 -18
- package/template/apps/web/src/pages/settings/BrandingSettingsSection.webtest.ts +9 -4
- package/template/apps/web/src/pages/settings/GlobalSettingsPage.vue +51 -6
- package/template/apps/web/src/pages/settings/GlobalSettingsPage.webtest.ts +19 -3
- package/template/apps/web/src/pages/settings/WatermarkSettingsSection.vue +1 -0
- package/template/apps/web/src/pages/settings/WatermarkYamlTransfer.vue +211 -0
- package/template/apps/web/src/pages/system/DiagnosticLookupPage.vue +18 -3
- package/template/apps/web/src/pages/system/DiagnosticLookupPage.webtest.ts +4 -1
- package/template/apps/web/src/pages/system/SystemOperationsPage.vue +23 -0
- package/template/apps/web/src/pages/system/components/DiagnosticLogList.vue +120 -0
- package/template/apps/web/src/pages/system/components/OperationEnvironmentPanel.vue +237 -0
- package/template/apps/web/src/pages/system/components/OperationFeatureAssessmentPanel.vue +131 -0
- package/template/apps/web/src/pages/system/components/PagedSelectionList.vue +31 -24
- package/template/apps/web/src/pages/system/components/SystemResourceActions.vue +2 -1
- package/template/apps/web/src/pages/system/components/SystemResourceEditor.vue +11 -2
- package/template/apps/web/src/pages/system/components/SystemResourcePage.vue +1 -0
- package/template/apps/web/src/pages/system/components/SystemResourcePage.webtest.ts +6 -2
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillImportDialog.vue +18 -9
- package/template/apps/web/src/pages/system/components/agent-workbench/SessionReplayTimeline.vue +18 -9
- package/template/apps/web/src/pages/system/components/agent-workbench/TestRunComposer.vue +66 -34
- package/template/apps/web/src/pages/system/components/agent-workbench/ToolCatalogPanel.vue +48 -33
- package/template/apps/web/src/pages/system/components/agent-workbench/ToolCatalogPanel.webtest.ts +9 -2
- package/template/apps/web/src/pages/system/components/agent-workbench/ToolRuleDetail.vue +23 -16
- package/template/apps/web/src/pages/system/components/dictionary-bulk/DictionaryBulkJobDetail.vue +10 -7
- package/template/apps/web/src/pages/system/components/user-account/RolePermissionSummary.vue +81 -57
- package/template/apps/web/src/pages/system/components/user-account/UserRoleSelector.vue +6 -4
- package/template/apps/web/src/pages/system/components/user-account/UserRoleSelector.webtest.ts +20 -4
- package/template/apps/web/src/pages/system/resource-config.ts +9 -0
- package/template/apps/web/src/pages/work-orders/WorkOrderListPage.vue +1 -1
- package/template/apps/web/src/router/disabled-feature-loading.webtest.ts +78 -0
- package/template/apps/web/src/router/index.ts +3 -6
- package/template/apps/web/src/router/manifest-routes.ts +2 -3
- package/template/apps/web/src/router/platform-admin-pages.ts +21 -62
- package/template/apps/web/src/router/platform-admin-route-bindings.ts +4 -4
- package/template/apps/web/src/services/diagnostics-api.ts +13 -1
- package/template/apps/web/src/services/operations-api.ts +4 -0
- package/template/apps/web/src/services/platform-settings-api.ts +35 -1
- package/template/apps/web/vite.config.ts +9 -3
- package/template/deploy/environment/windy.environment.example.yaml +53 -0
- package/template/docker-compose.yml +4 -2
- package/template/docs/architecture/agent-admin-workbench-implementation.md +1 -1
- package/template/docs/architecture/agent-admin-workbench-plan.md +1 -1
- package/template/docs/architecture/agent-workflow.md +8 -0
- package/template/docs/architecture/durable-jobs.md +17 -0
- package/template/docs/architecture/embedded-dsh-integration.md +1 -1
- package/template/docs/development/dsh-plugins.md +1 -1
- package/template/docs/development/performance-engineering.md +24 -0
- package/template/docs/operations/admin-settings-yaml.md +29 -0
- package/template/docs/operations/dsh-agent-migration.md +2 -2
- package/template/docs/operations/environment-capabilities.md +185 -0
- package/template/docs/platform/module-configuration.md +18 -3
- package/template/docs/platform/platform-authentication.md +1 -1
- package/template/package.json +10 -8
- package/template/packages/config/package.json +2 -2
- package/template/packages/config/src/definition.ts +14 -4
- package/template/packages/config/src/environment-loader.ts +27 -3
- package/template/packages/config/src/platform-ai-runtime.test.ts +94 -0
- package/template/packages/config/src/platform.ts +5 -2
- package/template/packages/database/drizzle/0065_durable_job_lease_snapshot_lookup.sql +1 -0
- package/template/packages/database/drizzle/0066_agent_source_sequence_bigint.sql +3 -0
- package/template/packages/database/drizzle/0067_media_runtime_access.sql +46 -0
- package/template/packages/database/drizzle/meta/0065_snapshot.json +15370 -0
- package/template/packages/database/drizzle/meta/0066_snapshot.json +15370 -0
- package/template/packages/database/drizzle/meta/0067_snapshot.json +15370 -0
- package/template/packages/database/drizzle/meta/_journal.json +21 -0
- package/template/packages/database/package.json +3 -3
- package/template/packages/database/src/schema/agent-session.ts +4 -3
- package/template/packages/database/src/schema/durable-jobs.ts +4 -0
- package/template/packages/database/src/schema/index.ts +3 -1
- package/template/packages/database/src/schema-durable-recovery.test.ts +21 -1
- package/template/packages/database/src/schema-source-sequence.test.ts +24 -0
- package/template/packages/example-work-order/package.json +2 -2
- package/template/packages/modules/package.json +1 -1
- package/template/packages/modules/src/admin-ui-boundary.test.ts +33 -0
- package/template/packages/modules/src/composition.ts +11 -28
- package/template/packages/modules/src/manifest.ts +2 -0
- package/template/packages/modules/src/menu-composition.ts +24 -0
- package/template/packages/modules/src/system-admin-routes.ts +2 -2
- package/template/packages/modules/src/system-admin-ui-catalog.ts +6 -1
- package/template/packages/modules/src/system-ai-api-bindings.ts +0 -16
- package/template/packages/modules/src/system-api-control-plane.ts +9 -1
- package/template/packages/modules/src/system-api-permissions.ts +7 -0
- package/template/packages/modules/src/system-api-watermark.ts +21 -0
- package/template/packages/modules/src/system-audit-actions.ts +3 -1
- package/template/packages/modules/src/system-features.ts +21 -3
- package/template/packages/modules/src/system-media-api-bindings.ts +97 -0
- package/template/packages/modules/src/system-module-audit-selection.ts +2 -0
- package/template/packages/modules/src/system-module-catalog.test.ts +13 -6
- package/template/packages/modules/src/system-module-catalog.ts +6 -241
- package/template/packages/modules/src/system-module-definitions.ts +260 -0
- package/template/packages/modules/src/system-modules-access.test.ts +2 -0
- package/template/packages/modules/src/system-modules.test.ts +7 -1
- package/template/packages/modules/src/system-modules.ts +25 -13
- package/template/packages/modules/src/system-permissions.ts +12 -0
- package/template/packages/server-sdk/package.json +1 -1
- package/template/packages/shared/index.ts +3 -0
- package/template/packages/shared/package.json +1 -1
- package/template/packages/shared/src/environment-assessment.ts +68 -0
- package/template/packages/shared/src/environment-policy.ts +205 -0
- package/template/packages/shared/src/license-console-capabilities.ts +7 -0
- package/template/packages/shared/src/license.ts +1 -0
- package/template/packages/shared/src/module-configuration.ts +2 -1
- package/template/scripts/operations/collect-device-info.py +230 -0
- package/template/apps/server/src/agent/module-ai-port-factory.ts +0 -41
- /package/template/apps/server/src/{agent → ai-runtime-security}/execution-grants.ts +0 -0
- /package/template/apps/server/src/{agent → ai-runtime-security}/idempotency-key.test.ts +0 -0
- /package/template/apps/server/src/{agent → ai-runtime-security}/idempotency-key.ts +0 -0
- /package/template/apps/server/src/{agent → ai-runtime-security}/provider-input-governance.test.ts +0 -0
- /package/template/apps/server/src/{agent → ai-runtime-security}/provider-input-governance.ts +0 -0
- /package/template/apps/server/src/{agent → media-runtime}/required-environment.ts +0 -0
- /package/template/apps/server/src/{agent → media-runtime}/runtime-readiness-sources.test.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-windy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "创建单组织、单租户、私有部署优先的 Windy 企业 Dashboard Starter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
},
|
|
37
37
|
"private": false,
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@inquirer/checkbox": "^5.2.
|
|
39
|
+
"@inquirer/checkbox": "^5.2.8"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -24,7 +24,9 @@ description: "在 Windy 或 create-windy 生成项目中新增或修改业务 Mo
|
|
|
24
24
|
Route、Audit Action,以及需要的 Migration/Schema Export、Task、Provider、JSON
|
|
25
25
|
Schema、Tool、AI Operation、Secret 和 Data Policy。Feature 使用能力基础 Key,
|
|
26
26
|
Permission 在同一 Key 后追加动作;非匿名入口和 Handler 只能引用已声明且同基础 Key
|
|
27
|
-
|
|
27
|
+
的治理能力。预览、校验等只读 API 即使使用 POST,也要声明已注册的 Audit Action。
|
|
28
|
+
按行为选择动作,读取当前配置并计算差异的预览可复用 `data.read`,实际写入使用对应更新动作。
|
|
29
|
+
**完成标准:Manifest 声明和 Host 实现双向枚举无缺失、未知或重复 Key。**
|
|
28
30
|
4. 数据层使用 Drizzle Schema、前向 Migration 和 Repository;Service 持有业务规则,
|
|
29
31
|
其它模块只能通过 Service、公开 Port 或注册机制协作。Manifest 与 Migration Bundle
|
|
30
32
|
版本、顺序、依赖和 Schema Export 必须一致;已发布 Migration ID/checksum 不改写。
|
|
@@ -92,6 +94,36 @@ description: "在 Windy 或 create-windy 生成项目中新增或修改业务 Mo
|
|
|
92
94
|
一次 `release:verify`。仅当项目提供 `lint` 脚本时运行 lint;一个 cohesive slice 一个
|
|
93
95
|
Conventional Commit。**完成标准:验证层级、未执行项和提交 SHA 均可审计。**
|
|
94
96
|
|
|
97
|
+
### 启动与人工验收交接
|
|
98
|
+
|
|
99
|
+
用户要求启动服务做人工验收时,先确认端口归属和数据库目标。迁移独立验收库后,核对
|
|
100
|
+
API、Web 代理及相关独立服务的就绪端点。模块装配失败时,从报错的 Manifest 绑定查起,
|
|
101
|
+
修复后重新走正常启动入口。交接时用发布标签和实际候选 SHA 界定差异,逐模块列出入口、
|
|
102
|
+
操作、预期结果和依赖环境,分别记录服务就绪与实际业务验收结果。
|
|
103
|
+
|
|
104
|
+
## 环境适配与可选能力
|
|
105
|
+
|
|
106
|
+
业务能力需要 GPU、模型、外部服务或可选软件时,先读
|
|
107
|
+
[环境能力评估与构建预设](../../../docs/operations/environment-capabilities.md),
|
|
108
|
+
将环境评估与能力声明一起设计:
|
|
109
|
+
|
|
110
|
+
- 分别记录硬件/操作系统证据、软件/Adapter 的真实支持、readiness 和功能质量验收。
|
|
111
|
+
没有 GPU 不能直接推出 OCR 不可用;探测不到设备或服务也不能写成已确认不支持。
|
|
112
|
+
- 构建模块选择决定实际交付内容;运行时 Feature 开关控制已有能力的可用性。
|
|
113
|
+
环境 YAML 的 `features` 仅生成评估建议,不能把它当作已执行的启停配置。
|
|
114
|
+
`build.modules` 必须接到生成器/打包器已经支持的裁剪入口,并检查源码、依赖、路由、
|
|
115
|
+
服务与数据库对象。仅隐藏入口或写入 YAML,不算物理裁剪。
|
|
116
|
+
- 评估报告给出可用、缺依赖或未验证的证据与原因;停用/恢复按用户已授权策略执行,
|
|
117
|
+
没有策略时先呈现具体受影响功能,再由用户确认。不要因探测失败自动改写功能开关。
|
|
118
|
+
- CPU OCR 项目选用 `system.media-runtime`,通过 `build.runtimes` 决定独立应用交付范围,
|
|
119
|
+
通过 `runtime` 决定 Server 启动装配。业务 UI 和服务入口使用对应的
|
|
120
|
+
`system.agent`、`system.document`、`system.speech` 或 `system.embedding` Feature。
|
|
121
|
+
- 病毒扫描独立使用 `antivirus` 配置。需要扫描的项目负责交付执行器和病毒库,并通过项目
|
|
122
|
+
Composition 将就绪检查与实际入库流程接通。验证时分别检查启动状态和文件处理结果。
|
|
123
|
+
|
|
124
|
+
**完成标准:构建内容、运行时预设、环境证据和人工决定可以分别核对;已验证与待验收
|
|
125
|
+
项明确,普通业务能力不被共享 AI 开关误伤。**
|
|
126
|
+
|
|
95
127
|
## Client Agent Workflow 重复故障解法
|
|
96
128
|
|
|
97
129
|
- 跨层 opaque ID 必须选一个 canonical prefix,并同步 Server 生成器、public SDK、客户端
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"templateCommit": "
|
|
4
|
-
"generatorVersion": "0.
|
|
3
|
+
"templateCommit": "266b77d1fad69f8cfa00f96fc09c7b494c1dc71d",
|
|
4
|
+
"generatorVersion": "0.10.1",
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"name": "system",
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
"name": "system.storage",
|
|
32
32
|
"version": "0.1.0"
|
|
33
33
|
},
|
|
34
|
+
{
|
|
35
|
+
"name": "system.media-runtime",
|
|
36
|
+
"version": "0.1.0"
|
|
37
|
+
},
|
|
34
38
|
{
|
|
35
39
|
"name": "system.agent",
|
|
36
40
|
"version": "0.1.2"
|
package/template/AGENTS.md
CHANGED
|
@@ -78,6 +78,8 @@
|
|
|
78
78
|
或 MCP 暴露时使用的仓库内开发流程。
|
|
79
79
|
- `docs/development/custom-login-page.md`:完整替换登录页的 ownership、认证复用和
|
|
80
80
|
升级迁移说明。
|
|
81
|
+
- 修改公共入口、懒加载、模块裁剪、缓存或慢查询时,读取
|
|
82
|
+
`docs/development/performance-engineering.md`。
|
|
81
83
|
- `docs/development/custom-error-pages.md`:统一错误语义、Request ID 与业务页面
|
|
82
84
|
替换方式。
|
|
83
85
|
- `bun run dev`:复用 Docker 镜像启动 PostgreSQL、自动 migration、Server 与支持热更新的 Web。
|
|
@@ -86,5 +88,7 @@
|
|
|
86
88
|
- `bun run dev:server`:启动 Server 开发服务。
|
|
87
89
|
- `/admin/system/ai-runtime`:查看受治理的 Run、Provider Attempt 与脱敏 Trajectory。
|
|
88
90
|
- `bun run lint`、`bun run typecheck`、`bun run test`、`bun run build`:执行基础验证;未选择 Oxc 时没有 lint 脚本。
|
|
91
|
+
- `windy.environment.yaml`:构建模块记录与环境评估建议;接入与边界见
|
|
92
|
+
`docs/operations/environment-capabilities.md`。
|
|
89
93
|
- `docs/README.md`:平台架构、模块接入和运维文档入口。
|
|
90
94
|
- `.windy/generation.json`:本次生成器版本、所选模块和选项记录。
|
package/template/README.md
CHANGED
|
@@ -74,6 +74,7 @@ Skill 仍可用于普通业务模块开发。
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
|
+
|
|
77
78
|
## 页面与登录
|
|
78
79
|
|
|
79
80
|
全新数据库的初始平台账号为 `admin`。初始密码不是所有项目共用的固定值,而是
|
|
@@ -119,6 +120,7 @@ create-windy 在本机 `.env` 中随机生成的 `WINDY_BOOTSTRAP_ADMIN_PASSWORD
|
|
|
119
120
|
| `system.audit` | 未包含 | H2 | 审计查询、可靠写入和恢复。 |
|
|
120
121
|
| `system.operations` | 未包含 | H2 | 服务、数据库、缓存、磁盘和会话监控。 |
|
|
121
122
|
| `system.storage` | 未包含 | H2 | 上传、下载和对象生命周期。 |
|
|
123
|
+
| `system.media-runtime` | 未包含 | H2 | 受治理的文档、语音、嵌入与公共文件引用。 |
|
|
122
124
|
| `system.agent` | 未包含 | H2 | 受控 Agent 工具宿主。 |
|
|
123
125
|
| `system.scheduler` | 未包含 | H2 | 任务、重试、历史和恢复。 |
|
|
124
126
|
| `system.notification` | 未包含 | H2 | 通知定向与定时发布、用户偏好、外部渠道投递、修改历史、阅读、收藏和归档。 |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# syntax=docker/dockerfile:1
|
|
2
2
|
# One application-owned Agent Server image; DSH is an npm workspace dependency.
|
|
3
3
|
FROM oven/bun:1.3.14-slim@sha256:d56a2534ffd262e92c12fd3249d3924d296d97086da773f821d7d0477435ea04 AS bun
|
|
4
|
-
FROM node:24.
|
|
4
|
+
FROM node:24.9.0-bookworm-slim@sha256:3e69116c924bfcba6c6979aff60d966c37aef56d488ce091c69d442ebec9f103 AS node
|
|
5
5
|
FROM bun AS dependencies
|
|
6
6
|
WORKDIR /app
|
|
7
7
|
COPY package.json bun.lock ./
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 当前用户的 DSH 扩展
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
上游 DSH 使用 `~0.2.2-rc.1`,镜像按 Bun 锁文件安装。
|
|
4
4
|
|
|
5
5
|
## 插件入口与持久化
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
- 插件自己的配置页在「插件」内;「设置」→「内置插件」提供全局运行清单。应用托管的共享模型地址、身份等配置仍由最后一层 deployment patch 固定,更改这些字段会被上游拒绝,不应绕开覆盖。
|
|
9
9
|
- 上游 `plugin-manager`、`config-editor`、`settings`、`hmr` 和 `client-hmr` 原样组合。安装和启停由 HMR 实时应用,真正需要重启的情况由上游显示原因。
|
|
10
10
|
- 插件安装写入每个用户 `DSH_HOME/profiles/web` 的 `package.json`、`pnpm-lock.yaml`、`node_modules`、`cordis.patch.yml` 等文件。worker 使用官方 `initProfile()` 仅补缺失文件,重启不清空个人清单、锁或两层个人 patch。
|
|
11
|
-
-
|
|
11
|
+
- 安装器是镜像内按 Bun 锁文件安装的官方 npm 包 `pnpm`(声明范围 `^11.28.11`)(MIT),由 Node 调用,不使用 curl 安装器。上游依赖 pnpm 的 `view/add/remove`、脚本批准和文件恢复语义;项目 monorepo 仍以 Bun 管理。Docker 补齐 Git 与 CA,便于上游 Git spec 安装。
|
|
12
12
|
- `tool-plugin-manager` 保持禁用;技能文本不能静默安装插件代码。安装代码由用户在原生管理界面执行。
|
|
13
13
|
|
|
14
14
|
开发阶段 `AGENT_DSH_USER_EXTENSIONS=1` 默认开启。设置为 `0` 并重启现有 Agent Server 会关闭扩展安装、配置及清单管理入口,同时关闭个人 Skills 默认根发现。此开关不会删除已安装文件,也不会停止已经保存为启用的可信插件;要撤销已有插件代码,应先在原生 UI 卸载或停用,再重启当前用户 worker / Agent Server。它不是恶意代码安全开关。
|
|
@@ -19,6 +19,7 @@ import LlmRuntime, {
|
|
|
19
19
|
type StreamChunk,
|
|
20
20
|
} from "@deepseek-ai/dsh-llm";
|
|
21
21
|
import ToolRuntime from "@deepseek-ai/dsh-tools";
|
|
22
|
+
import * as NativeToolExecutor from "@deepseek-ai/dsh-tool-executor-native";
|
|
22
23
|
import SystemPrompt from "@deepseek-ai/dsh-system-prompt";
|
|
23
24
|
import LocalFileSystem from "@deepseek-ai/dsh-fs-local";
|
|
24
25
|
import WorkingDirectory from "@deepseek-ai/dsh-working-directory";
|
|
@@ -172,6 +173,7 @@ export async function harness(
|
|
|
172
173
|
}),
|
|
173
174
|
);
|
|
174
175
|
fibers.push(await ctx.plugin(ToolRuntime));
|
|
176
|
+
fibers.push(await ctx.plugin(NativeToolExecutor));
|
|
175
177
|
fibers.push(
|
|
176
178
|
await ctx.plugin(AgentLoop, { maxParallelToolCalls: 2, agents: [] }),
|
|
177
179
|
);
|
|
@@ -165,7 +165,8 @@ test("real file churn no longer stops a worker during quota inspection", async (
|
|
|
165
165
|
await manager.close();
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
|
-
|
|
168
|
+
// 100 次真实目录扫描与并发文件变动属于 I/O 集成验证,保留全部轮次与断言。
|
|
169
|
+
}, 30_000);
|
|
169
170
|
|
|
170
171
|
test("missing root still stops a worker through the real inspection path", async () => {
|
|
171
172
|
await temporary(async (home) => {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=24.
|
|
7
|
+
"node": ">=24.9.0"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "bun build main.ts native/worker.ts --target=node --outdir dist --external '@deepseek-ai/*' --external ajv --external sharp",
|
|
@@ -16,48 +16,49 @@
|
|
|
16
16
|
"test:coordinator": "bun scripts/test-coordinator.ts"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@deepseek-ai/dsh": "0.2.
|
|
20
|
-
"@deepseek-ai/dsh-agent": "0.2.
|
|
21
|
-
"@deepseek-ai/dsh-agent-loop": "0.2.
|
|
22
|
-
"@deepseek-ai/dsh-session": "0.2.
|
|
23
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
24
|
-
"@deepseek-ai/dsh-compaction-basic": "0.2.
|
|
25
|
-
"@deepseek-ai/dsh-agent-preset-registry": "0.2.
|
|
26
|
-
"@deepseek-ai/dsh-tools": "0.2.
|
|
27
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.
|
|
28
|
-
"@deepseek-ai/dsh-session-projection": "0.2.
|
|
29
|
-
"@deepseek-ai/dsh-web-app": "0.2.
|
|
30
|
-
"@deepseek-ai/dsh-base": "0.2.
|
|
31
|
-
"@deepseek-ai/cordis": "4.0
|
|
32
|
-
"ajv": "8.20.0",
|
|
19
|
+
"@deepseek-ai/dsh": "~0.2.2-rc.1",
|
|
20
|
+
"@deepseek-ai/dsh-agent": "~0.2.2-rc.1",
|
|
21
|
+
"@deepseek-ai/dsh-agent-loop": "~0.2.2-rc.1",
|
|
22
|
+
"@deepseek-ai/dsh-session": "~0.2.2-rc.1",
|
|
23
|
+
"@deepseek-ai/dsh-llm": "~0.2.2-rc.1",
|
|
24
|
+
"@deepseek-ai/dsh-compaction-basic": "~0.2.2-rc.1",
|
|
25
|
+
"@deepseek-ai/dsh-agent-preset-registry": "~0.2.2-rc.1",
|
|
26
|
+
"@deepseek-ai/dsh-tools": "~0.2.2-rc.1",
|
|
27
|
+
"@deepseek-ai/dsh-system-prompt": "~0.2.2-rc.1",
|
|
28
|
+
"@deepseek-ai/dsh-session-projection": "~0.2.2-rc.1",
|
|
29
|
+
"@deepseek-ai/dsh-web-app": "~0.2.2-rc.1",
|
|
30
|
+
"@deepseek-ai/dsh-base": "~0.2.2-rc.1",
|
|
31
|
+
"@deepseek-ai/cordis": "^4.1.0",
|
|
32
|
+
"ajv": "^8.20.0",
|
|
33
33
|
"@southwind-ai/ai-client": "workspace:*",
|
|
34
|
-
"@deepseek-ai/dsh-llm-pi-ai": "0.2.
|
|
35
|
-
"@deepseek-ai/dsh-launch-environment": "0.2.
|
|
36
|
-
"@deepseek-ai/dsh-mcp-client": "0.2.
|
|
37
|
-
"@deepseek-ai/dsh-client-connection": "0.2.
|
|
38
|
-
"ws": "8.22.
|
|
39
|
-
"@deepseek-ai/dsh-scope": "0.2.
|
|
40
|
-
"zod": "4.
|
|
41
|
-
"sharp": "0.35.5",
|
|
42
|
-
"@deepseek-ai/dsh-attachment": "0.2.
|
|
43
|
-
"@deepseek-ai/dsh-subprocess-local": "0.2.
|
|
44
|
-
"@deepseek-ai/node-addon-system": "0.1.2",
|
|
45
|
-
"@deepseek-ai/dsh-app-boot": "0.2.
|
|
46
|
-
"pnpm": "11.28.
|
|
47
|
-
"fflate": "0.8.3",
|
|
48
|
-
"yaml": "2.9.
|
|
49
|
-
"@deepseek-ai/dsh-subagent": "0.2.
|
|
50
|
-
"@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.
|
|
51
|
-
"@deepseek-ai/dsh-tool-subagent": "0.2.
|
|
52
|
-
"@deepseek-ai/dsh-tool-subagent-control": "0.2.
|
|
53
|
-
"@deepseek-ai/dsh-working-directory": "0.2.
|
|
54
|
-
"@deepseek-ai/dsh-api-settings-controller": "0.2.
|
|
55
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.
|
|
56
|
-
"@deepseek-ai/dsh-skill": "0.2.
|
|
34
|
+
"@deepseek-ai/dsh-llm-pi-ai": "~0.2.2-rc.1",
|
|
35
|
+
"@deepseek-ai/dsh-launch-environment": "~0.2.2-rc.1",
|
|
36
|
+
"@deepseek-ai/dsh-mcp-client": "~0.2.2-rc.1",
|
|
37
|
+
"@deepseek-ai/dsh-client-connection": "~0.2.2-rc.1",
|
|
38
|
+
"ws": "^8.22.1",
|
|
39
|
+
"@deepseek-ai/dsh-scope": "~0.2.2-rc.1",
|
|
40
|
+
"zod": "^4.6.7",
|
|
41
|
+
"sharp": "^0.35.5",
|
|
42
|
+
"@deepseek-ai/dsh-attachment": "~0.2.2-rc.1",
|
|
43
|
+
"@deepseek-ai/dsh-subprocess-local": "~0.2.2-rc.1",
|
|
44
|
+
"@deepseek-ai/node-addon-system": "^0.1.2",
|
|
45
|
+
"@deepseek-ai/dsh-app-boot": "~0.2.2-rc.1",
|
|
46
|
+
"pnpm": "^11.28.11",
|
|
47
|
+
"fflate": "^0.8.3",
|
|
48
|
+
"yaml": "^2.9.1",
|
|
49
|
+
"@deepseek-ai/dsh-subagent": "~0.2.2-rc.1",
|
|
50
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "~0.2.2-rc.1",
|
|
51
|
+
"@deepseek-ai/dsh-tool-subagent": "~0.2.2-rc.1",
|
|
52
|
+
"@deepseek-ai/dsh-tool-subagent-control": "~0.2.2-rc.1",
|
|
53
|
+
"@deepseek-ai/dsh-working-directory": "~0.2.2-rc.1",
|
|
54
|
+
"@deepseek-ai/dsh-api-settings-controller": "~0.2.2-rc.1",
|
|
55
|
+
"@deepseek-ai/dsh-typert-protocol": "~0.2.2-rc.1",
|
|
56
|
+
"@deepseek-ai/dsh-skill": "~0.2.2-rc.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@types/ws": "8.18.
|
|
60
|
-
"@deepseek-ai/dsh-fs-local": "0.2.
|
|
61
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.
|
|
59
|
+
"@types/ws": "^8.18.2",
|
|
60
|
+
"@deepseek-ai/dsh-fs-local": "~0.2.2-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-slots": "~0.2.2-rc.1",
|
|
62
|
+
"@deepseek-ai/dsh-tool-executor-native": "~0.2.2-rc.1"
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Native workbench downloads
|
|
2
2
|
|
|
3
|
-
Thin project plugin for DSH
|
|
3
|
+
Thin project plugin for DSH (upstream MIT). It contributes to the
|
|
4
4
|
published `deliverables.file.actions` and `deliverables.review.file.actions`
|
|
5
5
|
slots, preserving native preview/open controls. Download availability does not
|
|
6
6
|
depend on a desktop opener being installed on the server.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
18px 半粗标题和 14px 说明。颜色读取 DSH 语义 Token,跟随当前浅色/深色主题。
|
|
6
6
|
上传图标采用项目既有 Lucide cloud-upload 的 ISC 图形路径;减少动态效果时禁用跳动。
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
实现最初依据的官方 MIT 包 `@deepseek-ai/dsh-client-ui-attachment@0.2.1-rc.2` 只公开整个
|
|
9
9
|
`conversation.input.attachments` 插槽,没有导出的独立 DropOverlay 或装饰插槽。
|
|
10
10
|
原生 React 页面不能直接挂载产品 Vue 组件;本插件只通过公开 `webserver/index-inject`
|
|
11
11
|
追加范围限定的 CSS,不复制附件组件、不替换上传回调,也不新增任何 drag/drop 监听。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Windy工作台设置策略
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
使用官方 Host profile 禁用账号/API 登录 UI、官方 Session Log 上传实现和对应设置 UI,以及服务端打开本机应用能力。Windy统一认证和模型代理保持产品管理;独立的 SettingsController Adapter 在 RPC 层拒绝打开服务器配置文件。
|
|
4
4
|
|
|
5
5
|
Client 使用公开 slot 的 priority shadowing 隐藏 `settings.action/open-document` 与 `settings.general.item/current-version`。换行图标按钮位于配置预览框右上方,不占设置页标题栏;保留 `aria-pressed`、Tooltip 与 `Alt+Z`。默认换行,关闭后横向滚动。alpha.3 未提供预览工具栏插槽,因此适配器仅观察语义 `[role="dialog"] pre`,在代码块前插入自有工具栏,不移动或复制上游 React 节点,不匹配中文文案或打包类名。关闭对话框或卸载时清理按钮、快捷键与样式;升级 DSH 后需要核对这个窄 DOM 边界。
|
|
6
6
|
|
|
@@ -26,7 +26,10 @@ test("the official client module system loads this plugin's editor and use chunk
|
|
|
26
26
|
__ModuleLoader__: {
|
|
27
27
|
load(registration: ClientBundleRegistration) {
|
|
28
28
|
Runtime = registration.factory(
|
|
29
|
-
Object.assign(() => ({}), {
|
|
29
|
+
Object.assign(() => ({}), {
|
|
30
|
+
async: async () => ({}),
|
|
31
|
+
asset: (reference: string) => reference,
|
|
32
|
+
}),
|
|
30
33
|
) as typeof Runtime;
|
|
31
34
|
},
|
|
32
35
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Windy DSH 主题插件
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
使用公开 `dsh.client` 插件声明、`ctx.theme.overrideTokens`
|
|
4
4
|
和 Cordis effect 生命周期。`tokens.json` 由 `bun apps/agent-server/plugins/theme/sync-tokens.ts` 从现有 `apps/web/src/style.css` 的 `:root/.dark` 语义色生成,映射至
|
|
5
5
|
DSH 的公开 `--dsw-*` token;不修改上游源码,不以高优先级全局 CSS 抢占其主题呈现器。
|
|
6
6
|
|
|
@@ -16,3 +16,7 @@ Host 仅经 `webserver/index-inject` 传递部署拥有的 token JSON。客户
|
|
|
16
16
|
聚焦测试直接加载当前 npm 包的原生 ThemeRuntime,覆盖偏好切换、系统变更与卸载恢复。
|
|
17
17
|
|
|
18
18
|
主题源变更后重新生成投影;Agent镜像仅携带生成JSON,不在运行时读取Web源码。原生加载状态也复用该投影,不另设配色或偏好。
|
|
19
|
+
|
|
20
|
+
当前 DSH 侧栏悬停复用 `--dsw-alias-interactive-bg-hover`,对应 Windy 的 `--accent`;
|
|
21
|
+
不再投影上游已移除的 `--dsw-specific-sidebar-nav-item-hover`。升级时继续由契约测试
|
|
22
|
+
逐项检查投影 token 在当前上游主题中存在,避免注册已失效的覆盖项。
|
|
@@ -28,7 +28,6 @@ export const themeTokenSources: Readonly<Record<string, string>> = {
|
|
|
28
28
|
"--dsw-specific-sidebar-fill": "--sidebar",
|
|
29
29
|
"--dsw-specific-sidebar-nav-item-active": "--sidebar-accent",
|
|
30
30
|
"--dsw-specific-sidebar-nav-item-active-accent": "--sidebar-accent",
|
|
31
|
-
"--dsw-specific-sidebar-nav-item-hover": "--sidebar-accent",
|
|
32
31
|
"--dsw-specific-menu": "--popover",
|
|
33
32
|
"--dsw-specific-input-major": "--card",
|
|
34
33
|
"--dsw-specific-selector": "--muted",
|
|
@@ -111,10 +111,6 @@
|
|
|
111
111
|
"light": "oklch(0.97 0 0)",
|
|
112
112
|
"dark": "oklch(0.269 0 0)"
|
|
113
113
|
},
|
|
114
|
-
"--dsw-specific-sidebar-nav-item-hover": {
|
|
115
|
-
"light": "oklch(0.97 0 0)",
|
|
116
|
-
"dark": "oklch(0.269 0 0)"
|
|
117
|
-
},
|
|
118
114
|
"--dsw-specific-menu": {
|
|
119
115
|
"light": "oklch(1 0 0)",
|
|
120
116
|
"dark": "oklch(0.205 0 0)"
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
工具事实来源是官方 MCP bridge 通过现有身份获得并注册的 `mcp__windy__*` 工具。
|
|
4
4
|
不另建业务工具 allowlist,不复制输入输出 Schema,也不扩大业务 MCP 暴露面。
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
DSH 的 MCP bridge 默认注册全部完整 Schema。当前 `openai-completions` 适配器
|
|
7
7
|
没有可直接使用的通用延迟搜索协议;单独添加 `deferLoading` 会让工具被过滤且无法发现。
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
本插件在同 Agent 的 `createScope` 注册官方 `NativeToolExecutor`,仅在公开 `describe`
|
|
9
|
+
边界裁剪本轮模型工具声明,执行仍委托官方 executor;配合 `tools.guard` 拒绝未加载的调用。
|
|
10
|
+
发现入口也注册到该 Scope,原 MCP 定义、step admission 与授权限制保持不变。
|
|
11
|
+
新版 `system-prompt/assemble` 只处理提示文本,不再承担工具声明裁剪;Windy native profile
|
|
12
|
+
禁用 PTC,本插件不为其它 executor 提供兼容回退。
|
|
10
13
|
每个 Agent 初始业务工具仅看到
|
|
11
14
|
`discover_business_tools`,其目录预览最多 12 项、1600 字符。模型先搜索/翻页查询每页
|
|
12
15
|
20 项的简洁目录,再从实际工具名称选择最多 8 项,在该 Agent 后续模型请求中声明所选工具的原始完整 Schema。
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { displayMetadata } from "./presentation.mjs";
|
|
2
2
|
import { createScope } from "@deepseek-ai/dsh-scope";
|
|
3
|
+
import { NativeToolExecutor } from "@deepseek-ai/dsh-tool-executor-native";
|
|
3
4
|
export const DISCOVER = "discover_business_tools";
|
|
4
5
|
const PREFIX = "mcp__windy__";
|
|
5
6
|
export function businessTools(ctx, scope) {
|
|
@@ -192,6 +193,18 @@ export function installDiscovery(ctx, metadata = new Map()) {
|
|
|
192
193
|
selected: new Set(),
|
|
193
194
|
refresh: () => synchronize(state),
|
|
194
195
|
};
|
|
196
|
+
const executor = new NativeToolExecutor(state.scope.ctx);
|
|
197
|
+
state.scope.ctx.tools.setExecutor({
|
|
198
|
+
describe(tools) {
|
|
199
|
+
return executor.describe(
|
|
200
|
+
tools.filter(
|
|
201
|
+
(tool) =>
|
|
202
|
+
!tool.name.startsWith(PREFIX) || state.selected.has(tool.name),
|
|
203
|
+
),
|
|
204
|
+
);
|
|
205
|
+
},
|
|
206
|
+
execute: (input) => executor.execute(input),
|
|
207
|
+
});
|
|
195
208
|
states.set(agent, state);
|
|
196
209
|
state.refresh();
|
|
197
210
|
}
|
|
@@ -221,16 +234,6 @@ export function installDiscovery(ctx, metadata = new Map()) {
|
|
|
221
234
|
)
|
|
222
235
|
return "TOOL_NOT_LOADED_DISCOVER_FIRST";
|
|
223
236
|
});
|
|
224
|
-
ctx.on("system-prompt/assemble", async (_assembly, context, next) => {
|
|
225
|
-
const assembled = await next();
|
|
226
|
-
const selected = states.get(context.scope)?.selected;
|
|
227
|
-
return {
|
|
228
|
-
...assembled,
|
|
229
|
-
tools: assembled.tools.filter(
|
|
230
|
-
(tool) => !tool.name.startsWith(PREFIX) || selected?.has(tool.name),
|
|
231
|
-
),
|
|
232
|
-
};
|
|
233
|
-
});
|
|
234
237
|
for (const agent of ctx.agents.list()) attach(agent);
|
|
235
238
|
ctx.effect(() => async () => {
|
|
236
239
|
updating = true;
|
|
@@ -2,6 +2,7 @@ import { afterEach, expect, test } from "bun:test";
|
|
|
2
2
|
import { Context } from "@deepseek-ai/cordis";
|
|
3
3
|
import SystemPrompt from "@deepseek-ai/dsh-system-prompt";
|
|
4
4
|
import ToolRuntime from "@deepseek-ai/dsh-tools";
|
|
5
|
+
import * as NativeToolExecutor from "@deepseek-ai/dsh-tool-executor-native";
|
|
5
6
|
import { createScope } from "@deepseek-ai/dsh-scope";
|
|
6
7
|
import { createMcpToolDefinition } from "@deepseek-ai/dsh-mcp-client";
|
|
7
8
|
import { ToolCallId } from "@deepseek-ai/dsh-llm";
|
|
@@ -33,7 +34,10 @@ async function fixture(count = 76) {
|
|
|
33
34
|
await prompt.await();
|
|
34
35
|
const runtime = ctx.plugin(ToolRuntime);
|
|
35
36
|
await runtime.await();
|
|
37
|
+
const executor = ctx.plugin(NativeToolExecutor);
|
|
38
|
+
await executor.await();
|
|
36
39
|
cleanups.push(async () => {
|
|
40
|
+
await executor.dispose();
|
|
37
41
|
await runtime.dispose();
|
|
38
42
|
await prompt.dispose();
|
|
39
43
|
});
|
|
@@ -82,14 +86,32 @@ async function fixture(count = 76) {
|
|
|
82
86
|
});
|
|
83
87
|
await discovery.await();
|
|
84
88
|
cleanups.push(() => discovery.dispose());
|
|
85
|
-
const execute = (name: string, args: unknown, subject = agent) =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
arguments: args,
|
|
89
|
+
const execute = async (name: string, args: unknown, subject = agent) => {
|
|
90
|
+
const signal = new AbortController().signal;
|
|
91
|
+
const toolSet = await ctx.tools.resolve({
|
|
89
92
|
agent: subject,
|
|
90
|
-
|
|
91
|
-
signal
|
|
93
|
+
modelSelection: { provider: "fixture", model: "fixture" },
|
|
94
|
+
signal,
|
|
92
95
|
});
|
|
96
|
+
try {
|
|
97
|
+
const { results } = await ctx.tools.execute({
|
|
98
|
+
calls: [
|
|
99
|
+
{
|
|
100
|
+
type: "tool-call",
|
|
101
|
+
name,
|
|
102
|
+
arguments: JSON.stringify(args),
|
|
103
|
+
id: ToolCallId(crypto.randomUUID()),
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
agent: subject,
|
|
107
|
+
signal,
|
|
108
|
+
toolSet,
|
|
109
|
+
});
|
|
110
|
+
return results[0]!.result;
|
|
111
|
+
} finally {
|
|
112
|
+
toolSet.dispose();
|
|
113
|
+
}
|
|
114
|
+
};
|
|
93
115
|
return {
|
|
94
116
|
ctx,
|
|
95
117
|
agent,
|
|
@@ -227,3 +249,43 @@ test("loading cannot bypass an existing Agent tool restriction", async () => {
|
|
|
227
249
|
expect(f.calls).toEqual([allowed]);
|
|
228
250
|
await policy.dispose();
|
|
229
251
|
});
|
|
252
|
+
|
|
253
|
+
test("discovery selection cannot bypass upstream step admission", async () => {
|
|
254
|
+
const f = await fixture(0);
|
|
255
|
+
const name = "mcp__windy__conditional";
|
|
256
|
+
let calls = 0;
|
|
257
|
+
const unregister = f.ctx.tools.register(
|
|
258
|
+
{
|
|
259
|
+
name,
|
|
260
|
+
description: "Conditional business tool",
|
|
261
|
+
parameters: { type: "object" },
|
|
262
|
+
output: { schema: { type: "object" }, render: () => [] },
|
|
263
|
+
execute: async () => {
|
|
264
|
+
calls++;
|
|
265
|
+
return {};
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
{ when: () => false },
|
|
269
|
+
);
|
|
270
|
+
try {
|
|
271
|
+
expect((await f.execute(DISCOVER, { names: [name] })).isError).toBe(false);
|
|
272
|
+
const toolSet = await f.ctx.tools.resolve({
|
|
273
|
+
agent: f.agent,
|
|
274
|
+
modelSelection: { provider: "fixture", model: "fixture" },
|
|
275
|
+
signal: new AbortController().signal,
|
|
276
|
+
});
|
|
277
|
+
try {
|
|
278
|
+
const assembly = await f.ctx.systemPrompt.assemble({
|
|
279
|
+
scope: f.agent,
|
|
280
|
+
toolSet,
|
|
281
|
+
});
|
|
282
|
+
expect(assembly.tools.map((tool) => tool.name)).toEqual([DISCOVER]);
|
|
283
|
+
} finally {
|
|
284
|
+
toolSet.dispose();
|
|
285
|
+
}
|
|
286
|
+
expect((await f.execute(name, {})).isError).toBe(true);
|
|
287
|
+
expect(calls).toBe(0);
|
|
288
|
+
} finally {
|
|
289
|
+
unregister();
|
|
290
|
+
}
|
|
291
|
+
});
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { digest } from "./contracts.js";
|
|
2
|
-
|
|
3
|
+
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
const { version } = require("@deepseek-ai/dsh/package.json") as {
|
|
6
|
+
version: string;
|
|
7
|
+
};
|
|
8
|
+
export const ENGINE_ID = `windy.dsh.${version}`;
|
|
3
9
|
export function compatibilityOffer() {
|
|
4
10
|
const protocolVersions = [1];
|
|
5
11
|
const protocolFeatures = [
|
|
@@ -6,6 +6,7 @@ import SessionStore, { SessionId } from "@deepseek-ai/dsh-session";
|
|
|
6
6
|
import SessionProjections from "@deepseek-ai/dsh-session-projection";
|
|
7
7
|
import LlmRuntime, { MessageId } from "@deepseek-ai/dsh-llm";
|
|
8
8
|
import ToolRuntime from "@deepseek-ai/dsh-tools";
|
|
9
|
+
import * as NativeToolExecutor from "@deepseek-ai/dsh-tool-executor-native";
|
|
9
10
|
import SystemPrompt from "@deepseek-ai/dsh-system-prompt";
|
|
10
11
|
import { SafeError, digest, type RunRequest } from "./contracts.js";
|
|
11
12
|
import { GovernedModelAdapter, type ExecutionBudget } from "./model-plugin.js";
|
|
@@ -98,6 +99,7 @@ export async function executeDshRun(
|
|
|
98
99
|
}),
|
|
99
100
|
);
|
|
100
101
|
fibers.push(await ctx.plugin(ToolRuntime));
|
|
102
|
+
fibers.push(await ctx.plugin(NativeToolExecutor));
|
|
101
103
|
fibers.push(
|
|
102
104
|
await ctx.plugin(AgentLoop, { maxParallelToolCalls: 1, agents: [] }),
|
|
103
105
|
);
|
|
@@ -16,6 +16,7 @@ import LlmRuntime, {
|
|
|
16
16
|
type StreamChunk,
|
|
17
17
|
} from "@deepseek-ai/dsh-llm";
|
|
18
18
|
import ToolRuntime from "@deepseek-ai/dsh-tools";
|
|
19
|
+
import * as NativeToolExecutor from "@deepseek-ai/dsh-tool-executor-native";
|
|
19
20
|
import SystemPrompt from "@deepseek-ai/dsh-system-prompt";
|
|
20
21
|
import UserQuestions from "@deepseek-ai/dsh-user-questions";
|
|
21
22
|
import * as AskUser from "@deepseek-ai/dsh-tool-ask-user";
|
|
@@ -87,6 +88,7 @@ async function scenario(tool: string, args: object, skillRoot?: string) {
|
|
|
87
88
|
SessionProjections,
|
|
88
89
|
AgentRegistry,
|
|
89
90
|
ToolRuntime,
|
|
91
|
+
NativeToolExecutor,
|
|
90
92
|
UserQuestions,
|
|
91
93
|
])
|
|
92
94
|
fibers.push(await ctx.plugin(plugin));
|
|
@@ -27,7 +27,8 @@ COPY packages/server-sdk/package.json packages/server-sdk/package.json
|
|
|
27
27
|
COPY packages/shared/package.json packages/shared/package.json
|
|
28
28
|
COPY packages/storage/package.json packages/storage/package.json
|
|
29
29
|
# windy-copy:deps end
|
|
30
|
-
|
|
30
|
+
ARG WINDY_NPM_REGISTRY=https://registry.npmjs.org
|
|
31
|
+
RUN --mount=type=cache,id=windy-bun-1.3.14,target=/root/.bun/install/cache,sharing=shared bun -e 'const child=Bun.spawn(["bun","install","--frozen-lockfile","--no-progress","--filter","*","--filter","!./apps/agent-server","--registry",process.env.WINDY_NPM_REGISTRY||"https://registry.npmjs.org","--backend=copyfile","--linker=hoisted","--ignore-scripts"],{stdin:"inherit",stdout:"inherit",stderr:"inherit"});const started=Date.now();const heartbeat=setInterval(()=>console.log("[windy] Bun 依赖安装尚未完成,已耗时 "+Math.round((Date.now()-started)/1000)+" 秒"),15000);const deadline=setTimeout(()=>{console.error("[windy] Bun 安装超过 300 秒,请检查 npm 下载网络或通过 WINDY_NPM_REGISTRY 指定可用源");child.kill("SIGKILL")},300000);const exitCode=await child.exited;clearInterval(heartbeat);clearTimeout(deadline);process.exit(exitCode)' && bun --cwd apps/server -e 'await import("argon2")'
|
|
31
32
|
|
|
32
33
|
FROM deps AS runner
|
|
33
34
|
# @windy-module system.storage begin
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@elysiajs/swagger": "^1.3.1",
|
|
14
|
-
"@modelcontextprotocol/sdk": "^1",
|
|
15
|
-
"@noble/ed25519": "^3.
|
|
14
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
15
|
+
"@noble/ed25519": "^3.2.0",
|
|
16
16
|
"@southwind-ai/config": "workspace:*",
|
|
17
17
|
"@southwind-ai/database": "workspace:*",
|
|
18
18
|
"@southwind-ai/example-work-order": "workspace:*",
|
|
@@ -24,20 +24,20 @@
|
|
|
24
24
|
"@southwind-ai/storage": "workspace:*",
|
|
25
25
|
"ajv": "^8.20.0",
|
|
26
26
|
"argon2": "^0.44.0",
|
|
27
|
-
"drizzle-orm": "^0.45.
|
|
28
|
-
"elysia": "^1.4.
|
|
27
|
+
"drizzle-orm": "^0.45.4",
|
|
28
|
+
"elysia": "^1.4.31",
|
|
29
29
|
"fflate": "^0.8.3",
|
|
30
|
-
"mysql2": "^3.
|
|
31
|
-
"nodemailer": "^9.
|
|
32
|
-
"pg": "^8.
|
|
33
|
-
"pino": "^10.
|
|
30
|
+
"mysql2": "^3.24.6",
|
|
31
|
+
"nodemailer": "^9.1.1",
|
|
32
|
+
"pg": "^8.23.1",
|
|
33
|
+
"pino": "^10.4.0",
|
|
34
34
|
"unicode-case-folding": "1.1.1",
|
|
35
|
-
"ws": "^8.22.
|
|
35
|
+
"ws": "^8.22.1",
|
|
36
36
|
"yaml": "^2.9.1",
|
|
37
|
-
"zod": "^4.
|
|
37
|
+
"zod": "^4.6.7"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/nodemailer": "^8.0.
|
|
40
|
+
"@types/nodemailer": "^8.0.2",
|
|
41
41
|
"@types/ws": "^8.18.2"
|
|
42
42
|
}
|
|
43
43
|
}
|