create-windy 0.8.3 → 0.9.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 +838 -560
- package/package.json +1 -1
- package/template/.windy-template.json +2 -2
- package/template/apps/agent-server/Dockerfile +92 -22
- package/template/apps/agent-server/README.md +47 -85
- package/template/apps/agent-server/documents/office.py +216 -0
- package/template/apps/agent-server/documents/query_report.py +136 -0
- package/template/apps/agent-server/documents/smoke.py +177 -0
- package/template/apps/agent-server/documents/test_boundaries.py +185 -0
- package/template/apps/agent-server/host-contracts.ts +56 -0
- package/template/apps/agent-server/install-native.ts +167 -0
- package/template/apps/agent-server/main.ts +179 -0
- package/template/apps/agent-server/native/EXTENSIONS.md +46 -0
- package/template/apps/agent-server/native/admission.ts +73 -0
- package/template/apps/agent-server/native/authorization.test.ts +176 -0
- package/template/apps/agent-server/native/authorization.ts +118 -0
- package/template/apps/agent-server/native/boundary-io.ts +93 -0
- package/template/apps/agent-server/native/boundary-product.ts +107 -0
- package/template/apps/agent-server/native/boundary-project.test.ts +247 -0
- package/template/apps/agent-server/native/boundary-project.ts +188 -0
- package/template/apps/agent-server/native/boundary.ts +188 -0
- package/template/apps/agent-server/native/compaction-policy.test.ts +175 -0
- package/template/apps/agent-server/native/config.ts +95 -0
- package/template/apps/agent-server/native/conversation-instructions.ts +9 -0
- package/template/apps/agent-server/native/extensions.test.ts +190 -0
- package/template/apps/agent-server/native/extensions.ts +31 -0
- package/template/apps/agent-server/native/host-profile.test.ts +91 -0
- package/template/apps/agent-server/native/host-profile.ts +33 -0
- package/template/apps/agent-server/native/host-test-fixture.ts +13 -0
- package/template/apps/agent-server/native/http.ts +129 -0
- package/template/apps/agent-server/native/lifecycle.test.ts +285 -0
- package/template/apps/agent-server/native/lifecycle.ts +136 -0
- package/template/apps/agent-server/native/manager.ts +292 -0
- package/template/apps/agent-server/native/native.test.ts +207 -0
- package/template/apps/agent-server/native/office-preview.test.ts +50 -0
- package/template/apps/agent-server/native/office-preview.ts +25 -0
- package/template/apps/agent-server/native/parallel-harness.ts +242 -0
- package/template/apps/agent-server/native/parallel-mcp-fixture.ts +97 -0
- package/template/apps/agent-server/native/parallel.test.ts +256 -0
- package/template/apps/agent-server/native/profile-composition.test.ts +147 -0
- package/template/apps/agent-server/native/profile.ts +307 -0
- package/template/apps/agent-server/native/request.ts +61 -0
- package/template/apps/agent-server/native/session-conflict.test.ts +235 -0
- package/template/apps/agent-server/native/session-conflict.ts +21 -0
- package/template/apps/agent-server/native/shared-skills.test.ts +128 -0
- package/template/apps/agent-server/native/shared-skills.ts +240 -0
- package/template/apps/agent-server/native/socket-lifecycle.test.ts +48 -0
- package/template/apps/agent-server/native/socket.ts +130 -0
- package/template/apps/agent-server/native/storage-lifecycle.test.ts +217 -0
- package/template/apps/agent-server/native/storage.ts +188 -0
- package/template/apps/agent-server/native/stream-authorization.test.ts +89 -0
- package/template/apps/agent-server/native/worker.ts +77 -0
- package/template/apps/agent-server/native-download.test.ts +119 -0
- package/template/apps/agent-server/native-download.ts +145 -0
- package/template/apps/agent-server/package.json +63 -0
- package/template/apps/agent-server/plugins/access.mjs +126 -0
- package/template/apps/agent-server/plugins/branding/README.md +9 -0
- package/template/apps/agent-server/plugins/branding/brand.css +85 -0
- package/template/apps/agent-server/plugins/branding/client.js +338 -0
- package/template/apps/agent-server/plugins/branding/index.mjs +35 -0
- package/template/apps/agent-server/plugins/branding/loading.d.mts +2 -0
- package/template/apps/agent-server/plugins/branding/loading.mjs +66 -0
- package/template/apps/agent-server/plugins/branding/loading.test.ts +89 -0
- package/template/apps/agent-server/plugins/branding/package.json +21 -0
- package/template/apps/agent-server/plugins/branding.test.ts +294 -0
- package/template/apps/agent-server/plugins/compaction.mjs +83 -0
- package/template/apps/agent-server/plugins/compaction.test.ts +91 -0
- package/template/apps/agent-server/plugins/confine-network.py +57 -0
- package/template/apps/agent-server/plugins/default-skills.test.ts +62 -0
- package/template/apps/agent-server/plugins/downloads/README.md +28 -0
- package/template/apps/agent-server/plugins/downloads/client.js +126 -0
- package/template/apps/agent-server/plugins/downloads/downloads.test.ts +222 -0
- package/template/apps/agent-server/plugins/downloads/index.d.mts +19 -0
- package/template/apps/agent-server/plugins/downloads/index.mjs +180 -0
- package/template/apps/agent-server/plugins/downloads/package.json +20 -0
- package/template/apps/agent-server/plugins/drop-overlay/README.md +24 -0
- package/template/apps/agent-server/plugins/drop-overlay/drop-overlay.test.ts +199 -0
- package/template/apps/agent-server/plugins/drop-overlay/index.d.mts +8 -0
- package/template/apps/agent-server/plugins/drop-overlay/index.mjs +12 -0
- package/template/apps/agent-server/plugins/drop-overlay/style.css +102 -0
- package/template/apps/agent-server/plugins/locale/client.js +61 -0
- package/template/apps/agent-server/plugins/locale/index.d.mts +9 -0
- package/template/apps/agent-server/plugins/locale/index.mjs +16 -0
- package/template/apps/agent-server/plugins/locale/locale.test.ts +217 -0
- package/template/apps/agent-server/plugins/locale/package.json +19 -0
- package/template/apps/agent-server/plugins/parallel.mjs +146 -0
- package/template/apps/agent-server/plugins/preset-registry.d.mts +2 -0
- package/template/apps/agent-server/plugins/preset-registry.mjs +41 -0
- package/template/apps/agent-server/plugins/preset-registry.test.ts +46 -0
- package/template/apps/agent-server/plugins/questions.d.mts +25 -0
- package/template/apps/agent-server/plugins/questions.mjs +142 -0
- package/template/apps/agent-server/plugins/questions.test.ts +105 -0
- package/template/apps/agent-server/plugins/settings/README.md +17 -0
- package/template/apps/agent-server/plugins/settings/client.js +102 -0
- package/template/apps/agent-server/plugins/settings/index.mjs +17 -0
- package/template/apps/agent-server/plugins/settings/package.json +19 -0
- package/template/apps/agent-server/plugins/settings/settings.test.ts +129 -0
- package/template/apps/agent-server/plugins/settings-controller.d.mts +4 -0
- package/template/apps/agent-server/plugins/settings-controller.mjs +31 -0
- package/template/apps/agent-server/plugins/settings-controller.test.ts +17 -0
- package/template/apps/agent-server/plugins/settings-dispatch.test.ts +34 -0
- package/template/apps/agent-server/plugins/shared-skills.d.mts +15 -0
- package/template/apps/agent-server/plugins/shared-skills.mjs +82 -0
- package/template/apps/agent-server/plugins/shared-skills.test.ts +51 -0
- package/template/apps/agent-server/plugins/skill-library/README.md +11 -0
- package/template/apps/agent-server/plugins/skill-library/archive.test.ts +43 -0
- package/template/apps/agent-server/plugins/skill-library/bundle.mjs +234 -0
- package/template/apps/agent-server/plugins/skill-library/client-chunks.test.ts +107 -0
- package/template/apps/agent-server/plugins/skill-library/client-form-mount.test.ts +139 -0
- package/template/apps/agent-server/plugins/skill-library/client-form.test.ts +261 -0
- package/template/apps/agent-server/plugins/skill-library/client-ui.test.ts +268 -0
- package/template/apps/agent-server/plugins/skill-library/client-use.test.ts +158 -0
- package/template/apps/agent-server/plugins/skill-library/client.editor.js +93 -0
- package/template/apps/agent-server/plugins/skill-library/client.form.js +316 -0
- package/template/apps/agent-server/plugins/skill-library/client.js +348 -0
- package/template/apps/agent-server/plugins/skill-library/client.request.js +52 -0
- package/template/apps/agent-server/plugins/skill-library/client.transfer.js +48 -0
- package/template/apps/agent-server/plugins/skill-library/client.use.js +46 -0
- package/template/apps/agent-server/plugins/skill-library/default-roots.test.ts +84 -0
- package/template/apps/agent-server/plugins/skill-library/draft.d.mts +17 -0
- package/template/apps/agent-server/plugins/skill-library/draft.mjs +152 -0
- package/template/apps/agent-server/plugins/skill-library/draft.test.ts +287 -0
- package/template/apps/agent-server/plugins/skill-library/index.d.mts +49 -0
- package/template/apps/agent-server/plugins/skill-library/index.mjs +226 -0
- package/template/apps/agent-server/plugins/skill-library/package.json +24 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/README.md +27 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/UPSTREAM.md +54 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/boot.test.ts +150 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/client.js +146 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/client.test.ts +195 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/index.d.mts +9 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/index.mjs +30 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/metadata.test.ts +82 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/package.json +21 -0
- package/template/apps/agent-server/plugins/skill-library/presentation/react-boot.test.ts +162 -0
- package/template/apps/agent-server/plugins/skill-library/skills.test.ts +342 -0
- package/template/apps/agent-server/plugins/skill-library/storage.mjs +293 -0
- package/template/apps/agent-server/plugins/skill-library/style.css +229 -0
- package/template/apps/agent-server/plugins/skill-library/test-fixture.ts +77 -0
- package/template/apps/agent-server/plugins/skill-library/workflow.d.mts +18 -0
- package/template/apps/agent-server/plugins/skill-library/workflow.mjs +189 -0
- package/template/apps/agent-server/plugins/skill-library/workflow.test.ts +164 -0
- package/template/apps/agent-server/plugins/skills/README.md +5 -0
- package/template/apps/agent-server/plugins/skills/windy-data-summary/SKILL.md +14 -0
- package/template/apps/agent-server/plugins/skills/windy-extension-guide/SKILL.md +14 -0
- package/template/apps/agent-server/plugins/skills/windy-office/SKILL.md +14 -0
- package/template/apps/agent-server/plugins/skills/windy-skill-capture/SKILL.md +14 -0
- package/template/apps/agent-server/plugins/skills/windy-source-compare/SKILL.md +14 -0
- package/template/apps/agent-server/plugins/subprocess.mjs +40 -0
- package/template/apps/agent-server/plugins/theme/README.md +18 -0
- package/template/apps/agent-server/plugins/theme/client.js +18 -0
- package/template/apps/agent-server/plugins/theme/index.d.mts +9 -0
- package/template/apps/agent-server/plugins/theme/index.mjs +18 -0
- package/template/apps/agent-server/plugins/theme/package.json +19 -0
- package/template/apps/agent-server/plugins/theme/source-tokens.ts +82 -0
- package/template/apps/agent-server/plugins/theme/sync-tokens.ts +12 -0
- package/template/apps/agent-server/plugins/theme/theme.test.ts +193 -0
- package/template/apps/agent-server/plugins/theme/tokens.json +166 -0
- package/template/apps/agent-server/plugins/tool-catalog/README.md +79 -0
- package/template/apps/agent-server/plugins/tool-catalog/categories.mjs +111 -0
- package/template/apps/agent-server/plugins/tool-catalog/categories.test.ts +118 -0
- package/template/apps/agent-server/plugins/tool-catalog/client-cache.test.ts +264 -0
- package/template/apps/agent-server/plugins/tool-catalog/client.js +333 -0
- package/template/apps/agent-server/plugins/tool-catalog/client.test.ts +136 -0
- package/template/apps/agent-server/plugins/tool-catalog/discovery.d.mts +42 -0
- package/template/apps/agent-server/plugins/tool-catalog/discovery.mjs +242 -0
- package/template/apps/agent-server/plugins/tool-catalog/discovery.test.ts +229 -0
- package/template/apps/agent-server/plugins/tool-catalog/index.d.mts +5 -0
- package/template/apps/agent-server/plugins/tool-catalog/index.mjs +91 -0
- package/template/apps/agent-server/plugins/tool-catalog/package.json +23 -0
- package/template/apps/agent-server/plugins/tool-catalog/presentation.d.mts +21 -0
- package/template/apps/agent-server/plugins/tool-catalog/presentation.mjs +153 -0
- package/template/apps/agent-server/plugins/tool-catalog/presentation.test.ts +166 -0
- package/template/apps/agent-server/plugins/tool-catalog/routes.test.ts +209 -0
- package/template/apps/agent-server/plugins/tool-catalog/style.css +155 -0
- package/template/apps/agent-server/plugins/tool-catalog/use-tool.test.ts +160 -0
- package/template/apps/agent-server/plugins/tool-presentation/README.md +7 -0
- package/template/apps/agent-server/plugins/tool-presentation/build-client.ts +29 -0
- package/template/apps/agent-server/plugins/tool-presentation/client.js +312 -0
- package/template/apps/agent-server/plugins/tool-presentation/client.results.js +9 -0
- package/template/apps/agent-server/plugins/tool-presentation/client.test.ts +178 -0
- package/template/apps/agent-server/plugins/tool-presentation/index.mjs +10 -0
- package/template/apps/agent-server/plugins/tool-presentation/package.json +24 -0
- package/template/apps/agent-server/plugins/tool-presentation/result-discovery.mjs +43 -0
- package/template/apps/agent-server/plugins/tool-presentation/result-model.d.mts +51 -0
- package/template/apps/agent-server/plugins/tool-presentation/result-model.mjs +96 -0
- package/template/apps/agent-server/plugins/workspace/README.md +5 -0
- package/template/apps/agent-server/plugins/workspace/index.mjs +8 -0
- package/template/apps/agent-server/plugins/workspace/package.json +10 -0
- package/template/apps/agent-server/plugins/workspace/style.css +124 -0
- package/template/apps/agent-server/project/host.ts +13 -0
- package/template/apps/agent-server/runtime/artifacts.ts +115 -0
- package/template/apps/agent-server/runtime/audit.nodecheck.ts +60 -0
- package/template/apps/agent-server/runtime/capacity.ts +61 -0
- package/template/apps/agent-server/runtime/client-completion-budget.nodecheck.ts +92 -0
- package/template/apps/agent-server/runtime/compatibility.ts +33 -0
- package/template/apps/agent-server/runtime/completions.ts +320 -0
- package/template/apps/agent-server/runtime/config.ts +246 -0
- package/template/apps/agent-server/runtime/context-budget.ts +70 -0
- package/template/apps/agent-server/runtime/context-plugin.ts +306 -0
- package/template/apps/agent-server/runtime/context.nodecheck.ts +241 -0
- package/template/apps/agent-server/runtime/contracts.ts +201 -0
- package/template/apps/agent-server/runtime/dsh-engine.ts +196 -0
- package/template/apps/agent-server/runtime/evaluation-plugin.ts +115 -0
- package/template/apps/agent-server/runtime/evaluation.nodecheck.ts +194 -0
- package/template/apps/agent-server/runtime/events.ts +71 -0
- package/template/apps/agent-server/runtime/governance.ts +194 -0
- package/template/apps/agent-server/runtime/index.ts +339 -0
- package/template/apps/agent-server/runtime/internal-output.ts +37 -0
- package/template/apps/agent-server/runtime/isolation.nodecheck.ts +287 -0
- package/template/apps/agent-server/runtime/model-payload.ts +97 -0
- package/template/apps/agent-server/runtime/model-plugin.ts +308 -0
- package/template/apps/agent-server/runtime/model-route.ts +34 -0
- package/template/apps/agent-server/runtime/model-usage.ts +51 -0
- package/template/apps/agent-server/runtime/model-wire.ts +45 -0
- package/template/apps/agent-server/runtime/native-authorization.nodecheck.ts +126 -0
- package/template/apps/agent-server/runtime/native-completion.nodecheck.ts +81 -0
- package/template/apps/agent-server/runtime/output-validation.ts +66 -0
- package/template/apps/agent-server/runtime/production-capacity.nodecheck.ts +121 -0
- package/template/apps/agent-server/runtime/questions-workflow.nodecheck.ts +249 -0
- package/template/apps/agent-server/runtime/report-breakdown.ts +79 -0
- package/template/apps/agent-server/runtime/reporting.ts +219 -0
- package/template/apps/agent-server/runtime/run-completion.ts +39 -0
- package/template/apps/agent-server/runtime/run-request-digest.ts +18 -0
- package/template/apps/agent-server/runtime/runtime-test-fixtures.ts +264 -0
- package/template/apps/agent-server/runtime/runtime.nodecheck.ts +150 -0
- package/template/apps/agent-server/runtime/store-idempotency.nodecheck.ts +74 -0
- package/template/apps/agent-server/runtime/store.ts +324 -0
- package/template/apps/agent-server/runtime/structured-output-mode.nodecheck.ts +51 -0
- package/template/apps/agent-server/runtime/tool-name.ts +6 -0
- package/template/apps/agent-server/runtime/tool-plugin.ts +201 -0
- package/template/apps/agent-server/runtime/vision-readiness.ts +200 -0
- package/template/apps/agent-server/scripts/confinement-check.mjs +103 -0
- package/template/apps/agent-server/scripts/coordinator-check.mjs +344 -0
- package/template/apps/agent-server/scripts/documents-delivery-check.mjs +309 -0
- package/template/apps/agent-server/scripts/office-preview-check.mjs +92 -0
- package/template/apps/agent-server/scripts/test-confinement.ts +58 -0
- package/template/apps/agent-server/scripts/test-coordinator.ts +36 -0
- package/template/apps/agent-server/scripts/test-runtime.ts +46 -0
- package/template/apps/agent-server/tsconfig.json +21 -0
- package/template/apps/server/Dockerfile +3 -0
- package/template/apps/server/package.json +5 -1
- package/template/apps/server/scripts/check-dsh-platform-example.ts +251 -0
- package/template/apps/server/src/agent/dsh-runtime-wire.test.ts +33 -0
- package/template/apps/server/src/agent/governance-runtime.ts +41 -0
- package/template/apps/server/src/agent/remote-runtime-response.ts +1 -1
- package/template/apps/server/src/agent/run-contracts.ts +1 -0
- package/template/apps/server/src/agent/run-definition-support.ts +9 -0
- package/template/apps/server/src/agent/runtime-tool-composition.ts +2 -0
- package/template/apps/server/src/agent/workflow-runtime-bootstrap.ts +9 -0
- package/template/apps/server/src/agent-skills/access.ts +88 -0
- package/template/apps/server/src/agent-skills/bootstrap.ts +49 -0
- package/template/apps/server/src/agent-skills/builtin-registration.ts +83 -0
- package/template/apps/server/src/agent-skills/builtins.ts +19 -0
- package/template/apps/server/src/agent-skills/bundle-zip.ts +163 -0
- package/template/apps/server/src/agent-skills/bundle.test.ts +79 -0
- package/template/apps/server/src/agent-skills/bundle.ts +133 -0
- package/template/apps/server/src/agent-skills/contracts.ts +46 -0
- package/template/apps/server/src/agent-skills/drizzle-repository.ts +125 -0
- package/template/apps/server/src/agent-skills/input.ts +29 -0
- package/template/apps/server/src/agent-skills/postgres.integration.test.ts +348 -0
- package/template/apps/server/src/agent-skills/read-routes.test.ts +116 -0
- package/template/apps/server/src/agent-skills/reader.ts +108 -0
- package/template/apps/server/src/agent-skills/repository.ts +105 -0
- package/template/apps/server/src/agent-skills/routes.ts +176 -0
- package/template/apps/server/src/agent-skills/service.test.ts +295 -0
- package/template/apps/server/src/agent-skills/service.ts +301 -0
- package/template/apps/server/src/agent-workflow/preset-registry.test.ts +137 -0
- package/template/apps/server/src/agent-workflow/preset-registry.ts +191 -0
- package/template/apps/server/src/agent-workflow/preset-routes.test.ts +94 -0
- package/template/apps/server/src/agent-workflow/preset-routes.ts +45 -0
- package/template/apps/server/src/ai-runtime-report/service.test.ts +10 -7
- package/template/apps/server/src/ai-runtime-report/service.ts +1 -1
- package/template/apps/server/src/app/agent-workflow-presets.ts +4 -0
- package/template/apps/server/src/app/dsh-skill-draft-audit.test.ts +195 -0
- package/template/apps/server/src/app/dsh-skill-draft-audit.ts +115 -0
- package/template/apps/server/src/app/dsh-workbench-audit.test.ts +71 -0
- package/template/apps/server/src/app/dsh-workbench-audit.ts +34 -0
- package/template/apps/server/src/app/dsh-workbench-handshake.test.ts +63 -0
- package/template/apps/server/src/app/dsh-workbench-handshake.ts +48 -0
- package/template/apps/server/src/app/dsh-workbench-http.test.ts +96 -0
- package/template/apps/server/src/app/dsh-workbench-lan-origin.test.ts +114 -0
- package/template/apps/server/src/app/dsh-workbench-launch.test.ts +70 -0
- package/template/apps/server/src/app/dsh-workbench-origin.test.ts +54 -0
- package/template/apps/server/src/app/dsh-workbench-proxy.ts +205 -0
- package/template/apps/server/src/app/dsh-workbench-session-conflict.test.ts +61 -0
- package/template/apps/server/src/app/dsh-workbench-session.ts +59 -0
- package/template/apps/server/src/app/dsh-workbench-socket-audit.test.ts +115 -0
- package/template/apps/server/src/app/dsh-workbench-socket.test.ts +246 -0
- package/template/apps/server/src/app/dsh-workbench-socket.ts +272 -0
- package/template/apps/server/src/app/dsh-workbench-test-support.ts +158 -0
- package/template/apps/server/src/app/dsh-workbench.test.ts +213 -0
- package/template/apps/server/src/app/dsh-workbench.ts +279 -0
- package/template/apps/server/src/app/workbench-public-origin.ts +16 -0
- package/template/apps/server/src/data-governance/user-plaintext-routes.test.ts +3 -0
- package/template/apps/server/src/http-app.ts +31 -0
- package/template/apps/server/src/mcp/adapter.ts +1 -0
- package/template/apps/server/src/module-composition.test.ts +23 -0
- package/template/apps/server/src/module-composition.ts +9 -2
- package/template/apps/server/src/observability/bootstrap.ts +12 -0
- package/template/apps/server/src/observability/diagnostic-failure-recorder.ts +94 -0
- package/template/apps/server/src/observability/diagnostic-http-contract.test.ts +42 -0
- package/template/apps/server/src/observability/diagnostic-index.test.ts +89 -0
- package/template/apps/server/src/observability/diagnostic-index.ts +88 -0
- package/template/apps/server/src/observability/diagnostic-repository.ts +67 -0
- package/template/apps/server/src/platform-app-bootstrap.ts +42 -0
- package/template/apps/server/src/platform-http-runtime.ts +6 -0
- package/template/apps/server/src/runtime-development.test.ts +25 -0
- package/template/apps/server/src/runtime-development.ts +6 -44
- package/template/apps/server/src/system/diagnostic-routes.test.ts +78 -0
- package/template/apps/server/src/system/diagnostic-routes.ts +66 -0
- package/template/apps/web/Dockerfile +9 -1
- package/template/apps/web/dev/start.ts +21 -10
- package/template/apps/web/dsh-workbench-location.ts +21 -0
- package/template/apps/web/dsh-workbench-proxy.test.ts +121 -0
- package/template/apps/web/dsh-workbench-proxy.ts +194 -0
- package/template/apps/web/package.json +3 -1
- package/template/apps/web/server.ts +27 -6
- package/template/apps/web/src/composables/useLoginFlow.ts +13 -1
- package/template/apps/web/src/pages/errors/PlatformErrorPage.vue +6 -0
- package/template/apps/web/src/pages/errors/PlatformErrorPage.webtest.ts +14 -1
- package/template/apps/web/src/pages/errors/error-page-extension.ts +1 -0
- package/template/apps/web/src/pages/system/AgentNativePage.vue +44 -0
- package/template/apps/web/src/pages/system/AgentWorkflowPage.vue +20 -7
- package/template/apps/web/src/pages/system/DiagnosticLookupPage.vue +56 -0
- package/template/apps/web/src/pages/system/DiagnosticLookupPage.webtest.ts +99 -0
- package/template/apps/web/src/pages/system/SystemAgentSkillsPage.vue +88 -0
- package/template/apps/web/src/pages/system/components/DiagnosticRecordDetails.vue +52 -0
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillDetailDialog.vue +166 -0
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillGovernanceActionDialog.vue +51 -0
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillImportDialog.vue +320 -0
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillImportDialog.webtest.ts +96 -0
- package/template/apps/web/src/pages/system/components/agent-skills/AgentSkillsTable.vue +69 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowPresetCatalog.vue +82 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowPresetCatalog.webtest.ts +57 -0
- package/template/apps/web/src/pages/system/composables/useAgentSkillsGovernance.ts +105 -0
- package/template/apps/web/src/pages/system/composables/useAgentWorkflowPresets.ts +44 -0
- package/template/apps/web/src/pages/system/composables/useDiagnosticLookup.ts +64 -0
- package/template/apps/web/src/router/error-navigation.ts +3 -1
- package/template/apps/web/src/router/error-navigation.webtest.ts +14 -2
- package/template/apps/web/src/router/index.ts +8 -49
- package/template/apps/web/src/router/platform-admin-pages.ts +79 -0
- package/template/apps/web/src/router/platform-admin-route-bindings.ts +8 -0
- package/template/apps/web/src/services/agent-skills-api.ts +55 -0
- package/template/apps/web/src/services/agent-workflow-api.ts +12 -0
- package/template/apps/web/src/services/diagnostics-api.ts +12 -0
- package/template/apps/web/src/services/http.ts +18 -0
- package/template/apps/web/src/services/http.webtest.ts +51 -0
- package/template/apps/web/vite.config.ts +39 -0
- package/template/deploy/dsh/README.md +5 -0
- package/template/deploy/dsh/documents/README.md +9 -0
- package/template/deploy/dsh/documents/requirements.in +6 -0
- package/template/deploy/dsh/documents/requirements.lock +72 -0
- package/template/docker-compose.yml +24 -10
- package/template/docs/adr/0004-embedded-dsh-runtime.md +9 -0
- package/template/docs/architecture/agent-admin-workbench-implementation.md +73 -0
- package/template/docs/architecture/agent-admin-workbench-plan.md +41 -0
- package/template/docs/architecture/agent-harness.md +2 -0
- package/template/docs/architecture/agent-runtime-compatibility.md +2 -0
- package/template/docs/architecture/embedded-dsh-integration.md +44 -0
- package/template/docs/development/dsh-plugins.md +55 -0
- package/template/docs/operations/dsh-agent-migration.md +98 -0
- package/template/docs/platform/agent-production-store.md +5 -78
- package/template/docs/platform/agent-runtime-observability.md +2 -0
- package/template/docs/platform/agent-runtime.md +2 -0
- package/template/docs/platform/agent-skills.md +25 -0
- package/template/package.json +4 -3
- package/template/packages/database/drizzle/0064_dsh_skills_diagnostics.sql +42 -0
- package/template/packages/database/drizzle/meta/0064_snapshot.json +15349 -0
- package/template/packages/database/drizzle/meta/_journal.json +7 -0
- package/template/packages/database/package.json +2 -2
- package/template/packages/database/src/schema/agent-skills.ts +65 -0
- package/template/packages/database/src/schema/diagnostics.ts +27 -0
- package/template/packages/database/src/schema/index.ts +8 -0
- package/template/packages/modules/package.json +1 -1
- package/template/packages/modules/src/system-admin-routes.ts +24 -0
- package/template/packages/modules/src/system-admin-ui-catalog.ts +17 -10
- package/template/packages/modules/src/system-agent-admin-bindings.ts +2 -0
- package/template/packages/modules/src/system-agent-admin-menus.ts +20 -0
- package/template/packages/modules/src/system-agent-audit-actions.ts +3 -0
- package/template/packages/modules/src/system-agent-dsh.ts +119 -0
- package/template/packages/modules/src/system-api-permissions.ts +9 -0
- package/template/packages/modules/src/system-audit-actions.ts +11 -0
- package/template/packages/modules/src/system-features.ts +5 -0
- package/template/packages/modules/src/system-module-audit-selection.ts +25 -0
- package/template/packages/modules/src/system-module-catalog.ts +12 -32
- package/template/packages/modules/src/system-modules.ts +14 -3
- package/template/packages/modules/src/system-permissions.ts +10 -0
- package/template/packages/server-sdk/package.json +2 -2
- package/template/packages/shared/index.ts +12 -0
- package/template/packages/shared/package.json +1 -1
- package/template/packages/shared/src/agent-skills.ts +68 -0
- package/template/packages/shared/src/agent-workflow-presets.ts +26 -0
- package/template/packages/shared/src/diagnostics.ts +13 -0
- package/template/packages/shared/src/rbac.ts +1 -0
- package/template/apps/agent-server/install-python-dependencies.sh +0 -92
- package/template/apps/agent-server/pyproject.toml +0 -51
- package/template/apps/agent-server/src/southwind_agent_server/__init__.py +0 -5
- package/template/apps/agent-server/src/southwind_agent_server/app.py +0 -344
- package/template/apps/agent-server/src/southwind_agent_server/approval_resolution.py +0 -30
- package/template/apps/agent-server/src/southwind_agent_server/artifact_input.py +0 -153
- package/template/apps/agent-server/src/southwind_agent_server/asgi.py +0 -8
- package/template/apps/agent-server/src/southwind_agent_server/attempt_context.py +0 -199
- package/template/apps/agent-server/src/southwind_agent_server/attempt_context_projection.py +0 -203
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_contracts.py +0 -61
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_governance.py +0 -82
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_routes.py +0 -121
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_runtime.py +0 -158
- package/template/apps/agent-server/src/southwind_agent_server/config.py +0 -267
- package/template/apps/agent-server/src/southwind_agent_server/context_message_digest.py +0 -24
- package/template/apps/agent-server/src/southwind_agent_server/context_version_contracts.py +0 -71
- package/template/apps/agent-server/src/southwind_agent_server/context_version_port.py +0 -307
- package/template/apps/agent-server/src/southwind_agent_server/contracts.py +0 -297
- package/template/apps/agent-server/src/southwind_agent_server/deterministic.py +0 -63
- package/template/apps/agent-server/src/southwind_agent_server/engine.py +0 -134
- package/template/apps/agent-server/src/southwind_agent_server/engine_capacity.py +0 -31
- package/template/apps/agent-server/src/southwind_agent_server/engine_identity.py +0 -2
- package/template/apps/agent-server/src/southwind_agent_server/fingerprint.py +0 -61
- package/template/apps/agent-server/src/southwind_agent_server/health_routes.py +0 -93
- package/template/apps/agent-server/src/southwind_agent_server/http_helpers.py +0 -62
- package/template/apps/agent-server/src/southwind_agent_server/lease.py +0 -15
- package/template/apps/agent-server/src/southwind_agent_server/multimodal.py +0 -76
- package/template/apps/agent-server/src/southwind_agent_server/openai_engine.py +0 -329
- package/template/apps/agent-server/src/southwind_agent_server/openai_engine_validation.py +0 -165
- package/template/apps/agent-server/src/southwind_agent_server/openai_provider.py +0 -345
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_insert.py +0 -37
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_queries.py +0 -235
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_replay.py +0 -44
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_status.py +0 -83
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_store.py +0 -336
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_summary.py +0 -304
- package/template/apps/agent-server/src/southwind_agent_server/postgres_store.py +0 -335
- package/template/apps/agent-server/src/southwind_agent_server/postgres_store_backend.py +0 -333
- package/template/apps/agent-server/src/southwind_agent_server/provider_audit.py +0 -144
- package/template/apps/agent-server/src/southwind_agent_server/provider_governance.py +0 -309
- package/template/apps/agent-server/src/southwind_agent_server/provider_output_guidance.py +0 -34
- package/template/apps/agent-server/src/southwind_agent_server/readiness_pin.py +0 -37
- package/template/apps/agent-server/src/southwind_agent_server/report_lifecycle.py +0 -218
- package/template/apps/agent-server/src/southwind_agent_server/report_metrics.py +0 -149
- package/template/apps/agent-server/src/southwind_agent_server/report_presenter.py +0 -300
- package/template/apps/agent-server/src/southwind_agent_server/report_routes.py +0 -132
- package/template/apps/agent-server/src/southwind_agent_server/report_store.py +0 -298
- package/template/apps/agent-server/src/southwind_agent_server/report_store_protocol.py +0 -75
- package/template/apps/agent-server/src/southwind_agent_server/report_types.py +0 -118
- package/template/apps/agent-server/src/southwind_agent_server/run_admission.py +0 -64
- package/template/apps/agent-server/src/southwind_agent_server/run_capacity.py +0 -59
- package/template/apps/agent-server/src/southwind_agent_server/runtime_budget.py +0 -74
- package/template/apps/agent-server/src/southwind_agent_server/runtime_compatibility.py +0 -89
- package/template/apps/agent-server/src/southwind_agent_server/runtime_factory.py +0 -105
- package/template/apps/agent-server/src/southwind_agent_server/runtime_logging.py +0 -57
- package/template/apps/agent-server/src/southwind_agent_server/service.py +0 -325
- package/template/apps/agent-server/src/southwind_agent_server/service_control.py +0 -64
- package/template/apps/agent-server/src/southwind_agent_server/service_errors.py +0 -4
- package/template/apps/agent-server/src/southwind_agent_server/service_execution.py +0 -34
- package/template/apps/agent-server/src/southwind_agent_server/service_tasks.py +0 -34
- package/template/apps/agent-server/src/southwind_agent_server/signal_events.py +0 -53
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_catalog.py +0 -118
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_errors.py +0 -2
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_schema.py +0 -73
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_serialization.py +0 -16
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_store.py +0 -350
- package/template/apps/agent-server/src/southwind_agent_server/sse.py +0 -41
- package/template/apps/agent-server/src/southwind_agent_server/store.py +0 -255
- package/template/apps/agent-server/src/southwind_agent_server/store_cipher.py +0 -40
- package/template/apps/agent-server/src/southwind_agent_server/structured_logging.py +0 -145
- package/template/apps/agent-server/src/southwind_agent_server/telemetry.py +0 -93
- package/template/apps/agent-server/src/southwind_agent_server/tool_host.py +0 -152
- package/template/apps/agent-server/src/southwind_agent_server/trajectory.py +0 -137
- package/template/apps/agent-server/src/southwind_agent_server/unavailable_engine.py +0 -58
- package/template/apps/agent-server/src/southwind_agent_server/vision_probe.py +0 -87
- package/template/apps/agent-server/src/southwind_agent_server/vision_requirement.py +0 -28
- package/template/apps/agent-server/src/southwind_agent_server/vlm_readiness.py +0 -247
- package/template/apps/agent-server/tests/__init__.py +0 -1
- package/template/apps/agent-server/tests/openai_provider_test_support.py +0 -131
- package/template/apps/agent-server/tests/test_api.py +0 -305
- package/template/apps/agent-server/tests/test_artifact_input.py +0 -110
- package/template/apps/agent-server/tests/test_client_completion.py +0 -230
- package/template/apps/agent-server/tests/test_config.py +0 -106
- package/template/apps/agent-server/tests/test_fingerprint.py +0 -10
- package/template/apps/agent-server/tests/test_multimodal.py +0 -81
- package/template/apps/agent-server/tests/test_openai_provider.py +0 -320
- package/template/apps/agent-server/tests/test_postgres_report_status.py +0 -59
- package/template/apps/agent-server/tests/test_postgres_report_summary.py +0 -298
- package/template/apps/agent-server/tests/test_postgres_store.py +0 -135
- package/template/apps/agent-server/tests/test_provider_attempt_reporting.py +0 -140
- package/template/apps/agent-server/tests/test_provider_governance.py +0 -276
- package/template/apps/agent-server/tests/test_report_attempt_lifecycle.py +0 -126
- package/template/apps/agent-server/tests/test_report_resilience.py +0 -183
- package/template/apps/agent-server/tests/test_report_routes.py +0 -143
- package/template/apps/agent-server/tests/test_report_store.py +0 -347
- package/template/apps/agent-server/tests/test_report_summary_parity.py +0 -116
- package/template/apps/agent-server/tests/test_report_terminal_sync.py +0 -177
- package/template/apps/agent-server/tests/test_run_capacity.py +0 -112
- package/template/apps/agent-server/tests/test_run_operational_logging.py +0 -114
- package/template/apps/agent-server/tests/test_runtime_compatibility.py +0 -119
- package/template/apps/agent-server/tests/test_runtime_factory_readiness.py +0 -52
- package/template/apps/agent-server/tests/test_sqlite_store.py +0 -182
- package/template/apps/agent-server/tests/test_structured_logging.py +0 -142
- package/template/apps/agent-server/tests/test_telemetry.py +0 -25
- package/template/apps/agent-server/tests/test_tool_approval.py +0 -28
- package/template/apps/agent-server/tests/test_tool_structured_output.py +0 -347
- package/template/apps/agent-server/tests/test_trajectory.py +0 -91
- package/template/apps/agent-server/tests/test_vision_readiness_enforcement.py +0 -72
- package/template/apps/agent-server/tests/test_vlm_readiness.py +0 -106
- package/template/apps/agent-server/uv.lock +0 -831
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Agent 工具目录与调试工作台方案
|
|
2
|
+
|
|
3
|
+
日期:2026-10-07。状态:源码实现已合入 main,0.8.3 已按用户授权跳过 gate 直接发布,见[发布记录](../operations/create-windy-0.8.3-release.md);下游升级与部署待独立验收。
|
|
4
|
+
|
|
5
|
+
## 业务场景与验收边界
|
|
6
|
+
|
|
7
|
+
平台管理员需要确认已安装模块提供哪些工具、当前账号为何能或不能调用;业务支持人员需要在当前权限和材料范围内创建测试会话,定位模型调用、工具调用、审批和 Workflow 的失败;审计人员需要回放业务会话已有的调用事实。
|
|
8
|
+
|
|
9
|
+
工具目录可查看不代表可执行。测试会话使用正常治理链;历史回放只读取已记录事实,不重新调用模型、工具或业务写入,不增加模型用量,也不计算节省时间。旧记录关联不足时标记缺失,不根据消息猜测执行经过。矛盾分析和聊天记录分析由利剑业务 owner 完成合入,本次保留业务实现,通过公开平台契约对接。
|
|
10
|
+
|
|
11
|
+
## 复用与结构
|
|
12
|
+
|
|
13
|
+
- 动态目录由已安装 Module Manifest、GovernedToolRegistry 和已注册 Operation Handler 生成,包含 Schema、Guard、数据分类、审批、幂等、预算、执行方式和允许的 Operation;不维护利剑专属工具列表。
|
|
14
|
+
- `/admin/system/agent-tools` 展示目录;`/admin/system/agent-debug` 在一个工作台中创建测试 Session/Run、接收 SSE、展示受控结果,以及选择并逐步回放已有会话。
|
|
15
|
+
- 测试 Session 必须由 PostgreSQL AH-1 Session 服务创建,随后通过普通 Run API 提交。无持久 Session 能力时明确拒绝,不降级到虚构会话。
|
|
16
|
+
- 回放复用 AH-1 append-only 日志与 lineage/checkpoint,以及 `registerAgentSessionProviders()` 返回的业务消息。业务 Provider 可提供可选 Run/Workflow 引用,平台逐个按当前账号和 Scope 重新授权读取。
|
|
17
|
+
- Workflow 通过公开查询接口提供全部节点尝试、分支、失败、重试和产物引用。事件只提供白名单摘要;不暴露密钥、原始推理链、Provider body 或私有 Locator。
|
|
18
|
+
- internal Operation 不通过浏览器 Run 入口或历史结果读取;Workflow 专属 Operation 不通过普通调试启动。目录资格不会签发 ExecutionGrant 或代替审批。
|
|
19
|
+
|
|
20
|
+
## Manifest 与接口
|
|
21
|
+
|
|
22
|
+
能力基础 Key 为 `system.agent-tools`(read)和 `system.agent-debug`(read/manage)。菜单、路由、API、Feature 与审计动作在 system.agent 模块内统一登记。业务 Operation/Session/Workflow 自身权限仍要逐项通过。
|
|
23
|
+
|
|
24
|
+
| 接口 | 行为 |
|
|
25
|
+
| ---------------------------------------------------- | -------------------------------- |
|
|
26
|
+
| GET `/api/agent/admin/tools` | 当前工具契约与安全拒绝原因 |
|
|
27
|
+
| GET `/api/agent/admin/operations` | 当前 Operation 及调试启动资格 |
|
|
28
|
+
| GET `/api/agent/admin/session-recordings` | 授权 Harness 或业务会话列表 |
|
|
29
|
+
| GET `/api/agent/admin/session-recordings/:sessionId` | 只读、受控、标明关联完整性的记录 |
|
|
30
|
+
| POST `/api/agent/admin/test-sessions` | 持久测试 Session 创建 |
|
|
31
|
+
| 普通 `/api/agent/runs`、events、result、cancel | 真实测试执行治理链 |
|
|
32
|
+
|
|
33
|
+
## 实施与验证
|
|
34
|
+
|
|
35
|
+
按目录、会话关联投影、工作台 UI 三个独立工作流实现,主 Agent 集成 Manifest、分发文件、文档与集中验证。验证包括动态模块增删、Guard 拒绝、internal 隔离、只读零执行、断线事件顺序、关联缺失、节点重试历史、未保存输入与取消。禁止用静态检查冒充测试或部署验收;不使用 Playwright、Chrome 或 GitHub Actions 自测。
|
|
36
|
+
|
|
37
|
+
最终技术实现文档记录实际接口、业务 Provider 接入、升级分发、运行限制与检查证据。0.8.3 已发布并通知下游升级 owner,不代表下游已完成升级。
|
|
38
|
+
|
|
39
|
+
## 参考与取舍
|
|
40
|
+
|
|
41
|
+
采用已存在的 Windy [Harness](./agent-harness.md) 和 [AH-1 Session](../adr/0003-agent-session-event-source.md),保留平台治理与业务 Provider 边界。[DeepSeek Harness 架构](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/architecture.md) 的持久事件与投影分离可用于理解回放:只重建已落盘事实,实时临时输出不能替代持久结算记录。本次不迁移其插件框架。
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Windy Agent Harness:移除 ADK 与可插拔演进方案
|
|
2
2
|
|
|
3
|
+
> 2026-10-29:执行层现由[内置DSH](./embedded-dsh-integration.md)接管。下文涉及Python Direct Engine、旧安装/存储及OTEL配置的内容属于历史实现;当前启动、配置与限制以[迁移运维](../operations/dsh-agent-migration.md)为准。canonical API、业务长期Session和治理契约继续有效。
|
|
4
|
+
|
|
3
5
|
状态:AH-0 仓库实现完成,候选集中验证与发布证据待执行
|
|
4
6
|
|
|
5
7
|
更新时间:2026-08-27
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Remote Agent Runtime 兼容契约
|
|
2
2
|
|
|
3
|
+
> 2026-10-29:执行层现由[内置DSH](./embedded-dsh-integration.md)接管。下文涉及Python Direct Engine、旧安装/存储及OTEL配置的内容属于历史实现;当前启动、配置与限制以[迁移运维](../operations/dsh-agent-migration.md)为准。canonical API、业务长期Session和治理契约继续有效。
|
|
4
|
+
|
|
3
5
|
更新时间:2026-09-02。
|
|
4
6
|
|
|
5
7
|
状态:WAI-1 V1 兼容协商基础已实现。它不开放新的业务 Run 入口,也不代表外部业务系统已经可以
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Windy 内置 DSH Agent 平台
|
|
2
|
+
|
|
3
|
+
2026-10-29。参考 sharp-sword `d8e1b68219a448d5c470f6ff298fd7114db40c5c`,在 Windy `1ad816a89455b8b4c3ce37f1e3732759fafa8f48` 上提取。验收证据另见[迁移操作与验证](../operations/dsh-agent-migration.md)。
|
|
4
|
+
|
|
5
|
+
## 使用者与结果
|
|
6
|
+
|
|
7
|
+
业务用户通过独立同源 `/agent` 使用会话、文件、文档工具和技能;管理员在 Windy Admin 查看工具契约、调试/回放、技能版本、Workflow 预设和运行事实。可用性取决于当前登录、License、Feature、RBAC、数据范围、模型容量及 Linux 隔离。工具目录或技能可见不代表拥有执行权限。
|
|
8
|
+
|
|
9
|
+
## 实现与职责
|
|
10
|
+
|
|
11
|
+
Agent Server 是 Node 24.7+ 与 TypeScript workspace,固定官方 DSH `0.2.1-rc.2` 和 Cordis `4.0.5`。Bun 管理依赖及构建;DSH 原生插件安装器需要的 pnpm 随同镜像交付。通过公开 AgentLoop、Skill Provider、MCP、生命周期及 UI slot 接入,没有自维护的 DSH 内核。
|
|
12
|
+
|
|
13
|
+
| 所有者 | 职责 |
|
|
14
|
+
| -------------- | --------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| Windy Server | 当前登录、Feature/License/RBAC、数据范围、Tool Host、审批、Artifact、长期业务 Session、审计及共享技能版本 |
|
|
16
|
+
| Agent 协调器 | canonical HTTP/SSE、Provider 治理、容量、SQLite、凭据保管、用户进程及受控模型/MCP边界 |
|
|
17
|
+
| DSH 与通用插件 | 原生会话、工作区、模型工具循环、压缩、文件/命令、中文、品牌、呈现、技能和有界子任务 |
|
|
18
|
+
| 项目组合 | 领域指令、领域技能、业务范围和业务呈现;调用公开平台服务,不复制平台执行器 |
|
|
19
|
+
|
|
20
|
+
`/api/agent/runs` 的创建、状态、结果、取消、幂等与 SSE 语义保留;Client Agent Session 模型协议也保留。canonical Operation 的结构化输出继续经过 Schema 校验。Execution Grant、逐次工具授权、审批、出网 DLP、内部结果加密、图片和 Context prepare/commit 由 Host 接缝执行。
|
|
21
|
+
|
|
22
|
+
## 两种会话事实
|
|
23
|
+
|
|
24
|
+
DSH 原生 Session 管理交互历史、文件上下文和子任务。它不替代 ADR 0003 定义的长期业务 Session,也不自动成为业务 Memory 或正式事实。业务 Workflow 的审批、不可变 Release、幂等副作用与恢复继续由现有服务持有。无需为每个 DSH 内部步骤额外创建 Windy Run。
|
|
25
|
+
|
|
26
|
+
## 入口、身份和隔离
|
|
27
|
+
|
|
28
|
+
`/agent` 与 `/agent/` 都由 Web 代理到产品 Server,再到 Agent Server。原生 HTML 固定相对资源基址;HTTP 与 WS 均验证来源。浏览器指定的内部身份头与转发来源不能进入可信边界。Vue 登录完成后以文档导航进入原生入口,管理面仍单独验证 `system.admin.access`。
|
|
29
|
+
|
|
30
|
+
`system.agent-workbench.use` 控制原生工作台;当前产品登录在每次模型/MCP边界和连接周期重新校验。同一账号的活动 Worker 绑定已有登录及公开来源,新登录冲突返回409。登出或确认撤权回收进程、连接和模型请求;暂时无法核实授权时拒绝传输,不冒充已经登出。
|
|
31
|
+
|
|
32
|
+
Linux 协调器仅为 UID/GID 切换和进程管理使用必要能力,用户 Worker 独立 UID 与0700 HOME。默认子进程通过官方扩展点继承 Landlock 文件约束和 seccomp 网络约束;隔离能力不足时拒绝执行。Provider Key、产品 Session 和内部服务 Token 不进入 Worker。共享技能附件由协调器在账号隔离目录中只读物化。
|
|
33
|
+
|
|
34
|
+
用户安装的插件是该用户授权的可信代码,可访问自己的 HOME 和网络,不受默认终端子进程沙箱等同约束。个人扩展默认开放;关闭管理入口不等于停用已有插件,撤销方式见运维文档。
|
|
35
|
+
|
|
36
|
+
## 容量、文件和限制
|
|
37
|
+
|
|
38
|
+
原生模型请求共享 canonical 容量,并至少为既有调用链预留一个槽位。全局容量为1时原生模型任务不可用;不得根据硬件名称自动提高容量。子任务深度1、活动上限2,共享家族预算,父取消同时停止排队和子任务。
|
|
39
|
+
|
|
40
|
+
默认工作区软配额512MiB、用户Worker最多2个;限制及容器资源以Compose和运行配置为准,不是并发人数承诺。当前协调器仅支持单副本SQLite,不承诺跨副本容量或HA。
|
|
41
|
+
|
|
42
|
+
Office文档工具随同一镜像离线交付。DOCX预览使用固定LibreOffice WASM转PDF;Python只用于文档工具。转换、输出、缓存与期限有界,原生下载继续经过当前用户边界。复杂排版、客户模型质量和现场吞吐须独立验收。
|
|
43
|
+
|
|
44
|
+
扩展方式见[DSH插件与项目接入](../development/dsh-plugins.md),技能治理见[Agent技能](../platform/agent-skills.md)。
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# DSH 插件与项目接入
|
|
2
|
+
|
|
3
|
+
运行基线固定为官方DSH `0.2.1-rc.2`、Cordis `4.0.5`和Node 24.7+。不要把本次回迁同时当作上游升级。官方依赖通过Bun与锁文件安装;不修改node_modules或复制上游内核。
|
|
4
|
+
|
|
5
|
+
## 项目扩展
|
|
6
|
+
|
|
7
|
+
`apps/agent-server/project/host.ts`是project-owned组合,类型为`DshHostConfiguration`。可声明助理文案、工作区名称、额外指令、只读技能目录和可信Host插件。项目插件配置不承载Secret或客户端自报权限;模型、MCP身份、隔离与部署约束由最后的托管配置持有。
|
|
8
|
+
|
|
9
|
+
`presetId`是部署固定的会话身份,默认`windy`。接管已有原生会话时保留其原ID;Registry、handoff和子任务统一使用该值,不重写既有会话文件。名称和说明可另行修改。项目插件可用`replaces: ["session-controller"]`接管官方公开SessionController,实现业务只读历史投影;平台先停用原条目再装入Adapter,拒绝重复接管或替换模型、身份、预算等其它托管条目。
|
|
10
|
+
|
|
11
|
+
项目只读资源与插件放入`project/`,通过相对Agent Server的路径引用。整个目录随镜像交付、root所有且Worker只读;个人会话与技能仍保存在各自HOME,不通过重新初始化HOME做接管。
|
|
12
|
+
|
|
13
|
+
### 受控业务边界
|
|
14
|
+
|
|
15
|
+
`boundaryRoutes`可声明固定GET/POST路径,模板只支持字面片段与`:id`参数,参数仅接受最多128位字母、数字、连字符或下划线;无通配符,不得覆盖`/mcp`、`/skills`或`/v1`。重复或交叠路由在启动时拒绝。业务Handler只依赖标准TypeScript的`DshBoundaryRequest`/`DshBoundaryContext`,不接触DSH私有类型、Worker或产品Session。
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
boundaryRoutes: [
|
|
19
|
+
{
|
|
20
|
+
key: "project.history",
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: "/business-history/:id",
|
|
23
|
+
maxResponseBytes: 2 * 1024 * 1024,
|
|
24
|
+
timeoutMs: 15_000,
|
|
25
|
+
handle: (request, context) =>
|
|
26
|
+
context.fetchProduct(`/api/my-module/history/${request.parameters.id}`),
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Handler收到`method/path/parameters/searchParams/body/signal`;查询参数仍须按业务协议校验。每次`fetchProduct`先重查当前登录,再向固定产品origin的相对`/api/`路径调用,继续经过产品API既有Manifest、Feature、License、RBAC与Scope。禁止外部URL、路径穿越、内部API、客户凭据/headers/redirect参数;HTTP方法必须与声明路由一致,仅允许JSON或二进制content-type。产品响应只保留content-type与no-store,不向Worker转发Set-Cookie或其它凭据头。
|
|
32
|
+
|
|
33
|
+
GET不接收正文,POST默认64KiB,可声明`maxBodyBytes`至多20MiB;回源正文遵守同一上限,响应默认2MiB、至多20MiB。整体处理默认15秒、最多30秒,包含回源授权、HTTP及响应读取;撤权、取消和超时中止后续调用。项目声明只负责接线,不授予业务权限。业务错误回执可返回原受控状态,框架错误只返回安全码;临时登录核验故障保持503,不能误报为已登出。
|
|
34
|
+
|
|
35
|
+
已匹配请求的路径上限2048字符、查询上限4096字符,回源相对URL上限8192字符;Handler不接收入站headers,产品请求headers由平台固定生成。额外只读技能目录同时进入官方发现和内置技能管理列表,不能通过个人管理入口修改或删除。
|
|
36
|
+
|
|
37
|
+
通过公开Cordis service/event和DSH Slot、Skill Provider、MCP、LocalSubprocessRuntime接口扩展;监听、定时器和资源使用生命周期释放。普通业务DTO只依赖平台类型,不导入DSH私有类型。Client bundle源与生成文件一同维护,更新chunk时重建主入口revision。
|
|
38
|
+
|
|
39
|
+
工作台品牌读取现有`/api/platform/branding`的softwareName、logoUrl和description。中文是部署策略,不新增i18n框架。主题复用平台语义token,不在各插件重复覆盖全局颜色。
|
|
40
|
+
|
|
41
|
+
开发 Compose 和生成项目默认将`WINDY_PUBLIC_BASE_URL`留空,工作台按浏览器同源Host确定来源,不能把内部API端口9747固定为Web来源。显式配置优先且必须是用户实际访问的Web origin;HTTPS反向代理或生产Client Agent Session仍须配置该基址,后者缺失时继续fail closed。
|
|
42
|
+
|
|
43
|
+
`apps/server/src/app/agent-workflow-presets.ts`是project-owned的预设注册入口。注册项必须引用已安装模块、已声明Feature/Permission和有效Workflow定义;可提供安全的同源业务入口及readiness。后台只读展示目录,正式启动仍由业务入口取得当前授权、不可变Release和材料。
|
|
44
|
+
|
|
45
|
+
## 个人扩展
|
|
46
|
+
|
|
47
|
+
个人插件及技能管理默认开放,按用户持久化。个人插件是该账号信任的代码;DSH官方安装器需要pnpm语义,镜像中提供固定安装器,项目包管理仍使用Bun。受部署固定的模型和身份不能通过个人profile替换。
|
|
48
|
+
|
|
49
|
+
`AGENT_DSH_USER_EXTENSIONS=0`关闭管理入口及个人技能发现,但不卸载、停用已保存插件。撤销插件应先通过原生管理界面停用/卸载,再重新创建该用户Worker;保护工作区、会话和必要文件。
|
|
50
|
+
|
|
51
|
+
## 验证与升级
|
|
52
|
+
|
|
53
|
+
新增能力先补成功、拒绝、声明漂移和清理测试。合并候选集中执行`bun run test:merge`;Node运行时检查由`test:agent`承载。Linux协调器与沙箱检查分别使用Agent Server的`test:coordinator`和`test:confinement`。
|
|
54
|
+
|
|
55
|
+
上游升级必须同批更新直接依赖和Cordis,检查公开API、最终profile合成、原生依赖完整性、UI slots、授权、取消、Office预览与隔离。依赖版本与SHA来源必须可追溯,不能仅手工改锁文件字符串。验证缺口写入交付文档。
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# DSH Agent 回迁、部署与验收
|
|
2
|
+
|
|
3
|
+
2026-10-29。开发分支 `rayjason/dsh-agent-platform-migration`。本次交付源码、生成升级支持及本地验证;不发布npm、不推送镜像、不部署生产。
|
|
4
|
+
|
|
5
|
+
## 切换与回退
|
|
6
|
+
|
|
7
|
+
1. 固定当前应用SHA、镜像digest、环境配置与Agent专用volume备份。确认没有正在执行的Agent任务,停止旧Agent服务。
|
|
8
|
+
2. 按新源码统一构建Agent Server、Server和Web。Node工作台代理、后台API与引擎需要同批更新,不能只替换Agent镜像。
|
|
9
|
+
3. 运行正式前向数据库迁移;新增DSH技能版本/幂等回执和诊断索引。既有业务库、上传文件、长期业务Session和Workflow记录保留。
|
|
10
|
+
4. 使用新的`AGENT_RUNTIME_DATABASE_PATH`,默认`/app/data/agent/embedded-dsh.sqlite`。原生HOME默认`/app/data/agent/dsh`。不读取、不迁移旧Python Run Store;旧历史详情无法回读时明确显示“运行详情不可用”,说明范围、过期或旧Agent数据重置等可能原因,统一404避免泄露记录存在性,不自动重新执行。
|
|
11
|
+
5. 验证就绪、当前登录、权限拒绝、canonical调用、原生入口、撤权及文件成果。验收后再按备份策略人工清理旧Agent专用文件,禁止清理业务PostgreSQL或共享文件存储。
|
|
12
|
+
6. 回退时停止新Agent,恢复同一批旧镜像及其专用备份。追加的数据库表可保留,不回写已发布迁移或回滚业务数据。
|
|
13
|
+
|
|
14
|
+
升级器按文件所有权处理:未修改的旧受管Python文件可删除;客户修改的受管文件报冲突;`apps/agent-server/project/host.ts`等项目扩展保留。DSH接线涉及项目拥有的路由和组合文件时只接受已知默认基线或已经完成的目标内容,修改过的文件需人工整合,不能静默覆盖。
|
|
15
|
+
|
|
16
|
+
## 配置与资源
|
|
17
|
+
|
|
18
|
+
- Node要求24.7+;Linux内核必须满足Landlock完整约束及seccomp。协调器使用root切换UID,容器drop ALL后仅补SETUID、SETGID、CHOWN、DAC_OVERRIDE、KILL,启用no-new-privileges。
|
|
19
|
+
- `AGENT_SERVER_INTERNAL_TOKEN`是内部服务认证;Provider继续使用`QWEN_API_URL/QWEN_API_KEY/QWEN_MODEL`。HTTPS Provider域名须在`AI_PROVIDER_HTTPS_HOST_ALLOWLIST`,内部结果加密使用`AGENT_INTERNAL_OUTPUT_ENCRYPTION_SECRET`。不向用户进程下发这些真实凭据。
|
|
20
|
+
- 全局模型容量由`AI_PROVIDER_MAX_CONCURRENT_RUNS`控制。Compose保留1槽、0队列默认值;因此原生模型任务显示容量预留不可用。现场确认模型和内存后才能提高上限;原生请求始终保留至少1槽给既有调用链。
|
|
21
|
+
- 原生任务上限`AGENT_DSH_MAX_ACTIVE_RUNS=2`,用户Worker默认2,工作区软配额512MiB,容器4GiB/2CPU/512PID。软配额不代替磁盘硬配额,WASM峰值RSS也不等于V8 heap限制。
|
|
22
|
+
- `AI_PROVIDER_CONTEXT_TOKENS`只能填现场确认的模型serving容量;未配置时不能用DSH界面估计当作容量证明。
|
|
23
|
+
- `WINDY_PUBLIC_BASE_URL`可固定公开来源;为空时同源HTTP入口保留浏览器Host用于局域网动态地址。HTTPS终止代理应设置正确公开基址,外部转发头不能代替部署配置。
|
|
24
|
+
- `AGENT_DSH_HOME`父目录必须专用于Agent数据,启动会收紧普通文件权限。当前SQLite/容量仅支持单副本。
|
|
25
|
+
|
|
26
|
+
个人扩展默认开放。`AGENT_DSH_USER_EXTENSIONS=0`关闭管理入口及个人技能发现;要撤销已安装插件,先停用或卸载,再重建该用户Worker。保留该用户工作区、技能和会话;禁止把关入口当作已撤销插件代码的证明。
|
|
27
|
+
|
|
28
|
+
## 构建与检查入口
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
bun install --frozen-lockfile
|
|
32
|
+
bun run --cwd apps/agent-server typecheck
|
|
33
|
+
bun run --cwd apps/agent-server build
|
|
34
|
+
bun run test:merge
|
|
35
|
+
# 合成Provider + 实际平台用户查询工具:
|
|
36
|
+
bun apps/server/scripts/check-dsh-platform-example.ts
|
|
37
|
+
# 只运行新增三表与 Repository 契约,自动创建并删除专用 PG18 容器:
|
|
38
|
+
WINDY_DSH_POSTGRES_TEST=1 bun test ./apps/server/src/agent-skills/postgres.integration.test.ts
|
|
39
|
+
# Agent专用原生架构镜像构建后:
|
|
40
|
+
bun run --cwd apps/agent-server test:coordinator
|
|
41
|
+
bun run --cwd apps/agent-server test:confinement
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
普通小提交只执行静态检查;合并候选集中执行merge gate。Node契约检查使用真实DSH Loop与合成Provider。Linux原生镜像检查验证协调器、不同UID、MCP/WS、凭据剥离、撤权、共享技能与文件约束。Office另用合成DOCX验证实际转换及产物回读。
|
|
45
|
+
|
|
46
|
+
正式发布才运行完整`release:verify`,本次不运行完整发布矩阵或GitHub Actions,不使用Playwright/Chrome。
|
|
47
|
+
|
|
48
|
+
## 验证记录
|
|
49
|
+
|
|
50
|
+
### 来源与提交
|
|
51
|
+
|
|
52
|
+
同步远端后从 Windy `1ad816a89455b8b4c3ce37f1e3732759fafa8f48` 创建本分支,参考 sharp-sword 远端 `d8e1b68219a448d5c470f6ff298fd7114db40c5c`。sharp-sword 原有2个本地提交及 Server/Web Dockerfile 未提交改动保留。
|
|
53
|
+
|
|
54
|
+
| 提交 | 切片 |
|
|
55
|
+
| ---------- | -------------------------------------------------------------------- |
|
|
56
|
+
| `3771afc4` | Node/DSH 运行时、原生工作台、隔离及通用插件,退役 Python 引擎 |
|
|
57
|
+
| `6c59d398` | 工作台代理与准入、共享技能治理、Workflow 预设、诊断、后台及 Manifest |
|
|
58
|
+
| `b5620876` | create-windy 生成、裁剪、升级、Docker 与构建分发 |
|
|
59
|
+
| `5a536e11` | 架构决策、平台职责、插件接缝及迁移运维文档 |
|
|
60
|
+
| `d1939dc2` | Tool Schema 透传及未终止 Run 的协议状态 |
|
|
61
|
+
| `d389ecbf` | 能力目录与开发组合接线 |
|
|
62
|
+
| `e262ad4e` | Windy 主题、加载页及打包契约 |
|
|
63
|
+
| `a7767955` | 受治理平台用户查询示例探针 |
|
|
64
|
+
| `f546b11d` | WS 启动校验、Admin 目录一致性、开发身份敏感权限拒绝 |
|
|
65
|
+
| `1eb71c8e` | Node 检查入口及旧运行详情不可用说明 |
|
|
66
|
+
| `9844e08a` | 精简 Agent 项目的调度/运维共同裁剪归属 |
|
|
67
|
+
| `f83af3a5` | 真实 PostgreSQL 18 与 Linux 文档交付检查 |
|
|
68
|
+
| `54f71825` | 配额目录替换与子任务预算检查使用显式同步,消除调度假设 |
|
|
69
|
+
|
|
70
|
+
### 本地验收
|
|
71
|
+
|
|
72
|
+
本地证据保存在忽略目录 `.artifacts/dsh-agent-platform-migration/` 及 `.artifacts/dsh-windy-20261029/`;不把合成产物、临时数据库或完整日志作为平台源文件提交。
|
|
73
|
+
|
|
74
|
+
代码候选为 `54f718258ef1d589f97bc9c9cfdc62d606ff0cf0`。本机原生 Linux ARM64 镜像:Agent `sha256:e98e7522c1962e49f906de7bda88cc93c388717a2bc3059265895d04f28936d5`;Web `sha256:08ed2a3b79bce939682af0ab6ac345c5ef696a866e1c2564018dc4b0bfa65693`。均只在本地构建,未推送。
|
|
75
|
+
|
|
76
|
+
| 范围 | 实际检查与结果 |
|
|
77
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
78
|
+
| 静态检查 | 提交钩子执行 Oxfmt、Oxlint 与根 TypeScript 检查,全部通过。它们不计为测试。 |
|
|
79
|
+
| 合并候选 | `54f71825` 上最终 `bun run test:merge` 退出0:Bun 2508通过/142跳过,Web 115文件335项通过,License 15文件49项通过,Node Agent 35项通过,Document/Speech/Embedding分别79/29/19项通过;合计3054项通过、0失败。 |
|
|
80
|
+
| 真实 DSH Loop | 35项 Node 检查通过;使用合成 Provider,覆盖结构化输出、工具/审批、授权重检、幂等与唯一终态、重放/重启、取消、连续单容量 Run、Client Agent 传输及内部结果加密。 |
|
|
81
|
+
| 同源工作台 | 实际 HTTP/WS 双跳、裸 `/agent` 相对资源、动态 LAN 来源、伪造身份头、登录冲突、撤权、冷启动预算及连接清理均有合约检查。 |
|
|
82
|
+
| Linux ARM64 | 固定镜像实测独立 UID/HOME、跨用户文件拒绝、凭据剥离、当前 MCP 身份、共享技能只读及版本撤销、登出回收/另一用户存活;Landlock 为 full,直接/子进程/继承句柄/PTY 的文件和网络限制通过。 |
|
|
83
|
+
| 生产 Web 镜像 | Node构建和Bun生产启动通过;只读容器中用合成同容器API上游验证就绪、静态首页、原生HTTP/WS转发及伪造内部身份头剥离,不涉及浏览器。 |
|
|
84
|
+
| 技能与诊断持久化 | 专用 PostgreSQL 18 容器执行0064三表迁移及真实 Repository:4项、37个断言通过,包括并发 CAS、幂等、重建连接池后的待审计恢复、停用/回滚及30天精确过期边界/有界清理。未连接业务数据库。 |
|
|
85
|
+
| 技能界面与权限 | 导入包边界、共享范围、依赖、读取与变更审计、版本冲突、停用/回滚及未保存输入保护由服务/API/组件检查覆盖;没有浏览器 E2E。 |
|
|
86
|
+
| Workflow/错误诊断 | 动态预设只读注册、当前授权与可用性说明;实际 HTTP 失败生成诊断号,只存路由模板/安全码,拒绝越权查询并审计。查询立即排除过期记录,物理清理在失败记录写入时按分钟节流、有界执行。 |
|
|
87
|
+
| 非案件示例 | 真实平台 ToolRegistry 的 `system.users.list` 经真实 DSH Loop 调用1次,合成 Provider 调用2次,canonical SSE 与结构化汇总返回授权示例用户数1。没有利剑案件依赖。 |
|
|
88
|
+
| 文档与下载 | Linux UID20000、无外网、只读输入下读取 `windy-office` 技能,使用镜像文档工具生成新 DOCX/XLSX 并独立回读,保留来源摘要和文本编号001;生产下载插件+真实 LocalFileSystem+HTTP 验证字节/摘要/中文文件名及匿名、跨会话、越界、软链拒绝。Session坐标和连接身份明确使用合成 fixture。 |
|
|
89
|
+
| Office 预览 | 固定 WASM 将36778字节合成 DOCX 转为29653字节完整 PDF,用时2402ms,峰值RSS1527008KiB、缺失字体为空;另行回读PDF有1页且包含中文平台用户汇总。超限前拒绝、预取消、禁用后台转换均通过。 |
|
|
90
|
+
| 生成与升级 | 真实 core 与精简 Agent 项目生成、依赖安装及完整类型检查通过;Agent 另通过实际启动组合及 Compose 配置校验。安装使用 `--ignore-scripts`,不宣称客户项目运行验收。升级的精确基线/已采纳/客户修改/删除状态、旧文件退役与环境只报告键名由契约检查覆盖。 |
|
|
91
|
+
|
|
92
|
+
文档下载复现使用 `apps/agent-server/scripts/documents-delivery-check.mjs`,通过只读 bind mount 挂到镜像相同目录,以 `--user 20000:20000 --network none --read-only --cap-drop ALL` 运行;fixture目录挂为`/fixtures`。输入为查询探针的`platform-example.json`、含工具名和汇总的合成`source.docx`、两列“编号/平台用户数”及数据“001/1”的`users.xlsx`。预览检查为`scripts/office-preview-check.mjs`,同样挂载运行,读取`/fixture/source.docx`及显式`WINDY_OFFICE_TEST_CONFIG`限制。
|
|
93
|
+
|
|
94
|
+
### 验收边界
|
|
95
|
+
|
|
96
|
+
本次不运行完整发布矩阵、全历史数据库迁移矩阵、客户模型/业务数据、现场并发容量或浏览器 E2E;不使用 Playwright、Chrome、GitHub Actions,不执行发布或生产部署。新表轻量检查不代替发布时完整迁移验证。DOCX复杂版式与分页未验收;示例表格没有公式,不据此声称公式重算。Office单次RSS用于资源观察,不是吞吐或并发承诺。
|
|
97
|
+
|
|
98
|
+
运行边界仍为单副本SQLite和Linux隔离。默认全局1槽为既有调用链预留,原生模型任务需在现场确认容量后配置。个人扩展默认开放,插件撤销必须执行前述停用/卸载与Worker重建;试验记忆方案未启用。
|
|
@@ -1,82 +1,9 @@
|
|
|
1
|
-
# Agent
|
|
1
|
+
# Agent 运行存储
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
2026-10-29。Agent Server 已由Node/DSH接管。canonical运行、SSE事件、Provider审计与原生用户工作区使用Agent专用本地存储;默认数据库为`AGENT_RUNTIME_DATABASE_PATH=/app/data/agent/embedded-dsh.sqlite`。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
执行事实、加密后的调用/事件/结果、Release 快照和评估结果,不保存业务会话、消息、
|
|
7
|
-
标题、案件范围或归档策略。业务事实仍由业务模块持久化。
|
|
5
|
+
当前只支持单副本,不承诺旧Python PostgreSQL Store模式或跨副本容量/HA。旧`AGENT_RUN_STORE_PATH`、`AGENT_DATABASE_URL`、`AI_PROVIDER_AUDIT_STORE_PATH`不能作为新实现已启用的证据。
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
`AGENT_DATABASE_URL` 且配置了 `AGENT_RUN_STORE_PATH` 时才启用。生产部署不得用
|
|
11
|
-
共享文件系统模拟多副本 SQLite。
|
|
7
|
+
产品PostgreSQL继续保存业务长期Session/Memory/Workflow、授权、运行绑定与报表治理事实;DSH存储不替代这些职责。内部结果仍使用Host声明的加密策略,普通历史读取不泄露internal输出。
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
同一个 `Idempotency-Key` 只能对应同一请求指纹。Run 的 canonical event 使用
|
|
16
|
-
`run_id + sequence` 唯一键,读取接口按 cursor 重放;终态后追加、完成和取消都是
|
|
17
|
-
幂等操作。事件或输出超过上限时,Store 写入唯一的 `run.failed`,避免运行态无限
|
|
18
|
-
增长。
|
|
19
|
-
|
|
20
|
-
每个工作副本领取 30 秒租约,并每 10 秒续租。租约丢失会中止当前执行,保留加密
|
|
21
|
-
调用快照供其他副本接管;恢复轮询使用行锁和 `skip locked` 防止重复领取。终态数据
|
|
22
|
-
按 TTL 清理,运行中数据不会被 TTL 清理。
|
|
23
|
-
|
|
24
|
-
## 不可变 Release 与回滚
|
|
25
|
-
|
|
26
|
-
每次 Run 固定以下坐标:
|
|
27
|
-
|
|
28
|
-
- Operation 与模块版本;
|
|
29
|
-
- Workflow、Prompt 和模型 Route 版本;
|
|
30
|
-
- Tool/输出 Schema 摘要;
|
|
31
|
-
- Manifest 摘要。
|
|
32
|
-
|
|
33
|
-
这些坐标生成稳定的 `releaseId`。同一 `releaseId` 只能对应同一快照,冲突时
|
|
34
|
-
fail closed,不能原地修改。业务模块通过
|
|
35
|
-
`ModuleAiOperationHandlerRegistration.release` 显式声明 Workflow、Prompt 和
|
|
36
|
-
Route 版本;未声明时使用模块版本。
|
|
37
|
-
|
|
38
|
-
回滚不是修改历史 Release,而是重新部署此前的模块/注册版本。旧 Release 仍保留,
|
|
39
|
-
新 Run 会固定到回滚后的旧坐标,历史 Run、评估和审计关联不会被改写。
|
|
40
|
-
|
|
41
|
-
## 评估、用量、Attempt、审计和 Trace
|
|
42
|
-
|
|
43
|
-
`POST /api/agent/evaluations` 仅接受内部 Token,可按 Release、评估集 Key 和评估集
|
|
44
|
-
版本幂等记录指标;同一坐标提交不同结果会拒绝。`usage.reported` 作为加密 canonical
|
|
45
|
-
event 保存。Provider attempt 审计以 `runId + attempt` 唯一保存,并可通过 Run 关联
|
|
46
|
-
Release、usage 和平台 Audit。
|
|
47
|
-
|
|
48
|
-
平台将请求关联值哈希为 128 位 Trace ID。Agent Runtime 用它建立 OTel 父 Trace,
|
|
49
|
-
Span 只包含 Run ID、Operation Key、Release ID 和终态,不写 Prompt、业务输入、
|
|
50
|
-
模型输出、Tool 参数、Actor 或 Secret。配置
|
|
51
|
-
`OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` 后启用 OTLP/HTTP 导出,认证头由
|
|
52
|
-
`OTEL_EXPORTER_OTLP_HEADERS` 注入。
|
|
53
|
-
|
|
54
|
-
## 运维配置
|
|
55
|
-
|
|
56
|
-
生产 Agent profile 必须配置:
|
|
57
|
-
|
|
58
|
-
```dotenv
|
|
59
|
-
AGENT_DATABASE_URL=postgresql://...
|
|
60
|
-
AGENT_RUN_ENCRYPTION_SECRET=至少32字节随机值
|
|
61
|
-
AGENT_SERVER_INTERNAL_TOKEN=随机内部令牌
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
可选配置:
|
|
65
|
-
|
|
66
|
-
```dotenv
|
|
67
|
-
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://collector.example/v1/traces
|
|
68
|
-
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer%20...
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
加密密钥缺失或不足 32 字节时 Runtime 拒绝启动。数据库迁移必须先于 Agent Server
|
|
72
|
-
启动。Provider attempt 的独立审计 Store 仍按
|
|
73
|
-
`AI_PROVIDER_AUDIT_RETENTION_DAYS` 执行留存;不可把它与业务日志混用。
|
|
74
|
-
|
|
75
|
-
## 故障与恢复
|
|
76
|
-
|
|
77
|
-
- PostgreSQL 不可用:启动 fail closed;运行中的副本停止续租,不继续产生副作用。
|
|
78
|
-
- 副本退出:租约过期后由其他副本恢复加密调用,不创建新 Run。
|
|
79
|
-
- OTLP 不可用:BatchSpanProcessor 按 OTel 导出策略处理,不向业务响应暴露 Collector
|
|
80
|
-
细节;Run Store 与平台 Audit 仍是业务审计事实。
|
|
81
|
-
- Release 快照冲突、评估结果漂移或幂等键漂移:稳定拒绝,要求修正发布输入。
|
|
82
|
-
- 超过容量、事件数或输出大小:写入或返回有界失败,不允许无界降级。
|
|
9
|
+
备份时协调停止Agent写入,保存SQLite主文件及WAL一致边界和原生HOME。采用新数据路径并允许旧Agent专用数据重置;业务数据库和文件必须保留。具体切换与回退见[迁移运维](../operations/dsh-agent-migration.md)。
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# AI Runtime 用量与运行报表
|
|
2
2
|
|
|
3
|
+
> 2026-10-29:执行层现由[内置DSH](../architecture/embedded-dsh-integration.md)接管。下文涉及Python Direct Engine、旧安装/存储及OTEL配置的内容属于历史实现;当前启动、配置与限制以[迁移运维](../operations/dsh-agent-migration.md)为准。canonical API、业务长期Session和治理契约继续有效。
|
|
4
|
+
|
|
3
5
|
`system.ai-runtime` 为 `system.agent` 提供运行事实、模型用量和缓存覆盖的管理面。它读取
|
|
4
6
|
canonical Agent Run 与每次 Provider Attempt 的独立报表投影,不把管理报表变成新的
|
|
5
7
|
执行入口,也不以报表写入结果改写 canonical Run 终态。
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Agent Runtime 接入
|
|
2
2
|
|
|
3
|
+
> 2026-10-29:执行层现由[内置DSH](../architecture/embedded-dsh-integration.md)接管。下文涉及Python Direct Engine、旧安装/存储及OTEL配置的内容属于历史实现;当前启动、配置与限制以[迁移运维](../operations/dsh-agent-migration.md)为准。canonical API、业务长期Session和治理契约继续有效。
|
|
4
|
+
|
|
3
5
|
## 当前基线
|
|
4
6
|
|
|
5
7
|
Windy 的服务端 Agent Runtime 由独立 Python Agent Server 承载,生产默认 Engine 是
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# DSH 技能与治理
|
|
2
|
+
|
|
3
|
+
技能是可审查的工作方法和文件包,不授予工具、身份或数据权限。Windy后台治理DSH `SKILL.md`/ZIP,不依赖旧Agent Code任务或脚本执行器。
|
|
4
|
+
|
|
5
|
+
## 管理与运行
|
|
6
|
+
|
|
7
|
+
后台支持目录、详情、全部版本、共享范围、依赖、导入发布、停用和回滚。范围包括本人、部门和租户;读写均由Host构造的当前Scope约束。平台内置“平台工具查询”提供非案件示例;启动初始化不会覆盖已治理的后续版本或停用状态。
|
|
8
|
+
|
|
9
|
+
- `GET /api/agent/skills`、`/:key`、`/:key/versions`:当前可读目录、正文及历史。
|
|
10
|
+
- `POST /api/agent/skills`:导入SKILL.md或ZIP并发布新版本。
|
|
11
|
+
- `POST /api/agent/skills/:key/disable|rollback`:停用或发布恢复历史内容的新版本。
|
|
12
|
+
- 写请求必须携带`idempotency-key`和`expectedVersion`;回滚另携带目标`version`。正文类型由共享DTO约束。
|
|
13
|
+
- `GET /api/agent/workbench/skills`:仅供当前原生身份读取可执行的已发布包;不授予管理权限。
|
|
14
|
+
|
|
15
|
+
Feature是`system.agent-skill`,权限是`.read`、`.manage`、`.execute`。工具依赖必须与已注册工具的Feature/Permission一致,并逐次检查当前可用性。
|
|
16
|
+
|
|
17
|
+
版本、包内容和幂等回执使用Repository+Drizzle持久化。变更先形成待审计回执,关键审计成功后才向运行时公开;重复请求复用回执,摘要漂移或版本竞争返回冲突。启动恢复未完成审计,避免崩溃后把未审计版本暴露给模型。读取审计只保存种类、Key、版本或数量,不保存技能正文。
|
|
18
|
+
|
|
19
|
+
## 文件包与编辑
|
|
20
|
+
|
|
21
|
+
SKILL.md必须是有效UTF-8,包含唯一YAML头的name、description和非空正文。ZIP有归档大小、展开大小、文件数和单文件上限;拒绝目录穿越、重复路径、链接、特殊文件、多个技能根和不受控YAML引用。具体上限以共享校验器和界面反馈为准。
|
|
22
|
+
|
|
23
|
+
导入失败保留当前输入,保存期间阻止重复提交。关闭编辑容器、切换路由与刷新前按真实编辑基线确认,成功后才清理未保存状态。
|
|
24
|
+
|
|
25
|
+
原生工作台的个人技能继续保存在当前工作区`.dsh/skills`。个人导入不产生组织发布身份。平台发布技能通过DSH公开Provider提供;每次发现/读取重新授权、比较版本摘要,附件按用户只读物化,停用或回滚撤下旧目录。已经发送给模型的历史上下文不能据此追溯消除。
|
package/template/package.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"speech:pins": "bun run scripts/provision-speech-readiness.ts",
|
|
22
22
|
"dev:embedding": "PLATFORM_ENABLE_AI=true EMBEDDING_SERVER_URL=http://embedding-server:8092 docker compose --profile agent --profile embedding up --build",
|
|
23
23
|
"dev:search": "OPENSEARCH_URL=http://opensearch:9200 docker compose --profile search up --build",
|
|
24
|
+
"dev:gateway": "bun run --cwd apps/windy-gateway start",
|
|
24
25
|
"dev:license": "bun run --cwd apps/license dev",
|
|
25
26
|
"dev:license:docker": "docker compose --profile license up license",
|
|
26
27
|
"dev:signing": "bun run --cwd apps/signing-service dev",
|
|
@@ -58,15 +59,15 @@
|
|
|
58
59
|
"release:candidate": "bun run scripts/release-candidate.ts",
|
|
59
60
|
"release:verify:full": "bun run scripts/release-verify.ts --full",
|
|
60
61
|
"test:packages:pack": "bun run scripts/platform-package-release.ts",
|
|
61
|
-
"test:agent": "
|
|
62
|
+
"test:agent": "bun run --cwd apps/agent-server test",
|
|
62
63
|
"test:document": "uv run --directory apps/document-server pytest",
|
|
63
64
|
"test:speech": "uv run --directory apps/speech-server pytest",
|
|
64
65
|
"test:embedding": "uv run --directory apps/embedding-server pytest",
|
|
65
|
-
"check:agent": "
|
|
66
|
+
"check:agent": "bun run --cwd apps/agent-server typecheck",
|
|
66
67
|
"check:document": "uv run --directory apps/document-server ruff check . && uv run --directory apps/document-server ruff format --check . && uv run --directory apps/document-server mypy",
|
|
67
68
|
"check:speech": "uv run --directory apps/speech-server ruff check . && uv run --directory apps/speech-server ruff format --check . && uv run --directory apps/speech-server mypy",
|
|
68
69
|
"check:embedding": "uv run --directory apps/embedding-server ruff check . && uv run --directory apps/embedding-server ruff format --check . && uv run --directory apps/embedding-server mypy",
|
|
69
|
-
"typecheck": "bun run --cwd apps/web typecheck && bun run --cwd apps/server typecheck && bun run --cwd apps/license typecheck && bun run --cwd apps/signing-service typecheck && bun run --cwd packages/ai-client typecheck && bun run --cwd packages/license-sdk typecheck && bun run --cwd packages/jobs typecheck && bun run --cwd packages/server-sdk typecheck && bun run --cwd packages/storage typecheck && bun run --cwd packages/database typecheck && bun run --cwd packages/crud-generator typecheck && bun run --cwd packages/delivery typecheck && bun run --cwd packages/create-windy typecheck",
|
|
70
|
+
"typecheck": "bun run --cwd apps/web typecheck && bun run --cwd apps/server typecheck && bun run --cwd apps/license typecheck && bun run --cwd apps/signing-service typecheck && bun run --cwd packages/ai-client typecheck && bun run --cwd packages/license-sdk typecheck && bun run --cwd packages/jobs typecheck && bun run --cwd packages/server-sdk typecheck && bun run --cwd packages/storage typecheck && bun run --cwd packages/database typecheck && bun run --cwd packages/crud-generator typecheck && bun run --cwd packages/delivery typecheck && bun run --cwd packages/create-windy typecheck && bun run --cwd apps/agent-server typecheck && bun run --cwd apps/windy-gateway typecheck && bun run --cwd packages/model-gateway typecheck",
|
|
70
71
|
"lint": "oxlint .",
|
|
71
72
|
"format": "oxfmt",
|
|
72
73
|
"check:static": "bun run lint && bun run typecheck && bun run check:agent && bun run check:document && bun run check:speech && bun run check:embedding",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
CREATE TABLE "agent_skill_mutations" (
|
|
2
|
+
"tenant_id" varchar(64) NOT NULL,
|
|
3
|
+
"actor_id" varchar(64) NOT NULL,
|
|
4
|
+
"idempotency_key" varchar(160) NOT NULL,
|
|
5
|
+
"request_digest" varchar(71) NOT NULL,
|
|
6
|
+
"skill_key" varchar(64) NOT NULL,
|
|
7
|
+
"version" integer NOT NULL,
|
|
8
|
+
"result" jsonb NOT NULL,
|
|
9
|
+
"audit" jsonb NOT NULL,
|
|
10
|
+
"audit_committed" boolean DEFAULT false NOT NULL,
|
|
11
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
12
|
+
CONSTRAINT "agent_skill_mutations_tenant_id_actor_id_idempotency_key_pk" PRIMARY KEY("tenant_id","actor_id","idempotency_key")
|
|
13
|
+
);
|
|
14
|
+
--> statement-breakpoint
|
|
15
|
+
CREATE TABLE "agent_skill_versions" (
|
|
16
|
+
"tenant_id" varchar(64) NOT NULL,
|
|
17
|
+
"skill_key" varchar(64) NOT NULL,
|
|
18
|
+
"version" integer NOT NULL,
|
|
19
|
+
"metadata" jsonb NOT NULL,
|
|
20
|
+
"bundle" jsonb NOT NULL,
|
|
21
|
+
"audit_committed" boolean DEFAULT false NOT NULL,
|
|
22
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
23
|
+
CONSTRAINT "agent_skill_versions_tenant_id_skill_key_version_pk" PRIMARY KEY("tenant_id","skill_key","version")
|
|
24
|
+
);
|
|
25
|
+
--> statement-breakpoint
|
|
26
|
+
CREATE TABLE "diagnostic_events" (
|
|
27
|
+
"diagnostic_id" varchar(41) PRIMARY KEY NOT NULL,
|
|
28
|
+
"request_id" varchar(160) NOT NULL,
|
|
29
|
+
"occurred_at" timestamp with time zone NOT NULL,
|
|
30
|
+
"expires_at" timestamp with time zone NOT NULL,
|
|
31
|
+
"service" varchar(24) NOT NULL,
|
|
32
|
+
"stage" varchar(24) NOT NULL,
|
|
33
|
+
"method" varchar(16) NOT NULL,
|
|
34
|
+
"route" varchar(256) NOT NULL,
|
|
35
|
+
"status_code" integer NOT NULL,
|
|
36
|
+
"error_code" varchar(80) NOT NULL
|
|
37
|
+
);
|
|
38
|
+
--> statement-breakpoint
|
|
39
|
+
CREATE INDEX "idx_agent_skill_audit_pending" ON "agent_skill_mutations" USING btree ("audit_committed","created_at");--> statement-breakpoint
|
|
40
|
+
CREATE INDEX "idx_agent_skill_catalog" ON "agent_skill_versions" USING btree ("tenant_id","audit_committed","skill_key");--> statement-breakpoint
|
|
41
|
+
CREATE INDEX "idx_diagnostic_events_expiry" ON "diagnostic_events" USING btree ("expires_at");--> statement-breakpoint
|
|
42
|
+
CREATE INDEX "idx_diagnostic_events_request" ON "diagnostic_events" USING btree ("request_id");
|