create-windy 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +486 -156
- package/package.json +2 -1
- package/template/.windy-template.json +2 -2
- package/template/apps/agent-server/README.md +25 -6
- package/template/apps/agent-server/src/southwind_agent_server/adk_adapter.py +15 -2
- package/template/apps/agent-server/src/southwind_agent_server/app.py +13 -34
- package/template/apps/agent-server/src/southwind_agent_server/config.py +49 -0
- package/template/apps/agent-server/src/southwind_agent_server/contracts.py +13 -0
- package/template/apps/agent-server/src/southwind_agent_server/engine_capacity.py +31 -0
- package/template/apps/agent-server/src/southwind_agent_server/fingerprint.py +5 -0
- package/template/apps/agent-server/src/southwind_agent_server/health_routes.py +50 -0
- package/template/apps/agent-server/src/southwind_agent_server/openai_engine.py +11 -2
- package/template/apps/agent-server/src/southwind_agent_server/openai_provider.py +3 -9
- package/template/apps/agent-server/src/southwind_agent_server/postgres_store.py +5 -0
- package/template/apps/agent-server/src/southwind_agent_server/readiness_pin.py +37 -0
- package/template/apps/agent-server/src/southwind_agent_server/run_admission.py +64 -0
- package/template/apps/agent-server/src/southwind_agent_server/run_capacity.py +59 -0
- package/template/apps/agent-server/src/southwind_agent_server/service.py +42 -43
- package/template/apps/agent-server/src/southwind_agent_server/service_errors.py +4 -0
- package/template/apps/agent-server/src/southwind_agent_server/service_execution.py +31 -0
- package/template/apps/agent-server/src/southwind_agent_server/service_tasks.py +34 -0
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_catalog.py +11 -0
- package/template/apps/agent-server/src/southwind_agent_server/store.py +6 -0
- package/template/apps/agent-server/src/southwind_agent_server/vision_probe.py +87 -0
- package/template/apps/agent-server/src/southwind_agent_server/vision_requirement.py +28 -0
- package/template/apps/agent-server/src/southwind_agent_server/vlm_readiness.py +247 -0
- package/template/apps/agent-server/tests/test_api.py +16 -3
- package/template/apps/agent-server/tests/test_openai_provider.py +21 -4
- package/template/apps/agent-server/tests/test_postgres_store.py +3 -0
- package/template/apps/agent-server/tests/test_run_capacity.py +110 -0
- package/template/apps/agent-server/tests/test_runtime_factory_readiness.py +37 -0
- package/template/apps/agent-server/tests/test_sqlite_store.py +3 -0
- package/template/apps/agent-server/tests/test_vision_readiness_enforcement.py +72 -0
- package/template/apps/agent-server/tests/test_vlm_readiness.py +106 -0
- package/template/apps/document-server/src/southwind_document_server/adapter.py +117 -205
- package/template/apps/document-server/src/southwind_document_server/adapter_errors.py +13 -0
- package/template/apps/document-server/src/southwind_document_server/app.py +62 -14
- package/template/apps/document-server/src/southwind_document_server/artifacts.py +27 -0
- package/template/apps/document-server/src/southwind_document_server/config.py +96 -2
- package/template/apps/document-server/src/southwind_document_server/contracts.py +168 -13
- package/template/apps/document-server/src/southwind_document_server/fingerprint.py +128 -0
- package/template/apps/document-server/src/southwind_document_server/grants.py +81 -0
- package/template/apps/document-server/src/southwind_document_server/multipart_output.py +265 -0
- package/template/apps/document-server/src/southwind_document_server/output_validation.py +202 -0
- package/template/apps/document-server/src/southwind_document_server/progress.py +27 -0
- package/template/apps/document-server/src/southwind_document_server/readiness.py +280 -0
- package/template/apps/document-server/src/southwind_document_server/readiness_contracts.py +280 -0
- package/template/apps/document-server/src/southwind_document_server/readiness_http.py +87 -0
- package/template/apps/document-server/src/southwind_document_server/readiness_support.py +120 -0
- package/template/apps/document-server/src/southwind_document_server/request_validation.py +48 -0
- package/template/apps/document-server/src/southwind_document_server/service.py +297 -96
- package/template/apps/document-server/src/southwind_document_server/service_recovery.py +183 -0
- package/template/apps/document-server/src/southwind_document_server/sink.py +316 -0
- package/template/apps/document-server/src/southwind_document_server/store.py +301 -141
- package/template/apps/document-server/src/southwind_document_server/store_events.py +40 -0
- package/template/apps/document-server/src/southwind_document_server/store_models.py +62 -0
- package/template/apps/document-server/src/southwind_document_server/store_recovery.py +247 -0
- package/template/apps/document-server/src/southwind_document_server/store_schema.py +50 -0
- package/template/apps/document-server/tests/recovery_support.py +230 -0
- package/template/apps/document-server/tests/support.py +210 -0
- package/template/apps/document-server/tests/test_adapter.py +251 -0
- package/template/apps/document-server/tests/test_config.py +43 -0
- package/template/apps/document-server/tests/test_contracts.py +80 -0
- package/template/apps/document-server/tests/test_fingerprint.py +125 -0
- package/template/apps/document-server/tests/test_grants.py +46 -0
- package/template/apps/document-server/tests/test_handshake.py +154 -0
- package/template/apps/document-server/tests/test_integration.py +192 -0
- package/template/apps/document-server/tests/test_multipart_security.py +259 -0
- package/template/apps/document-server/tests/test_readiness.py +311 -0
- package/template/apps/document-server/tests/test_readiness_contracts.py +131 -0
- package/template/apps/document-server/tests/test_recovery.py +222 -0
- package/template/apps/document-server/tests/test_recovery_faults.py +101 -0
- package/template/apps/document-server/tests/test_recovery_races.py +283 -0
- package/template/apps/document-server/tests/test_service.py +16 -13
- package/template/apps/document-server/tests/test_service_artifacts.py +296 -0
- package/template/apps/document-server/tests/test_sink.py +253 -0
- package/template/apps/document-server/tests/test_store.py +199 -0
- package/template/apps/embedding-server/pyproject.toml +5 -0
- package/template/apps/embedding-server/src/southwind_embedding_server/adapter.py +38 -2
- package/template/apps/embedding-server/src/southwind_embedding_server/app.py +111 -3
- package/template/apps/embedding-server/src/southwind_embedding_server/config.py +27 -0
- package/template/apps/embedding-server/src/southwind_embedding_server/image_input.py +16 -5
- package/template/apps/embedding-server/src/southwind_embedding_server/run_cipher.py +31 -0
- package/template/apps/embedding-server/src/southwind_embedding_server/run_service.py +130 -0
- package/template/apps/embedding-server/src/southwind_embedding_server/run_store.py +250 -0
- package/template/apps/embedding-server/tests/test_adapter.py +25 -0
- package/template/apps/embedding-server/tests/test_run_http.py +185 -0
- package/template/apps/embedding-server/tests/test_run_service.py +200 -0
- package/template/apps/embedding-server/uv.lock +71 -0
- package/template/apps/server/Dockerfile +13 -0
- package/template/apps/server/package.json +1 -0
- package/template/apps/server/src/agent/drizzle-screenshot-intake-repository.integration.test.ts +283 -0
- package/template/apps/server/src/agent/drizzle-screenshot-intake-repository.ts +175 -0
- package/template/apps/server/src/agent/persistent-screenshot-intake-producer.ts +320 -0
- package/template/apps/server/src/agent/remote-runtime.ts +8 -1
- package/template/apps/server/src/agent/required-environment.ts +5 -0
- package/template/apps/server/src/agent/run-attach.ts +41 -0
- package/template/apps/server/src/agent/run-audit.ts +49 -0
- package/template/apps/server/src/agent/run-contracts.ts +6 -1
- package/template/apps/server/src/agent/run-facade.ts +66 -68
- package/template/apps/server/src/agent/run-route-input.ts +26 -1
- package/template/apps/server/src/agent/run-routes.ts +1 -0
- package/template/apps/server/src/agent/runtime-bootstrap-report.test.ts +1 -1
- package/template/apps/server/src/agent/runtime-bootstrap.ts +110 -60
- package/template/apps/server/src/agent/runtime-readiness-sources.test.ts +27 -0
- package/template/apps/server/src/agent/runtime-readiness-sources.ts +31 -0
- package/template/apps/server/src/agent/runtime-reporting-bootstrap.ts +40 -0
- package/template/apps/server/src/agent/screenshot-intake-authorization.ts +29 -0
- package/template/apps/server/src/agent/screenshot-intake-bootstrap.ts +61 -0
- package/template/apps/server/src/agent/screenshot-intake-durable.ts +53 -0
- package/template/apps/server/src/agent/screenshot-intake-errors.ts +9 -0
- package/template/apps/server/src/agent/screenshot-intake-producer.ts +41 -0
- package/template/apps/server/src/agent/screenshot-intake-record.ts +44 -0
- package/template/apps/server/src/agent/screenshot-intake-recovery.ts +106 -0
- package/template/apps/server/src/agent/screenshot-intake-repository.ts +64 -0
- package/template/apps/server/src/agent/screenshot-intake-reservation.ts +24 -0
- package/template/apps/server/src/agent/screenshot-intake-routes.ts +171 -0
- package/template/apps/server/src/agent/screenshot-intake-runtime-types.ts +6 -0
- package/template/apps/server/src/agent/screenshot-intake-sweep.ts +26 -0
- package/template/apps/server/src/agent/screenshot-intake-test-support.ts +87 -0
- package/template/apps/server/src/agent/screenshot-intake-v2-validation.ts +152 -0
- package/template/apps/server/src/agent/screenshot-intake-v2.test.ts +338 -0
- package/template/apps/server/src/agent/screenshot-intake-v2.ts +350 -0
- package/template/apps/server/src/agent/screenshot-png.ts +15 -0
- package/template/apps/server/src/agent/screenshot-run-binding.ts +34 -0
- package/template/apps/server/src/agent/unavailable-routes.ts +9 -0
- package/template/apps/server/src/agent/vision-facade.test.ts +98 -8
- package/template/apps/server/src/agent/vision-input.ts +5 -2
- package/template/apps/server/src/agent/vision-readiness-pin.ts +74 -0
- package/template/apps/server/src/agent/vision-readiness.ts +58 -0
- package/template/apps/server/src/ai-artifact/runtime-reference.test.ts +135 -0
- package/template/apps/server/src/ai-artifact/runtime.ts +134 -5
- package/template/apps/server/src/ai-output-artifact/cleanup.ts +214 -0
- package/template/apps/server/src/ai-output-artifact/contracts.ts +152 -0
- package/template/apps/server/src/ai-output-artifact/drizzle-cleanup.ts +37 -0
- package/template/apps/server/src/ai-output-artifact/drizzle-complete.ts +71 -0
- package/template/apps/server/src/ai-output-artifact/drizzle-grant-cleanup.ts +45 -0
- package/template/apps/server/src/ai-output-artifact/drizzle-grants.ts +109 -0
- package/template/apps/server/src/ai-output-artifact/drizzle-mapping.ts +77 -0
- package/template/apps/server/src/ai-output-artifact/drizzle-readiness.ts +46 -0
- package/template/apps/server/src/ai-output-artifact/drizzle-repository.ts +350 -0
- package/template/apps/server/src/ai-output-artifact/drizzle-seal.ts +64 -0
- package/template/apps/server/src/ai-output-artifact/grant.ts +30 -0
- package/template/apps/server/src/ai-output-artifact/host-registry.ts +53 -0
- package/template/apps/server/src/ai-output-artifact/memory-cleanup.ts +47 -0
- package/template/apps/server/src/ai-output-artifact/memory-grants.ts +98 -0
- package/template/apps/server/src/ai-output-artifact/memory-readiness.ts +26 -0
- package/template/apps/server/src/ai-output-artifact/memory-repository.ts +348 -0
- package/template/apps/server/src/ai-output-artifact/policy.test.ts +67 -0
- package/template/apps/server/src/ai-output-artifact/policy.ts +125 -0
- package/template/apps/server/src/ai-output-artifact/postgres-test-support.ts +147 -0
- package/template/apps/server/src/ai-output-artifact/postgres.integration.test.ts +349 -0
- package/template/apps/server/src/ai-output-artifact/reference-codec.ts +128 -0
- package/template/apps/server/src/ai-output-artifact/repository-grant-invariants.test-support.ts +165 -0
- package/template/apps/server/src/ai-output-artifact/repository-invariants.test-support.ts +239 -0
- package/template/apps/server/src/ai-output-artifact/repository-invariants.test.ts +18 -0
- package/template/apps/server/src/ai-output-artifact/repository.ts +107 -0
- package/template/apps/server/src/ai-output-artifact/route-input.ts +173 -0
- package/template/apps/server/src/ai-output-artifact/routes-delete.test.ts +287 -0
- package/template/apps/server/src/ai-output-artifact/routes-grant.test.ts +116 -0
- package/template/apps/server/src/ai-output-artifact/routes-nonblocking-body.test.ts +136 -0
- package/template/apps/server/src/ai-output-artifact/routes-security.test.ts +176 -0
- package/template/apps/server/src/ai-output-artifact/routes-storage-error.test.ts +105 -0
- package/template/apps/server/src/ai-output-artifact/routes.test-support.ts +84 -0
- package/template/apps/server/src/ai-output-artifact/routes.test.ts +198 -0
- package/template/apps/server/src/ai-output-artifact/routes.ts +280 -0
- package/template/apps/server/src/ai-output-artifact/service-completion.ts +60 -0
- package/template/apps/server/src/ai-output-artifact/service-grants.test.ts +169 -0
- package/template/apps/server/src/ai-output-artifact/service-grants.ts +217 -0
- package/template/apps/server/src/ai-output-artifact/service-input.ts +175 -0
- package/template/apps/server/src/ai-output-artifact/service-read.ts +89 -0
- package/template/apps/server/src/ai-output-artifact/service-recovery.test.ts +238 -0
- package/template/apps/server/src/ai-output-artifact/service-support.ts +240 -0
- package/template/apps/server/src/ai-output-artifact/service.test.ts +283 -0
- package/template/apps/server/src/ai-output-artifact/service.ts +334 -0
- package/template/apps/server/src/ai-output-artifact/storage-recovery.ts +33 -0
- package/template/apps/server/src/ai-output-artifact/storage-writer.ts +103 -0
- package/template/apps/server/src/ai-output-artifact/test-support.ts +161 -0
- package/template/apps/server/src/ai-runtime-readiness/health-response.ts +92 -0
- package/template/apps/server/src/ai-runtime-readiness/operation-port-trust.test.ts +66 -0
- package/template/apps/server/src/ai-runtime-readiness/operation-port.test-support.ts +143 -0
- package/template/apps/server/src/ai-runtime-readiness/operation-port.test.ts +193 -0
- package/template/apps/server/src/ai-runtime-readiness/operation-port.ts +172 -0
- package/template/apps/server/src/ai-runtime-readiness/trust-store.ts +61 -0
- package/template/apps/server/src/app/ai-screenshot-intake-binding.ts +22 -0
- package/template/apps/server/src/app/document-output-artifact-bindings.ts +5 -0
- package/template/apps/server/src/app/speech-output-artifact-bindings.ts +5 -0
- package/template/apps/server/src/application-services.ts +9 -3
- package/template/apps/server/src/audit/redaction.ts +1 -0
- package/template/apps/server/src/audit/reliable-writer.test.ts +8 -0
- package/template/apps/server/src/auth/password-change-license-restriction.test.ts +156 -0
- package/template/apps/server/src/document/cancel-response.ts +33 -0
- package/template/apps/server/src/document/contracts.ts +6 -0
- package/template/apps/server/src/document/errors.ts +11 -0
- package/template/apps/server/src/document/facade-cancel.test.ts +226 -0
- package/template/apps/server/src/document/facade-cancel.ts +110 -0
- package/template/apps/server/src/document/facade-grant-handoff.test.ts +113 -0
- package/template/apps/server/src/document/facade-idempotency.test.ts +195 -0
- package/template/apps/server/src/document/facade-invocation.ts +46 -0
- package/template/apps/server/src/document/facade-output-artifact.test.ts +310 -0
- package/template/apps/server/src/document/facade-read-response.ts +116 -0
- package/template/apps/server/src/document/facade-readiness.test.ts +95 -0
- package/template/apps/server/src/document/facade-support.ts +297 -0
- package/template/apps/server/src/document/facade.ts +164 -173
- package/template/apps/server/src/document/output-artifact-composition.test.ts +64 -0
- package/template/apps/server/src/document/output-artifact-composition.ts +78 -0
- package/template/apps/server/src/document/output-artifact-fingerprint.contract.test.ts +110 -0
- package/template/apps/server/src/document/output-artifact-fingerprint.ts +150 -0
- package/template/apps/server/src/document/output-artifact-host-registry.ts +44 -0
- package/template/apps/server/src/document/output-artifact-host.test.ts +332 -0
- package/template/apps/server/src/document/output-artifact-host.ts +331 -0
- package/template/apps/server/src/document/output-artifact-manifest.test-support.ts +71 -0
- package/template/apps/server/src/document/output-artifact-publish.test-support.ts +48 -0
- package/template/apps/server/src/document/output-artifact-readiness-probe.ts +347 -0
- package/template/apps/server/src/document/output-artifact-readiness-timeout.ts +30 -0
- package/template/apps/server/src/document/output-artifact-readiness.test.ts +264 -0
- package/template/apps/server/src/document/output-artifact-readiness.ts +87 -0
- package/template/apps/server/src/document/output-artifact-route-composition.test.ts +27 -0
- package/template/apps/server/src/document/output-artifact-route-composition.ts +14 -0
- package/template/apps/server/src/document/output-artifact-runtime.test-support.ts +8 -0
- package/template/apps/server/src/document/output-artifact-runtime.test.ts +124 -0
- package/template/apps/server/src/document/output-artifact-runtime.ts +275 -0
- package/template/apps/server/src/document/output-artifact.test-support.ts +350 -0
- package/template/apps/server/src/document/remote-response.ts +162 -0
- package/template/apps/server/src/document/remote-runtime.test.ts +100 -4
- package/template/apps/server/src/document/remote-runtime.ts +37 -85
- package/template/apps/server/src/document/routes-read-response.test.ts +267 -0
- package/template/apps/server/src/document/routes.test.ts +109 -0
- package/template/apps/server/src/document/routes.ts +23 -14
- package/template/apps/server/src/embedding/audit.ts +46 -0
- package/template/apps/server/src/embedding/contracts.ts +13 -0
- package/template/apps/server/src/embedding/drizzle-run-binding-repository.integration.test.ts +100 -0
- package/template/apps/server/src/embedding/drizzle-run-binding-repository.ts +102 -0
- package/template/apps/server/src/embedding/facade-types.ts +18 -0
- package/template/apps/server/src/embedding/facade.ts +242 -111
- package/template/apps/server/src/embedding/operation-authorization.ts +23 -0
- package/template/apps/server/src/embedding/remote-runtime.test.ts +18 -0
- package/template/apps/server/src/embedding/remote-runtime.ts +77 -0
- package/template/apps/server/src/embedding/routes.test.ts +118 -0
- package/template/apps/server/src/embedding/routes.ts +98 -0
- package/template/apps/server/src/embedding/run-artifact.ts +18 -0
- package/template/apps/server/src/embedding/run-authorization.test.ts +133 -0
- package/template/apps/server/src/embedding/run-authorization.ts +91 -0
- package/template/apps/server/src/embedding/run-binding-repository.ts +75 -0
- package/template/apps/server/src/embedding/run-fingerprint.test.ts +52 -0
- package/template/apps/server/src/embedding/run-fingerprint.ts +39 -0
- package/template/apps/server/src/embedding/terminal-observer.test.ts +26 -0
- package/template/apps/server/src/embedding/terminal-observer.ts +44 -0
- package/template/apps/server/src/index.ts +38 -31
- package/template/apps/server/src/module-host/ai-operation-port.ts +3 -3
- package/template/apps/server/src/module-host/durable-context.ts +194 -16
- package/template/apps/server/src/module-host/durable-handler-registration.ts +1 -0
- package/template/apps/server/src/module-host/durable-storage-filesystem-restart.test.ts +265 -0
- package/template/apps/server/src/module-host/durable-storage-write.test.ts +345 -0
- package/template/apps/server/src/module-host/http-runtime.ts +25 -0
- package/template/apps/server/src/module-host/initialize-contracts.ts +18 -1
- package/template/apps/server/src/module-host/initialize.test.ts +18 -0
- package/template/apps/server/src/module-host/initialize.ts +42 -2
- package/template/apps/server/src/module-host/module-secret-audit-version.test.ts +73 -0
- package/template/apps/server/src/module-host/module-secret-binding-resolution.ts +60 -0
- package/template/apps/server/src/module-host/module-secret-durable.test.ts +206 -0
- package/template/apps/server/src/module-host/module-secret-port.test-support.ts +125 -0
- package/template/apps/server/src/module-host/module-secret-port.test.ts +161 -0
- package/template/apps/server/src/module-host/module-secret-port.ts +249 -0
- package/template/apps/server/src/module-host/module-secret-result.test.ts +324 -0
- package/template/apps/server/src/module-host/module-secret-result.ts +274 -0
- package/template/apps/server/src/module-host/module-secret-tool-boundary.test.ts +143 -0
- package/template/apps/server/src/module-host/project-composition.ts +1 -0
- package/template/apps/server/src/module-host/report-staging-port.ts +55 -0
- package/template/apps/server/src/module-host/report-staging-registration.test.ts +104 -0
- package/template/apps/server/src/module-host/request-context.ts +58 -1
- package/template/apps/server/src/module-host/route-declaration.ts +11 -4
- package/template/apps/server/src/module-host/route-installer.test-fixture.ts +246 -0
- package/template/apps/server/src/module-host/route-installer.test.ts +47 -211
- package/template/apps/server/src/module-host/route-installer.ts +192 -21
- package/template/apps/server/src/module-host/route-registration.test.ts +44 -4
- package/template/apps/server/src/module-host/runtime-composition.ts +2 -0
- package/template/apps/server/src/module-host/scoped-host.ts +84 -0
- package/template/apps/server/src/module-host/screenshot-artifact-ref.ts +91 -0
- package/template/apps/server/src/module-host/screenshot-intake-composition.test.ts +292 -0
- package/template/apps/server/src/module-host/screenshot-intake-deadline.ts +38 -0
- package/template/apps/server/src/module-host/screenshot-intake-plan.ts +75 -0
- package/template/apps/server/src/module-host/screenshot-intake-port.ts +297 -0
- package/template/apps/server/src/module-host/screenshot-intake-security.test.ts +311 -0
- package/template/apps/server/src/module-host/screenshot-intake-store.ts +76 -0
- package/template/apps/server/src/module-host/screenshot-intake-test-support.ts +68 -0
- package/template/apps/server/src/module-host/secret-bindings.test.ts +167 -0
- package/template/apps/server/src/module-host/secret-bindings.ts +184 -0
- package/template/apps/server/src/module-host/storage-authorization-binding.test.ts +242 -0
- package/template/apps/server/src/module-host/storage-port.test.ts +8 -1
- package/template/apps/server/src/module-host/storage-port.ts +84 -8
- package/template/apps/server/src/module-host/storage-restart-fixture.test-support.ts +242 -0
- package/template/apps/server/src/module-host/storage-restart-postgres.integration.test.ts +280 -0
- package/template/apps/server/src/module-host/storage-scope-drift-http.test.ts +68 -0
- package/template/apps/server/src/module-host/storage-scope.ts +52 -1
- package/template/apps/server/src/module-host/storage-stream-route.test.ts +282 -0
- package/template/apps/server/src/module-host/storage-write-error.test.ts +174 -0
- package/template/apps/server/src/module-host/storage-write-error.ts +62 -0
- package/template/apps/server/src/module-host/storage-write-port.test.ts +323 -0
- package/template/apps/server/src/module-host/storage-write-port.ts +320 -0
- package/template/apps/server/src/module-host/storage-write-unavailable.ts +21 -0
- package/template/apps/server/src/module-host/storage-writer-retention.test.ts +109 -0
- package/template/apps/server/src/module-host/user-directory-composition.test.ts +1 -0
- package/template/apps/server/src/module-preflight-secret.test.ts +79 -0
- package/template/apps/server/src/module-preflight.ts +5 -0
- package/template/apps/server/src/platform-http-runtime.ts +16 -4
- package/template/apps/server/src/report-staging/archive-frame-stream.test.ts +209 -0
- package/template/apps/server/src/report-staging/archive-frame-stream.ts +341 -0
- package/template/apps/server/src/report-staging/archive-process.test.ts +302 -0
- package/template/apps/server/src/report-staging/archive-process.ts +257 -0
- package/template/apps/server/src/report-staging/archive-volumes.ts +30 -0
- package/template/apps/server/src/report-staging/cancellation.ts +13 -0
- package/template/apps/server/src/report-staging/contracts.ts +94 -0
- package/template/apps/server/src/report-staging/drizzle-lifecycle.ts +278 -0
- package/template/apps/server/src/report-staging/drizzle-mapping.ts +140 -0
- package/template/apps/server/src/report-staging/drizzle-repository.integration.test.ts +346 -0
- package/template/apps/server/src/report-staging/drizzle-repository.ts +255 -0
- package/template/apps/server/src/report-staging/drizzle-seal.integration.test.ts +267 -0
- package/template/apps/server/src/report-staging/drizzle-seal.ts +177 -0
- package/template/apps/server/src/report-staging/filesystem-cleanup.test.ts +68 -0
- package/template/apps/server/src/report-staging/filesystem-cleanup.ts +102 -0
- package/template/apps/server/src/report-staging/filesystem-errors.ts +15 -0
- package/template/apps/server/src/report-staging/filesystem-identifiers.ts +19 -0
- package/template/apps/server/src/report-staging/filesystem-io.test.ts +85 -0
- package/template/apps/server/src/report-staging/filesystem-io.ts +206 -0
- package/template/apps/server/src/report-staging/filesystem-scan.ts +85 -0
- package/template/apps/server/src/report-staging/filesystem-store.ts +346 -0
- package/template/apps/server/src/report-staging/heartbeat.test.ts +47 -0
- package/template/apps/server/src/report-staging/heartbeat.ts +53 -0
- package/template/apps/server/src/report-staging/manifest-stream.ts +46 -0
- package/template/apps/server/src/report-staging/memory-repository.ts +256 -0
- package/template/apps/server/src/report-staging/metadata-catalog.ts +89 -0
- package/template/apps/server/src/report-staging/metadata-spool-paths.ts +195 -0
- package/template/apps/server/src/report-staging/metadata-spool-schema.ts +54 -0
- package/template/apps/server/src/report-staging/metadata-spool.test.ts +214 -0
- package/template/apps/server/src/report-staging/metadata-spool.ts +305 -0
- package/template/apps/server/src/report-staging/native/archive-frame-helper.c +309 -0
- package/template/apps/server/src/report-staging/path-policy.test.ts +127 -0
- package/template/apps/server/src/report-staging/path-policy.ts +263 -0
- package/template/apps/server/src/report-staging/repository-fence.test.ts +114 -0
- package/template/apps/server/src/report-staging/repository.ts +75 -0
- package/template/apps/server/src/report-staging/runtime.ts +31 -0
- package/template/apps/server/src/report-staging/sealed-file.test.ts +34 -0
- package/template/apps/server/src/report-staging/sealed-file.ts +137 -0
- package/template/apps/server/src/report-staging/service-input-limits.test.ts +62 -0
- package/template/apps/server/src/report-staging/service-input.ts +204 -0
- package/template/apps/server/src/report-staging/service-lifecycle.test.ts +132 -0
- package/template/apps/server/src/report-staging/service-read-fence.test.ts +37 -0
- package/template/apps/server/src/report-staging/service-read.ts +172 -0
- package/template/apps/server/src/report-staging/service-support.ts +149 -0
- package/template/apps/server/src/report-staging/service.test-fixture.ts +226 -0
- package/template/apps/server/src/report-staging/service.test.ts +314 -0
- package/template/apps/server/src/report-staging/service.ts +255 -0
- package/template/apps/server/src/report-staging/supervised-process.ts +194 -0
- package/template/apps/server/src/speech/contracts.ts +8 -0
- package/template/apps/server/src/speech/errors.ts +10 -0
- package/template/apps/server/src/speech/facade-contract.ts +49 -0
- package/template/apps/server/src/speech/facade-output.test.ts +299 -0
- package/template/apps/server/src/speech/facade-output.ts +298 -0
- package/template/apps/server/src/speech/facade-validation.ts +127 -0
- package/template/apps/server/src/speech/facade.ts +185 -151
- package/template/apps/server/src/speech/fingerprint.test.ts +42 -0
- package/template/apps/server/src/speech/fingerprint.ts +28 -0
- package/template/apps/server/src/speech/output-artifact-binding.test.ts +11 -0
- package/template/apps/server/src/speech/output-artifact-binding.ts +30 -0
- package/template/apps/server/src/speech/output-artifact-error.ts +9 -0
- package/template/apps/server/src/speech/output-artifact-host.test-support.ts +73 -0
- package/template/apps/server/src/speech/output-artifact-host.test.ts +302 -0
- package/template/apps/server/src/speech/output-artifact-host.ts +279 -0
- package/template/apps/server/src/speech/output-artifact-policy.ts +114 -0
- package/template/apps/server/src/speech/output-artifact-replay.ts +91 -0
- package/template/apps/server/src/speech/remote-response.ts +158 -0
- package/template/apps/server/src/speech/remote-runtime.test.ts +90 -0
- package/template/apps/server/src/speech/remote-runtime.ts +36 -78
- package/template/apps/server/src/speech/routes.ts +60 -16
- package/template/apps/server/src/startup-finalization.ts +52 -0
- package/template/apps/server/src/startup-preflight.ts +2 -0
- package/template/apps/server/src/startup-shutdown.test.ts +69 -0
- package/template/apps/server/src/startup-shutdown.ts +61 -0
- package/template/apps/server/src/storage/drizzle-upload-purge.ts +61 -0
- package/template/apps/server/src/storage/drizzle-upload-references.ts +23 -0
- package/template/apps/server/src/storage/drizzle-upload-repository.integration.test.ts +103 -0
- package/template/apps/server/src/storage/drizzle-upload-repository.ts +109 -14
- package/template/apps/server/src/storage/host-runtime.ts +15 -0
- package/template/apps/server/src/storage/routes-stream-cancellation.test.ts +154 -0
- package/template/apps/server/src/storage/routes.test.ts +13 -2
- package/template/apps/server/src/storage/routes.ts +57 -18
- package/template/apps/server/src/storage/runtime.ts +17 -4
- package/template/apps/server/src/system/route-types.ts +5 -1
- package/template/apps/server/src/system/system-resource-monitoring.test.ts +47 -0
- package/template/apps/server/src/system/system-resource-monitoring.ts +60 -10
- package/template/apps/server/src/work-order/routes.test.ts +1 -0
- package/template/apps/speech-server/src/southwind_speech_server/adapter.py +58 -17
- package/template/apps/speech-server/src/southwind_speech_server/app.py +24 -17
- package/template/apps/speech-server/src/southwind_speech_server/bounded_json.py +60 -0
- package/template/apps/speech-server/src/southwind_speech_server/config.py +122 -2
- package/template/apps/speech-server/src/southwind_speech_server/contracts.py +58 -0
- package/template/apps/speech-server/src/southwind_speech_server/errors.py +8 -0
- package/template/apps/speech-server/src/southwind_speech_server/normalizer.py +14 -0
- package/template/apps/speech-server/src/southwind_speech_server/output_artifact.py +190 -0
- package/template/apps/speech-server/src/southwind_speech_server/output_validation.py +54 -0
- package/template/apps/speech-server/src/southwind_speech_server/pin_cli.py +83 -0
- package/template/apps/speech-server/src/southwind_speech_server/readiness.py +266 -0
- package/template/apps/speech-server/src/southwind_speech_server/readiness_contracts.py +268 -0
- package/template/apps/speech-server/src/southwind_speech_server/readiness_http.py +91 -0
- package/template/apps/speech-server/src/southwind_speech_server/readiness_local.py +161 -0
- package/template/apps/speech-server/src/southwind_speech_server/readiness_support.py +106 -0
- package/template/apps/speech-server/src/southwind_speech_server/service.py +118 -13
- package/template/apps/speech-server/src/southwind_speech_server/store.py +7 -0
- package/template/apps/speech-server/tests/test_bounded_json.py +55 -0
- package/template/apps/speech-server/tests/test_config.py +22 -0
- package/template/apps/speech-server/tests/test_output_artifact.py +60 -0
- package/template/apps/speech-server/tests/test_output_validation.py +44 -0
- package/template/apps/speech-server/tests/test_readiness.py +315 -0
- package/template/apps/speech-server/tests/test_readiness_http.py +48 -0
- package/template/apps/speech-server/tests/test_readiness_local.py +43 -0
- package/template/apps/speech-server/tests/test_service.py +211 -36
- package/template/apps/web/src/pages/system/components/OperationGpuMonitor.vue +23 -3
- package/template/apps/web/src/pages/system/components/OperationGpuMonitor.webtest.ts +29 -0
- package/template/apps/web/src/pages/system/components/OperationServiceMonitor.vue +2 -1
- package/template/apps/web/src/pages/system/components/OperationServiceMonitor.webtest.ts +4 -1
- package/template/docker-compose.yml +38 -1
- package/template/docs/architecture/ai-runtime-readiness.md +498 -0
- package/template/docs/architecture/ai-runtime.md +20 -4
- package/template/docs/architecture/durable-jobs.md +54 -5
- package/template/docs/architecture/module-host.md +72 -9
- package/template/docs/architecture/module-manifest-composition.md +5 -2
- package/template/docs/architecture/module-secret-resolution.md +250 -0
- package/template/docs/architecture/object-storage.md +144 -3
- package/template/docs/architecture/report-staging.md +158 -0
- package/template/docs/architecture/server-module-interface.md +29 -0
- package/template/docs/architecture/speech-variants.md +45 -0
- package/template/docs/platform/agent-tools.md +16 -0
- package/template/docs/platform/document-ai-runtime.md +199 -17
- package/template/docs/platform/module-configuration.md +5 -0
- package/template/docs/platform/speech-ai-runtime.md +34 -5
- package/template/docs/platform/vision-ai-runtime.md +24 -0
- package/template/package.json +4 -1
- package/template/packages/ai-client/package.json +1 -1
- package/template/packages/ai-client/src/agent/client/client.ts +3 -0
- package/template/packages/ai-client/src/agent/client/index.ts +1 -0
- package/template/packages/ai-client/src/agent/client/screenshot.test.ts +40 -0
- package/template/packages/ai-client/src/agent/client/screenshot.ts +146 -0
- package/template/packages/ai-client/src/agent/client/types.ts +2 -0
- package/template/packages/ai-client/src/agent/contracts/runs.ts +1 -0
- package/template/packages/ai-client/src/embedding/client.test.ts +52 -0
- package/template/packages/ai-client/src/embedding/client.ts +69 -0
- package/template/packages/ai-client/src/embedding/contracts.ts +47 -0
- package/template/packages/ai-client/src/embedding/index.ts +1 -0
- package/template/packages/ai-client/src/embedding/run.ts +130 -0
- package/template/packages/ai-client/src/speech/client.test.ts +26 -0
- package/template/packages/ai-client/src/speech/client.ts +25 -1
- package/template/packages/ai-client/src/speech/contracts.ts +19 -0
- package/template/packages/config/package.json +1 -1
- package/template/packages/database/drizzle/0048_illegal_magneto.sql +11 -0
- package/template/packages/database/drizzle/0049_right_lenny_balinger.sql +79 -0
- package/template/packages/database/drizzle/0050_greedy_sister_grimm.sql +92 -0
- package/template/packages/database/drizzle/0051_lame_shockwave.sql +19 -0
- package/template/packages/database/drizzle/0052_tiresome_komodo.sql +1 -0
- package/template/packages/database/drizzle/0053_calm_victor_mancha.sql +1 -0
- package/template/packages/database/drizzle/0054_tough_thanos.sql +29 -0
- package/template/packages/database/drizzle/meta/0048_snapshot.json +8852 -0
- package/template/packages/database/drizzle/meta/0049_snapshot.json +9410 -0
- package/template/packages/database/drizzle/meta/0050_snapshot.json +10115 -0
- package/template/packages/database/drizzle/meta/0051_snapshot.json +10257 -0
- package/template/packages/database/drizzle/meta/0052_snapshot.json +10263 -0
- package/template/packages/database/drizzle/meta/0053_snapshot.json +10270 -0
- package/template/packages/database/drizzle/meta/0054_snapshot.json +10468 -0
- package/template/packages/database/drizzle/meta/_journal.json +49 -0
- package/template/packages/database/package.json +1 -1
- package/template/packages/database/src/agent-runtime-schema.test.ts +15 -0
- package/template/packages/database/src/ai-output-artifacts.test.ts +57 -0
- package/template/packages/database/src/schema/agent-runtime.ts +43 -0
- package/template/packages/database/src/schema/ai-output-artifacts.ts +182 -0
- package/template/packages/database/src/schema/embedding-runtime.ts +62 -0
- package/template/packages/database/src/schema/file-storage.ts +18 -0
- package/template/packages/database/src/schema/index.ts +3 -0
- package/template/packages/database/src/schema/report-staging.ts +212 -0
- package/template/packages/database/src/schema.test.ts +19 -0
- package/template/packages/jobs/package.json +1 -1
- package/template/packages/modules/index.ts +1 -0
- package/template/packages/modules/package.json +1 -1
- package/template/packages/modules/src/ai-operation-composition.test.ts +37 -0
- package/template/packages/modules/src/ai-operation-composition.ts +2 -0
- package/template/packages/modules/src/ai-operation-readiness-contract.test.ts +38 -0
- package/template/packages/modules/src/ai-operation-readiness-contract.ts +34 -0
- package/template/packages/modules/src/capability-audit-validation.ts +20 -0
- package/template/packages/modules/src/capability-guard-validation.ts +41 -0
- package/template/packages/modules/src/composition.ts +11 -0
- package/template/packages/modules/src/manifest.ts +40 -0
- package/template/packages/modules/src/secret-composition.test.ts +308 -0
- package/template/packages/modules/src/secret-composition.ts +176 -0
- package/template/packages/modules/src/system-api-control-plane.ts +17 -1
- package/template/packages/modules/src/system-module-catalog.test.ts +52 -0
- package/template/packages/modules/src/system-module-catalog.ts +1 -1
- package/template/packages/server-sdk/contracts/ai-runtime-readiness/v1/document-python-parity.json +12 -0
- package/template/packages/server-sdk/contracts/ai-runtime-readiness/v1/document.json +70 -0
- package/template/packages/server-sdk/contracts/ai-runtime-readiness/v1/embedding.json +68 -0
- package/template/packages/server-sdk/contracts/ai-runtime-readiness/v1/speech.json +80 -0
- package/template/packages/server-sdk/contracts/ai-runtime-readiness/v1/vlm.json +70 -0
- package/template/packages/server-sdk/contracts/document-runtime/v1/fingerprint-fixture.json +101 -0
- package/template/packages/server-sdk/index.ts +109 -0
- package/template/packages/server-sdk/package.json +22 -3
- package/template/packages/server-sdk/src/ai-runtime-readiness-capture.ts +168 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-digest.ts +49 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-identity.ts +16 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-keys.ts +23 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-limits.ts +141 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-projection.ts +326 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-requirement.ts +31 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-time.ts +16 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-trust.ts +84 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-validation-values.ts +147 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-validation.ts +299 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness-values.ts +42 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.adversarial-input.contract.test.ts +146 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.contract-support.ts +139 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.contract.test.ts +314 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.digest-safety.contract.test.ts +131 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.fail-closed.contract.test.ts +215 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.identity.contract.test.ts +138 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.input-safety.contract.test.ts +314 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.public-api.test.ts +18 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.python-parity.contract.test.ts +160 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.trust.contract.test.ts +135 -0
- package/template/packages/server-sdk/src/ai-runtime-readiness.ts +198 -0
- package/template/packages/server-sdk/src/ai-screenshot-intake-port.ts +58 -0
- package/template/packages/server-sdk/src/data-governance-registration.ts +1 -3
- package/template/packages/server-sdk/src/durable-handler.ts +12 -0
- package/template/packages/server-sdk/src/module-adapter.test.ts +10 -0
- package/template/packages/server-sdk/src/module-adapter.ts +3 -0
- package/template/packages/server-sdk/src/module-host.ts +8 -0
- package/template/packages/server-sdk/src/report-staging-context-compatibility.test.ts +25 -0
- package/template/packages/server-sdk/src/report-staging-port.ts +190 -0
- package/template/packages/server-sdk/src/request-context.ts +27 -1
- package/template/packages/server-sdk/src/route-definition.ts +6 -0
- package/template/packages/server-sdk/src/secret-binding.test.ts +66 -0
- package/template/packages/server-sdk/src/secret-binding.ts +54 -0
- package/template/packages/server-sdk/src/secret-context-compatibility.test.ts +77 -0
- package/template/packages/server-sdk/src/secret-port.ts +80 -0
- package/template/packages/server-sdk/src/storage-port.ts +129 -9
- package/template/packages/server-sdk/src/storage-v052-source-compatibility.test.ts +61 -0
- package/template/packages/shared/index.ts +2 -0
- package/template/packages/shared/package.json +4 -1
- package/template/packages/shared/src/ai-operation-readiness.test.ts +75 -0
- package/template/packages/shared/src/ai-operation-readiness.ts +170 -0
- package/template/packages/shared/src/license-catalog.ts +14 -9
- package/template/packages/shared/src/stable-key.ts +26 -0
- package/template/packages/shared/tsconfig.json +16 -0
- package/template/packages/storage/index.ts +2 -0
- package/template/packages/storage/package.json +1 -1
- package/template/packages/storage/src/in-memory-upload-repository.ts +105 -2
- package/template/packages/storage/src/local-file-blob-store.test.ts +58 -0
- package/template/packages/storage/src/local-file-blob-store.ts +5 -71
- package/template/packages/storage/src/local-file-blob-writer.ts +96 -0
- package/template/packages/storage/src/upload-abort-recovery.test.ts +234 -0
- package/template/packages/storage/src/upload-abort.ts +130 -0
- package/template/packages/storage/src/upload-cleanup-race.test.ts +207 -0
- package/template/packages/storage/src/upload-cleanup.ts +85 -0
- package/template/packages/storage/src/upload-completion.ts +52 -0
- package/template/packages/storage/src/upload-purge.test.ts +163 -0
- package/template/packages/storage/src/upload-purge.ts +261 -0
- package/template/packages/storage/src/upload-repository-v052-compatibility.test.ts +31 -0
- package/template/packages/storage/src/upload-repository.ts +61 -0
- package/template/packages/storage/src/upload-service-recovery.test.ts +296 -0
- package/template/packages/storage/src/upload-service.ts +138 -150
- package/template/packages/storage/src/upload-streams.ts +126 -30
- package/template/packages/storage/src/upload-types.ts +13 -0
- package/template/packages/storage/src/upload-validation.ts +127 -0
- package/template/scripts/provision-speech-readiness.ts +147 -0
package/dist/cli.js
CHANGED
|
@@ -34,8 +34,8 @@ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports,
|
|
|
34
34
|
var __require = import.meta.require;
|
|
35
35
|
|
|
36
36
|
// ../../node_modules/.bun/cli-width@4.1.0/node_modules/cli-width/index.js
|
|
37
|
-
var require_cli_width = __commonJS((exports,
|
|
38
|
-
|
|
37
|
+
var require_cli_width = __commonJS((exports, module2) => {
|
|
38
|
+
module2.exports = cliWidth;
|
|
39
39
|
function normalizeOpts(options) {
|
|
40
40
|
const defaultOpts = {
|
|
41
41
|
defaultWidth: 0,
|
|
@@ -74,7 +74,7 @@ var require_cli_width = __commonJS((exports, module3) => {
|
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
// ../../node_modules/.bun/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js
|
|
77
|
-
var require_lib = __commonJS((exports,
|
|
77
|
+
var require_lib = __commonJS((exports, module2) => {
|
|
78
78
|
var Stream = __require("stream");
|
|
79
79
|
|
|
80
80
|
class MuteStream extends Stream {
|
|
@@ -190,7 +190,7 @@ var require_lib = __commonJS((exports, module3) => {
|
|
|
190
190
|
return this.#proxy("close", ...args);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
module2.exports = MuteStream;
|
|
194
194
|
});
|
|
195
195
|
|
|
196
196
|
// src/arguments.ts
|
|
@@ -239,29 +239,89 @@ function validateModuleDistributionCatalog(manifests) {
|
|
|
239
239
|
return manifests;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
+
// src/optional-module-base.ts
|
|
243
|
+
function optionalModule(name, label, description, dependencies) {
|
|
244
|
+
const selection = "optional";
|
|
245
|
+
return {
|
|
246
|
+
name,
|
|
247
|
+
version: "0.1.0",
|
|
248
|
+
windyRange: "^0.5.0",
|
|
249
|
+
label,
|
|
250
|
+
description,
|
|
251
|
+
selection,
|
|
252
|
+
runtimeActivation: "toggle",
|
|
253
|
+
deploymentInstall: "project-composition-required",
|
|
254
|
+
dependencies,
|
|
255
|
+
conflicts: [],
|
|
256
|
+
runtimePackage: null,
|
|
257
|
+
packages: [],
|
|
258
|
+
registryDependencies: [],
|
|
259
|
+
fileRoots: [],
|
|
260
|
+
documentation: [],
|
|
261
|
+
schemaFiles: [],
|
|
262
|
+
migrationRoots: [],
|
|
263
|
+
databaseTables: [],
|
|
264
|
+
databaseLineageOwner: "platform",
|
|
265
|
+
transientDatabaseTables: [],
|
|
266
|
+
databaseStatementTokens: [],
|
|
267
|
+
uninstallPolicy: "retain-data",
|
|
268
|
+
installRecipe: `module-${name}-install`,
|
|
269
|
+
updateRecipes: [`module-${name}-update-0.1.0`],
|
|
270
|
+
uninstallRecipe: `module-${name}-uninstall`
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// src/optional-module-storage.ts
|
|
275
|
+
var storageOptionalModule = {
|
|
276
|
+
...optionalModule("system.storage", "\u6587\u4EF6\u5B58\u50A8", "\u4E0A\u4F20\u3001\u4E0B\u8F7D\u548C\u5BF9\u8C61\u751F\u547D\u5468\u671F\u3002", ["system", "system.settings", "system.scheduler"]),
|
|
277
|
+
runtimeActivation: "physical-only",
|
|
278
|
+
registryDependencies: [
|
|
279
|
+
{
|
|
280
|
+
sourceName: "unicode-case-folding",
|
|
281
|
+
name: "unicode-case-folding",
|
|
282
|
+
version: "1.1.1"
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
fileRoots: [
|
|
286
|
+
"apps/server/src/storage",
|
|
287
|
+
"apps/server/src/report-staging",
|
|
288
|
+
"apps/server/src/module-host/durable-storage-filesystem-restart.test.ts",
|
|
289
|
+
"apps/server/src/module-host/durable-storage-write.test.ts",
|
|
290
|
+
"apps/server/src/module-host/report-staging-port.ts",
|
|
291
|
+
"apps/server/src/module-host/route-installer.test.ts",
|
|
292
|
+
"apps/server/src/module-host/route-installer.test-fixture.ts",
|
|
293
|
+
"apps/server/src/module-host/storage-authorization-binding.test.ts",
|
|
294
|
+
"apps/server/src/module-host/storage-port.test.ts",
|
|
295
|
+
"apps/server/src/module-host/storage-restart-fixture.test-support.ts",
|
|
296
|
+
"apps/server/src/module-host/storage-restart-postgres.integration.test.ts",
|
|
297
|
+
"apps/server/src/module-host/storage-scope-drift-http.test.ts",
|
|
298
|
+
"apps/server/src/module-host/storage-stream-route.test.ts"
|
|
299
|
+
],
|
|
300
|
+
documentation: [
|
|
301
|
+
"docs/architecture/object-storage.md",
|
|
302
|
+
"docs/architecture/report-staging.md"
|
|
303
|
+
],
|
|
304
|
+
schemaFiles: [
|
|
305
|
+
"packages/database/src/schema/file-storage.ts",
|
|
306
|
+
"packages/database/src/schema/report-staging.ts"
|
|
307
|
+
],
|
|
308
|
+
databaseTables: [
|
|
309
|
+
"file_upload_sessions",
|
|
310
|
+
"file_upload_parts",
|
|
311
|
+
"file_metadata",
|
|
312
|
+
"report_staging_groups",
|
|
313
|
+
"report_staging_sources",
|
|
314
|
+
"report_staging_entries",
|
|
315
|
+
"report_staging_read_leases",
|
|
316
|
+
"report_staging_claims"
|
|
317
|
+
]
|
|
318
|
+
};
|
|
319
|
+
|
|
242
320
|
// src/optional-module-distribution.ts
|
|
243
321
|
var optionalModuleManifests = [
|
|
322
|
+
storageOptionalModule,
|
|
244
323
|
{
|
|
245
|
-
...
|
|
246
|
-
"system",
|
|
247
|
-
"system.settings"
|
|
248
|
-
]),
|
|
249
|
-
runtimeActivation: "physical-only",
|
|
250
|
-
fileRoots: [
|
|
251
|
-
"apps/server/src/storage",
|
|
252
|
-
"apps/server/src/module-host/route-installer.test.ts",
|
|
253
|
-
"apps/server/src/module-host/storage-port.test.ts"
|
|
254
|
-
],
|
|
255
|
-
documentation: ["docs/architecture/object-storage.md"],
|
|
256
|
-
schemaFiles: ["packages/database/src/schema/file-storage.ts"],
|
|
257
|
-
databaseTables: [
|
|
258
|
-
"file_upload_sessions",
|
|
259
|
-
"file_upload_parts",
|
|
260
|
-
"file_metadata"
|
|
261
|
-
]
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
...module("system.agent", "Agent Tool", "\u53D7\u63A7 Agent \u5DE5\u5177\u5BBF\u4E3B\u3002", [
|
|
324
|
+
...optionalModule("system.agent", "Agent Tool", "\u53D7\u63A7 Agent \u5DE5\u5177\u5BBF\u4E3B\u3002", [
|
|
265
325
|
"system",
|
|
266
326
|
"system.audit",
|
|
267
327
|
"system.storage",
|
|
@@ -287,7 +347,12 @@ var optionalModuleManifests = [
|
|
|
287
347
|
"apps/embedding-server",
|
|
288
348
|
"apps/server/src/agent",
|
|
289
349
|
"apps/server/src/ai-runtime-report",
|
|
350
|
+
"apps/server/src/ai-runtime-readiness",
|
|
351
|
+
"apps/server/src/app/ai-screenshot-intake-binding.ts",
|
|
352
|
+
"apps/server/src/app/document-output-artifact-bindings.ts",
|
|
353
|
+
"apps/server/src/app/speech-output-artifact-bindings.ts",
|
|
290
354
|
"apps/server/src/ai-artifact",
|
|
355
|
+
"apps/server/src/ai-output-artifact",
|
|
291
356
|
"apps/server/src/document",
|
|
292
357
|
"apps/server/src/speech",
|
|
293
358
|
"apps/server/src/embedding",
|
|
@@ -298,6 +363,7 @@ var optionalModuleManifests = [
|
|
|
298
363
|
"apps/server/src/module-host/ai-operation-port.test.ts",
|
|
299
364
|
"apps/server/src/module-host/tool-handlers.ts",
|
|
300
365
|
"apps/server/src/module-host/tool-handlers.test.ts",
|
|
366
|
+
"apps/server/src/module-host/module-secret-tool-boundary.test.ts",
|
|
301
367
|
"apps/web/src/pages/system/AiRuntimePage.vue",
|
|
302
368
|
"apps/web/src/pages/system/ai-runtime-presenter.ts",
|
|
303
369
|
"apps/web/src/pages/system/ai-runtime-presenter.webtest.ts",
|
|
@@ -308,8 +374,10 @@ var optionalModuleManifests = [
|
|
|
308
374
|
"apps/web/src/services/ai-runtime-api.webtest.ts",
|
|
309
375
|
"docker-compose.agent-debug.yml",
|
|
310
376
|
"scripts/dev-adk-web.ts",
|
|
377
|
+
"scripts/provision-speech-readiness.ts",
|
|
311
378
|
"packages/modules/src/system-agent-tools.ts",
|
|
312
379
|
"packages/database/src/agent-runtime-schema.test.ts",
|
|
380
|
+
"packages/database/src/ai-output-artifacts.test.ts",
|
|
313
381
|
"packages/shared/src/ai-runtime-report.ts"
|
|
314
382
|
],
|
|
315
383
|
documentation: [
|
|
@@ -328,22 +396,27 @@ var optionalModuleManifests = [
|
|
|
328
396
|
"docs/platform/speech-ai-runtime.md",
|
|
329
397
|
"docs/platform/embedding-ai-runtime.md"
|
|
330
398
|
],
|
|
331
|
-
schemaFiles: [
|
|
399
|
+
schemaFiles: [
|
|
400
|
+
"packages/database/src/schema/agent-runtime.ts",
|
|
401
|
+
"packages/database/src/schema/embedding-runtime.ts",
|
|
402
|
+
"packages/database/src/schema/ai-output-artifacts.ts"
|
|
403
|
+
],
|
|
332
404
|
databaseTables: [
|
|
333
405
|
"agent_operation_releases",
|
|
334
406
|
"agent_runtime_runs",
|
|
335
407
|
"agent_runtime_events",
|
|
336
408
|
"agent_evaluation_results",
|
|
337
409
|
"agent_run_bindings",
|
|
410
|
+
"agent_screenshot_intakes",
|
|
338
411
|
"agent_runtime_report_runs",
|
|
339
|
-
"agent_runtime_report_attempts"
|
|
412
|
+
"agent_runtime_report_attempts",
|
|
413
|
+
"embedding_run_bindings",
|
|
414
|
+
"ai_output_artifact_scopes",
|
|
415
|
+
"ai_output_artifacts"
|
|
340
416
|
]
|
|
341
417
|
},
|
|
342
418
|
{
|
|
343
|
-
...
|
|
344
|
-
"system",
|
|
345
|
-
"system.audit"
|
|
346
|
-
]),
|
|
419
|
+
...optionalModule("system.scheduler", "\u4EFB\u52A1\u8C03\u5EA6", "\u4EFB\u52A1\u3001\u91CD\u8BD5\u3001\u5386\u53F2\u548C\u6062\u590D\u3002", ["system", "system.audit"]),
|
|
347
420
|
fileRoots: [
|
|
348
421
|
"apps/server/src/scheduler",
|
|
349
422
|
"apps/server/src/jobs",
|
|
@@ -352,6 +425,7 @@ var optionalModuleManifests = [
|
|
|
352
425
|
"apps/server/src/module-host/durable-context.test.ts",
|
|
353
426
|
"apps/server/src/module-host/durable-context-guard.test.ts",
|
|
354
427
|
"apps/server/src/module-host/durable-context-unavailable.test.ts",
|
|
428
|
+
"apps/server/src/module-host/module-secret-durable.test.ts",
|
|
355
429
|
"apps/server/src/module-host/job-port.test.ts",
|
|
356
430
|
"apps/server/src/module-host/task-definitions.ts",
|
|
357
431
|
"packages/database/src/schema-durable-recovery.test.ts",
|
|
@@ -386,7 +460,7 @@ var optionalModuleManifests = [
|
|
|
386
460
|
]
|
|
387
461
|
},
|
|
388
462
|
{
|
|
389
|
-
...
|
|
463
|
+
...optionalModule("system.notification", "\u7AD9\u5185\u901A\u77E5", "\u901A\u77E5\u5B9A\u5411\u4E0E\u5B9A\u65F6\u53D1\u5E03\u3001\u7528\u6237\u504F\u597D\u3001\u5916\u90E8\u6E20\u9053\u6295\u9012\u3001\u4FEE\u6539\u5386\u53F2\u3001\u9605\u8BFB\u3001\u6536\u85CF\u548C\u5F52\u6863\u3002", ["system", "system.identity", "system.scheduler"]),
|
|
390
464
|
registryDependencies: [
|
|
391
465
|
{
|
|
392
466
|
sourceName: "nodemailer",
|
|
@@ -431,12 +505,7 @@ var optionalModuleManifests = [
|
|
|
431
505
|
]
|
|
432
506
|
},
|
|
433
507
|
{
|
|
434
|
-
...
|
|
435
|
-
"system",
|
|
436
|
-
"system.identity",
|
|
437
|
-
"system.notification",
|
|
438
|
-
"system.scheduler"
|
|
439
|
-
]),
|
|
508
|
+
...optionalModule("system.workflow", "\u5BA1\u6279\u5DE5\u4F5C\u6D41", "\u5BA1\u6279\u3001\u8F6C\u4EA4\u3001\u8D85\u65F6\u548C\u8865\u507F\u3002", ["system", "system.identity", "system.notification", "system.scheduler"]),
|
|
440
509
|
fileRoots: [
|
|
441
510
|
"apps/server/src/workflow",
|
|
442
511
|
"packages/database/src/schema-workflow-notification.test.ts"
|
|
@@ -446,11 +515,7 @@ var optionalModuleManifests = [
|
|
|
446
515
|
databaseTables: ["workflow_work_items", "workflow_transitions"]
|
|
447
516
|
},
|
|
448
517
|
{
|
|
449
|
-
...
|
|
450
|
-
"system",
|
|
451
|
-
"system.storage",
|
|
452
|
-
"system.scheduler"
|
|
453
|
-
]),
|
|
518
|
+
...optionalModule("system.bulk-data", "\u6279\u91CF\u6570\u636E", "\u6279\u91CF\u5BFC\u5165\u5BFC\u51FA\u4E0E\u7ED3\u679C\u7559\u5B58\u3002", ["system", "system.storage", "system.scheduler"]),
|
|
454
519
|
fileRoots: [
|
|
455
520
|
"apps/server/src/bulk-data",
|
|
456
521
|
"apps/server/src/jobs/legacy-adapter.integration.test.ts",
|
|
@@ -465,9 +530,7 @@ var optionalModuleManifests = [
|
|
|
465
530
|
databaseTables: ["bulk_data_jobs", "bulk_data_artifacts"]
|
|
466
531
|
},
|
|
467
532
|
{
|
|
468
|
-
...
|
|
469
|
-
"system"
|
|
470
|
-
]),
|
|
533
|
+
...optionalModule("system.search", "\u5E73\u53F0\u641C\u7D22", "\u6743\u9650\u611F\u77E5\u641C\u7D22\u4E0E Provider \u805A\u5408\u3002", ["system"]),
|
|
471
534
|
fileRoots: [
|
|
472
535
|
"apps/server/src/search",
|
|
473
536
|
"apps/server/src/module-host/search-providers.ts",
|
|
@@ -480,7 +543,7 @@ var optionalModuleManifests = [
|
|
|
480
543
|
documentation: ["docs/architecture/search-provider-protocol.md"]
|
|
481
544
|
},
|
|
482
545
|
{
|
|
483
|
-
...
|
|
546
|
+
...optionalModule("system.data-governance", "\u6570\u636E\u6CBB\u7406", "\u654F\u611F\u5B57\u6BB5\u3001\u660E\u6587\u8BBF\u95EE\u548C\u6CBB\u7406\u5BFC\u51FA\u3002", [
|
|
484
547
|
"system",
|
|
485
548
|
"system.identity",
|
|
486
549
|
"system.audit",
|
|
@@ -506,7 +569,7 @@ var optionalModuleManifests = [
|
|
|
506
569
|
databaseTables: ["governed_export_requests"]
|
|
507
570
|
},
|
|
508
571
|
{
|
|
509
|
-
...
|
|
572
|
+
...optionalModule("work-order", "\u793A\u4F8B\u5DE5\u5355", "\u53EF\u66FF\u6362\u7684\u4E1A\u52A1\u6A21\u5757\u63A5\u5165\u793A\u4F8B\u3002", [
|
|
510
573
|
"system",
|
|
511
574
|
"system.identity",
|
|
512
575
|
"system.search",
|
|
@@ -532,36 +595,6 @@ var optionalModuleManifests = [
|
|
|
532
595
|
databaseLineageOwner: "module"
|
|
533
596
|
}
|
|
534
597
|
];
|
|
535
|
-
function module(name, label, description, dependencies) {
|
|
536
|
-
const selection = "optional";
|
|
537
|
-
return {
|
|
538
|
-
name,
|
|
539
|
-
version: "0.1.0",
|
|
540
|
-
windyRange: "^0.5.0",
|
|
541
|
-
label,
|
|
542
|
-
description,
|
|
543
|
-
selection,
|
|
544
|
-
runtimeActivation: "toggle",
|
|
545
|
-
deploymentInstall: "project-composition-required",
|
|
546
|
-
dependencies,
|
|
547
|
-
conflicts: [],
|
|
548
|
-
runtimePackage: null,
|
|
549
|
-
packages: [],
|
|
550
|
-
registryDependencies: [],
|
|
551
|
-
fileRoots: [],
|
|
552
|
-
documentation: [],
|
|
553
|
-
schemaFiles: [],
|
|
554
|
-
migrationRoots: [],
|
|
555
|
-
databaseTables: [],
|
|
556
|
-
databaseLineageOwner: "platform",
|
|
557
|
-
transientDatabaseTables: [],
|
|
558
|
-
databaseStatementTokens: [],
|
|
559
|
-
uninstallPolicy: "retain-data",
|
|
560
|
-
installRecipe: `module-${name}-install`,
|
|
561
|
-
updateRecipes: [`module-${name}-update-0.1.0`],
|
|
562
|
-
uninstallRecipe: `module-${name}-uninstall`
|
|
563
|
-
};
|
|
564
|
-
}
|
|
565
598
|
|
|
566
599
|
// src/module-distribution.ts
|
|
567
600
|
var requiredModuleNames = ["system", "system.identity"];
|
|
@@ -572,10 +605,10 @@ var recommendedModuleNames = [
|
|
|
572
605
|
"system.operations"
|
|
573
606
|
];
|
|
574
607
|
var platformModules = [
|
|
575
|
-
|
|
576
|
-
|
|
608
|
+
module("system", "\u7CFB\u7EDF\u6838\u5FC3", "Admin \u51C6\u5165\u3001Feature \u4E0E\u6570\u636E\u5E93\u57FA\u7EBF\u3002", "required"),
|
|
609
|
+
module("system.identity", "\u8EAB\u4EFD\u4E0E\u6743\u9650", "\u8BA4\u8BC1\u3001\u7528\u6237\u3001\u89D2\u8272\u3001\u7EC4\u7EC7\u548C\u6570\u636E\u8303\u56F4\u3002", "required", ["system"]),
|
|
577
610
|
{
|
|
578
|
-
...
|
|
611
|
+
...module("system.settings", "\u5E73\u53F0\u8BBE\u7F6E", "\u54C1\u724C\u3001Logo \u4E0E\u6C34\u5370\u3002", "recommended", ["system"]),
|
|
579
612
|
runtimeActivation: "physical-only",
|
|
580
613
|
fileRoots: [
|
|
581
614
|
"apps/server/src/settings",
|
|
@@ -598,7 +631,7 @@ var platformModules = [
|
|
|
598
631
|
]
|
|
599
632
|
},
|
|
600
633
|
{
|
|
601
|
-
...
|
|
634
|
+
...module("system.configuration", "\u914D\u7F6E\u7248\u672C", "\u7C7B\u578B\u5316\u914D\u7F6E\u3001\u5E94\u7528\u548C\u56DE\u6EDA\u3002", "recommended", ["system"]),
|
|
602
635
|
fileRoots: [
|
|
603
636
|
"apps/server/src/configuration",
|
|
604
637
|
"apps/web/src/pages/configuration",
|
|
@@ -613,7 +646,7 @@ var platformModules = [
|
|
|
613
646
|
]
|
|
614
647
|
},
|
|
615
648
|
{
|
|
616
|
-
...
|
|
649
|
+
...module("system.license", "\u79BB\u7EBF License", "\u79BB\u7EBF\u9A8C\u7B7E\u3001\u5B89\u88C5\u548C\u9650\u5236\u6001\u3002", "optional", ["system"]),
|
|
617
650
|
registryDependencies: [
|
|
618
651
|
{
|
|
619
652
|
sourceName: "@southwind-ai/license",
|
|
@@ -665,7 +698,7 @@ var platformModules = [
|
|
|
665
698
|
]
|
|
666
699
|
},
|
|
667
700
|
{
|
|
668
|
-
...
|
|
701
|
+
...module("system.audit", "\u5BA1\u8BA1\u65E5\u5FD7", "\u5BA1\u8BA1\u67E5\u8BE2\u3001\u53EF\u9760\u5199\u5165\u548C\u6062\u590D\u3002", "recommended", ["system"]),
|
|
669
702
|
fileRoots: [
|
|
670
703
|
"apps/server/src/audit/drizzle-log-store.ts",
|
|
671
704
|
"apps/server/src/audit/recovery-queue.ts",
|
|
@@ -689,7 +722,7 @@ var platformModules = [
|
|
|
689
722
|
databaseStatementTokens: ["idx_audit_logs_"]
|
|
690
723
|
},
|
|
691
724
|
{
|
|
692
|
-
...
|
|
725
|
+
...module("system.operations", "\u8FD0\u7EF4\u76D1\u63A7", "\u670D\u52A1\u3001\u6570\u636E\u5E93\u3001\u7F13\u5B58\u3001\u78C1\u76D8\u548C\u4F1A\u8BDD\u76D1\u63A7\u3002", "recommended", ["system", "system.configuration"]),
|
|
693
726
|
fileRoots: [
|
|
694
727
|
"apps/server/src/system/operation-monitoring.ts",
|
|
695
728
|
"apps/server/src/system/operation-monitoring.test.ts",
|
|
@@ -765,7 +798,7 @@ function selectedModuleManifests(names) {
|
|
|
765
798
|
}
|
|
766
799
|
return moduleDistributionCatalog.filter(({ name }) => selected.has(name));
|
|
767
800
|
}
|
|
768
|
-
function
|
|
801
|
+
function module(name, label, description, selection, dependencies = []) {
|
|
769
802
|
return {
|
|
770
803
|
name,
|
|
771
804
|
version: "0.1.0",
|
|
@@ -912,9 +945,10 @@ class CommandExecutionError extends Error {
|
|
|
912
945
|
this.name = "CommandExecutionError";
|
|
913
946
|
}
|
|
914
947
|
}
|
|
915
|
-
async function runCommand(command, args, cwd) {
|
|
948
|
+
async function runCommand(command, args, cwd, options = {}) {
|
|
916
949
|
const child = Bun.spawn([command, ...args], {
|
|
917
950
|
cwd,
|
|
951
|
+
env: options.env ?? process.env,
|
|
918
952
|
stderr: "inherit",
|
|
919
953
|
stdin: "inherit",
|
|
920
954
|
stdout: "inherit"
|
|
@@ -1059,7 +1093,9 @@ var managedSecretKeys = [
|
|
|
1059
1093
|
"AGENT_SERVER_INTERNAL_TOKEN",
|
|
1060
1094
|
"ADK_DEBUG_PLATFORM_TOKEN",
|
|
1061
1095
|
"AGENT_RUN_ENCRYPTION_SECRET",
|
|
1062
|
-
"AI_ARTIFACT_ENCRYPTION_SECRET"
|
|
1096
|
+
"AI_ARTIFACT_ENCRYPTION_SECRET",
|
|
1097
|
+
"EMBEDDING_RUN_ENCRYPTION_SECRET",
|
|
1098
|
+
"AI_OUTPUT_ARTIFACT_REFERENCE_SECRET"
|
|
1063
1099
|
];
|
|
1064
1100
|
async function initializeLocalEnvironment(projectRoot, generateSecret = defaultSecret) {
|
|
1065
1101
|
const target = join(projectRoot, ".env");
|
|
@@ -1083,6 +1119,12 @@ async function initializeLocalEnvironment(projectRoot, generateSecret = defaultS
|
|
|
1083
1119
|
if (/^AI_ARTIFACT_ENCRYPTION_SECRET=[ \t\r]*$/m.test(content)) {
|
|
1084
1120
|
content = setEmptyVariable(content, "AI_ARTIFACT_ENCRYPTION_SECRET", generateSecret());
|
|
1085
1121
|
}
|
|
1122
|
+
if (/^EMBEDDING_RUN_ENCRYPTION_SECRET=[ \t\r]*$/m.test(content)) {
|
|
1123
|
+
content = setEmptyVariable(content, "EMBEDDING_RUN_ENCRYPTION_SECRET", generateSecret());
|
|
1124
|
+
}
|
|
1125
|
+
if (/^AI_OUTPUT_ARTIFACT_REFERENCE_SECRET=[ \t\r]*$/m.test(content)) {
|
|
1126
|
+
content = setEmptyVariable(content, "AI_OUTPUT_ARTIFACT_REFERENCE_SECRET", generateSecret());
|
|
1127
|
+
}
|
|
1086
1128
|
let handle;
|
|
1087
1129
|
try {
|
|
1088
1130
|
handle = await open(target, "wx", 384);
|
|
@@ -2563,19 +2605,30 @@ async function materializeSelectedModules(targetDirectory, selectedNames) {
|
|
|
2563
2605
|
]),
|
|
2564
2606
|
...moduleDistributionCatalog.filter(({ databaseLineageOwner }) => databaseLineageOwner === "module").flatMap(({ databaseTables }) => databaseTables)
|
|
2565
2607
|
], removed.flatMap(({ databaseStatementTokens }) => databaseStatementTokens));
|
|
2566
|
-
const removedRoots = removed.flatMap((manifest) => [
|
|
2608
|
+
const removedRoots = collapseRemovalRoots(removed.flatMap((manifest) => [
|
|
2567
2609
|
...manifest.packages,
|
|
2568
2610
|
...manifest.fileRoots,
|
|
2569
2611
|
...manifest.documentation,
|
|
2570
2612
|
...manifest.schemaFiles
|
|
2571
|
-
]);
|
|
2613
|
+
]));
|
|
2572
2614
|
await Promise.all([...new Set(removedRoots)].map((path) => rm3(join7(targetDirectory, path), { recursive: true, force: true })));
|
|
2573
2615
|
await pruneWorkspaceReferences(targetDirectory, removedPackageNames, removedRoots);
|
|
2574
2616
|
}
|
|
2617
|
+
function collapseRemovalRoots(paths) {
|
|
2618
|
+
const roots = [];
|
|
2619
|
+
for (const path of [...new Set(paths)].sort((left, right) => left.length - right.length || left.localeCompare(right))) {
|
|
2620
|
+
if (roots.some((root) => path === root || path.startsWith(`${root}/`))) {
|
|
2621
|
+
continue;
|
|
2622
|
+
}
|
|
2623
|
+
roots.push(path);
|
|
2624
|
+
}
|
|
2625
|
+
return roots.sort();
|
|
2626
|
+
}
|
|
2575
2627
|
async function stripModuleBlocks(root, selected) {
|
|
2576
2628
|
for (const path of await collectFiles2(root)) {
|
|
2577
|
-
if (!textExtensions.has(extname(path)))
|
|
2629
|
+
if (basename3(path) !== "Dockerfile" && !textExtensions.has(extname(path))) {
|
|
2578
2630
|
continue;
|
|
2631
|
+
}
|
|
2579
2632
|
const source = await readFile6(path, "utf8");
|
|
2580
2633
|
if (!source.includes("@windy-module"))
|
|
2581
2634
|
continue;
|
|
@@ -2752,6 +2805,31 @@ Skill \u4ECD\u53EF\u7528\u4E8E\u666E\u901A\u4E1A\u52A1\u6A21\u5757\u5F00\u53D1\u
|
|
|
2752
2805
|
`;
|
|
2753
2806
|
}
|
|
2754
2807
|
|
|
2808
|
+
// src/runtime-profile-opensearch.ts
|
|
2809
|
+
var openSearchComposeService = ` opensearch:
|
|
2810
|
+
profiles: ["search"]
|
|
2811
|
+
image: opensearchproject/opensearch:2.19.3
|
|
2812
|
+
environment:
|
|
2813
|
+
discovery.type: single-node
|
|
2814
|
+
DISABLE_INSTALL_DEMO_CONFIG: "true"
|
|
2815
|
+
DISABLE_SECURITY_PLUGIN: "true"
|
|
2816
|
+
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
|
|
2817
|
+
ports:
|
|
2818
|
+
- "127.0.0.1:19200:9200"
|
|
2819
|
+
volumes:
|
|
2820
|
+
- opensearch-data:/usr/share/opensearch/data
|
|
2821
|
+
healthcheck:
|
|
2822
|
+
test:
|
|
2823
|
+
[
|
|
2824
|
+
"CMD-SHELL",
|
|
2825
|
+
"curl -fsS http://127.0.0.1:9200/_cluster/health?wait_for_status=yellow",
|
|
2826
|
+
]
|
|
2827
|
+
interval: 10s
|
|
2828
|
+
timeout: 5s
|
|
2829
|
+
retries: 12
|
|
2830
|
+
|
|
2831
|
+
`;
|
|
2832
|
+
|
|
2755
2833
|
// src/runtime-profile-files.ts
|
|
2756
2834
|
var starterComposeBase = `services:
|
|
2757
2835
|
postgres:
|
|
@@ -2794,6 +2872,7 @@ var starterComposeBase = `services:
|
|
|
2794
2872
|
DATABASE_URL: postgresql://windy:\${POSTGRES_PASSWORD}@postgres:5432/windy
|
|
2795
2873
|
WINDY_BOOTSTRAP_ADMIN_PASSWORD: \${WINDY_BOOTSTRAP_ADMIN_PASSWORD:?\u8BF7\u5728 .env \u4E2D\u8BBE\u7F6E\u7BA1\u7406\u5458\u521D\u59CB\u5BC6\u7801}
|
|
2796
2874
|
WINDY_AUDIT_QUEUE_FILE: /app/data/audit/recovery-queue.json
|
|
2875
|
+
__STORAGE_SERVER_ENV__
|
|
2797
2876
|
WINDY_CONTAINERIZED: "1"
|
|
2798
2877
|
BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD: "true"
|
|
2799
2878
|
WINDY_SYSTEM_USAGE_PATHS: /app/data/audit
|
|
@@ -2805,6 +2884,9 @@ __TOOL_SANDBOX_SERVER_ENV__
|
|
|
2805
2884
|
AI_ARTIFACT_URL: http://server:9747/api/internal/ai/artifacts
|
|
2806
2885
|
AI_ARTIFACT_ENCRYPTION_SECRET: \${AI_ARTIFACT_ENCRYPTION_SECRET:-}
|
|
2807
2886
|
DOCUMENT_SERVER_URL: \${DOCUMENT_SERVER_URL:-}
|
|
2887
|
+
AI_OUTPUT_ARTIFACT_REFERENCE_SECRET: \${AI_OUTPUT_ARTIFACT_REFERENCE_SECRET:-}
|
|
2888
|
+
DOCUMENT_OUTPUT_ARTIFACT_SINK_IDENTITY: \${DOCUMENT_OUTPUT_ARTIFACT_SINK_IDENTITY:-}
|
|
2889
|
+
DOCUMENT_OUTPUT_ARTIFACT_SINK_RELEASE_DIGEST: \${DOCUMENT_OUTPUT_ARTIFACT_SINK_RELEASE_DIGEST:-}
|
|
2808
2890
|
SPEECH_SERVER_URL: \${SPEECH_SERVER_URL:-}
|
|
2809
2891
|
EMBEDDING_SERVER_URL: \${EMBEDDING_SERVER_URL:-}
|
|
2810
2892
|
__OPENSEARCH_SERVER_ENV__
|
|
@@ -2814,6 +2896,7 @@ __OPENSEARCH_SERVER_ENV__
|
|
|
2814
2896
|
- ./apps/server:/app/apps/server
|
|
2815
2897
|
- ./packages:/app/packages
|
|
2816
2898
|
- server-audit-data:/app/data/audit
|
|
2899
|
+
__STORAGE_SERVER_VOLUME__
|
|
2817
2900
|
__TOOL_SANDBOX_SERVER_VOLUME__
|
|
2818
2901
|
depends_on:
|
|
2819
2902
|
migrate:
|
|
@@ -2854,29 +2937,6 @@ volumes:
|
|
|
2854
2937
|
postgres-data:
|
|
2855
2938
|
server-audit-data:
|
|
2856
2939
|
__OPTIONAL_VOLUMES__
|
|
2857
|
-
`;
|
|
2858
|
-
var openSearchComposeService = ` opensearch:
|
|
2859
|
-
profiles: ["search"]
|
|
2860
|
-
image: opensearchproject/opensearch:2.19.3
|
|
2861
|
-
environment:
|
|
2862
|
-
discovery.type: single-node
|
|
2863
|
-
DISABLE_INSTALL_DEMO_CONFIG: "true"
|
|
2864
|
-
DISABLE_SECURITY_PLUGIN: "true"
|
|
2865
|
-
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
|
|
2866
|
-
ports:
|
|
2867
|
-
- "127.0.0.1:19200:9200"
|
|
2868
|
-
volumes:
|
|
2869
|
-
- opensearch-data:/usr/share/opensearch/data
|
|
2870
|
-
healthcheck:
|
|
2871
|
-
test:
|
|
2872
|
-
[
|
|
2873
|
-
"CMD-SHELL",
|
|
2874
|
-
"curl -fsS http://127.0.0.1:9200/_cluster/health?wait_for_status=yellow",
|
|
2875
|
-
]
|
|
2876
|
-
interval: 10s
|
|
2877
|
-
timeout: 5s
|
|
2878
|
-
retries: 12
|
|
2879
|
-
|
|
2880
2940
|
`;
|
|
2881
2941
|
var agentComposeService = ` tool-sandbox-init:
|
|
2882
2942
|
profiles: ["agent"]
|
|
@@ -2945,8 +3005,17 @@ var agentComposeService = ` tool-sandbox-init:
|
|
|
2945
3005
|
AI_PROVIDER_CONNECT_TIMEOUT_MS: \${AI_PROVIDER_CONNECT_TIMEOUT_MS:-5000}
|
|
2946
3006
|
AI_PROVIDER_REQUEST_TIMEOUT_MS: \${AI_PROVIDER_REQUEST_TIMEOUT_MS:-60000}
|
|
2947
3007
|
AI_PROVIDER_MAX_RESPONSE_BYTES: \${AI_PROVIDER_MAX_RESPONSE_BYTES:-2097152}
|
|
3008
|
+
AI_PROVIDER_MAX_DURATION_SECONDS: \${AI_PROVIDER_MAX_DURATION_SECONDS:-300}
|
|
3009
|
+
AI_PROVIDER_MAX_INPUT_BYTES: \${AI_PROVIDER_MAX_INPUT_BYTES:-67108864}
|
|
3010
|
+
AI_PROVIDER_MAX_ARTIFACTS: \${AI_PROVIDER_MAX_ARTIFACTS:-16}
|
|
3011
|
+
AI_PROVIDER_MAX_PIXELS_PER_ARTIFACT: \${AI_PROVIDER_MAX_PIXELS_PER_ARTIFACT:-100000000}
|
|
2948
3012
|
AI_PROVIDER_CAPABILITIES: \${AI_PROVIDER_CAPABILITIES:-text-generation}
|
|
2949
3013
|
AI_PROVIDER_INPUT_MODALITIES: \${AI_PROVIDER_INPUT_MODALITIES:-text}
|
|
3014
|
+
AI_PROVIDER_DEPLOYMENT_IDENTITY: \${AI_PROVIDER_DEPLOYMENT_IDENTITY:-}
|
|
3015
|
+
AI_PROVIDER_RELEASE_DIGEST: \${AI_PROVIDER_RELEASE_DIGEST:-}
|
|
3016
|
+
AI_PROVIDER_READINESS_TTL_SECONDS: \${AI_PROVIDER_READINESS_TTL_SECONDS:-60}
|
|
3017
|
+
AI_PROVIDER_MAX_CONCURRENT_RUNS: \${AI_PROVIDER_MAX_CONCURRENT_RUNS:-1}
|
|
3018
|
+
AI_PROVIDER_MAX_QUEUE_DEPTH: \${AI_PROVIDER_MAX_QUEUE_DEPTH:-0}
|
|
2950
3019
|
volumes:
|
|
2951
3020
|
- agent-run-data:/app/data/agent
|
|
2952
3021
|
depends_on:
|
|
@@ -2964,9 +3033,13 @@ var agentComposeService = ` tool-sandbox-init:
|
|
|
2964
3033
|
DOCUMENT_SERVER_INTERNAL_TOKEN: \${AGENT_SERVER_INTERNAL_TOKEN:-}
|
|
2965
3034
|
DOCUMENT_RUN_STORE_PATH: /app/data/document/runs.sqlite3
|
|
2966
3035
|
DOCUMENT_ARTIFACT_URL: \${DOCUMENT_ARTIFACT_URL:-http://server:9747/api/internal/ai/artifacts}
|
|
3036
|
+
DOCUMENT_OUTPUT_ARTIFACT_URL: \${DOCUMENT_OUTPUT_ARTIFACT_URL:-http://server:9747/api/internal/ai/output-artifacts}
|
|
2967
3037
|
DOCUMENT_ADAPTER_URL: \${DOCUMENT_ADAPTER_URL:-}
|
|
2968
3038
|
DOCUMENT_ADAPTER_TOKEN: \${DOCUMENT_ADAPTER_TOKEN:-}
|
|
2969
3039
|
DOCUMENT_DEPLOYMENT_KEY: \${DOCUMENT_DEPLOYMENT_KEY:-}
|
|
3040
|
+
DOCUMENT_DEPLOYMENT_IDENTITY: \${DOCUMENT_DEPLOYMENT_IDENTITY:-}
|
|
3041
|
+
DOCUMENT_RELEASE_DIGEST: \${DOCUMENT_RELEASE_DIGEST:-}
|
|
3042
|
+
DOCUMENT_OFFERS_DIGEST: \${DOCUMENT_OFFERS_DIGEST:-}
|
|
2970
3043
|
DOCUMENT_ADAPTER_CAPABILITIES: \${DOCUMENT_ADAPTER_CAPABILITIES:-document.ocr,document.layout,document.table}
|
|
2971
3044
|
DOCUMENT_MAX_UNITS: \${DOCUMENT_MAX_UNITS:-500}
|
|
2972
3045
|
volumes:
|
|
@@ -2984,12 +3057,23 @@ var agentComposeService = ` tool-sandbox-init:
|
|
|
2984
3057
|
SPEECH_SERVER_INTERNAL_TOKEN: \${AGENT_SERVER_INTERNAL_TOKEN:-}
|
|
2985
3058
|
SPEECH_RUN_STORE_PATH: /app/data/speech/runs.sqlite3
|
|
2986
3059
|
SPEECH_ARTIFACT_URL: \${SPEECH_ARTIFACT_URL:-http://server:9747/api/internal/ai/artifacts}
|
|
3060
|
+
SPEECH_OUTPUT_ARTIFACT_URL: \${SPEECH_OUTPUT_ARTIFACT_URL:-http://server:9747/api/internal/ai/output-artifacts}
|
|
2987
3061
|
SPEECH_ADAPTER_URL: \${SPEECH_ADAPTER_URL:-}
|
|
2988
3062
|
SPEECH_ADAPTER_TOKEN: \${SPEECH_ADAPTER_TOKEN:-}
|
|
2989
3063
|
SPEECH_DEPLOYMENT_KEY: \${SPEECH_DEPLOYMENT_KEY:-}
|
|
2990
|
-
|
|
3064
|
+
SPEECH_DEPLOYMENT_IDENTITY: \${SPEECH_DEPLOYMENT_IDENTITY:-}
|
|
3065
|
+
SPEECH_RELEASE_DIGEST: \${SPEECH_RELEASE_DIGEST:-}
|
|
3066
|
+
SPEECH_OFFERS_DIGEST: \${SPEECH_OFFERS_DIGEST:-}
|
|
3067
|
+
SPEECH_ADAPTER_CAPABILITIES: \${SPEECH_ADAPTER_CAPABILITIES:-speech.transcribe.batch,speech.translate,speech.vad,speech.timestamps}
|
|
2991
3068
|
SPEECH_MAX_UNITS: \${SPEECH_MAX_UNITS:-100000}
|
|
2992
3069
|
SPEECH_MAX_MEDIA_DURATION_SECONDS: \${SPEECH_MAX_MEDIA_DURATION_SECONDS:-86400}
|
|
3070
|
+
SPEECH_MAX_INPUT_ARTIFACT_BYTES: \${SPEECH_MAX_INPUT_ARTIFACT_BYTES:-2147483648}
|
|
3071
|
+
SPEECH_MAX_INLINE_OUTPUT_BYTES: \${SPEECH_MAX_INLINE_OUTPUT_BYTES:-67108864}
|
|
3072
|
+
SPEECH_MAX_OUTPUT_ARTIFACT_BYTES: \${SPEECH_MAX_OUTPUT_ARTIFACT_BYTES:-536870912}
|
|
3073
|
+
SPEECH_MAX_CONCURRENT_RUNS: \${SPEECH_MAX_CONCURRENT_RUNS:-1}
|
|
3074
|
+
SPEECH_MAX_QUEUE_DEPTH: \${SPEECH_MAX_QUEUE_DEPTH:-0}
|
|
3075
|
+
SPEECH_READINESS_TIMEOUT_SECONDS: \${SPEECH_READINESS_TIMEOUT_SECONDS:-5}
|
|
3076
|
+
SPEECH_READINESS_TTL_SECONDS: \${SPEECH_READINESS_TTL_SECONDS:-60}
|
|
2993
3077
|
volumes:
|
|
2994
3078
|
- speech-run-data:/app/data/speech
|
|
2995
3079
|
depends_on:
|
|
@@ -3004,6 +3088,7 @@ var agentComposeService = ` tool-sandbox-init:
|
|
|
3004
3088
|
environment:
|
|
3005
3089
|
EMBEDDING_SERVER_INTERNAL_TOKEN: \${AGENT_SERVER_INTERNAL_TOKEN:-}
|
|
3006
3090
|
EMBEDDING_ARTIFACT_URL: \${EMBEDDING_ARTIFACT_URL:-http://server:9747/api/internal/ai/artifacts}
|
|
3091
|
+
EMBEDDING_RUN_ARTIFACT_URL: \${EMBEDDING_RUN_ARTIFACT_URL:-http://server:9747/api/internal/embeddings/runs}
|
|
3007
3092
|
EMBEDDING_ADAPTER_URL: \${EMBEDDING_ADAPTER_URL:-}
|
|
3008
3093
|
EMBEDDING_ADAPTER_TOKEN: \${EMBEDDING_ADAPTER_TOKEN:-}
|
|
3009
3094
|
EMBEDDING_DEPLOYMENT_KEY: \${EMBEDDING_DEPLOYMENT_KEY:-}
|
|
@@ -3014,15 +3099,20 @@ var agentComposeService = ` tool-sandbox-init:
|
|
|
3014
3099
|
EMBEDDING_NORMALIZED: \${EMBEDDING_NORMALIZED:-true}
|
|
3015
3100
|
EMBEDDING_CAPABILITIES: \${EMBEDDING_CAPABILITIES:-embedding.text}
|
|
3016
3101
|
EMBEDDING_MAX_UNITS: \${EMBEDDING_MAX_UNITS:-256}
|
|
3102
|
+
EMBEDDING_RUN_ENCRYPTION_SECRET: \${EMBEDDING_RUN_ENCRYPTION_SECRET:-}
|
|
3103
|
+
EMBEDDING_MAX_CONCURRENT_RUNS: \${EMBEDDING_MAX_CONCURRENT_RUNS:-1}
|
|
3104
|
+
EMBEDDING_RUN_TERMINAL_TTL_SECONDS: \${EMBEDDING_RUN_TERMINAL_TTL_SECONDS:-604800}
|
|
3105
|
+
volumes:
|
|
3106
|
+
- embedding-run-data:/app/data/embedding
|
|
3017
3107
|
depends_on:
|
|
3018
3108
|
server:
|
|
3019
3109
|
condition: service_started
|
|
3020
3110
|
|
|
3021
3111
|
`;
|
|
3022
|
-
function starterComposeFor(includeAgent, includeSearch = true) {
|
|
3112
|
+
function starterComposeFor(includeAgent, includeSearch = true, includeStorage = true) {
|
|
3023
3113
|
return starterComposeBase.replace(` web:
|
|
3024
3114
|
`, `${includeAgent ? agentComposeService : ""} web:
|
|
3025
|
-
`).replace("__TOOL_SANDBOX_SERVER_ENV__", includeAgent ? " TOOL_SANDBOX_SOCKET: /run/windy-tool-sandbox/worker.sock" : "").replace("__TOOL_SANDBOX_SERVER_VOLUME__", includeAgent ? " - tool-sandbox-ipc:/run/windy-tool-sandbox" : "").replace("__OPENSEARCH_SERVER_ENV__", includeSearch ? ` OPENSEARCH_URL: \${OPENSEARCH_URL:-}
|
|
3115
|
+
`).replace("__TOOL_SANDBOX_SERVER_ENV__", includeAgent ? " TOOL_SANDBOX_SOCKET: /run/windy-tool-sandbox/worker.sock" : "").replace("__TOOL_SANDBOX_SERVER_VOLUME__", includeAgent ? " - tool-sandbox-ipc:/run/windy-tool-sandbox" : "").replace("__STORAGE_SERVER_ENV__", includeStorage ? " WINDY_STORAGE_ROOT: /app/data/storage" : "").replace("__STORAGE_SERVER_VOLUME__", includeStorage ? " - server-storage-data:/app/data/storage" : "").replace("__OPENSEARCH_SERVER_ENV__", includeSearch ? ` OPENSEARCH_URL: \${OPENSEARCH_URL:-}
|
|
3026
3116
|
OPENSEARCH_USERNAME: \${OPENSEARCH_USERNAME:-}
|
|
3027
3117
|
OPENSEARCH_PASSWORD: \${OPENSEARCH_PASSWORD:-}
|
|
3028
3118
|
OPENSEARCH_WORK_ORDER_INDEX: \${OPENSEARCH_WORK_ORDER_INDEX:-windy-work-orders-v1}` : "").replace("__OPENSEARCH_SERVICE__", includeSearch ? openSearchComposeService : "").replace("__OPTIONAL_VOLUMES__", [
|
|
@@ -3030,16 +3120,23 @@ function starterComposeFor(includeAgent, includeSearch = true) {
|
|
|
3030
3120
|
includeAgent ? " tool-sandbox-ipc:" : "",
|
|
3031
3121
|
includeAgent ? " document-run-data:" : "",
|
|
3032
3122
|
includeAgent ? " speech-run-data:" : "",
|
|
3033
|
-
|
|
3123
|
+
includeAgent ? " embedding-run-data:" : "",
|
|
3124
|
+
includeSearch ? " opensearch-data:" : "",
|
|
3125
|
+
includeStorage ? " server-storage-data:" : ""
|
|
3034
3126
|
].filter(Boolean).join(`
|
|
3035
3127
|
`));
|
|
3036
3128
|
}
|
|
3037
3129
|
var starterCompose = starterComposeFor(true);
|
|
3038
3130
|
// src/runtime-environment-example.ts
|
|
3039
|
-
function environmentExample(includeExample, includeAgent = true, includeSearch = true) {
|
|
3131
|
+
function environmentExample(includeExample, includeAgent = true, includeSearch = true, includeStorage = true) {
|
|
3040
3132
|
return `# \u590D\u5236\u4E3A .env \u540E\u586B\u5199\u3002\u4E0D\u8981\u63D0\u4EA4\u771F\u5B9E\u5BC6\u7801\u3002
|
|
3041
3133
|
POSTGRES_PASSWORD=
|
|
3042
3134
|
WINDY_BOOTSTRAP_ADMIN_PASSWORD=
|
|
3135
|
+
${includeStorage ? `
|
|
3136
|
+
# Compose \u9ED8\u8BA4\u628A Storage \u4E0E\u62A5\u544A\u6682\u5B58\u6301\u4E45\u5316\u5230 /app/data/storage\u3002
|
|
3137
|
+
# \u5982\u9700\u72EC\u7ACB\u6302\u8F7D\u62A5\u544A\u6682\u5B58\u76EE\u5F55\uFF0C\u8BF7\u540C\u65F6\u4FEE\u6539 Compose volume\u3002
|
|
3138
|
+
# WINDY_REPORT_STAGING_ROOT=/app/data/storage/report-staging
|
|
3139
|
+
` : ""}
|
|
3043
3140
|
${includeAgent ? `
|
|
3044
3141
|
# Agent profile \u4EC5\u7531\u670D\u52A1\u7AEF Agent Runtime \u8BFB\u53D6\uFF1B\u4E0D\u8981\u4F7F\u7528 VITE_ \u524D\u7F00\u3002
|
|
3045
3142
|
# ADK Web \u901A\u8FC7 canonical Run API \u8C03\u8BD5\u9879\u76EE\u9009\u62E9\u7684\u771F\u5B9E\u6587\u672C Operation\uFF1B\u8C03\u8BD5 Token
|
|
@@ -3056,21 +3153,40 @@ OTEL_EXPORTER_OTLP_HEADERS=
|
|
|
3056
3153
|
AI_ARTIFACT_ENCRYPTION_SECRET=
|
|
3057
3154
|
DOCUMENT_SERVER_URL=
|
|
3058
3155
|
DOCUMENT_ARTIFACT_URL=
|
|
3156
|
+
DOCUMENT_OUTPUT_ARTIFACT_URL=
|
|
3059
3157
|
DOCUMENT_ADAPTER_URL=
|
|
3060
3158
|
DOCUMENT_ADAPTER_TOKEN=
|
|
3061
3159
|
DOCUMENT_DEPLOYMENT_KEY=
|
|
3160
|
+
DOCUMENT_DEPLOYMENT_IDENTITY=
|
|
3161
|
+
DOCUMENT_RELEASE_DIGEST=
|
|
3162
|
+
DOCUMENT_OFFERS_DIGEST=
|
|
3163
|
+
AI_OUTPUT_ARTIFACT_REFERENCE_SECRET=
|
|
3164
|
+
DOCUMENT_OUTPUT_ARTIFACT_SINK_IDENTITY=
|
|
3165
|
+
DOCUMENT_OUTPUT_ARTIFACT_SINK_RELEASE_DIGEST=
|
|
3062
3166
|
# DOCUMENT_ADAPTER_CAPABILITIES=document.ocr,document.layout,document.table
|
|
3063
3167
|
# DOCUMENT_MAX_UNITS=500
|
|
3064
3168
|
SPEECH_SERVER_URL=
|
|
3065
3169
|
SPEECH_ARTIFACT_URL=
|
|
3170
|
+
SPEECH_OUTPUT_ARTIFACT_URL=
|
|
3066
3171
|
SPEECH_ADAPTER_URL=
|
|
3067
3172
|
SPEECH_ADAPTER_TOKEN=
|
|
3068
3173
|
SPEECH_DEPLOYMENT_KEY=
|
|
3069
|
-
|
|
3174
|
+
SPEECH_DEPLOYMENT_IDENTITY=
|
|
3175
|
+
SPEECH_RELEASE_DIGEST=
|
|
3176
|
+
SPEECH_OFFERS_DIGEST=
|
|
3177
|
+
# SPEECH_ADAPTER_CAPABILITIES=speech.transcribe.batch,speech.translate,speech.vad,speech.timestamps
|
|
3070
3178
|
# SPEECH_MAX_UNITS=100000
|
|
3071
3179
|
# SPEECH_MAX_MEDIA_DURATION_SECONDS=86400
|
|
3180
|
+
# SPEECH_MAX_INPUT_ARTIFACT_BYTES=2147483648
|
|
3181
|
+
# SPEECH_MAX_INLINE_OUTPUT_BYTES=67108864
|
|
3182
|
+
# SPEECH_MAX_OUTPUT_ARTIFACT_BYTES=536870912
|
|
3183
|
+
# SPEECH_MAX_CONCURRENT_RUNS=1
|
|
3184
|
+
# SPEECH_MAX_QUEUE_DEPTH=0
|
|
3185
|
+
# SPEECH_READINESS_TIMEOUT_SECONDS=5
|
|
3186
|
+
# SPEECH_READINESS_TTL_SECONDS=60
|
|
3072
3187
|
EMBEDDING_SERVER_URL=
|
|
3073
3188
|
EMBEDDING_ARTIFACT_URL=
|
|
3189
|
+
EMBEDDING_RUN_ARTIFACT_URL=
|
|
3074
3190
|
EMBEDDING_ADAPTER_URL=
|
|
3075
3191
|
EMBEDDING_ADAPTER_TOKEN=
|
|
3076
3192
|
EMBEDDING_DEPLOYMENT_KEY=
|
|
@@ -3081,6 +3197,9 @@ EMBEDDING_DIMENSIONS=
|
|
|
3081
3197
|
# EMBEDDING_NORMALIZED=true
|
|
3082
3198
|
# EMBEDDING_CAPABILITIES=embedding.text,embedding.image
|
|
3083
3199
|
# EMBEDDING_MAX_UNITS=256
|
|
3200
|
+
EMBEDDING_RUN_ENCRYPTION_SECRET=
|
|
3201
|
+
# EMBEDDING_MAX_CONCURRENT_RUNS=1
|
|
3202
|
+
# EMBEDDING_RUN_TERMINAL_TTL_SECONDS=604800
|
|
3084
3203
|
QWEN_API_URL=
|
|
3085
3204
|
QWEN_API_KEY=
|
|
3086
3205
|
QWEN_MODEL=
|
|
@@ -3088,10 +3207,19 @@ AI_PROVIDER_HTTPS_HOST_ALLOWLIST=
|
|
|
3088
3207
|
# VLM Deployment \u793A\u4F8B\uFF1Atext-generation,vision\uFF1B\u8F93\u5165\u6A21\u6001\uFF1Atext,image
|
|
3089
3208
|
# AI_PROVIDER_CAPABILITIES=text-generation
|
|
3090
3209
|
# AI_PROVIDER_INPUT_MODALITIES=text
|
|
3210
|
+
# AI_PROVIDER_DEPLOYMENT_IDENTITY=
|
|
3211
|
+
# AI_PROVIDER_RELEASE_DIGEST=
|
|
3212
|
+
# AI_PROVIDER_READINESS_TTL_SECONDS=60
|
|
3213
|
+
# AI_PROVIDER_MAX_CONCURRENT_RUNS=1
|
|
3214
|
+
# AI_PROVIDER_MAX_QUEUE_DEPTH=0
|
|
3091
3215
|
# AI_PROVIDER_AUDIT_RETENTION_DAYS=90
|
|
3092
3216
|
# AI_PROVIDER_CONNECT_TIMEOUT_MS=5000
|
|
3093
3217
|
# AI_PROVIDER_REQUEST_TIMEOUT_MS=60000
|
|
3094
3218
|
# AI_PROVIDER_MAX_RESPONSE_BYTES=2097152
|
|
3219
|
+
# AI_PROVIDER_MAX_DURATION_SECONDS=300
|
|
3220
|
+
# AI_PROVIDER_MAX_INPUT_BYTES=67108864
|
|
3221
|
+
# AI_PROVIDER_MAX_ARTIFACTS=16
|
|
3222
|
+
# AI_PROVIDER_MAX_PIXELS_PER_ARTIFACT=100000000
|
|
3095
3223
|
` : ""}
|
|
3096
3224
|
|
|
3097
3225
|
${includeSearch ? `# OpenSearch profile \u9ED8\u8BA4\u4E0D\u542F\u52A8\uFF1Bbun run dev:search \u4F1A\u53EA\u5411 Server \u6CE8\u5165\u5BB9\u5668\u5185\u5730\u5740\u3002
|
|
@@ -3110,8 +3238,8 @@ OPENSEARCH_PASSWORD=
|
|
|
3110
3238
|
` : ""}
|
|
3111
3239
|
`;
|
|
3112
3240
|
}
|
|
3113
|
-
// src/
|
|
3114
|
-
function starterDocsReadme(includeOfflineLicense = true, includeAgent = true, includeOperations = true) {
|
|
3241
|
+
// src/starter-docs-readme.ts
|
|
3242
|
+
function starterDocsReadme(includeOfflineLicense = true, includeAgent = true, includeOperations = true, includeStorage = true) {
|
|
3115
3243
|
return `# Windy Starter \u6587\u6863
|
|
3116
3244
|
|
|
3117
3245
|
\u672C\u76EE\u5F55\u53EA\u5305\u542B\u5BA2\u6237\u8FD0\u884C\u9879\u76EE\u9700\u8981\u7684\u5E73\u53F0\u67B6\u6784\u3001\u5F00\u53D1\u63A5\u5165\u548C\u8FD0\u7EF4\u53EF\u89C2\u6D4B\u6027\u6587\u6863\u3002
|
|
@@ -3119,17 +3247,20 @@ License \u7B7E\u53D1\u4E2D\u5FC3\u3001\u72EC\u7ACB\u7B7E\u540D\u670D\u52A1\u3001
|
|
|
3119
3247
|
\u89C4\u5212\u5C5E\u4E8E\u8F6F\u4EF6\u4F9B\u5E94\u65B9\u63A7\u5236\u9762\uFF0C\u4E0D\u8FDB\u5165\u5BA2\u6237 Starter\u3002
|
|
3120
3248
|
|
|
3121
3249
|
- \u67B6\u6784\uFF1A\u4ECE [Module Manifest \u7EC4\u5408](./architecture/module-manifest-composition.md) \u5F00\u59CB\u3002
|
|
3250
|
+
- \u5916\u90E8\u51ED\u636E\uFF1A[\u6A21\u5757 Secret \u89E3\u6790 Port](./architecture/module-secret-resolution.md)\u3002
|
|
3122
3251
|
- \u6570\u636E\u5E93\uFF1A\u4E1A\u52A1\u8868\u4F7F\u7528 [Migration Bundle \u4E0E\u72EC\u7ACB Drizzle lineage](./architecture/migration-bundle.md)\u3002
|
|
3123
3252
|
- \u5E73\u53F0\u5F00\u53D1\uFF1A\u4ECE [\u7CFB\u7EDF CRUD API](./platform/system-crud-api.md) \u548C [CRUD \u751F\u6210\u5668](./development/crud-generator.md) \u5F00\u59CB\u3002
|
|
3124
3253
|
- Web \u4E1A\u52A1\u9875\u9762\uFF1A[project-owned \u4E1A\u52A1 Web \u8DEF\u7531](./development/business-web-routes.md)\u3002
|
|
3125
3254
|
- \u90E8\u7F72\u671F\u6A21\u5757\u7BA1\u7406\uFF1A[\u6A21\u5757\u751F\u547D\u5468\u671F](./development/module-lifecycle.md)\u3002
|
|
3126
3255
|
- \u4E1A\u52A1\u6A21\u5757\u5F00\u53D1\uFF1A[windy-business-module Skill](../.agents/skills/windy-business-module/SKILL.md)\u3002
|
|
3256
|
+
${includeStorage ? "- \u5927\u62A5\u544A\u5BFC\u5165\uFF1A[\u53D7\u6CBB\u7406\u7684\u5927\u62A5\u544A\u6682\u5B58](./architecture/report-staging.md)\u3002" : ""}
|
|
3127
3257
|
${includeOfflineLicense ? "- License \u6D88\u8D39\u7AEF\uFF1A[\u79BB\u7EBF\u6FC0\u6D3B\u4E0E\u5B89\u88C5\u534F\u8BAE](./license/license-offline-activation-code.md)\uFF1B\u8FD0\u884C\u65F6\u80FD\u529B\u7531 npm \u4F9D\u8D56 `@southwind-ai/license` \u63D0\u4F9B\u3002" : ""}
|
|
3128
3258
|
- \u8FD0\u7EF4\uFF1A[\u53EF\u89C2\u6D4B\u6027](./operations/observability.md)${includeOperations ? " \u4E0E [\u8FD0\u7EF4\u603B\u89C8](./platform/operations-overview.md)" : ""}\u3002
|
|
3129
3259
|
${includeAgent ? "- Agent\u3001\u591A\u6A21\u6001 Runtime \u4E0E MCP\uFF1A[Agent Runtime \u63A5\u5165](./platform/agent-runtime.md)\u3001[Document AI Runtime](./platform/document-ai-runtime.md)\u3001[Speech AI Runtime](./platform/speech-ai-runtime.md)\u3001[\u53D7\u63A7\u5DE5\u5177](./platform/agent-tools.md)\u4E0E[MCP \u4E1A\u52A1\u80FD\u529B](./architecture/mcp-business-capabilities.md)\u3002" : ""}
|
|
3130
3260
|
- \u517C\u5BB9\uFF1A[RuoYi-Vue Adapter](./adapters/ruoyi-vue-compatibility.md)\u3002
|
|
3131
3261
|
`;
|
|
3132
3262
|
}
|
|
3263
|
+
// src/project-files.ts
|
|
3133
3264
|
function starterReadme(projectName, includeExample = true, includeOxc = true, projectLicense = "UNLICENSED", selectedModules = []) {
|
|
3134
3265
|
const selected = new Set(selectedModules);
|
|
3135
3266
|
const includeAgent = selected.has("system.agent");
|
|
@@ -3428,6 +3559,8 @@ function createStarterPackage(source, projectName, includeOxc = true, projectLic
|
|
|
3428
3559
|
} : {},
|
|
3429
3560
|
...selectedModules.includes("system.agent") ? {
|
|
3430
3561
|
"dev:agent": "docker compose --profile agent up --build",
|
|
3562
|
+
"dev:speech": "PLATFORM_ENABLE_AI=true SPEECH_SERVER_URL=http://speech-server:8091 docker compose --profile agent --profile speech up --build",
|
|
3563
|
+
"speech:pins": "bun run scripts/provision-speech-readiness.ts",
|
|
3431
3564
|
"dev:adk-web": "bun run scripts/dev-adk-web.ts"
|
|
3432
3565
|
} : {},
|
|
3433
3566
|
...generatorVersion ? { windy: "create-windy" } : {},
|
|
@@ -3442,6 +3575,7 @@ function createStarterPackage(source, projectName, includeOxc = true, projectLic
|
|
|
3442
3575
|
"bun run --cwd apps/server typecheck",
|
|
3443
3576
|
"bun run --cwd packages/ai-client typecheck",
|
|
3444
3577
|
"bun run --cwd packages/jobs typecheck",
|
|
3578
|
+
"bun run --cwd packages/shared typecheck",
|
|
3445
3579
|
"bun run --cwd packages/server-sdk typecheck",
|
|
3446
3580
|
"bun run --cwd packages/storage typecheck",
|
|
3447
3581
|
"bun run --cwd packages/database typecheck",
|
|
@@ -3478,7 +3612,8 @@ var templateRootFiles = [
|
|
|
3478
3612
|
"package.json",
|
|
3479
3613
|
"scripts/notification-postgres-regression.ts",
|
|
3480
3614
|
"scripts/lib/postgres-regression.ts",
|
|
3481
|
-
"scripts/dev-adk-web.ts"
|
|
3615
|
+
"scripts/dev-adk-web.ts",
|
|
3616
|
+
"scripts/provision-speech-readiness.ts"
|
|
3482
3617
|
];
|
|
3483
3618
|
var templateDirectories = [
|
|
3484
3619
|
".agents/skills/windy-business-module",
|
|
@@ -3505,6 +3640,7 @@ var templateDocumentationFiles = [
|
|
|
3505
3640
|
"docs/architecture/admin-surface-boundary.md",
|
|
3506
3641
|
"docs/architecture/ai-egress.md",
|
|
3507
3642
|
"docs/architecture/ai-runtime.md",
|
|
3643
|
+
"docs/architecture/ai-runtime-readiness.md",
|
|
3508
3644
|
"docs/architecture/data-scope-query-enforcement.md",
|
|
3509
3645
|
"docs/architecture/durable-jobs.md",
|
|
3510
3646
|
"docs/architecture/foundation-infrastructure.md",
|
|
@@ -3513,8 +3649,11 @@ var templateDocumentationFiles = [
|
|
|
3513
3649
|
"docs/architecture/migration-bundle.md",
|
|
3514
3650
|
"docs/architecture/module-host.md",
|
|
3515
3651
|
"docs/architecture/module-manifest-composition.md",
|
|
3652
|
+
"docs/architecture/module-secret-resolution.md",
|
|
3516
3653
|
"docs/architecture/object-storage.md",
|
|
3654
|
+
"docs/architecture/report-staging.md",
|
|
3517
3655
|
"docs/architecture/search-provider-protocol.md",
|
|
3656
|
+
"docs/architecture/speech-variants.md",
|
|
3518
3657
|
"docs/architecture/server-module-interface.md",
|
|
3519
3658
|
"docs/architecture/web-access-snapshot-resilience.md",
|
|
3520
3659
|
"docs/development/business-web-routes.md",
|
|
@@ -3664,8 +3803,8 @@ function isGenerationProvenance(value) {
|
|
|
3664
3803
|
function isModuleVersion(value) {
|
|
3665
3804
|
if (!value || typeof value !== "object")
|
|
3666
3805
|
return false;
|
|
3667
|
-
const
|
|
3668
|
-
return typeof
|
|
3806
|
+
const module2 = value;
|
|
3807
|
+
return typeof module2.name === "string" && module2.name.length > 0 && typeof module2.version === "string" && module2.version.length > 0;
|
|
3669
3808
|
}
|
|
3670
3809
|
|
|
3671
3810
|
// src/registry-dependencies.ts
|
|
@@ -3866,10 +4005,10 @@ async function generateProject(input) {
|
|
|
3866
4005
|
const packageJson = JSON.parse(await readFile10(packagePath, "utf8"));
|
|
3867
4006
|
await writeFile9(packagePath, `${JSON.stringify(createStarterPackage(packageJson, input.projectName, includeOxc, projectLicense, selectedModules, templateMetadata.generatorVersion), null, 2)}
|
|
3868
4007
|
`);
|
|
3869
|
-
await writeFile9(join11(input.targetDirectory, "docker-compose.yml"), starterComposeFor(selectedModules.includes("system.agent"), selectedModules.includes("system.search")));
|
|
3870
|
-
await writeFile9(join11(input.targetDirectory, ".env.example"), environmentExample(includeExample, selectedModules.includes("system.agent"), selectedModules.includes("system.search")));
|
|
4008
|
+
await writeFile9(join11(input.targetDirectory, "docker-compose.yml"), starterComposeFor(selectedModules.includes("system.agent"), selectedModules.includes("system.search"), selectedModules.includes("system.storage")));
|
|
4009
|
+
await writeFile9(join11(input.targetDirectory, ".env.example"), environmentExample(includeExample, selectedModules.includes("system.agent"), selectedModules.includes("system.search"), selectedModules.includes("system.storage")));
|
|
3871
4010
|
await writeFile9(join11(input.targetDirectory, "README.md"), starterReadme(input.projectName, includeExample, includeOxc, projectLicense, selectedModules));
|
|
3872
|
-
await writeFile9(join11(input.targetDirectory, "docs/README.md"), starterDocsReadme(selectedModules.includes("system.license"), selectedModules.includes("system.agent"), selectedModules.includes("system.operations")));
|
|
4011
|
+
await writeFile9(join11(input.targetDirectory, "docs/README.md"), starterDocsReadme(selectedModules.includes("system.license"), selectedModules.includes("system.agent"), selectedModules.includes("system.operations"), selectedModules.includes("system.storage")));
|
|
3873
4012
|
await reflectCodeQualityChoice(input.targetDirectory, includeOxc);
|
|
3874
4013
|
await applyWindyBaseLicense(input.targetDirectory);
|
|
3875
4014
|
await applyProjectLicense(input.targetDirectory, projectLicense, input.licenseHolder);
|
|
@@ -7574,6 +7713,16 @@ var recipes = [
|
|
|
7574
7713
|
id: "starter-0.5.0-to-0.5.1",
|
|
7575
7714
|
from: "0.5.0",
|
|
7576
7715
|
to: "0.5.1"
|
|
7716
|
+
},
|
|
7717
|
+
{
|
|
7718
|
+
id: "starter-0.5.1-to-0.5.2",
|
|
7719
|
+
from: "0.5.1",
|
|
7720
|
+
to: "0.5.2"
|
|
7721
|
+
},
|
|
7722
|
+
{
|
|
7723
|
+
id: "starter-0.5.2-to-0.6.0",
|
|
7724
|
+
from: "0.5.2",
|
|
7725
|
+
to: "0.6.0"
|
|
7577
7726
|
}
|
|
7578
7727
|
];
|
|
7579
7728
|
function resolveRecipeChain(sourceVersion, targetVersion) {
|
|
@@ -8457,6 +8606,146 @@ import { join as join23 } from "path";
|
|
|
8457
8606
|
import { mkdtemp as mkdtemp2, rm as rm6, writeFile as writeFile12 } from "fs/promises";
|
|
8458
8607
|
import { tmpdir as tmpdir2 } from "os";
|
|
8459
8608
|
import { join as join22 } from "path";
|
|
8609
|
+
|
|
8610
|
+
// src/update/merge-convergent-additions.ts
|
|
8611
|
+
async function reconcileConvergentAdditions(input) {
|
|
8612
|
+
const [oursDiff, theirsDiff] = await Promise.all([
|
|
8613
|
+
diff(input.root, input.basePath, input.oursPath),
|
|
8614
|
+
diff(input.root, input.basePath, input.theirsPath)
|
|
8615
|
+
]);
|
|
8616
|
+
if (oursDiff === undefined || theirsDiff === undefined)
|
|
8617
|
+
return;
|
|
8618
|
+
const oursAdditions = pureAdditions(oursDiff);
|
|
8619
|
+
const theirsAdditions = pureAdditions(theirsDiff);
|
|
8620
|
+
const oursByContent = new Map;
|
|
8621
|
+
for (const addition of oursAdditions) {
|
|
8622
|
+
const key = addition.lines.join(`
|
|
8623
|
+
`);
|
|
8624
|
+
oursByContent.set(key, [...oursByContent.get(key) ?? [], addition]);
|
|
8625
|
+
}
|
|
8626
|
+
const decode = (content) => new TextDecoder().decode(content);
|
|
8627
|
+
const baseLines = decode(input.base).split(`
|
|
8628
|
+
`);
|
|
8629
|
+
const oursLines = decode(input.ours).split(`
|
|
8630
|
+
`);
|
|
8631
|
+
const theirsLines = decode(input.theirs).split(`
|
|
8632
|
+
`);
|
|
8633
|
+
const mergedLines = input.merged.split(`
|
|
8634
|
+
`);
|
|
8635
|
+
const convergent = theirsAdditions.flatMap((addition) => {
|
|
8636
|
+
if (!isSubstantial(addition.lines) || !isNamedClassMethod(addition.lines)) {
|
|
8637
|
+
return [];
|
|
8638
|
+
}
|
|
8639
|
+
const key = addition.lines.join(`
|
|
8640
|
+
`);
|
|
8641
|
+
const matchingOurs = oursByContent.get(key);
|
|
8642
|
+
if (matchingOurs?.length !== 1)
|
|
8643
|
+
return [];
|
|
8644
|
+
if (theirsAdditions.filter((candidate2) => candidate2.lines.join(`
|
|
8645
|
+
`) === key).length !== 1) {
|
|
8646
|
+
return [];
|
|
8647
|
+
}
|
|
8648
|
+
const oursContainer = enclosingClass(oursLines, matchingOurs[0]);
|
|
8649
|
+
const theirsContainer = enclosingClass(theirsLines, addition);
|
|
8650
|
+
if (!oursContainer || oursContainer !== theirsContainer)
|
|
8651
|
+
return [];
|
|
8652
|
+
return countSequence(baseLines, addition.lines) === 0 && countSequence(oursLines, addition.lines) === 1 && countSequence(theirsLines, addition.lines) === 1 && countSequence(mergedLines, addition.lines) > 1 ? [{ ours: matchingOurs[0], theirs: addition }] : [];
|
|
8653
|
+
});
|
|
8654
|
+
if (convergent.length !== 1)
|
|
8655
|
+
return;
|
|
8656
|
+
const candidate = convergent[0];
|
|
8657
|
+
if (!candidate)
|
|
8658
|
+
return;
|
|
8659
|
+
const oursWithout = withoutAddition(oursLines, candidate.ours);
|
|
8660
|
+
const theirsWithout = withoutAddition(theirsLines, candidate.theirs);
|
|
8661
|
+
if (!oursWithout || !theirsWithout || !sameLines(oursWithout, theirsWithout)) {
|
|
8662
|
+
return;
|
|
8663
|
+
}
|
|
8664
|
+
return input.ours;
|
|
8665
|
+
}
|
|
8666
|
+
async function diff(root, basePath, branchPath) {
|
|
8667
|
+
const result2 = await captureProcess("git", ["diff", "--no-index", "--unified=0", "--no-color", basePath, branchPath], root);
|
|
8668
|
+
return result2.code === 0 || result2.code === 1 ? result2.stdout : undefined;
|
|
8669
|
+
}
|
|
8670
|
+
function pureAdditions(diff2) {
|
|
8671
|
+
const lines = diff2.split(`
|
|
8672
|
+
`);
|
|
8673
|
+
const additions = [];
|
|
8674
|
+
for (let index = 0;index < lines.length; index += 1) {
|
|
8675
|
+
const match = /^@@ -\d+(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/.exec(lines[index] ?? "");
|
|
8676
|
+
if (!match)
|
|
8677
|
+
continue;
|
|
8678
|
+
const oldCount = match[1] === undefined ? 1 : Number(match[1]);
|
|
8679
|
+
const start = Number(match[2]);
|
|
8680
|
+
const newCount = match[3] === undefined ? 1 : Number(match[3]);
|
|
8681
|
+
if (oldCount !== 0 || newCount === 0)
|
|
8682
|
+
continue;
|
|
8683
|
+
const added = [];
|
|
8684
|
+
for (let cursor = index + 1;cursor < lines.length; cursor += 1) {
|
|
8685
|
+
const line = lines[cursor] ?? "";
|
|
8686
|
+
if (line.startsWith("@@ "))
|
|
8687
|
+
break;
|
|
8688
|
+
if (line.startsWith("+"))
|
|
8689
|
+
added.push(line.slice(1));
|
|
8690
|
+
}
|
|
8691
|
+
if (added.length === newCount)
|
|
8692
|
+
additions.push({ start, lines: added });
|
|
8693
|
+
}
|
|
8694
|
+
return additions;
|
|
8695
|
+
}
|
|
8696
|
+
function isSubstantial(lines) {
|
|
8697
|
+
return lines.filter((line) => line.trim()).length >= 3 && lines.join(`
|
|
8698
|
+
`).length >= 32;
|
|
8699
|
+
}
|
|
8700
|
+
function isNamedClassMethod(lines) {
|
|
8701
|
+
const first = lines.find((line) => line.trim())?.trim() ?? "";
|
|
8702
|
+
const last = [...lines].reverse().find((line) => line.trim())?.trim() ?? "";
|
|
8703
|
+
return /^(?:(?:public|protected|private|static|abstract|override|async|declare|get|set)\s+)*(?:\*\s*)?[A-Za-z_$][\w$]*\s*(?:<[^>{}]*>)?\s*\(/.test(first) && lines.some((line) => line.includes("{")) && /^}\s*;?$/.test(last);
|
|
8704
|
+
}
|
|
8705
|
+
function enclosingClass(lines, addition) {
|
|
8706
|
+
const memberIndent = leadingWhitespace(addition.lines.find((line) => line.trim()) ?? "");
|
|
8707
|
+
for (let index = addition.start - 2;index >= 0; index -= 1) {
|
|
8708
|
+
const line = lines[index] ?? "";
|
|
8709
|
+
if (!line.trim() || leadingWhitespace(line) >= memberIndent)
|
|
8710
|
+
continue;
|
|
8711
|
+
const match = /^(\s*)(?:(?:export|default|abstract|declare)\s+)*class\s+([A-Za-z_$][\w$]*)\b/.exec(line);
|
|
8712
|
+
if (!match)
|
|
8713
|
+
return;
|
|
8714
|
+
const name = match[2] ?? "";
|
|
8715
|
+
const ordinal = lines.slice(0, index + 1).filter((candidate) => new RegExp(`^\\s*(?:(?:export|default|abstract|declare)\\s+)*class\\s+${escapeRegExp2(name)}\\b`).test(candidate)).length;
|
|
8716
|
+
return `${name}#${ordinal}`;
|
|
8717
|
+
}
|
|
8718
|
+
}
|
|
8719
|
+
function leadingWhitespace(line) {
|
|
8720
|
+
return /^\s*/.exec(line)?.[0].length ?? 0;
|
|
8721
|
+
}
|
|
8722
|
+
function escapeRegExp2(value) {
|
|
8723
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
8724
|
+
}
|
|
8725
|
+
function countSequence(lines, sequence) {
|
|
8726
|
+
let count = 0;
|
|
8727
|
+
for (let index = 0;index <= lines.length - sequence.length; index += 1) {
|
|
8728
|
+
if (sameLines(lines.slice(index, index + sequence.length), sequence)) {
|
|
8729
|
+
count += 1;
|
|
8730
|
+
}
|
|
8731
|
+
}
|
|
8732
|
+
return count;
|
|
8733
|
+
}
|
|
8734
|
+
function withoutAddition(lines, addition) {
|
|
8735
|
+
const index = addition.start - 1;
|
|
8736
|
+
if (!sameLines(lines.slice(index, index + addition.lines.length), addition.lines)) {
|
|
8737
|
+
return;
|
|
8738
|
+
}
|
|
8739
|
+
return [
|
|
8740
|
+
...lines.slice(0, index),
|
|
8741
|
+
...lines.slice(index + addition.lines.length)
|
|
8742
|
+
];
|
|
8743
|
+
}
|
|
8744
|
+
function sameLines(left, right) {
|
|
8745
|
+
return left.length === right.length && left.every((line, index) => line === right[index]);
|
|
8746
|
+
}
|
|
8747
|
+
|
|
8748
|
+
// src/update/merge.ts
|
|
8460
8749
|
async function mergeTextFile(base, ours, theirs) {
|
|
8461
8750
|
const root = await mkdtemp2(join22(tmpdir2(), "windy-merge-"));
|
|
8462
8751
|
try {
|
|
@@ -8470,6 +8759,19 @@ async function mergeTextFile(base, ours, theirs) {
|
|
|
8470
8759
|
]);
|
|
8471
8760
|
const result2 = await captureProcess("git", ["merge-file", "-p", "--diff3", oursPath, basePath, theirsPath], root);
|
|
8472
8761
|
if (result2.code === 0) {
|
|
8762
|
+
const reconciledContent = await reconcileConvergentAdditions({
|
|
8763
|
+
root,
|
|
8764
|
+
basePath,
|
|
8765
|
+
oursPath,
|
|
8766
|
+
theirsPath,
|
|
8767
|
+
base,
|
|
8768
|
+
ours,
|
|
8769
|
+
theirs,
|
|
8770
|
+
merged: result2.stdout
|
|
8771
|
+
});
|
|
8772
|
+
if (reconciledContent !== undefined) {
|
|
8773
|
+
return { content: reconciledContent };
|
|
8774
|
+
}
|
|
8473
8775
|
return { content: new TextEncoder().encode(result2.stdout) };
|
|
8474
8776
|
}
|
|
8475
8777
|
if (result2.code === 1) {
|
|
@@ -8866,6 +9168,33 @@ function resolveModuleRecipeIds(request) {
|
|
|
8866
9168
|
return lifecycle.updatedModules.flatMap((name) => catalog.get(name).updateRecipes);
|
|
8867
9169
|
}
|
|
8868
9170
|
|
|
9171
|
+
// src/update/planner-project-owned-tests.ts
|
|
9172
|
+
var testSuffixes = [
|
|
9173
|
+
".webtest.ts",
|
|
9174
|
+
".webtest.tsx",
|
|
9175
|
+
".test.ts",
|
|
9176
|
+
".test.tsx"
|
|
9177
|
+
];
|
|
9178
|
+
var sourceExtensions = [".vue", ".ts", ".tsx", ".js", ".jsx"];
|
|
9179
|
+
function preserveTestsForExistingProjectOwnedSources(files, sourceEntries) {
|
|
9180
|
+
const projectOwnedSourcePaths = new Set([...sourceEntries.values()].filter(({ ownership }) => ownership === "project-owned").map(({ path: path2 }) => path2));
|
|
9181
|
+
for (const file of files) {
|
|
9182
|
+
if (file.ownership !== "project-owned" || file.action !== "create" || !hasExistingSourceForTest(file.path, projectOwnedSourcePaths)) {
|
|
9183
|
+
continue;
|
|
9184
|
+
}
|
|
9185
|
+
file.action = "preserve";
|
|
9186
|
+
file.reason = "\u9879\u76EE\u81EA\u6709\u5B9E\u73B0\u5DF2\u5B58\u5728\uFF0C\u4E0D\u65B0\u589E\u4E0A\u6E38\u884C\u4E3A\u6D4B\u8BD5";
|
|
9187
|
+
delete file.content;
|
|
9188
|
+
}
|
|
9189
|
+
}
|
|
9190
|
+
function hasExistingSourceForTest(path2, sourcePaths) {
|
|
9191
|
+
const suffix = testSuffixes.find((candidate) => path2.endsWith(candidate));
|
|
9192
|
+
if (!suffix)
|
|
9193
|
+
return false;
|
|
9194
|
+
const stem = path2.slice(0, -suffix.length);
|
|
9195
|
+
return sourceExtensions.some((extension) => sourcePaths.has(`${stem}${extension}`));
|
|
9196
|
+
}
|
|
9197
|
+
|
|
8869
9198
|
// src/update/planner-snapshots.ts
|
|
8870
9199
|
import { readFile as readFile20, stat as stat2 } from "fs/promises";
|
|
8871
9200
|
import { join as join24 } from "path";
|
|
@@ -8961,7 +9290,7 @@ var oxcManagedPaths = new Set([
|
|
|
8961
9290
|
".oxlintrc.json",
|
|
8962
9291
|
".husky/pre-commit"
|
|
8963
9292
|
]);
|
|
8964
|
-
async function createUpdatePlan(request, artifacts) {
|
|
9293
|
+
async function createUpdatePlan(request, artifacts, dependencies = {}) {
|
|
8965
9294
|
await assertProjectReadyForUpdate(request.projectDirectory);
|
|
8966
9295
|
const manifestPath = join25(request.projectDirectory, ".windy/files.json");
|
|
8967
9296
|
const expectedManifestHash = hashContent(await readFile21(manifestPath));
|
|
@@ -8974,7 +9303,7 @@ async function createUpdatePlan(request, artifacts) {
|
|
|
8974
9303
|
if (targetVersion !== targetProvenance.generatorVersion) {
|
|
8975
9304
|
throw new Error(`\u5F53\u524D CLI \u53EA\u80FD\u66F4\u65B0\u5230 ${targetProvenance.generatorVersion}\uFF0C\u8BF7\u8FD0\u884C create-windy@${targetVersion}`);
|
|
8976
9305
|
}
|
|
8977
|
-
const versionRecipes = resolveRecipeChain(provenance.windyVersion, targetVersion);
|
|
9306
|
+
const versionRecipes = (dependencies.resolveVersionRecipes ?? resolveRecipeChain)(provenance.windyVersion, targetVersion);
|
|
8978
9307
|
const moduleRecipes = resolveModuleRecipeIds(request);
|
|
8979
9308
|
const recipes2 = [...versionRecipes.map(({ id }) => id), ...moduleRecipes];
|
|
8980
9309
|
const [rawSourceManifest, rawTargetManifest] = await Promise.all([
|
|
@@ -9025,6 +9354,7 @@ async function createUpdatePlan(request, artifacts) {
|
|
|
9025
9354
|
manageGeneratedProjectOwned: request.targetModules !== undefined,
|
|
9026
9355
|
forcePlatformBaseline: request.forcePlatformBaseline === true
|
|
9027
9356
|
});
|
|
9357
|
+
preserveTestsForExistingProjectOwnedSources(files, sourceEntries);
|
|
9028
9358
|
await deriveDockerfilePlans(files, projectSnapshots, new Set([
|
|
9029
9359
|
...paths,
|
|
9030
9360
|
...workspaceSnapshot.manifests.keys(),
|
|
@@ -10168,7 +10498,7 @@ async function runUpdate(args, projectDirectory) {
|
|
|
10168
10498
|
console.log(recipes2.length ? `\u53EF\u66F4\u65B0\uFF1A${current.windyVersion} \u2192 ${target}\uFF08${recipes2.length} \u4E2A\u8FDE\u7EED recipe\uFF09` : `\u5DF2\u662F\u5F53\u524D CLI \u652F\u6301\u7684\u6700\u65B0\u7248\u672C ${current.windyVersion}`);
|
|
10169
10499
|
return;
|
|
10170
10500
|
}
|
|
10171
|
-
if (!recipes2.length) {
|
|
10501
|
+
if (!recipes2.length && current.templateCommit === template.templateCommit) {
|
|
10172
10502
|
console.log(`\u9879\u76EE\u5DF2\u7ECF\u662F ${target}\uFF0C\u65E0\u9700\u66F4\u65B0`);
|
|
10173
10503
|
return;
|
|
10174
10504
|
}
|
|
@@ -10358,8 +10688,8 @@ function isPlatform(value) {
|
|
|
10358
10688
|
function isModule(value) {
|
|
10359
10689
|
if (!value || typeof value !== "object")
|
|
10360
10690
|
return false;
|
|
10361
|
-
const
|
|
10362
|
-
return typeof
|
|
10691
|
+
const module2 = value;
|
|
10692
|
+
return typeof module2.key === "string" && /^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(module2.key) && isStringList(module2.schema) && typeof module2.out === "string" && isStringList(module2.legacyPlatformTables) && module2.legacyPlatformTables.every(isTableName);
|
|
10363
10693
|
}
|
|
10364
10694
|
function isStringList(value) {
|
|
10365
10695
|
return Array.isArray(value) && value.length > 0 && value.every((item) => typeof item === "string" && item.length > 0);
|
|
@@ -10376,10 +10706,10 @@ function validatePaths(projectDirectory, config) {
|
|
|
10376
10706
|
resolveProjectPath(projectDirectory, path2);
|
|
10377
10707
|
}
|
|
10378
10708
|
const platformOut = resolveProjectPath(projectDirectory, config.platform.out);
|
|
10379
|
-
for (const
|
|
10380
|
-
const moduleOut = resolveProjectPath(projectDirectory,
|
|
10709
|
+
for (const module2 of config.modules) {
|
|
10710
|
+
const moduleOut = resolveProjectPath(projectDirectory, module2.out);
|
|
10381
10711
|
if (moduleOut === platformOut || moduleOut.startsWith(`${platformOut}/`) || platformOut.startsWith(`${moduleOut}/`)) {
|
|
10382
|
-
throw new Error(`${
|
|
10712
|
+
throw new Error(`${module2.key} \u7684 lineage \u8F93\u51FA\u4E0D\u80FD\u4E0E\u5E73\u53F0\u76EE\u5F55\u91CD\u53E0`);
|
|
10383
10713
|
}
|
|
10384
10714
|
}
|
|
10385
10715
|
}
|
|
@@ -10387,14 +10717,14 @@ function validateUniqueness(config) {
|
|
|
10387
10717
|
const keys = new Set;
|
|
10388
10718
|
const outputs = new Set;
|
|
10389
10719
|
const tables = new Set;
|
|
10390
|
-
for (const
|
|
10391
|
-
if (keys.has(
|
|
10392
|
-
throw new Error(`Module key \u91CD\u590D\uFF1A${
|
|
10393
|
-
if (outputs.has(
|
|
10394
|
-
throw new Error(`Module lineage \u8F93\u51FA\u91CD\u590D\uFF1A${
|
|
10395
|
-
keys.add(
|
|
10396
|
-
outputs.add(
|
|
10397
|
-
for (const table of
|
|
10720
|
+
for (const module2 of config.modules) {
|
|
10721
|
+
if (keys.has(module2.key))
|
|
10722
|
+
throw new Error(`Module key \u91CD\u590D\uFF1A${module2.key}`);
|
|
10723
|
+
if (outputs.has(module2.out))
|
|
10724
|
+
throw new Error(`Module lineage \u8F93\u51FA\u91CD\u590D\uFF1A${module2.out}`);
|
|
10725
|
+
keys.add(module2.key);
|
|
10726
|
+
outputs.add(module2.out);
|
|
10727
|
+
for (const table of module2.legacyPlatformTables) {
|
|
10398
10728
|
if (tables.has(table))
|
|
10399
10729
|
throw new Error(`\u65E7\u5E73\u53F0\u8868\u91CD\u590D\u58F0\u660E\uFF1A${table}`);
|
|
10400
10730
|
tables.add(table);
|
|
@@ -10450,27 +10780,27 @@ async function handoffModuleSchemaLineages(options) {
|
|
|
10450
10780
|
}
|
|
10451
10781
|
return {
|
|
10452
10782
|
moduleCount: config.modules.length,
|
|
10453
|
-
tableCount: config.modules.reduce((total,
|
|
10783
|
+
tableCount: config.modules.reduce((total, module2) => total + module2.legacyPlatformTables.length, 0)
|
|
10454
10784
|
};
|
|
10455
10785
|
}
|
|
10456
10786
|
async function stageModuleLineages(project, temporaryRoot, config, execute) {
|
|
10457
10787
|
const outputs = [];
|
|
10458
|
-
for (const [index,
|
|
10788
|
+
for (const [index, module2] of config.modules.entries()) {
|
|
10459
10789
|
const output = join28(temporaryRoot, `module-${index}`);
|
|
10460
10790
|
await mkdir9(output, { recursive: true });
|
|
10461
10791
|
const generatedConfig = join28(temporaryRoot, `module-${index}.config.ts`);
|
|
10462
|
-
await writeDrizzleConfig(generatedConfig, project,
|
|
10792
|
+
await writeDrizzleConfig(generatedConfig, project, module2.schema, relative6(temporaryRoot, output));
|
|
10463
10793
|
await execute(generatedConfig, temporaryRoot);
|
|
10464
10794
|
const sqlFiles = await listSqlFiles(output);
|
|
10465
10795
|
if (sqlFiles.length !== 1) {
|
|
10466
|
-
throw new Error(`${
|
|
10796
|
+
throw new Error(`${module2.key} baseline \u5FC5\u987B\u6070\u597D\u751F\u6210\u4E00\u4E2A migration`);
|
|
10467
10797
|
}
|
|
10468
10798
|
await writeFile14(join28(output, sqlFiles[0]), metadataOnlySql("module"));
|
|
10469
10799
|
await writeFile14(join28(output, "lineage.json"), `${JSON.stringify({
|
|
10470
10800
|
schemaVersion: 1,
|
|
10471
|
-
moduleKey:
|
|
10472
|
-
schema:
|
|
10473
|
-
legacyPlatformTables:
|
|
10801
|
+
moduleKey: module2.key,
|
|
10802
|
+
schema: module2.schema,
|
|
10803
|
+
legacyPlatformTables: module2.legacyPlatformTables,
|
|
10474
10804
|
productionExecutor: "module-migration-bundle"
|
|
10475
10805
|
}, null, 2)}
|
|
10476
10806
|
`);
|
|
@@ -10503,10 +10833,10 @@ async function installStagedLineages(project, temporaryRoot, config, stagedModul
|
|
|
10503
10833
|
await rename2(platform, backup);
|
|
10504
10834
|
try {
|
|
10505
10835
|
await rename2(stagedPlatform, platform);
|
|
10506
|
-
for (const [index,
|
|
10507
|
-
const output = resolveProjectPath(project,
|
|
10836
|
+
for (const [index, module2] of config.modules.entries()) {
|
|
10837
|
+
const output = resolveProjectPath(project, module2.out);
|
|
10508
10838
|
if (await exists(output)) {
|
|
10509
|
-
throw new Error(`${
|
|
10839
|
+
throw new Error(`${module2.key} lineage \u8F93\u51FA\u5DF2\u5B58\u5728\uFF0C\u7981\u6B62\u8986\u76D6`);
|
|
10510
10840
|
}
|
|
10511
10841
|
await mkdir9(dirname9(output), { recursive: true });
|
|
10512
10842
|
await rename2(stagedModules[index], output);
|
|
@@ -10538,9 +10868,9 @@ async function validateSchemaSources(project, config) {
|
|
|
10538
10868
|
]) {
|
|
10539
10869
|
await access3(resolveProjectPath(project, schema));
|
|
10540
10870
|
}
|
|
10541
|
-
for (const
|
|
10542
|
-
if (await exists(resolveProjectPath(project,
|
|
10543
|
-
throw new Error(`${
|
|
10871
|
+
for (const module2 of config.modules) {
|
|
10872
|
+
if (await exists(resolveProjectPath(project, module2.out))) {
|
|
10873
|
+
throw new Error(`${module2.key} lineage \u8F93\u51FA\u5DF2\u5B58\u5728\uFF0C\u7981\u6B62\u8986\u76D6`);
|
|
10544
10874
|
}
|
|
10545
10875
|
}
|
|
10546
10876
|
}
|