create-windy 0.6.11 → 0.6.14
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 +580 -269
- package/package.json +1 -1
- package/template/.agents/skills/windy-business-module/SKILL.md +98 -70
- package/template/.windy-template.json +3 -3
- package/template/AGENTS.md +3 -6
- package/template/apps/agent-server/Dockerfile +2 -3
- package/template/apps/agent-server/README.md +38 -54
- package/template/apps/agent-server/pyproject.toml +0 -1
- package/template/apps/agent-server/src/southwind_agent_server/app.py +4 -2
- package/template/apps/agent-server/src/southwind_agent_server/attempt_context.py +191 -0
- package/template/apps/agent-server/src/southwind_agent_server/attempt_context_projection.py +203 -0
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_contracts.py +61 -0
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_governance.py +82 -0
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_routes.py +121 -0
- package/template/apps/agent-server/src/southwind_agent_server/client_completion_runtime.py +158 -0
- package/template/apps/agent-server/src/southwind_agent_server/context_message_digest.py +24 -0
- package/template/apps/agent-server/src/southwind_agent_server/context_version_contracts.py +71 -0
- package/template/apps/agent-server/src/southwind_agent_server/context_version_port.py +307 -0
- package/template/apps/agent-server/src/southwind_agent_server/contracts.py +39 -0
- package/template/apps/agent-server/src/southwind_agent_server/deterministic.py +2 -0
- package/template/apps/agent-server/src/southwind_agent_server/engine.py +9 -1
- package/template/apps/agent-server/src/southwind_agent_server/engine_identity.py +2 -0
- package/template/apps/agent-server/src/southwind_agent_server/fingerprint.py +15 -0
- package/template/apps/agent-server/src/southwind_agent_server/health_routes.py +37 -3
- package/template/apps/agent-server/src/southwind_agent_server/openai_engine.py +46 -26
- package/template/apps/agent-server/src/southwind_agent_server/openai_engine_validation.py +32 -0
- package/template/apps/agent-server/src/southwind_agent_server/openai_provider.py +7 -0
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_insert.py +5 -2
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_queries.py +1 -0
- package/template/apps/agent-server/src/southwind_agent_server/postgres_report_store.py +6 -1
- package/template/apps/agent-server/src/southwind_agent_server/postgres_store.py +3 -2
- package/template/apps/agent-server/src/southwind_agent_server/postgres_store_backend.py +1 -0
- package/template/apps/agent-server/src/southwind_agent_server/provider_governance.py +21 -0
- package/template/apps/agent-server/src/southwind_agent_server/report_lifecycle.py +2 -1
- package/template/apps/agent-server/src/southwind_agent_server/report_presenter.py +1 -0
- package/template/apps/agent-server/src/southwind_agent_server/report_routes.py +7 -1
- package/template/apps/agent-server/src/southwind_agent_server/report_store.py +10 -56
- package/template/apps/agent-server/src/southwind_agent_server/report_store_protocol.py +75 -0
- package/template/apps/agent-server/src/southwind_agent_server/report_types.py +9 -2
- package/template/apps/agent-server/src/southwind_agent_server/runtime_budget.py +74 -0
- package/template/apps/agent-server/src/southwind_agent_server/runtime_factory.py +11 -3
- package/template/apps/agent-server/src/southwind_agent_server/service.py +41 -65
- package/template/apps/agent-server/src/southwind_agent_server/service_control.py +64 -0
- package/template/apps/agent-server/src/southwind_agent_server/service_execution.py +3 -0
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_errors.py +2 -0
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_schema.py +9 -1
- package/template/apps/agent-server/src/southwind_agent_server/sqlite_store.py +6 -5
- package/template/apps/agent-server/src/southwind_agent_server/store.py +2 -0
- package/template/apps/agent-server/src/southwind_agent_server/trajectory.py +137 -0
- package/template/apps/agent-server/src/southwind_agent_server/unavailable_engine.py +58 -0
- package/template/apps/agent-server/tests/test_api.py +30 -11
- package/template/apps/agent-server/tests/test_client_completion.py +230 -0
- package/template/apps/agent-server/tests/test_provider_attempt_reporting.py +12 -24
- package/template/apps/agent-server/tests/test_report_resilience.py +2 -0
- package/template/apps/agent-server/tests/test_report_routes.py +58 -1
- package/template/apps/agent-server/tests/test_report_summary_parity.py +1 -0
- package/template/apps/agent-server/tests/test_run_capacity.py +2 -0
- package/template/apps/agent-server/tests/test_runtime_factory_readiness.py +18 -3
- package/template/apps/agent-server/tests/test_trajectory.py +91 -0
- package/template/apps/agent-server/uv.lock +0 -259
- package/template/apps/server/Dockerfile +9 -4
- package/template/apps/server/src/agent/actor-projection-audit.ts +6 -0
- package/template/apps/server/src/agent/agent-run-delegation-policy.ts +115 -0
- package/template/apps/server/src/agent/agent-session-bootstrap.ts +23 -0
- package/template/apps/server/src/agent/{debug-session-facade-provider-failure.test.ts → agent-session-facade-provider-failure.test.ts} +24 -33
- package/template/apps/server/src/agent/{debug-session-facade.test.ts → agent-session-facade.test.ts} +34 -45
- package/template/apps/server/src/agent/{debug-session-facade.ts → agent-session-facade.ts} +50 -57
- package/template/apps/server/src/agent/{debug-session-id.test.ts → agent-session-id.test.ts} +5 -5
- package/template/apps/server/src/agent/{debug-session-id.ts → agent-session-id.ts} +7 -7
- package/template/apps/server/src/agent/{debug-session-provider-reader.ts → agent-session-provider-reader.ts} +18 -15
- package/template/apps/server/src/agent/{debug-session-routes.test.ts → agent-session-routes.test.ts} +16 -16
- package/template/apps/server/src/agent/{debug-session-routes.ts → agent-session-routes.ts} +12 -12
- package/template/apps/server/src/agent/{debug-session-validation.ts → agent-session-validation.ts} +13 -11
- package/template/apps/server/src/agent/client-session/authorization.ts +47 -0
- package/template/apps/server/src/agent/client-session/bootstrap.ts +96 -0
- package/template/apps/server/src/agent/client-session/capabilities.ts +19 -0
- package/template/apps/server/src/agent/client-session/completion.ts +299 -0
- package/template/apps/server/src/agent/client-session/contracts.ts +136 -0
- package/template/apps/server/src/agent/client-session/digest.ts +39 -0
- package/template/apps/server/src/agent/client-session/drizzle-repository.integration.test.ts +170 -0
- package/template/apps/server/src/agent/client-session/drizzle-repository.ts +345 -0
- package/template/apps/server/src/agent/client-session/errors.ts +28 -0
- package/template/apps/server/src/agent/client-session/fixtures/page-agent-1.12.2-request.json +52 -0
- package/template/apps/server/src/agent/client-session/host-auth.test.ts +144 -0
- package/template/apps/server/src/agent/client-session/host-auth.ts +110 -0
- package/template/apps/server/src/agent/client-session/manifest-admission.ts +240 -0
- package/template/apps/server/src/agent/client-session/openai-stream.ts +123 -0
- package/template/apps/server/src/agent/client-session/presentation.ts +46 -0
- package/template/apps/server/src/agent/client-session/remote-provider.test.ts +144 -0
- package/template/apps/server/src/agent/client-session/remote-provider.ts +216 -0
- package/template/apps/server/src/agent/client-session/repository.ts +225 -0
- package/template/apps/server/src/agent/client-session/request.test.ts +69 -0
- package/template/apps/server/src/agent/client-session/request.ts +289 -0
- package/template/apps/server/src/agent/client-session/revocation.ts +23 -0
- package/template/apps/server/src/agent/client-session/routes.ts +315 -0
- package/template/apps/server/src/agent/client-session/runtime-audit.ts +42 -0
- package/template/apps/server/src/agent/client-session/service.test-support.ts +226 -0
- package/template/apps/server/src/agent/client-session/service.test.ts +268 -0
- package/template/apps/server/src/agent/client-session/service.ts +346 -0
- package/template/apps/server/src/agent/context-memory/attempt-context-contracts.ts +60 -0
- package/template/apps/server/src/agent/context-memory/authoritative-source-registry.ts +127 -0
- package/template/apps/server/src/agent/context-memory/context-builder.test.ts +160 -0
- package/template/apps/server/src/agent/context-memory/context-builder.ts +184 -0
- package/template/apps/server/src/agent/context-memory/contracts.ts +284 -0
- package/template/apps/server/src/agent/context-memory/digest.ts +22 -0
- package/template/apps/server/src/agent/context-memory/memory-authorization.ts +82 -0
- package/template/apps/server/src/agent/context-memory/memory-content.ts +69 -0
- package/template/apps/server/src/agent/context-memory/memory-object-registry.ts +87 -0
- package/template/apps/server/src/agent/context-memory/memory-projector-contracts.ts +121 -0
- package/template/apps/server/src/agent/context-memory/memory-projector-validation.ts +155 -0
- package/template/apps/server/src/agent/context-memory/memory-projector.test.ts +19 -0
- package/template/apps/server/src/agent/context-memory/memory-projector.ts +259 -0
- package/template/apps/server/src/agent/context-memory/memory-retrieval-policy.ts +195 -0
- package/template/apps/server/src/agent/context-memory/memory-retriever.test.ts +339 -0
- package/template/apps/server/src/agent/context-memory/memory-retriever.ts +184 -0
- package/template/apps/server/src/agent/context-memory/search-provider-port.test.ts +62 -0
- package/template/apps/server/src/agent/context-memory/search-provider-port.ts +75 -0
- package/template/apps/server/src/agent/context-memory/working-context-expiry.ts +95 -0
- package/template/apps/server/src/agent/context-message-recovery.ts +23 -0
- package/template/apps/server/src/agent/context-version-routes.ts +241 -0
- package/template/apps/server/src/agent/context-version-runtime.ts +332 -0
- package/template/apps/server/src/agent/context-version-support.ts +93 -0
- package/template/apps/server/src/agent/context-version-validation.ts +118 -0
- package/template/apps/server/src/agent/drizzle-run-binding-repository.ts +11 -0
- package/template/apps/server/src/agent/idempotency-key.ts +9 -1
- package/template/apps/server/src/agent/memory-runtime-adapters.ts +266 -0
- package/template/apps/server/src/agent/memory-scope-binding.ts +14 -0
- package/template/apps/server/src/agent/module-ai-port-factory.ts +41 -0
- package/template/apps/server/src/agent/provider-input-governance.ts +19 -0
- package/template/apps/server/src/agent/remote-runtime-response.ts +162 -0
- package/template/apps/server/src/agent/remote-runtime.ts +53 -153
- package/template/apps/server/src/agent/run-audit.ts +2 -2
- package/template/apps/server/src/agent/run-authorization.test.ts +27 -0
- package/template/apps/server/src/agent/run-authorization.ts +60 -1
- package/template/apps/server/src/agent/run-binding-repository.ts +9 -0
- package/template/apps/server/src/agent/run-browser-authorization.ts +79 -0
- package/template/apps/server/src/agent/run-contracts.ts +23 -0
- package/template/apps/server/src/agent/run-facade.ts +139 -139
- package/template/apps/server/src/agent/run-failure-cleanup.ts +58 -0
- package/template/apps/server/src/agent/run-operation-policy.ts +20 -0
- package/template/apps/server/src/agent/run-route-input.ts +19 -1
- package/template/apps/server/src/agent/run-routes.ts +133 -5
- package/template/apps/server/src/agent/run-runtime-request.ts +89 -0
- package/template/apps/server/src/agent/run-session-authorization.ts +95 -0
- package/template/apps/server/src/agent/run-start-preparation.ts +71 -0
- package/template/apps/server/src/agent/runtime-bootstrap-input.ts +42 -0
- package/template/apps/server/src/agent/runtime-bootstrap-report.test.ts +53 -1
- package/template/apps/server/src/agent/runtime-bootstrap.ts +114 -111
- package/template/apps/server/src/agent/runtime-tool-composition.ts +38 -0
- package/template/apps/server/src/agent/session-context-source-support.ts +38 -0
- package/template/apps/server/src/agent/session-context-source.ts +346 -0
- package/template/apps/server/src/agent/session-invalidation/contracts.ts +217 -0
- package/template/apps/server/src/agent/session-invalidation/dispatcher.contract.test.ts +333 -0
- package/template/apps/server/src/agent/session-invalidation/dispatcher.ts +205 -0
- package/template/apps/server/src/agent/session-invalidation/module-authoritative-producer.test.ts +127 -0
- package/template/apps/server/src/agent/session-invalidation/module-authoritative-producer.ts +202 -0
- package/template/apps/server/src/agent/session-invalidation/read-guard.ts +39 -0
- package/template/apps/server/src/agent/session-invalidation/runtime.ts +69 -0
- package/template/apps/server/src/agent/session-invalidation/test-envelopes.ts +24 -0
- package/template/apps/server/src/agent/session-invalidation/worker.contract.test.ts +135 -0
- package/template/apps/server/src/agent/session-invalidation/worker.ts +76 -0
- package/template/apps/server/src/agent/session-log/checkpoint-digest.ts +36 -0
- package/template/apps/server/src/agent/session-log/domain.ts +123 -0
- package/template/apps/server/src/agent/session-log/events.ts +229 -0
- package/template/apps/server/src/agent/session-log/history.ts +143 -0
- package/template/apps/server/src/agent/session-log/in-memory-repository.ts +340 -0
- package/template/apps/server/src/agent/session-log/lifecycle.ts +67 -0
- package/template/apps/server/src/agent/session-log/replay-policy.ts +76 -0
- package/template/apps/server/src/agent/session-log/repository.ts +103 -0
- package/template/apps/server/src/agent/session-log/service.ts +349 -0
- package/template/apps/server/src/agent/session-log/session-log.test.ts +282 -0
- package/template/apps/server/src/agent/session-persistence/drizzle-context-memory.ts +348 -0
- package/template/apps/server/src/agent/session-persistence/drizzle-governed-context.ts +328 -0
- package/template/apps/server/src/agent/session-persistence/drizzle-invalidation-outbox.ts +260 -0
- package/template/apps/server/src/agent/session-persistence/drizzle-memory-projection-deletion.ts +56 -0
- package/template/apps/server/src/agent/session-persistence/drizzle-run-projection-receipt.ts +80 -0
- package/template/apps/server/src/agent/session-persistence/drizzle-session-fork.ts +147 -0
- package/template/apps/server/src/agent/session-persistence/drizzle-session-list.ts +24 -0
- package/template/apps/server/src/agent/session-persistence/drizzle-session-mapping.ts +154 -0
- package/template/apps/server/src/agent/session-persistence/drizzle-session-mutations.ts +64 -0
- package/template/apps/server/src/agent/session-persistence/drizzle-session-repository.ts +335 -0
- package/template/apps/server/src/agent/session-persistence/invalidation-projections.ts +229 -0
- package/template/apps/server/src/agent/session-persistence/payload-codec.ts +90 -0
- package/template/apps/server/src/agent/session-projection-access.ts +155 -0
- package/template/apps/server/src/agent/session-projection-bootstrap.ts +87 -0
- package/template/apps/server/src/agent/session-projection-errors.ts +22 -0
- package/template/apps/server/src/agent/session-projection-facade.ts +349 -0
- package/template/apps/server/src/agent/session-projection-routes.ts +215 -0
- package/template/apps/server/src/agent/session-projection-view.ts +137 -0
- package/template/apps/server/src/agent/session-result-memory.ts +228 -0
- package/template/apps/server/src/agent/session-run-lifecycle.ts +85 -0
- package/template/apps/server/src/agent/session-run-link-contracts.ts +56 -0
- package/template/apps/server/src/agent/session-run-link.ts +343 -0
- package/template/apps/server/src/agent/session-run-recovery.ts +16 -0
- package/template/apps/server/src/agent/session-runtime-composition.ts +265 -0
- package/template/apps/server/src/agent/session-source-chain-authorizer.ts +141 -0
- package/template/apps/server/src/agent/session-terminal-reconciler.ts +100 -0
- package/template/apps/server/src/agent/session-turn-state.ts +49 -0
- package/template/apps/server/src/agent/tool-audit.ts +3 -3
- package/template/apps/server/src/agent/tool-execution-receipt.ts +13 -0
- package/template/apps/server/src/agent/tool-host.ts +41 -4
- package/template/apps/server/src/agent/tool-registry-composition.ts +52 -0
- package/template/apps/server/src/agent/tool-registry.test.ts +5 -5
- package/template/apps/server/src/agent/tool-registry.ts +53 -59
- package/template/apps/server/src/agent/unavailable-routes.ts +49 -5
- package/template/apps/server/src/agent/workflow-durable-runtime-input.ts +32 -0
- package/template/apps/server/src/agent/workflow-runtime-bootstrap.ts +59 -0
- package/template/apps/server/src/agent-workflow/adapter-dispatch.ts +148 -0
- package/template/apps/server/src/agent-workflow/approval-node-adapter.ts +77 -0
- package/template/apps/server/src/agent-workflow/artifact-access-error.ts +9 -0
- package/template/apps/server/src/agent-workflow/artifact-node-adapter.ts +67 -0
- package/template/apps/server/src/agent-workflow/artifact-policy.ts +71 -0
- package/template/apps/server/src/agent-workflow/artifact-source-authorization.ts +85 -0
- package/template/apps/server/src/agent-workflow/authorization.ts +238 -0
- package/template/apps/server/src/agent-workflow/budget-ledger.ts +118 -0
- package/template/apps/server/src/agent-workflow/budget-validation.ts +305 -0
- package/template/apps/server/src/agent-workflow/canonical-agent-run-binding.ts +17 -0
- package/template/apps/server/src/agent-workflow/canonical-agent-run-evidence.ts +142 -0
- package/template/apps/server/src/agent-workflow/canonical-agent-run-port.ts +304 -0
- package/template/apps/server/src/agent-workflow/canonical-agent-run-remote.ts +64 -0
- package/template/apps/server/src/agent-workflow/canonical-json.ts +16 -0
- package/template/apps/server/src/agent-workflow/command-drive.ts +195 -0
- package/template/apps/server/src/agent-workflow/command-error.ts +9 -0
- package/template/apps/server/src/agent-workflow/command-facade.ts +290 -0
- package/template/apps/server/src/agent-workflow/command-input.ts +133 -0
- package/template/apps/server/src/agent-workflow/condition-node-adapter.ts +69 -0
- package/template/apps/server/src/agent-workflow/definition-budget-validation.ts +41 -0
- package/template/apps/server/src/agent-workflow/definition-node-validation.ts +197 -0
- package/template/apps/server/src/agent-workflow/definition-validation.ts +198 -0
- package/template/apps/server/src/agent-workflow/delegated-tool-authorization.ts +15 -0
- package/template/apps/server/src/agent-workflow/delegation-child-delivery.ts +129 -0
- package/template/apps/server/src/agent-workflow/delegation-execution-authorization.ts +218 -0
- package/template/apps/server/src/agent-workflow/delegation-policy-validation.ts +253 -0
- package/template/apps/server/src/agent-workflow/delegation-policy.ts +179 -0
- package/template/apps/server/src/agent-workflow/drizzle-artifact-port.ts +211 -0
- package/template/apps/server/src/agent-workflow/drizzle-artifact-support.ts +152 -0
- package/template/apps/server/src/agent-workflow/drizzle-budget-ledger-settlement.ts +271 -0
- package/template/apps/server/src/agent-workflow/drizzle-budget-ledger-support.ts +226 -0
- package/template/apps/server/src/agent-workflow/drizzle-budget-ledger.ts +189 -0
- package/template/apps/server/src/agent-workflow/drizzle-cancellation-reconcile.ts +177 -0
- package/template/apps/server/src/agent-workflow/drizzle-delegated-tool-authorization.ts +155 -0
- package/template/apps/server/src/agent-workflow/drizzle-delegation-completion.ts +84 -0
- package/template/apps/server/src/agent-workflow/drizzle-delegation-lifecycle.ts +139 -0
- package/template/apps/server/src/agent-workflow/drizzle-delegation-port.ts +288 -0
- package/template/apps/server/src/agent-workflow/drizzle-effect-command-fence.ts +333 -0
- package/template/apps/server/src/agent-workflow/drizzle-evaluation-repository.ts +214 -0
- package/template/apps/server/src/agent-workflow/drizzle-event-validation.ts +43 -0
- package/template/apps/server/src/agent-workflow/drizzle-recovery-admission.ts +115 -0
- package/template/apps/server/src/agent-workflow/drizzle-repository-lineage.ts +103 -0
- package/template/apps/server/src/agent-workflow/drizzle-repository-mappers.ts +317 -0
- package/template/apps/server/src/agent-workflow/drizzle-repository-write.ts +311 -0
- package/template/apps/server/src/agent-workflow/drizzle-repository.ts +285 -0
- package/template/apps/server/src/agent-workflow/drizzle-side-effect-repository.ts +83 -0
- package/template/apps/server/src/agent-workflow/drizzle-write-support.ts +101 -0
- package/template/apps/server/src/agent-workflow/durable-continuation-authorization.ts +109 -0
- package/template/apps/server/src/agent-workflow/durable-continuation-driver.ts +97 -0
- package/template/apps/server/src/agent-workflow/durable-continuation-runtime.ts +173 -0
- package/template/apps/server/src/agent-workflow/durable-job-node-adapter.ts +106 -0
- package/template/apps/server/src/agent-workflow/effect-command-fence.ts +250 -0
- package/template/apps/server/src/agent-workflow/evaluation-evidence-coordinates.ts +225 -0
- package/template/apps/server/src/agent-workflow/evaluation-evidence-metrics.ts +280 -0
- package/template/apps/server/src/agent-workflow/evaluation-evidence-reader.ts +326 -0
- package/template/apps/server/src/agent-workflow/evaluation-metrics-validation.ts +85 -0
- package/template/apps/server/src/agent-workflow/evaluation-projection.ts +70 -0
- package/template/apps/server/src/agent-workflow/evaluation-repository.ts +134 -0
- package/template/apps/server/src/agent-workflow/evaluation-service.ts +292 -0
- package/template/apps/server/src/agent-workflow/evaluation-tool-registration.ts +95 -0
- package/template/apps/server/src/agent-workflow/evaluation-validation.ts +331 -0
- package/template/apps/server/src/agent-workflow/event-validation.ts +277 -0
- package/template/apps/server/src/agent-workflow/governed-tool-schema.ts +55 -0
- package/template/apps/server/src/agent-workflow/in-memory-evaluation-repository.ts +123 -0
- package/template/apps/server/src/agent-workflow/in-memory-mutation-validation.ts +154 -0
- package/template/apps/server/src/agent-workflow/in-memory-repository-support.ts +277 -0
- package/template/apps/server/src/agent-workflow/in-memory-repository.ts +339 -0
- package/template/apps/server/src/agent-workflow/in-memory-side-effect-store.ts +78 -0
- package/template/apps/server/src/agent-workflow/input-receipt.ts +55 -0
- package/template/apps/server/src/agent-workflow/model-node-adapter.ts +86 -0
- package/template/apps/server/src/agent-workflow/model-pricing-catalog.ts +215 -0
- package/template/apps/server/src/agent-workflow/node-adapter-factory.ts +83 -0
- package/template/apps/server/src/agent-workflow/node-adapters.ts +50 -0
- package/template/apps/server/src/agent-workflow/node-execution-ports.ts +185 -0
- package/template/apps/server/src/agent-workflow/node-input-receipt-port.ts +42 -0
- package/template/apps/server/src/agent-workflow/node-result-receipt.ts +50 -0
- package/template/apps/server/src/agent-workflow/platform-node-adapter-support.ts +185 -0
- package/template/apps/server/src/agent-workflow/platform-node-adapters.ts +256 -0
- package/template/apps/server/src/agent-workflow/platform-node-approval.ts +146 -0
- package/template/apps/server/src/agent-workflow/platform-node-direct-adapters.ts +65 -0
- package/template/apps/server/src/agent-workflow/production-delegation-scope.ts +58 -0
- package/template/apps/server/src/agent-workflow/production-node-policies.ts +62 -0
- package/template/apps/server/src/agent-workflow/query-service.ts +198 -0
- package/template/apps/server/src/agent-workflow/release.ts +96 -0
- package/template/apps/server/src/agent-workflow/repository.ts +157 -0
- package/template/apps/server/src/agent-workflow/routes.ts +307 -0
- package/template/apps/server/src/agent-workflow/runtime-composition.ts +308 -0
- package/template/apps/server/src/agent-workflow/scheduler-cancellation-reconcile.ts +253 -0
- package/template/apps/server/src/agent-workflow/scheduler-cancellation-support.ts +145 -0
- package/template/apps/server/src/agent-workflow/scheduler-cancellation.ts +2 -0
- package/template/apps/server/src/agent-workflow/scheduler-context.ts +85 -0
- package/template/apps/server/src/agent-workflow/scheduler-deadline.ts +65 -0
- package/template/apps/server/src/agent-workflow/scheduler-effect-result.ts +205 -0
- package/template/apps/server/src/agent-workflow/scheduler-execution-convergence.ts +174 -0
- package/template/apps/server/src/agent-workflow/scheduler-execution.ts +211 -0
- package/template/apps/server/src/agent-workflow/scheduler-failure.ts +102 -0
- package/template/apps/server/src/agent-workflow/scheduler-join-cancellation.ts +282 -0
- package/template/apps/server/src/agent-workflow/scheduler-mutation-queue.ts +13 -0
- package/template/apps/server/src/agent-workflow/scheduler-node-timeout.ts +139 -0
- package/template/apps/server/src/agent-workflow/scheduler-parallel-dispatch.ts +99 -0
- package/template/apps/server/src/agent-workflow/scheduler-recovery-activation.ts +63 -0
- package/template/apps/server/src/agent-workflow/scheduler-recovery-budget.ts +41 -0
- package/template/apps/server/src/agent-workflow/scheduler-recovery-effect.ts +331 -0
- package/template/apps/server/src/agent-workflow/scheduler-recovery-event-time.ts +26 -0
- package/template/apps/server/src/agent-workflow/scheduler-recovery-failed-policy.ts +129 -0
- package/template/apps/server/src/agent-workflow/scheduler-recovery-node.ts +208 -0
- package/template/apps/server/src/agent-workflow/scheduler-recovery-policy-convergence.ts +140 -0
- package/template/apps/server/src/agent-workflow/scheduler-reservation-convergence.ts +40 -0
- package/template/apps/server/src/agent-workflow/scheduler-side-effect-execution.ts +249 -0
- package/template/apps/server/src/agent-workflow/scheduler-support.ts +235 -0
- package/template/apps/server/src/agent-workflow/scheduler-workflow-cancellation.ts +296 -0
- package/template/apps/server/src/agent-workflow/scheduler.ts +289 -0
- package/template/apps/server/src/agent-workflow/service-completion.ts +102 -0
- package/template/apps/server/src/agent-workflow/service-mutation-identity.ts +94 -0
- package/template/apps/server/src/agent-workflow/service-node-admission.ts +36 -0
- package/template/apps/server/src/agent-workflow/service-node-run-update.ts +55 -0
- package/template/apps/server/src/agent-workflow/service-recovery-events.ts +38 -0
- package/template/apps/server/src/agent-workflow/service-recovery.ts +264 -0
- package/template/apps/server/src/agent-workflow/service-retry.ts +86 -0
- package/template/apps/server/src/agent-workflow/service-run-command.ts +131 -0
- package/template/apps/server/src/agent-workflow/service-state-error.ts +21 -0
- package/template/apps/server/src/agent-workflow/service-state-invariants.ts +44 -0
- package/template/apps/server/src/agent-workflow/service-support.ts +152 -0
- package/template/apps/server/src/agent-workflow/service.ts +307 -0
- package/template/apps/server/src/agent-workflow/side-effect-state.ts +226 -0
- package/template/apps/server/src/agent-workflow/state-machine.ts +321 -0
- package/template/apps/server/src/agent-workflow/subagent-node-adapter.ts +229 -0
- package/template/apps/server/src/agent-workflow/tool-node-adapter.ts +259 -0
- package/template/apps/server/src/agent-workflow/usage.ts +149 -0
- package/template/apps/server/src/agent-workflow/wait-signal-service.ts +147 -0
- package/template/apps/server/src/agent-workflow/workflow-artifact-token.ts +109 -0
- package/template/apps/server/src/agent-workflow/workflow-value-validation.ts +101 -0
- package/template/apps/server/src/agent-workflow/workspace-policy.ts +109 -0
- package/template/apps/server/src/ai-runtime-report/remote-parser.ts +41 -0
- package/template/apps/server/src/ai-runtime-report/service.test.ts +2 -0
- package/template/apps/server/src/app/agent-runtime-composition.ts +38 -0
- package/template/apps/server/src/app/client-agent-host-auth-binding.ts +10 -0
- package/template/apps/server/src/auth/actor-resolver.test.ts +33 -0
- package/template/apps/server/src/auth/actor-resolver.ts +6 -1
- package/template/apps/server/src/auth/composition.ts +36 -0
- package/template/apps/server/src/auth/routes.test-support.ts +2 -0
- package/template/apps/server/src/auth/routes.test.ts +18 -0
- package/template/apps/server/src/auth/runtime.ts +2 -0
- package/template/apps/server/src/auth/service-options.ts +16 -0
- package/template/apps/server/src/auth/service.ts +7 -12
- package/template/apps/server/src/index.ts +35 -37
- package/template/apps/server/src/license/pairing-service.test.ts +1 -1
- package/template/apps/server/src/module-host/agent-session-memory-port.ts +91 -0
- package/template/apps/server/src/module-host/{debug-session-provider-registration.test.ts → agent-session-provider-registration.test.ts} +42 -17
- package/template/apps/server/src/module-host/{debug-session-provider-registration.ts → agent-session-provider-registration.ts} +18 -18
- package/template/apps/server/src/module-host/agent-source-invalidation-port.ts +53 -0
- package/template/apps/server/src/module-host/http-runtime.ts +14 -0
- package/template/apps/server/src/module-host/initialize-contracts.ts +4 -5
- package/template/apps/server/src/module-host/initialize.ts +4 -4
- package/template/apps/server/src/module-host/request-context.test.ts +5 -5
- package/template/apps/server/src/module-host/request-context.ts +8 -0
- package/template/apps/server/src/module-host/route-install-context.ts +65 -0
- package/template/apps/server/src/module-host/route-installer.ts +11 -56
- package/template/apps/server/src/module-host/scoped-host.ts +17 -12
- package/template/apps/server/src/module-host/storage-authorization-binding.test.ts +3 -3
- package/template/apps/server/src/module-host.ts +3 -5
- package/template/apps/server/src/runtime.ts +3 -36
- package/template/apps/server/src/storage/routes-stream-cancellation.test.ts +19 -0
- package/template/apps/server/src/storage/routes.ts +3 -1
- package/template/apps/server/src/system/actor.ts +15 -2
- package/template/apps/server/src/system/authorization-invalidation-bridge.ts +30 -0
- package/template/apps/server/src/system/authorization-invalidation-composition.ts +36 -0
- package/template/apps/server/src/system/drizzle-system.ts +8 -1
- package/template/apps/server/src/system/identity-route-config.ts +9 -1
- package/template/apps/server/src/system/routes.ts +3 -0
- package/template/apps/server/src/system/seed.ts +3 -0
- package/template/apps/server/src/system/user-account-policy.ts +91 -0
- package/template/apps/web/package.json +1 -0
- package/template/apps/web/src/layout/AppSidebar.vue +2 -0
- package/template/apps/web/src/pages/system/AgentSessionPage.vue +73 -0
- package/template/apps/web/src/pages/system/AgentSessionPage.webtest.ts +66 -0
- package/template/apps/web/src/pages/system/AgentWorkflowPage.vue +69 -0
- package/template/apps/web/src/pages/system/components/agent-session/AgentSessionDetail.vue +114 -0
- package/template/apps/web/src/pages/system/components/agent-session/AgentSessionList.vue +84 -0
- package/template/apps/web/src/pages/system/components/agent-session/ContextVersionPanel.vue +119 -0
- package/template/apps/web/src/pages/system/components/agent-session/ContextVersionPanel.webtest.ts +46 -0
- package/template/apps/web/src/pages/system/components/agent-session/MemoryProjectionPanel.vue +163 -0
- package/template/apps/web/src/pages/system/components/agent-session/MemoryProjectionPanel.webtest.ts +62 -0
- package/template/apps/web/src/pages/system/components/agent-session/SessionTimeline.vue +71 -0
- package/template/apps/web/src/pages/system/components/agent-session/SessionTimeline.webtest.ts +34 -0
- package/template/apps/web/src/pages/system/components/agent-session/agent-session-presenter.ts +56 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowNodeCard.vue +39 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowNodeDetail.vue +172 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowRunDetail.vue +151 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowRunGraph.vue +96 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowRunList.vue +100 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/WorkflowRunSummary.vue +148 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/agent-workflow-presenter.ts +74 -0
- package/template/apps/web/src/pages/system/components/agent-workflow/workflow-graph-layout.ts +108 -0
- package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeRunDetailDialog.vue +9 -0
- package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeRunDetailDialog.webtest.ts +22 -0
- package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeRunTable.webtest.ts +2 -0
- package/template/apps/web/src/pages/system/components/ai-runtime/AiRuntimeTrajectory.vue +118 -0
- package/template/apps/web/src/pages/system/composables/useAgentSessions.ts +209 -0
- package/template/apps/web/src/pages/system/composables/useAgentSessions.webtest.ts +138 -0
- package/template/apps/web/src/pages/system/composables/useAgentWorkflowRuns.ts +173 -0
- package/template/apps/web/src/router/index.ts +4 -0
- package/template/apps/web/src/router/platform-admin-route-bindings.ts +6 -0
- package/template/apps/web/src/services/agent-session-api.ts +159 -0
- package/template/apps/web/src/services/agent-session-api.webtest.ts +65 -0
- package/template/apps/web/src/services/agent-workflow-api.ts +181 -0
- package/template/apps/web/src/services/ai-runtime-api.ts +4 -0
- package/template/docker-compose.yml +11 -8
- package/template/docs/adr/0003-agent-session-event-source.md +3 -0
- package/template/docs/architecture/agent-harness.md +464 -0
- package/template/docs/architecture/agent-workflow.md +99 -0
- package/template/docs/architecture/ai-runtime.md +55 -47
- package/template/docs/architecture/module-host.md +4 -3
- package/template/docs/operations/adk-retirement.md +98 -0
- package/template/docs/operations/agent-session-memory.md +162 -0
- package/template/docs/operations/agent-session-troubleshooting.md +196 -0
- package/template/docs/operations/agent-workflow-recovery.md +74 -0
- package/template/docs/operations/incremental-delivery.md +1 -1
- package/template/docs/platform/agent-production-store.md +82 -0
- package/template/docs/platform/agent-run-reattachment.md +52 -0
- package/template/docs/platform/agent-runtime-observability.md +4 -3
- package/template/docs/platform/agent-runtime.md +116 -281
- package/template/docs/platform/agent-tool-approval.md +61 -0
- package/template/docs/platform/background-ai-operations.md +50 -0
- package/template/docs/platform/client-agent-session.md +173 -0
- package/template/docs/platform/embedding-ai-runtime.md +94 -0
- package/template/docs/platform/platform-authentication.md +5 -8
- package/template/package.json +0 -1
- package/template/packages/ai-client/index.ts +1 -0
- package/template/packages/ai-client/package.json +2 -1
- package/template/packages/ai-client/src/agent/client/client.ts +15 -2
- package/template/packages/ai-client/src/agent/client/run-protocol.test.ts +39 -25
- package/template/packages/ai-client/src/agent/client/types.ts +4 -0
- package/template/packages/ai-client/src/agent/contracts/contracts.test.ts +49 -7
- package/template/packages/ai-client/src/agent/contracts/events.ts +61 -0
- package/template/packages/ai-client/src/agent/contracts/runs.ts +1 -0
- package/template/packages/ai-client/src/client-agent/contracts.ts +131 -0
- package/template/packages/ai-client/src/client-agent/http.test.ts +60 -0
- package/template/packages/ai-client/src/client-agent/http.ts +66 -0
- package/template/packages/ai-client/src/client-agent/index.ts +3 -0
- package/template/packages/ai-client/src/client-agent/validation.test.ts +57 -0
- package/template/packages/ai-client/src/client-agent/validation.ts +152 -0
- package/template/packages/config/index.test.ts +18 -0
- package/template/packages/config/package.json +1 -1
- package/template/packages/config/src/platform-validation.ts +8 -0
- package/template/packages/config/src/platform.ts +22 -9
- package/template/packages/database/drizzle/0055_square_yellowjacket.sql +47 -0
- package/template/packages/database/drizzle/0056_tricky_living_mummy.sql +2 -0
- package/template/packages/database/drizzle/0057_mature_doomsday.sql +4 -0
- package/template/packages/database/drizzle/0058_agent_session_memory.sql +159 -0
- package/template/packages/database/drizzle/0059_agent_source_module_key.sql +16 -0
- package/template/packages/database/drizzle/0060_slimy_rocket_raccoon.sql +43 -0
- package/template/packages/database/drizzle/0061_agent_workflow.sql +303 -0
- package/template/packages/database/drizzle/meta/0055_snapshot.json +11071 -0
- package/template/packages/database/drizzle/meta/0056_snapshot.json +11098 -0
- package/template/packages/database/drizzle/meta/0057_snapshot.json +10878 -0
- package/template/packages/database/drizzle/meta/0058_snapshot.json +12294 -0
- package/template/packages/database/drizzle/meta/0059_snapshot.json +12344 -0
- package/template/packages/database/drizzle/meta/0060_snapshot.json +12326 -0
- package/template/packages/database/drizzle/meta/0061_snapshot.json +14395 -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 +26 -0
- package/template/packages/database/src/schema/agent-context-message.ts +38 -0
- package/template/packages/database/src/schema/agent-runtime.ts +7 -0
- package/template/packages/database/src/schema/agent-session-receipt.ts +36 -0
- package/template/packages/database/src/schema/agent-session.ts +344 -0
- package/template/packages/database/src/schema/agent-workflow-delegation.ts +126 -0
- package/template/packages/database/src/schema/agent-workflow-effects.ts +213 -0
- package/template/packages/database/src/schema/agent-workflow-evaluation.ts +67 -0
- package/template/packages/database/src/schema/agent-workflow.ts +270 -0
- package/template/packages/database/src/schema/client-agent.ts +95 -0
- package/template/packages/database/src/schema/index.ts +8 -0
- package/template/packages/jobs/package.json +1 -1
- package/template/packages/modules/index.ts +2 -0
- package/template/packages/modules/package.json +1 -1
- package/template/packages/modules/src/ai-client-execution-composition.test.ts +98 -0
- package/template/packages/modules/src/ai-client-execution-policy.ts +54 -0
- package/template/packages/modules/src/ai-operation-composition.ts +2 -0
- package/template/packages/modules/src/manifest.ts +15 -0
- package/template/packages/modules/src/system-admin-routes.ts +16 -0
- package/template/packages/modules/src/system-admin-ui-catalog.ts +4 -1
- package/template/packages/modules/src/system-agent-audit-actions.ts +26 -0
- package/template/packages/modules/src/system-ai-api-bindings.ts +262 -0
- package/template/packages/modules/src/system-api-control-plane.ts +4 -78
- package/template/packages/modules/src/system-audit-actions.ts +113 -0
- package/template/packages/modules/src/system-features.ts +17 -0
- package/template/packages/modules/src/system-module-catalog.ts +21 -11
- package/template/packages/modules/src/system-modules.ts +22 -0
- package/template/packages/modules/src/system-permissions.ts +8 -0
- package/template/packages/server-sdk/index.ts +43 -0
- package/template/packages/server-sdk/package.json +5 -1
- package/template/packages/server-sdk/src/agent-session-memory-port.ts +64 -0
- package/template/packages/server-sdk/src/agent-session-provider.ts +63 -0
- package/template/packages/server-sdk/src/agent-source-invalidation-port.ts +54 -0
- package/template/packages/server-sdk/src/ai-operation-registration.ts +2 -0
- package/template/packages/server-sdk/src/client-agent-session.ts +95 -0
- package/template/packages/server-sdk/src/debug-session-provider.ts +14 -63
- package/template/packages/server-sdk/src/module-host.ts +7 -3
- package/template/packages/server-sdk/src/request-context.ts +6 -0
- package/template/packages/shared/index.ts +3 -0
- package/template/packages/shared/package.json +1 -1
- package/template/packages/shared/src/agent-workflow-definition.ts +113 -0
- package/template/packages/shared/src/agent-workflow-delegation.ts +123 -0
- package/template/packages/shared/src/agent-workflow-evaluation.ts +159 -0
- package/template/packages/shared/src/agent-workflow-events.ts +99 -0
- package/template/packages/shared/src/agent-workflow-run.ts +259 -0
- package/template/packages/shared/src/agent-workflow.ts +3 -0
- package/template/packages/shared/src/ai-runtime-report.ts +25 -0
- package/template/packages/shared/src/rbac.ts +24 -0
- package/template/packages/storage/package.json +1 -1
- package/template/packages/storage/src/upload-streams.test.ts +31 -0
- package/template/packages/storage/src/upload-streams.ts +20 -6
- package/template/apps/agent-server/adk_web_agents/__init__.py +0 -1
- package/template/apps/agent-server/adk_web_agents/canonical_debug/__init__.py +0 -1
- package/template/apps/agent-server/adk_web_agents/canonical_debug/agent.py +0 -145
- package/template/apps/agent-server/adk_web_agents/safe_debug/__init__.py +0 -3
- package/template/apps/agent-server/adk_web_agents/safe_debug/agent.py +0 -40
- package/template/apps/agent-server/adk_web_agents/services.py +0 -25
- package/template/apps/agent-server/project/adk-web-debug.json +0 -4
- package/template/apps/agent-server/src/southwind_agent_server/adk_adapter.py +0 -333
- package/template/apps/agent-server/src/southwind_agent_server/adk_debug.py +0 -348
- package/template/apps/agent-server/src/southwind_agent_server/adk_debug_sessions.py +0 -325
- package/template/apps/agent-server/src/southwind_agent_server/adk_failure.py +0 -13
- package/template/apps/agent-server/src/southwind_agent_server/adk_model.py +0 -304
- package/template/apps/agent-server/src/southwind_agent_server/adk_tools.py +0 -143
- package/template/apps/agent-server/tests/test_adk_adapter.py +0 -307
- package/template/apps/agent-server/tests/test_adk_debug_result_polling.py +0 -139
- package/template/apps/agent-server/tests/test_adk_debug_sessions.py +0 -215
- package/template/apps/agent-server/tests/test_adk_web_agent.py +0 -12
- package/template/apps/agent-server/tests/test_adk_web_canonical_debug.py +0 -282
- package/template/apps/server/src/agent/run-debug-authorization.ts +0 -27
- package/template/apps/server/src/agent/run-facade-adk-debug.test.ts +0 -95
- package/template/apps/server/src/runtime-adk-debug.test.ts +0 -270
- package/template/apps/server/src/runtime-adk-debug.ts +0 -164
- package/template/apps/server/src/runtime-request-actor.test.ts +0 -55
- package/template/apps/server/src/runtime-request-actor.ts +0 -22
- package/template/docker-compose.agent-debug.yml +0 -58
- package/template/scripts/dev-adk-web.ts +0 -107
package/dist/cli.js
CHANGED
|
@@ -271,6 +271,178 @@ function optionalModule(name, label, description, dependencies) {
|
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
// src/optional-module-agent.ts
|
|
275
|
+
var agentOptionalModule = {
|
|
276
|
+
...optionalModule("system.agent", "Agent Tool", "\u53D7\u63A7 Agent \u5DE5\u5177\u5BBF\u4E3B\u3002", [
|
|
277
|
+
"system",
|
|
278
|
+
"system.audit",
|
|
279
|
+
"system.storage",
|
|
280
|
+
"system.scheduler",
|
|
281
|
+
"system.workflow"
|
|
282
|
+
]),
|
|
283
|
+
registryDependencies: [
|
|
284
|
+
{
|
|
285
|
+
sourceName: "@modelcontextprotocol/sdk",
|
|
286
|
+
name: "@modelcontextprotocol/sdk",
|
|
287
|
+
version: "^1.29.0"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
sourceName: "ajv",
|
|
291
|
+
name: "ajv",
|
|
292
|
+
version: "^8.20.0"
|
|
293
|
+
}
|
|
294
|
+
],
|
|
295
|
+
fileRoots: [
|
|
296
|
+
"apps/agent-server",
|
|
297
|
+
"apps/document-server",
|
|
298
|
+
"apps/speech-server",
|
|
299
|
+
"apps/embedding-server",
|
|
300
|
+
"apps/server/src/agent",
|
|
301
|
+
"apps/server/src/agent-workflow",
|
|
302
|
+
"apps/server/src/ai-runtime-report",
|
|
303
|
+
"apps/server/src/ai-runtime-readiness",
|
|
304
|
+
"apps/server/src/app/ai-screenshot-intake-binding.ts",
|
|
305
|
+
"apps/server/src/app/agent-runtime-composition.ts",
|
|
306
|
+
"apps/server/src/app/client-agent-host-auth-binding.ts",
|
|
307
|
+
"apps/server/src/app/document-output-artifact-bindings.ts",
|
|
308
|
+
"apps/server/src/app/speech-output-artifact-bindings.ts",
|
|
309
|
+
"apps/server/src/ai-artifact",
|
|
310
|
+
"apps/server/src/ai-output-artifact",
|
|
311
|
+
"apps/server/src/document",
|
|
312
|
+
"apps/server/src/speech",
|
|
313
|
+
"apps/server/src/embedding",
|
|
314
|
+
"apps/server/src/mcp",
|
|
315
|
+
"apps/server/src/module-host/ai-operation-port.ts",
|
|
316
|
+
"apps/server/src/module-host/ai-operation-port.test.ts",
|
|
317
|
+
"apps/server/src/module-host/agent-session-memory-port.ts",
|
|
318
|
+
"apps/server/src/module-host/agent-source-invalidation-port.ts",
|
|
319
|
+
"apps/server/src/module-host/tool-handlers.ts",
|
|
320
|
+
"apps/server/src/module-host/tool-handlers.test.ts",
|
|
321
|
+
"apps/server/src/module-host/module-secret-tool-boundary.test.ts",
|
|
322
|
+
"apps/web/src/pages/system/AiRuntimePage.vue",
|
|
323
|
+
"apps/web/src/pages/system/AgentSessionPage.vue",
|
|
324
|
+
"apps/web/src/pages/system/AgentSessionPage.webtest.ts",
|
|
325
|
+
"apps/web/src/pages/system/AgentWorkflowPage.vue",
|
|
326
|
+
"apps/web/src/pages/system/ai-runtime-presenter.ts",
|
|
327
|
+
"apps/web/src/pages/system/ai-runtime-presenter.webtest.ts",
|
|
328
|
+
"apps/web/src/pages/system/components/ai-runtime",
|
|
329
|
+
"apps/web/src/pages/system/components/agent-session",
|
|
330
|
+
"apps/web/src/pages/system/components/agent-workflow",
|
|
331
|
+
"apps/web/src/pages/system/composables/useAgentWorkflowRuns.ts",
|
|
332
|
+
"apps/web/src/pages/system/composables/useAgentSessions.ts",
|
|
333
|
+
"apps/web/src/pages/system/composables/useAgentSessions.webtest.ts",
|
|
334
|
+
"apps/web/src/pages/system/composables/useAiRuntimeReport.ts",
|
|
335
|
+
"apps/web/src/pages/system/composables/useAiRuntimeReport.webtest.ts",
|
|
336
|
+
"apps/web/src/services/agent-workflow-api.ts",
|
|
337
|
+
"apps/web/src/services/agent-session-api.ts",
|
|
338
|
+
"apps/web/src/services/agent-session-api.webtest.ts",
|
|
339
|
+
"apps/web/src/services/ai-runtime-api.ts",
|
|
340
|
+
"apps/web/src/services/ai-runtime-api.webtest.ts",
|
|
341
|
+
"scripts/provision-speech-readiness.ts",
|
|
342
|
+
"packages/modules/src/system-agent-audit-actions.ts",
|
|
343
|
+
"packages/modules/src/system-agent-tools.ts",
|
|
344
|
+
"packages/modules/src/system-agent-supervisor.ts",
|
|
345
|
+
"packages/modules/src/system-agent-supervisor.test.ts",
|
|
346
|
+
"packages/modules/src/system-ai-api-bindings.ts",
|
|
347
|
+
"packages/server-sdk/src/system-agent-supervisor.ts",
|
|
348
|
+
"packages/server-sdk/src/system-agent-supervisor.test.ts",
|
|
349
|
+
"packages/database/src/agent-runtime-schema.test.ts",
|
|
350
|
+
"packages/database/src/ai-output-artifacts.test.ts",
|
|
351
|
+
"packages/shared/src/agent-workflow-definition.ts",
|
|
352
|
+
"packages/shared/src/agent-workflow-delegation.ts",
|
|
353
|
+
"packages/shared/src/agent-workflow-evaluation.ts",
|
|
354
|
+
"packages/shared/src/agent-workflow-events.ts",
|
|
355
|
+
"packages/shared/src/agent-workflow-run.ts",
|
|
356
|
+
"packages/shared/src/agent-workflow.ts",
|
|
357
|
+
"packages/shared/src/ai-runtime-report.ts",
|
|
358
|
+
"packages/shared/src/screenshot-context-digest.ts",
|
|
359
|
+
"packages/shared/src/screenshot-context-digest.test.ts"
|
|
360
|
+
],
|
|
361
|
+
documentation: [
|
|
362
|
+
"docs/adr/0003-agent-session-event-source.md",
|
|
363
|
+
"docs/architecture/agent-harness.md",
|
|
364
|
+
"docs/architecture/agent-workflow.md",
|
|
365
|
+
"docs/architecture/ai-egress.md",
|
|
366
|
+
"docs/architecture/ai-runtime-readiness.md",
|
|
367
|
+
"docs/architecture/ai-runtime.md",
|
|
368
|
+
"docs/architecture/mcp-business-capabilities.md",
|
|
369
|
+
"docs/operations/agent-session-memory.md",
|
|
370
|
+
"docs/operations/agent-session-troubleshooting.md",
|
|
371
|
+
"docs/operations/agent-workflow-recovery.md",
|
|
372
|
+
"docs/operations/adk-retirement.md",
|
|
373
|
+
"docs/platform/agent-run-attestation.md",
|
|
374
|
+
"docs/platform/client-agent-session.md",
|
|
375
|
+
"docs/platform/vision-ai-runtime.md",
|
|
376
|
+
"docs/platform/agent-runtime.md",
|
|
377
|
+
"docs/platform/agent-runtime-observability.md",
|
|
378
|
+
"docs/platform/agent-supervisor-output-contract.md",
|
|
379
|
+
"docs/platform/agent-tools.md",
|
|
380
|
+
"docs/platform/agent-tool-approval.md",
|
|
381
|
+
"docs/platform/agent-tool-sandbox.md",
|
|
382
|
+
"docs/platform/agent-production-store.md",
|
|
383
|
+
"docs/platform/agent-run-reattachment.md",
|
|
384
|
+
"docs/platform/background-ai-operations.md",
|
|
385
|
+
"docs/platform/document-ai-runtime.md",
|
|
386
|
+
"docs/platform/speech-ai-runtime.md",
|
|
387
|
+
"docs/platform/embedding-ai-runtime.md"
|
|
388
|
+
],
|
|
389
|
+
schemaFiles: [
|
|
390
|
+
"packages/database/src/schema/agent-runtime.ts",
|
|
391
|
+
"packages/database/src/schema/agent-context-message.ts",
|
|
392
|
+
"packages/database/src/schema/agent-session-receipt.ts",
|
|
393
|
+
"packages/database/src/schema/agent-session.ts",
|
|
394
|
+
"packages/database/src/schema/agent-workflow.ts",
|
|
395
|
+
"packages/database/src/schema/agent-workflow-delegation.ts",
|
|
396
|
+
"packages/database/src/schema/agent-workflow-effects.ts",
|
|
397
|
+
"packages/database/src/schema/agent-workflow-evaluation.ts",
|
|
398
|
+
"packages/database/src/schema/client-agent.ts",
|
|
399
|
+
"packages/database/src/schema/embedding-runtime.ts",
|
|
400
|
+
"packages/database/src/schema/ai-output-artifacts.ts"
|
|
401
|
+
],
|
|
402
|
+
databaseTables: [
|
|
403
|
+
"agent_operation_releases",
|
|
404
|
+
"agent_runtime_runs",
|
|
405
|
+
"agent_runtime_events",
|
|
406
|
+
"agent_evaluation_results",
|
|
407
|
+
"agent_run_bindings",
|
|
408
|
+
"agent_screenshot_intakes",
|
|
409
|
+
"agent_runtime_report_runs",
|
|
410
|
+
"agent_runtime_report_attempts",
|
|
411
|
+
"client_agent_sessions",
|
|
412
|
+
"client_agent_receipts",
|
|
413
|
+
"embedding_run_bindings",
|
|
414
|
+
"ai_output_artifact_scopes",
|
|
415
|
+
"ai_output_artifacts",
|
|
416
|
+
"agent_sessions",
|
|
417
|
+
"agent_session_events",
|
|
418
|
+
"agent_session_checkpoints",
|
|
419
|
+
"agent_context_versions",
|
|
420
|
+
"agent_context_sources",
|
|
421
|
+
"agent_context_messages",
|
|
422
|
+
"agent_memory_projections",
|
|
423
|
+
"agent_memory_sources",
|
|
424
|
+
"agent_source_invalidations",
|
|
425
|
+
"agent_source_invalidation_deliveries",
|
|
426
|
+
"agent_session_run_projection_receipts",
|
|
427
|
+
"agent_workflow_definitions",
|
|
428
|
+
"agent_workflow_releases",
|
|
429
|
+
"agent_workflow_runs",
|
|
430
|
+
"agent_workflow_node_runs",
|
|
431
|
+
"agent_workflow_events",
|
|
432
|
+
"agent_workflow_delegations",
|
|
433
|
+
"agent_workflow_budget_reservations",
|
|
434
|
+
"agent_workflow_side_effect_commands",
|
|
435
|
+
"agent_workflow_side_effect_receipts",
|
|
436
|
+
"agent_workflow_evaluations"
|
|
437
|
+
],
|
|
438
|
+
databaseStatementTokens: [
|
|
439
|
+
"idx_agent_context_sources_origin",
|
|
440
|
+
"idx_agent_memory_sources_origin",
|
|
441
|
+
"uk_agent_source_invalidations_sequence",
|
|
442
|
+
"agent_workflow_"
|
|
443
|
+
]
|
|
444
|
+
};
|
|
445
|
+
|
|
274
446
|
// src/optional-module-storage.ts
|
|
275
447
|
var storageOptionalModule = {
|
|
276
448
|
...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"]),
|
|
@@ -320,104 +492,7 @@ var storageOptionalModule = {
|
|
|
320
492
|
// src/optional-module-distribution.ts
|
|
321
493
|
var optionalModuleManifests = [
|
|
322
494
|
storageOptionalModule,
|
|
323
|
-
|
|
324
|
-
...optionalModule("system.agent", "Agent Tool", "\u53D7\u63A7 Agent \u5DE5\u5177\u5BBF\u4E3B\u3002", [
|
|
325
|
-
"system",
|
|
326
|
-
"system.audit",
|
|
327
|
-
"system.storage",
|
|
328
|
-
"system.scheduler",
|
|
329
|
-
"system.workflow"
|
|
330
|
-
]),
|
|
331
|
-
registryDependencies: [
|
|
332
|
-
{
|
|
333
|
-
sourceName: "@modelcontextprotocol/sdk",
|
|
334
|
-
name: "@modelcontextprotocol/sdk",
|
|
335
|
-
version: "^1.29.0"
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
sourceName: "ajv",
|
|
339
|
-
name: "ajv",
|
|
340
|
-
version: "^8.20.0"
|
|
341
|
-
}
|
|
342
|
-
],
|
|
343
|
-
fileRoots: [
|
|
344
|
-
"apps/agent-server",
|
|
345
|
-
"apps/document-server",
|
|
346
|
-
"apps/speech-server",
|
|
347
|
-
"apps/embedding-server",
|
|
348
|
-
"apps/server/src/agent",
|
|
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",
|
|
354
|
-
"apps/server/src/ai-artifact",
|
|
355
|
-
"apps/server/src/ai-output-artifact",
|
|
356
|
-
"apps/server/src/document",
|
|
357
|
-
"apps/server/src/speech",
|
|
358
|
-
"apps/server/src/embedding",
|
|
359
|
-
"apps/server/src/mcp",
|
|
360
|
-
"apps/server/src/runtime-adk-debug.ts",
|
|
361
|
-
"apps/server/src/runtime-adk-debug.test.ts",
|
|
362
|
-
"apps/server/src/module-host/ai-operation-port.ts",
|
|
363
|
-
"apps/server/src/module-host/ai-operation-port.test.ts",
|
|
364
|
-
"apps/server/src/module-host/tool-handlers.ts",
|
|
365
|
-
"apps/server/src/module-host/tool-handlers.test.ts",
|
|
366
|
-
"apps/server/src/module-host/module-secret-tool-boundary.test.ts",
|
|
367
|
-
"apps/web/src/pages/system/AiRuntimePage.vue",
|
|
368
|
-
"apps/web/src/pages/system/ai-runtime-presenter.ts",
|
|
369
|
-
"apps/web/src/pages/system/ai-runtime-presenter.webtest.ts",
|
|
370
|
-
"apps/web/src/pages/system/components/ai-runtime",
|
|
371
|
-
"apps/web/src/pages/system/composables/useAiRuntimeReport.ts",
|
|
372
|
-
"apps/web/src/pages/system/composables/useAiRuntimeReport.webtest.ts",
|
|
373
|
-
"apps/web/src/services/ai-runtime-api.ts",
|
|
374
|
-
"apps/web/src/services/ai-runtime-api.webtest.ts",
|
|
375
|
-
"docker-compose.agent-debug.yml",
|
|
376
|
-
"scripts/dev-adk-web.ts",
|
|
377
|
-
"scripts/provision-speech-readiness.ts",
|
|
378
|
-
"packages/modules/src/system-agent-tools.ts",
|
|
379
|
-
"packages/database/src/agent-runtime-schema.test.ts",
|
|
380
|
-
"packages/database/src/ai-output-artifacts.test.ts",
|
|
381
|
-
"packages/shared/src/ai-runtime-report.ts",
|
|
382
|
-
"packages/shared/src/screenshot-context-digest.ts",
|
|
383
|
-
"packages/shared/src/screenshot-context-digest.test.ts"
|
|
384
|
-
],
|
|
385
|
-
documentation: [
|
|
386
|
-
"docs/architecture/ai-runtime.md",
|
|
387
|
-
"docs/architecture/mcp-business-capabilities.md",
|
|
388
|
-
"docs/platform/agent-run-attestation.md",
|
|
389
|
-
"docs/platform/agent-runtime.md",
|
|
390
|
-
"docs/platform/agent-runtime-observability.md",
|
|
391
|
-
"docs/platform/agent-supervisor-output-contract.md",
|
|
392
|
-
"docs/platform/agent-tools.md",
|
|
393
|
-
"docs/platform/agent-tool-approval.md",
|
|
394
|
-
"docs/platform/agent-tool-sandbox.md",
|
|
395
|
-
"docs/platform/agent-production-store.md",
|
|
396
|
-
"docs/platform/agent-run-reattachment.md",
|
|
397
|
-
"docs/platform/background-ai-operations.md",
|
|
398
|
-
"docs/platform/document-ai-runtime.md",
|
|
399
|
-
"docs/platform/speech-ai-runtime.md",
|
|
400
|
-
"docs/platform/embedding-ai-runtime.md"
|
|
401
|
-
],
|
|
402
|
-
schemaFiles: [
|
|
403
|
-
"packages/database/src/schema/agent-runtime.ts",
|
|
404
|
-
"packages/database/src/schema/embedding-runtime.ts",
|
|
405
|
-
"packages/database/src/schema/ai-output-artifacts.ts"
|
|
406
|
-
],
|
|
407
|
-
databaseTables: [
|
|
408
|
-
"agent_operation_releases",
|
|
409
|
-
"agent_runtime_runs",
|
|
410
|
-
"agent_runtime_events",
|
|
411
|
-
"agent_evaluation_results",
|
|
412
|
-
"agent_run_bindings",
|
|
413
|
-
"agent_screenshot_intakes",
|
|
414
|
-
"agent_runtime_report_runs",
|
|
415
|
-
"agent_runtime_report_attempts",
|
|
416
|
-
"embedding_run_bindings",
|
|
417
|
-
"ai_output_artifact_scopes",
|
|
418
|
-
"ai_output_artifacts"
|
|
419
|
-
]
|
|
420
|
-
},
|
|
495
|
+
agentOptionalModule,
|
|
421
496
|
{
|
|
422
497
|
...optionalModule("system.scheduler", "\u4EFB\u52A1\u8C03\u5EA6", "\u4EFB\u52A1\u3001\u91CD\u8BD5\u3001\u5386\u53F2\u548C\u6062\u590D\u3002", ["system", "system.audit"]),
|
|
423
498
|
fileRoots: [
|
|
@@ -1109,7 +1184,6 @@ import { lstat, open, readFile, rename, rm } from "fs/promises";
|
|
|
1109
1184
|
import { join } from "path";
|
|
1110
1185
|
var managedSecretKeys = [
|
|
1111
1186
|
"AGENT_SERVER_INTERNAL_TOKEN",
|
|
1112
|
-
"ADK_DEBUG_PLATFORM_TOKEN",
|
|
1113
1187
|
"AGENT_RUN_ENCRYPTION_SECRET",
|
|
1114
1188
|
"AI_ARTIFACT_ENCRYPTION_SECRET",
|
|
1115
1189
|
"EMBEDDING_RUN_ENCRYPTION_SECRET",
|
|
@@ -1128,9 +1202,6 @@ async function initializeLocalEnvironment(projectRoot, generateSecret = defaultS
|
|
|
1128
1202
|
if (/^AGENT_SERVER_INTERNAL_TOKEN=[ \t\r]*$/m.test(content)) {
|
|
1129
1203
|
content = setEmptyVariable(content, "AGENT_SERVER_INTERNAL_TOKEN", generateSecret());
|
|
1130
1204
|
}
|
|
1131
|
-
if (/^ADK_DEBUG_PLATFORM_TOKEN=[ \t\r]*$/m.test(content)) {
|
|
1132
|
-
content = setEmptyVariable(content, "ADK_DEBUG_PLATFORM_TOKEN", generateSecret());
|
|
1133
|
-
}
|
|
1134
1205
|
if (/^AGENT_RUN_ENCRYPTION_SECRET=[ \t\r]*$/m.test(content)) {
|
|
1135
1206
|
content = setEmptyVariable(content, "AGENT_RUN_ENCRYPTION_SECRET", generateSecret());
|
|
1136
1207
|
}
|
|
@@ -2710,11 +2781,8 @@ function dockerManifestCopyLines(directories) {
|
|
|
2710
2781
|
return directories.map((directory) => `COPY ${directory}/package.json ${directory}/package.json`);
|
|
2711
2782
|
}
|
|
2712
2783
|
function rewriteAnchoredSection(source, anchor, lines) {
|
|
2713
|
-
const { begin, end } = locateAnchoredSection(source, anchor);
|
|
2714
|
-
|
|
2715
|
-
`);
|
|
2716
|
-
return [...all.slice(0, begin + 1), ...lines, ...all.slice(end)].join(`
|
|
2717
|
-
`);
|
|
2784
|
+
const { begin, end, eol, lines: all } = locateAnchoredSection(source, anchor);
|
|
2785
|
+
return [...all.slice(0, begin + 1), ...lines, ...all.slice(end)].join(eol);
|
|
2718
2786
|
}
|
|
2719
2787
|
function hasDockerfileCopyAnchors(source, target) {
|
|
2720
2788
|
return source.includes(`# ${depsCopyAnchor} begin`) && source.includes(`# ${depsCopyAnchor} end`) && (!target.includeBuildClosure || source.includes(`# ${buildCopyAnchor} begin`) && source.includes(`# ${buildCopyAnchor} end`));
|
|
@@ -2764,8 +2832,11 @@ async function planDockerfileInProject(root, target, options = {}) {
|
|
|
2764
2832
|
function locateAnchoredSection(source, anchor) {
|
|
2765
2833
|
const beginMarker = `# ${anchor} begin`;
|
|
2766
2834
|
const endMarker = `# ${anchor} end`;
|
|
2767
|
-
const
|
|
2768
|
-
`)
|
|
2835
|
+
const eol = source.includes(`\r
|
|
2836
|
+
`) ? `\r
|
|
2837
|
+
` : `
|
|
2838
|
+
`;
|
|
2839
|
+
const lines = source.split(eol);
|
|
2769
2840
|
const begin = lines.indexOf(beginMarker);
|
|
2770
2841
|
const end = lines.indexOf(endMarker);
|
|
2771
2842
|
if (begin === -1 || end === -1 || end <= begin) {
|
|
@@ -2774,7 +2845,7 @@ function locateAnchoredSection(source, anchor) {
|
|
|
2774
2845
|
if (lines.indexOf(beginMarker, begin + 1) !== -1 || lines.indexOf(endMarker, end + 1) !== -1) {
|
|
2775
2846
|
throw new Error(`Dockerfile \u951A\u70B9\u6BB5 ${anchor} \u91CD\u590D\uFF0C\u8BF7\u4FDD\u7559\u552F\u4E00\u4E00\u6BB5`);
|
|
2776
2847
|
}
|
|
2777
|
-
return { begin, end };
|
|
2848
|
+
return { begin, end, eol, lines };
|
|
2778
2849
|
}
|
|
2779
2850
|
function parseManifest(content) {
|
|
2780
2851
|
return JSON.parse(new TextDecoder().decode(content));
|
|
@@ -3163,8 +3234,25 @@ var starterServerBuild = ` build:
|
|
|
3163
3234
|
context: .
|
|
3164
3235
|
dockerfile: apps/server/Dockerfile
|
|
3165
3236
|
args:
|
|
3166
|
-
WINDY_DEBIAN_MIRROR: \${WINDY_DEBIAN_MIRROR:-http://
|
|
3167
|
-
WINDY_DEBIAN_SECURITY_MIRROR: \${WINDY_DEBIAN_SECURITY_MIRROR:-http://
|
|
3237
|
+
WINDY_DEBIAN_MIRROR: \${WINDY_DEBIAN_MIRROR:-http://deb.debian.org/debian}
|
|
3238
|
+
WINDY_DEBIAN_SECURITY_MIRROR: \${WINDY_DEBIAN_SECURITY_MIRROR:-http://deb.debian.org/debian-security}`;
|
|
3239
|
+
function agentWorkflowServerEnvironment(includeAgent) {
|
|
3240
|
+
return includeAgent ? " WINDY_AGENT_WORKFLOW_MODEL_PRICING_JSON: ${WINDY_AGENT_WORKFLOW_MODEL_PRICING_JSON:-}" : "";
|
|
3241
|
+
}
|
|
3242
|
+
function optionalComposeVolumes(includeAgent, includeSearch, includeStorage) {
|
|
3243
|
+
return [
|
|
3244
|
+
...includeAgent ? [
|
|
3245
|
+
" agent-run-data:",
|
|
3246
|
+
" tool-sandbox-ipc:",
|
|
3247
|
+
" document-run-data:",
|
|
3248
|
+
" speech-run-data:",
|
|
3249
|
+
" embedding-run-data:"
|
|
3250
|
+
] : [],
|
|
3251
|
+
...includeSearch ? [" opensearch-data:"] : [],
|
|
3252
|
+
...includeStorage ? [" server-storage-data:"] : []
|
|
3253
|
+
].join(`
|
|
3254
|
+
`);
|
|
3255
|
+
}
|
|
3168
3256
|
|
|
3169
3257
|
// src/runtime-profile-files.ts
|
|
3170
3258
|
var starterComposeBase = `services:
|
|
@@ -3210,9 +3298,11 @@ __STORAGE_SERVER_ENV__
|
|
|
3210
3298
|
WINDY_SYSTEM_USAGE_PATHS: /app/data/audit
|
|
3211
3299
|
PLATFORM_ENABLE_AI: \${PLATFORM_ENABLE_AI:-false}
|
|
3212
3300
|
AGENT_SERVER_URL: http://agent-server:8080
|
|
3301
|
+
WINDY_PUBLIC_BASE_URL: \${WINDY_PUBLIC_BASE_URL:-http://localhost:9747}
|
|
3213
3302
|
AGENT_TOOL_HOST_URL: http://server:9747
|
|
3214
3303
|
__TOOL_SANDBOX_SERVER_ENV__
|
|
3215
3304
|
AGENT_SERVER_INTERNAL_TOKEN: \${AGENT_SERVER_INTERNAL_TOKEN:-}
|
|
3305
|
+
__AGENT_WORKFLOW_SERVER_ENV__
|
|
3216
3306
|
AI_ARTIFACT_URL: http://server:9747/api/internal/ai/artifacts
|
|
3217
3307
|
AI_ARTIFACT_ENCRYPTION_SECRET: \${AI_ARTIFACT_ENCRYPTION_SECRET:-}
|
|
3218
3308
|
DOCUMENT_SERVER_URL: \${DOCUMENT_SERVER_URL:-}
|
|
@@ -3321,6 +3411,7 @@ ${starterServerBuild}
|
|
|
3321
3411
|
WINDY_PYPI_INDEX_URL: \${WINDY_PYPI_INDEX_URL:-http://mirrors.cloud.tencent.com/pypi/simple}
|
|
3322
3412
|
environment:
|
|
3323
3413
|
AGENT_SERVER_INTERNAL_TOKEN: \${AGENT_SERVER_INTERNAL_TOKEN:-}
|
|
3414
|
+
AGENT_CONTEXT_HOST_URL: http://server:9747
|
|
3324
3415
|
AGENT_RUN_STORE_PATH: /app/data/agent/runs.sqlite3
|
|
3325
3416
|
AGENT_DATABASE_URL: postgresql://windy:\${POSTGRES_PASSWORD}@postgres:5432/windy
|
|
3326
3417
|
AGENT_RUN_ENCRYPTION_SECRET: \${AGENT_RUN_ENCRYPTION_SECRET:-}
|
|
@@ -3453,19 +3544,10 @@ ${starterServerBuild}
|
|
|
3453
3544
|
function starterComposeFor(includeAgent, includeSearch = true, includeStorage = true) {
|
|
3454
3545
|
return starterComposeBase.replace(` web:
|
|
3455
3546
|
`, `${includeAgent ? agentComposeService : ""} web:
|
|
3456
|
-
`).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:-}
|
|
3547
|
+
`).replace("__TOOL_SANDBOX_SERVER_ENV__", includeAgent ? " TOOL_SANDBOX_SOCKET: /run/windy-tool-sandbox/worker.sock" : "").replace("__AGENT_WORKFLOW_SERVER_ENV__", agentWorkflowServerEnvironment(includeAgent)).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:-}
|
|
3457
3548
|
OPENSEARCH_USERNAME: \${OPENSEARCH_USERNAME:-}
|
|
3458
3549
|
OPENSEARCH_PASSWORD: \${OPENSEARCH_PASSWORD:-}
|
|
3459
|
-
OPENSEARCH_WORK_ORDER_INDEX: \${OPENSEARCH_WORK_ORDER_INDEX:-windy-work-orders-v1}` : "").replace("__OPENSEARCH_SERVICE__", includeSearch ? openSearchComposeService : "").replace("__OPTIONAL_VOLUMES__",
|
|
3460
|
-
includeAgent ? " agent-run-data:" : "",
|
|
3461
|
-
includeAgent ? " tool-sandbox-ipc:" : "",
|
|
3462
|
-
includeAgent ? " document-run-data:" : "",
|
|
3463
|
-
includeAgent ? " speech-run-data:" : "",
|
|
3464
|
-
includeAgent ? " embedding-run-data:" : "",
|
|
3465
|
-
includeSearch ? " opensearch-data:" : "",
|
|
3466
|
-
includeStorage ? " server-storage-data:" : ""
|
|
3467
|
-
].filter(Boolean).join(`
|
|
3468
|
-
`));
|
|
3550
|
+
OPENSEARCH_WORK_ORDER_INDEX: \${OPENSEARCH_WORK_ORDER_INDEX:-windy-work-orders-v1}` : "").replace("__OPENSEARCH_SERVICE__", includeSearch ? openSearchComposeService : "").replace("__OPTIONAL_VOLUMES__", optionalComposeVolumes(includeAgent, includeSearch, includeStorage));
|
|
3469
3551
|
}
|
|
3470
3552
|
var starterCompose = starterComposeFor(true);
|
|
3471
3553
|
// src/runtime-environment-example.ts
|
|
@@ -3480,18 +3562,20 @@ ${includeStorage ? `
|
|
|
3480
3562
|
` : ""}
|
|
3481
3563
|
${includeAgent ? `
|
|
3482
3564
|
# Agent profile \u4EC5\u7531\u670D\u52A1\u7AEF Agent Runtime \u8BFB\u53D6\uFF1B\u4E0D\u8981\u4F7F\u7528 VITE_ \u524D\u7F00\u3002
|
|
3483
|
-
# ADK Web \u901A\u8FC7 canonical Run API \u8C03\u8BD5\u9879\u76EE\u9009\u62E9\u7684\u771F\u5B9E\u6587\u672C Operation\uFF1B\u8C03\u8BD5 Token
|
|
3484
|
-
# \u7531 create-windy \u81EA\u52A8\u751F\u6210\uFF0C\u53EA\u6CE8\u5165 Server \u4E0E localhost-only ADK Web\u3002
|
|
3485
3565
|
PLATFORM_ENABLE_AI=false
|
|
3486
3566
|
AGENT_SERVER_INTERNAL_TOKEN=
|
|
3487
|
-
ADK_DEBUG_PLATFORM_TOKEN=
|
|
3488
3567
|
AGENT_RUN_ENCRYPTION_SECRET=
|
|
3568
|
+
# Model \u8282\u70B9\u542F\u7528\u524D\u5FC5\u987B\u586B\u5165\u7531\u8FD0\u7EF4\u51BB\u7ED3\u7684 deployment/model \u4EF7\u683C\u76EE\u5F55\uFF1B\u7F3A\u5931\u65F6 readiness \u660E\u786E unavailable\u3002
|
|
3569
|
+
WINDY_AGENT_WORKFLOW_MODEL_PRICING_JSON=
|
|
3570
|
+
# \u975E Compose \u90E8\u7F72\u9700\u6307\u5411 Windy Server\uFF1B\u957F\u671F Session \u7684\u6A21\u578B\u8C03\u7528\u4F1A fail closed\u3002
|
|
3571
|
+
# AGENT_CONTEXT_HOST_URL=http://server:9747
|
|
3489
3572
|
# \u591A\u526F\u672C\u751F\u4EA7\u9ED8\u8BA4\u4F7F\u7528 Compose \u6CE8\u5165\u7684 PostgreSQL\uFF1B\u7559\u7A7A\u624D\u56DE\u9000\u5355\u526F\u672C SQLite\u3002
|
|
3490
3573
|
AGENT_DATABASE_URL=
|
|
3491
3574
|
# \u53EF\u9009\uFF1A\u53EA\u53D1\u9001\u65E0 Prompt/\u8F93\u5165/\u8F93\u51FA\u7684 Agent Run \u5143\u6570\u636E Span\u3002
|
|
3492
3575
|
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=
|
|
3493
3576
|
OTEL_EXPORTER_OTLP_HEADERS=
|
|
3494
3577
|
AI_ARTIFACT_ENCRYPTION_SECRET=
|
|
3578
|
+
WINDY_PUBLIC_BASE_URL=http://localhost:9747
|
|
3495
3579
|
DOCUMENT_SERVER_URL=
|
|
3496
3580
|
DOCUMENT_ARTIFACT_URL=
|
|
3497
3581
|
DOCUMENT_OUTPUT_ARTIFACT_URL=
|
|
@@ -3609,7 +3693,7 @@ ${includeStorage ? "- \u5927\u62A5\u544A\u5BFC\u5165\uFF1A[\u53D7\u6CBB\u7406\u7
|
|
|
3609
3693
|
${includeOfflineLicense ? "- License \u6D88\u8D39\u7AEF\uFF1A[\u79BB\u7EBF\u6FC0\u6D3B\u4E0E\u5B89\u88C5\u534F\u8BAE](./license/license-offline-activation-code.md)\u4E0E[\u624B\u673A\u626B\u7801\u914D\u5BF9\u6FC0\u6D3B](./license/license-pairing-activation.md)\uFF1B\u8FD0\u884C\u65F6\u80FD\u529B\u7531 npm \u4F9D\u8D56 `@southwind-ai/license` \u63D0\u4F9B\u3002" : ""}
|
|
3610
3694
|
- \u8FD0\u7EF4\uFF1A[\u53EF\u89C2\u6D4B\u6027](./operations/observability.md)${includeOperations ? " \u4E0E [\u8FD0\u7EF4\u603B\u89C8](./platform/operations-overview.md)" : ""}\u3002
|
|
3611
3695
|
- \u4EA4\u4ED8\uFF1A[\u6309 registry digest \u4E0E OCI blob \u5DEE\u91CF\u53D1\u5E03](./operations/incremental-delivery.md)\u3002
|
|
3612
|
-
${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" : ""}
|
|
3696
|
+
${includeAgent ? "- Agent\u3001\u591A\u6A21\u6001 Runtime \u4E0E MCP\uFF1A[Agent Harness](./architecture/agent-harness.md)\u3001[Agent Runtime \u63A5\u5165](./platform/agent-runtime.md)\u3001[Session/Memory \u8FD0\u7EF4](./operations/agent-session-memory.md)\u3001[Session \u6545\u969C\u901F\u67E5](./operations/agent-session-troubleshooting.md)\u3001[Agent Workflow](./architecture/agent-workflow.md)\u3001[Workflow \u6062\u590D\u8FD0\u7EF4](./operations/agent-workflow-recovery.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" : ""}
|
|
3613
3697
|
- \u517C\u5BB9\uFF1A[RuoYi-Vue Adapter](./adapters/ruoyi-vue-compatibility.md)\u3002
|
|
3614
3698
|
`;
|
|
3615
3699
|
}
|
|
@@ -3729,22 +3813,10 @@ Speech Runtime \u53EA\u63A5\u6536\u6388\u6743 Artifact\uFF0C\u8D1F\u8D23\u683C\u
|
|
|
3729
3813
|
Artifact\uFF1B\u5B9E\u65F6 ASR\u3001TTS \u548C Dictation \u5C1A\u672A\u5F00\u653E\u3002\u8BE6\u89C1
|
|
3730
3814
|
[Speech AI Runtime](./docs/platform/speech-ai-runtime.md)\u3002
|
|
3731
3815
|
|
|
3732
|
-
\
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
\
|
|
3736
|
-
|
|
3737
|
-
\`\`\`bash
|
|
3738
|
-
bun run dev:adk-web
|
|
3739
|
-
\`\`\`
|
|
3740
|
-
|
|
3741
|
-
\u8BBF\u95EE \`http://127.0.0.1:8000\` \u5E76\u9009\u62E9 \`canonical_debug\`\u3002\u8BE5\u547D\u4EE4\u4F1A\u540C\u65F6\u542F\u52A8\u5B8C\u6574
|
|
3742
|
-
Agent Runtime\uFF1BWindy \u542F\u52A8\u811A\u672C\u8BFB\u53D6\u9879\u76EE\u9009\u62E9\u7684 Operation\uFF0CADK Web \u4F7F\u7528 create-windy
|
|
3743
|
-
\u81EA\u52A8\u751F\u6210\u7684\u968F\u673A\u8C03\u8BD5 Token\uFF0C\u7ECF canonical HTTP/SSE \u6267\u884C\u771F\u5B9E Operation\u3002Server \u4E13\u7528\u8EAB\u4EFD
|
|
3744
|
-
\u5411\u4E1A\u52A1 Module \u6295\u5F71\u8BE5\u7528\u6237\u7684\u771F\u5B9E\u6210\u5458 ID \u4E0E\u5F53\u524D Scope\uFF0C\u5E76\u628A\u6743\u9650\u6536\u7A84\u5230\u7528\u6237\u5DF2\u6709\u6743\u9650\u548C
|
|
3745
|
-
Operation/allowed Tools \u95ED\u5305\uFF1B\u6838\u5FC3\u5BA1\u8BA1\u4E3B\u4F53\u4ECD\u4E3A ADK Debug Service\u3002\u666E\u901A \`dev\`\u3001
|
|
3746
|
-
\`agent\` profile \u548C\u751F\u4EA7\u90E8\u7F72\u5747\u4E0D\u4F1A\u542F\u52A8\u6216\u66B4\u9732 ADK Web\uFF1B\u9875\u9762\u663E\u793A\u7684\u662F canonical Run
|
|
3747
|
-
\u6458\u8981\uFF0C\u4E0D\u662F\u5185\u90E8\u5B8C\u6574 Workflow \u56FE\u3002
|
|
3816
|
+
\u5F00\u53D1\u4E0E\u5BA1\u8BA1\u7EDF\u4E00\u4F7F\u7528 Windy \u4E3B\u7AD9\uFF1A\`/admin/system/ai-runtime\` \u63D0\u4F9B\u53D7\u6743\u9650\u4FDD\u62A4\u7684 Run\u3001
|
|
3817
|
+
Provider Attempt \u4E0E\u8131\u654F Trajectory\uFF1B\u4E1A\u52A1\u6A21\u5757\u53EF\u901A\u8FC7 \`registerAgentSessionProviders()\`
|
|
3818
|
+
\u6CE8\u518C\u5386\u53F2\u4F1A\u8BDD\u53EA\u8BFB\u6295\u5F71\u3002\u4E24\u8005\u5747\u590D\u7528\u5F53\u524D\u767B\u5F55\u8EAB\u4EFD\u3001Manifest Feature/RBAC \u4E0E Audit\uFF0C\u4E0D\u521B\u5EFA
|
|
3819
|
+
\u7B2C\u4E8C\u79CD\u8C03\u8BD5 Token\uFF0C\u4E5F\u4E0D\u4F1A\u5C55\u793A\u8F93\u5165\u8F93\u51FA\u6B63\u6587\u3001Tool \u53C2\u6570\u6216 Provider \u539F\u59CB\u54CD\u5E94\u3002
|
|
3748
3820
|
` : ""}
|
|
3749
3821
|
${includeSearch ? `
|
|
3750
3822
|
## OpenSearch \u641C\u7D22 profile
|
|
@@ -3912,7 +3984,7 @@ function createStarterPackage(source, projectName, includeOxc = true, projectLic
|
|
|
3912
3984
|
...includeOxc ? { "lint-staged": sourceLintStaged ?? defaultLintStaged } : {},
|
|
3913
3985
|
scripts: {
|
|
3914
3986
|
...includeOxc ? {
|
|
3915
|
-
prepare: "
|
|
3987
|
+
prepare: "husky"
|
|
3916
3988
|
} : {},
|
|
3917
3989
|
dev: "docker compose up",
|
|
3918
3990
|
"docker:sync": "create-windy sync-docker",
|
|
@@ -3923,8 +3995,7 @@ function createStarterPackage(source, projectName, includeOxc = true, projectLic
|
|
|
3923
3995
|
...selectedModules.includes("system.agent") ? {
|
|
3924
3996
|
"dev:agent": "docker compose --profile agent up --build",
|
|
3925
3997
|
"dev:speech": "PLATFORM_ENABLE_AI=true SPEECH_SERVER_URL=http://speech-server:8091 docker compose --profile agent --profile speech up --build",
|
|
3926
|
-
"speech:pins": "bun run scripts/provision-speech-readiness.ts"
|
|
3927
|
-
"dev:adk-web": "bun run scripts/dev-adk-web.ts"
|
|
3998
|
+
"speech:pins": "bun run scripts/provision-speech-readiness.ts"
|
|
3928
3999
|
} : {},
|
|
3929
4000
|
...generatorVersion ? { windy: "create-windy" } : {},
|
|
3930
4001
|
"dev:web": "bun run --cwd apps/web dev",
|
|
@@ -3970,13 +4041,11 @@ var templateRootFiles = [
|
|
|
3970
4041
|
"README.md",
|
|
3971
4042
|
"bunfig.toml",
|
|
3972
4043
|
"docker-compose.yml",
|
|
3973
|
-
"docker-compose.agent-debug.yml",
|
|
3974
4044
|
"drizzle.config.ts",
|
|
3975
4045
|
"module-schema.lineages.json",
|
|
3976
4046
|
"package.json",
|
|
3977
4047
|
"scripts/notification-postgres-regression.ts",
|
|
3978
4048
|
"scripts/lib/postgres-regression.ts",
|
|
3979
|
-
"scripts/dev-adk-web.ts",
|
|
3980
4049
|
"scripts/provision-speech-readiness.ts"
|
|
3981
4050
|
];
|
|
3982
4051
|
var templateDirectories = [
|
|
@@ -4002,7 +4071,10 @@ var templateDirectories = [
|
|
|
4002
4071
|
];
|
|
4003
4072
|
var templateDocumentationFiles = [
|
|
4004
4073
|
"docs/adapters/ruoyi-vue-compatibility.md",
|
|
4074
|
+
"docs/adr/0003-agent-session-event-source.md",
|
|
4005
4075
|
"docs/architecture/admin-surface-boundary.md",
|
|
4076
|
+
"docs/architecture/agent-harness.md",
|
|
4077
|
+
"docs/architecture/agent-workflow.md",
|
|
4006
4078
|
"docs/architecture/ai-egress.md",
|
|
4007
4079
|
"docs/architecture/ai-runtime.md",
|
|
4008
4080
|
"docs/architecture/ai-runtime-readiness.md",
|
|
@@ -4029,19 +4101,29 @@ var templateDocumentationFiles = [
|
|
|
4029
4101
|
"docs/development/ui-component-gallery.md",
|
|
4030
4102
|
"docs/license/license-offline-activation-code.md",
|
|
4031
4103
|
"docs/license/license-pairing-activation.md",
|
|
4104
|
+
"docs/operations/agent-session-memory.md",
|
|
4105
|
+
"docs/operations/agent-session-troubleshooting.md",
|
|
4106
|
+
"docs/operations/adk-retirement.md",
|
|
4032
4107
|
"docs/operations/observability.md",
|
|
4108
|
+
"docs/operations/agent-workflow-recovery.md",
|
|
4033
4109
|
"docs/operations/incremental-delivery.md",
|
|
4034
4110
|
"docs/platform/agent-run-attestation.md",
|
|
4035
|
-
"docs/platform/agent-
|
|
4036
|
-
"docs/platform/agent-tools.md",
|
|
4111
|
+
"docs/platform/client-agent-session.md",
|
|
4037
4112
|
"docs/platform/agent-runtime.md",
|
|
4038
4113
|
"docs/platform/agent-runtime-observability.md",
|
|
4114
|
+
"docs/platform/agent-supervisor-output-contract.md",
|
|
4115
|
+
"docs/platform/agent-tools.md",
|
|
4116
|
+
"docs/platform/agent-tool-approval.md",
|
|
4039
4117
|
"docs/platform/agent-tool-sandbox.md",
|
|
4118
|
+
"docs/platform/agent-production-store.md",
|
|
4119
|
+
"docs/platform/agent-run-reattachment.md",
|
|
4120
|
+
"docs/platform/background-ai-operations.md",
|
|
4040
4121
|
"docs/platform/audit-reliability.md",
|
|
4041
4122
|
"docs/platform/bulk-data-jobs.md",
|
|
4042
4123
|
"docs/platform/business-user-directory.md",
|
|
4043
4124
|
"docs/platform/data-access-control.md",
|
|
4044
4125
|
"docs/platform/document-ai-runtime.md",
|
|
4126
|
+
"docs/platform/embedding-ai-runtime.md",
|
|
4045
4127
|
"docs/platform/governed-export-renderers.md",
|
|
4046
4128
|
"docs/platform/module-configuration.md",
|
|
4047
4129
|
"docs/platform/navigation-registry.md",
|
|
@@ -6309,8 +6391,8 @@ import { rm as rm10 } from "fs/promises";
|
|
|
6309
6391
|
import { resolve as resolve8 } from "path";
|
|
6310
6392
|
|
|
6311
6393
|
// src/update/doctor.ts
|
|
6312
|
-
import { readFile as
|
|
6313
|
-
import { join as
|
|
6394
|
+
import { readFile as readFile12 } from "fs/promises";
|
|
6395
|
+
import { join as join17 } from "path";
|
|
6314
6396
|
|
|
6315
6397
|
// src/update/process.ts
|
|
6316
6398
|
import { spawn as spawn2 } from "child_process";
|
|
@@ -8205,6 +8287,64 @@ async function applyTransaction(plan) {
|
|
|
8205
8287
|
};
|
|
8206
8288
|
}
|
|
8207
8289
|
|
|
8290
|
+
// src/update/legacy-adk-retirement.ts
|
|
8291
|
+
import { lstat as lstat6, readFile as readFile11 } from "fs/promises";
|
|
8292
|
+
import { join as join16 } from "path";
|
|
8293
|
+
var projectOwnedDebugConfig = "apps/agent-server/project/adk-web-debug.json";
|
|
8294
|
+
var deprecatedEnvironmentKeys = [
|
|
8295
|
+
"ADK_DEBUG_PLATFORM_TOKEN",
|
|
8296
|
+
"WINDY_ADK_DEBUG_TOKEN",
|
|
8297
|
+
"WINDY_ADK_DEBUG_OPERATION_KEY",
|
|
8298
|
+
"WINDY_ADK_DEBUG_DATA_ACTOR_ID"
|
|
8299
|
+
];
|
|
8300
|
+
async function inspectAdkRetirement(projectDirectory) {
|
|
8301
|
+
const findings = [];
|
|
8302
|
+
if (await pathExists(join16(projectDirectory, projectOwnedDebugConfig))) {
|
|
8303
|
+
findings.push({
|
|
8304
|
+
kind: "project-owned-file",
|
|
8305
|
+
path: projectOwnedDebugConfig,
|
|
8306
|
+
message: `${projectOwnedDebugConfig} \u5C5E\u4E8E project-owned\uFF1BADK Web \u5DF2\u79FB\u9664\uFF0C\u4F46 Windy \u4E0D\u4F1A\u731C\u6D4B\u5220\u9664\uFF0C\u8BF7\u786E\u8BA4\u65E0\u5BA2\u6237\u7528\u9014\u540E\u4EBA\u5DE5\u6E05\u7406\u3002`
|
|
8307
|
+
});
|
|
8308
|
+
}
|
|
8309
|
+
const environmentPath = join16(projectDirectory, ".env");
|
|
8310
|
+
const metadata = await metadataOf(environmentPath);
|
|
8311
|
+
if (!metadata)
|
|
8312
|
+
return findings;
|
|
8313
|
+
if (metadata.isSymbolicLink()) {
|
|
8314
|
+
findings.push({
|
|
8315
|
+
kind: "external-environment",
|
|
8316
|
+
path: ".env",
|
|
8317
|
+
message: "\u5916\u90E8\u6258\u7BA1\u7684 .env \u672A\u8BFB\u53D6\u6216\u6539\u5199\uFF1B\u8BF7\u4EBA\u5DE5\u786E\u8BA4\u5E76\u79FB\u9664\u5176\u4E2D\u5DF2\u5F03\u7528\u7684 ADK Debug \u914D\u7F6E\u3002"
|
|
8318
|
+
});
|
|
8319
|
+
return findings;
|
|
8320
|
+
}
|
|
8321
|
+
const content = await readFile11(environmentPath, "utf8");
|
|
8322
|
+
for (const key of deprecatedEnvironmentKeys) {
|
|
8323
|
+
if (!new RegExp(`^${key}=`, "m").test(content))
|
|
8324
|
+
continue;
|
|
8325
|
+
findings.push({
|
|
8326
|
+
kind: "environment-key",
|
|
8327
|
+
path: ".env",
|
|
8328
|
+
key,
|
|
8329
|
+
message: `${key} \u5DF2\u5F03\u7528\uFF1B\u4E3A\u907F\u514D\u8BEF\u5220\u5BA2\u6237 Secret\uFF0CWindy \u4E0D\u4F1A\u81EA\u52A8\u6539\u5199\u6216\u5220\u9664\u8BE5\u503C\u3002`
|
|
8330
|
+
});
|
|
8331
|
+
}
|
|
8332
|
+
return findings;
|
|
8333
|
+
}
|
|
8334
|
+
async function pathExists(path2) {
|
|
8335
|
+
return Boolean(await metadataOf(path2));
|
|
8336
|
+
}
|
|
8337
|
+
async function metadataOf(path2) {
|
|
8338
|
+
try {
|
|
8339
|
+
return await lstat6(path2);
|
|
8340
|
+
} catch (error) {
|
|
8341
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
8342
|
+
return;
|
|
8343
|
+
}
|
|
8344
|
+
throw error;
|
|
8345
|
+
}
|
|
8346
|
+
}
|
|
8347
|
+
|
|
8208
8348
|
// src/update/doctor.ts
|
|
8209
8349
|
var oxcPaths = new Set([
|
|
8210
8350
|
".oxfmtrc.json",
|
|
@@ -8222,11 +8362,12 @@ async function diagnoseProject(projectDirectory, repair = false) {
|
|
|
8222
8362
|
}
|
|
8223
8363
|
const mayRepairEnvironment = repair && recoveryAction !== "recovery-conflicts";
|
|
8224
8364
|
const environmentRepair = mayRepairEnvironment ? await repairLocalEnvironment(projectDirectory) : undefined;
|
|
8225
|
-
const [provenance, manifest, git, environment] = await Promise.all([
|
|
8365
|
+
const [provenance, manifest, git, environment, manualCleanup] = await Promise.all([
|
|
8226
8366
|
readGenerationProvenance(projectDirectory),
|
|
8227
8367
|
readManagedFilesManifest(projectDirectory),
|
|
8228
8368
|
captureProcess("git", ["status", "--porcelain"], projectDirectory),
|
|
8229
|
-
environmentRepair ? Promise.resolve(environmentRepair) : inspectLocalEnvironment(projectDirectory)
|
|
8369
|
+
environmentRepair ? Promise.resolve(environmentRepair) : inspectLocalEnvironment(projectDirectory),
|
|
8370
|
+
inspectAdkRetirement(projectDirectory)
|
|
8230
8371
|
]);
|
|
8231
8372
|
const modifiedManagedFiles = [];
|
|
8232
8373
|
const missingManagedFiles = [];
|
|
@@ -8235,7 +8376,7 @@ async function diagnoseProject(projectDirectory, repair = false) {
|
|
|
8235
8376
|
if (file.ownership === "project-owned")
|
|
8236
8377
|
continue;
|
|
8237
8378
|
try {
|
|
8238
|
-
const changed = hashContent(await
|
|
8379
|
+
const changed = hashContent(await readFile12(join17(projectDirectory, file.path))) !== file.hash;
|
|
8239
8380
|
if (!changed)
|
|
8240
8381
|
continue;
|
|
8241
8382
|
modifiedManagedFiles.push(file.path);
|
|
@@ -8264,6 +8405,7 @@ async function diagnoseProject(projectDirectory, repair = false) {
|
|
|
8264
8405
|
localEnvironmentExternal: environment.externalFile,
|
|
8265
8406
|
missingLocalEnvironmentKeys: environment.missingKeys,
|
|
8266
8407
|
duplicateLocalEnvironmentKeys: environment.duplicateKeys,
|
|
8408
|
+
manualCleanup,
|
|
8267
8409
|
recoveryAction
|
|
8268
8410
|
};
|
|
8269
8411
|
}
|
|
@@ -8295,6 +8437,21 @@ var recipes = [
|
|
|
8295
8437
|
id: "starter-0.6.10-to-0.6.11",
|
|
8296
8438
|
from: "0.6.10",
|
|
8297
8439
|
to: "0.6.11"
|
|
8440
|
+
},
|
|
8441
|
+
{
|
|
8442
|
+
id: "starter-0.6.11-to-0.6.12",
|
|
8443
|
+
from: "0.6.11",
|
|
8444
|
+
to: "0.6.12"
|
|
8445
|
+
},
|
|
8446
|
+
{
|
|
8447
|
+
id: "starter-0.6.12-to-0.6.13",
|
|
8448
|
+
from: "0.6.12",
|
|
8449
|
+
to: "0.6.13"
|
|
8450
|
+
},
|
|
8451
|
+
{
|
|
8452
|
+
id: "starter-0.6.13-to-0.6.14",
|
|
8453
|
+
from: "0.6.13",
|
|
8454
|
+
to: "0.6.14"
|
|
8298
8455
|
}
|
|
8299
8456
|
];
|
|
8300
8457
|
function resolveRecipeChain(sourceVersion, targetVersion) {
|
|
@@ -8340,18 +8497,18 @@ function parseVersion2(version) {
|
|
|
8340
8497
|
}
|
|
8341
8498
|
|
|
8342
8499
|
// src/update/updater.ts
|
|
8343
|
-
import { readFile as
|
|
8344
|
-
import { join as
|
|
8500
|
+
import { readFile as readFile24, rm as rm8 } from "fs/promises";
|
|
8501
|
+
import { join as join29 } from "path";
|
|
8345
8502
|
|
|
8346
8503
|
// src/update/artifacts.ts
|
|
8347
|
-
import { mkdtemp, readFile as
|
|
8504
|
+
import { mkdtemp, readFile as readFile15 } from "fs/promises";
|
|
8348
8505
|
import { tmpdir } from "os";
|
|
8349
|
-
import { basename as basename10, join as
|
|
8506
|
+
import { basename as basename10, join as join20 } from "path";
|
|
8350
8507
|
|
|
8351
8508
|
// src/update/published-artifacts.ts
|
|
8352
8509
|
import { createHash as createHash4 } from "crypto";
|
|
8353
|
-
import { mkdir as mkdir6, readFile as
|
|
8354
|
-
import { basename as basename9, join as
|
|
8510
|
+
import { mkdir as mkdir6, readFile as readFile13, writeFile as writeFile10 } from "fs/promises";
|
|
8511
|
+
import { basename as basename9, join as join18 } from "path";
|
|
8355
8512
|
|
|
8356
8513
|
// src/update/safe-archive.ts
|
|
8357
8514
|
import { mkdir as mkdir5 } from "fs/promises";
|
|
@@ -8403,17 +8560,17 @@ async function downloadPublicArtifact(temporaryRoot, label, version, expectedInt
|
|
|
8403
8560
|
}
|
|
8404
8561
|
const archive = await readBoundedResponse(response, `create-windy@${version} artifact `);
|
|
8405
8562
|
verifyArchive(metadata, archive);
|
|
8406
|
-
const destination =
|
|
8407
|
-
const archivePath =
|
|
8563
|
+
const destination = join18(temporaryRoot, `${label}-artifact`);
|
|
8564
|
+
const archivePath = join18(temporaryRoot, `${label}.tgz`);
|
|
8408
8565
|
await writeFile10(archivePath, archive);
|
|
8409
8566
|
await extractSafeTarArchive({
|
|
8410
8567
|
archivePath,
|
|
8411
8568
|
destination,
|
|
8412
8569
|
cwd: temporaryRoot
|
|
8413
8570
|
});
|
|
8414
|
-
const packageRoot2 =
|
|
8415
|
-
const packageJson = JSON.parse(await
|
|
8416
|
-
const template = await readTemplateMetadata(
|
|
8571
|
+
const packageRoot2 = join18(destination, "package");
|
|
8572
|
+
const packageJson = JSON.parse(await readFile13(join18(packageRoot2, "package.json"), "utf8"));
|
|
8573
|
+
const template = await readTemplateMetadata(join18(packageRoot2, "template"));
|
|
8417
8574
|
if (packageJson.name !== "create-windy" || packageJson.version !== version || template.generatorVersion !== version) {
|
|
8418
8575
|
throw new Error(`create-windy@${version} \u5305\u8EAB\u4EFD\u6216\u6A21\u677F\u5143\u6570\u636E\u4E0D\u4E00\u81F4`);
|
|
8419
8576
|
}
|
|
@@ -8545,10 +8702,10 @@ function verifyArchive(metadata, archive) {
|
|
|
8545
8702
|
}
|
|
8546
8703
|
}
|
|
8547
8704
|
async function generatePublicArtifactProject(temporaryRoot, label, projectName, packageRoot2, provenance) {
|
|
8548
|
-
const parent =
|
|
8705
|
+
const parent = join18(temporaryRoot, label);
|
|
8549
8706
|
await mkdir6(parent, { recursive: true });
|
|
8550
8707
|
const args = [
|
|
8551
|
-
|
|
8708
|
+
join18(packageRoot2, "dist/cli.js"),
|
|
8552
8709
|
projectName,
|
|
8553
8710
|
"--yes",
|
|
8554
8711
|
"--skip-install",
|
|
@@ -8568,26 +8725,26 @@ async function generatePublicArtifactProject(temporaryRoot, label, projectName,
|
|
|
8568
8725
|
}
|
|
8569
8726
|
}
|
|
8570
8727
|
await assertProcess("bun", args, parent);
|
|
8571
|
-
return
|
|
8728
|
+
return join18(parent, projectName);
|
|
8572
8729
|
}
|
|
8573
8730
|
|
|
8574
8731
|
// src/module-history.ts
|
|
8575
8732
|
import {
|
|
8576
|
-
lstat as
|
|
8733
|
+
lstat as lstat7,
|
|
8577
8734
|
mkdir as mkdir7,
|
|
8578
8735
|
readdir as readdir8,
|
|
8579
|
-
readFile as
|
|
8736
|
+
readFile as readFile14,
|
|
8580
8737
|
writeFile as writeFile11
|
|
8581
8738
|
} from "fs/promises";
|
|
8582
|
-
import { dirname as dirname8, join as
|
|
8739
|
+
import { dirname as dirname8, join as join19, relative as relative5, sep as sep4 } from "path";
|
|
8583
8740
|
async function archiveRemovedModuleMigrations(input) {
|
|
8584
8741
|
await assertExistingHistoryIntegrity(input.projectDirectory);
|
|
8585
|
-
let changed = await copyMigrationTree(input.projectDirectory, ".windy/module-history",
|
|
8742
|
+
let changed = await copyMigrationTree(input.projectDirectory, ".windy/module-history", join19(input.targetDirectory, ".windy/module-history"));
|
|
8586
8743
|
const target = new Set(input.targetModules);
|
|
8587
8744
|
const removed = moduleDistributionCatalog.filter(({ name }) => input.sourceModules.includes(name) && !target.has(name));
|
|
8588
8745
|
for (const manifest of removed) {
|
|
8589
8746
|
for (const root of manifest.migrationRoots) {
|
|
8590
|
-
changed = await copyMigrationTree(input.projectDirectory, root,
|
|
8747
|
+
changed = await copyMigrationTree(input.projectDirectory, root, join19(input.targetDirectory, ".windy/module-history", manifest.name, root)) || changed;
|
|
8591
8748
|
}
|
|
8592
8749
|
}
|
|
8593
8750
|
if (changed) {
|
|
@@ -8595,7 +8752,7 @@ async function archiveRemovedModuleMigrations(input) {
|
|
|
8595
8752
|
}
|
|
8596
8753
|
}
|
|
8597
8754
|
async function assertExistingHistoryIntegrity(projectDirectory) {
|
|
8598
|
-
const historyRoot =
|
|
8755
|
+
const historyRoot = join19(projectDirectory, ".windy/module-history");
|
|
8599
8756
|
const metadata = await readOptionalMetadata(historyRoot);
|
|
8600
8757
|
if (!metadata)
|
|
8601
8758
|
return;
|
|
@@ -8610,13 +8767,13 @@ async function assertExistingHistoryIntegrity(projectDirectory) {
|
|
|
8610
8767
|
if (!entry || isMissingManagedFile(entry)) {
|
|
8611
8768
|
throw new Error(`\u6A21\u5757 migration \u5386\u53F2\u672A\u767B\u8BB0\u5230\u53D7\u7BA1\u6E05\u5355\uFF1A${relativePath2}`);
|
|
8612
8769
|
}
|
|
8613
|
-
if (hashContent(await
|
|
8770
|
+
if (hashContent(await readFile14(path2)) !== entry.hash) {
|
|
8614
8771
|
throw new Error(`\u6A21\u5757 migration \u5386\u53F2\u5DF2\u88AB\u4FEE\u6539\uFF1A${relativePath2}`);
|
|
8615
8772
|
}
|
|
8616
8773
|
}
|
|
8617
8774
|
}
|
|
8618
8775
|
async function copyMigrationTree(projectRoot, relativeRoot, targetRoot) {
|
|
8619
|
-
const sourceRoot =
|
|
8776
|
+
const sourceRoot = join19(projectRoot, relativeRoot);
|
|
8620
8777
|
const rootMetadata = await readOptionalMetadata(sourceRoot);
|
|
8621
8778
|
if (!rootMetadata)
|
|
8622
8779
|
return false;
|
|
@@ -8624,9 +8781,9 @@ async function copyMigrationTree(projectRoot, relativeRoot, targetRoot) {
|
|
|
8624
8781
|
throw new Error(`\u6A21\u5757 migration \u6839\u76EE\u5F55\u65E0\u6548\uFF1A${relativeRoot}`);
|
|
8625
8782
|
}
|
|
8626
8783
|
for (const source of await collectRegularFiles(sourceRoot)) {
|
|
8627
|
-
const target =
|
|
8784
|
+
const target = join19(targetRoot, relative5(sourceRoot, source).split(sep4).join("/"));
|
|
8628
8785
|
await mkdir7(dirname8(target), { recursive: true });
|
|
8629
|
-
await writeFile11(target, await
|
|
8786
|
+
await writeFile11(target, await readFile14(source));
|
|
8630
8787
|
}
|
|
8631
8788
|
return true;
|
|
8632
8789
|
}
|
|
@@ -8636,8 +8793,8 @@ async function collectRegularFiles(root) {
|
|
|
8636
8793
|
return files.sort();
|
|
8637
8794
|
async function visit(directory) {
|
|
8638
8795
|
for (const name of (await readdir8(directory)).sort()) {
|
|
8639
|
-
const path2 =
|
|
8640
|
-
const metadata = await
|
|
8796
|
+
const path2 = join19(directory, name);
|
|
8797
|
+
const metadata = await lstat7(path2);
|
|
8641
8798
|
if (metadata.isSymbolicLink()) {
|
|
8642
8799
|
throw new Error(`\u6A21\u5757 migration \u4E0D\u5141\u8BB8\u7B26\u53F7\u94FE\u63A5\uFF1A${path2}`);
|
|
8643
8800
|
}
|
|
@@ -8650,7 +8807,7 @@ async function collectRegularFiles(root) {
|
|
|
8650
8807
|
}
|
|
8651
8808
|
async function readOptionalMetadata(path2) {
|
|
8652
8809
|
try {
|
|
8653
|
-
return await
|
|
8810
|
+
return await lstat7(path2);
|
|
8654
8811
|
} catch (error) {
|
|
8655
8812
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
8656
8813
|
return;
|
|
@@ -8666,10 +8823,10 @@ class PublishedArtifactProvider {
|
|
|
8666
8823
|
this.#fetch = fetcher;
|
|
8667
8824
|
}
|
|
8668
8825
|
async prepare(projectDirectory, provenance, targetModules) {
|
|
8669
|
-
const temporaryRoot = await mkdtemp(
|
|
8826
|
+
const temporaryRoot = await mkdtemp(join20(tmpdir(), "windy-update-"));
|
|
8670
8827
|
const projectName = await readProjectName2(projectDirectory);
|
|
8671
|
-
const baseDirectory =
|
|
8672
|
-
const targetDirectory =
|
|
8828
|
+
const baseDirectory = join20(temporaryRoot, "base", projectName);
|
|
8829
|
+
const targetDirectory = join20(temporaryRoot, "target", projectName);
|
|
8673
8830
|
const baseArtifact = await downloadPublicArtifact(temporaryRoot, "base", provenance.generatorVersion, undefined, this.#fetch);
|
|
8674
8831
|
if (baseArtifact.identity.templateCommit !== provenance.templateCommit) {
|
|
8675
8832
|
throw new Error("Project Lock \u4E0E\u6765\u6E90 registry artifact \u7684 template commit \u4E0D\u4E00\u81F4");
|
|
@@ -8697,13 +8854,13 @@ class PublishedArtifactProvider {
|
|
|
8697
8854
|
}
|
|
8698
8855
|
}
|
|
8699
8856
|
async function readProjectName2(projectDirectory) {
|
|
8700
|
-
const source = JSON.parse(await
|
|
8857
|
+
const source = JSON.parse(await readFile15(join20(projectDirectory, "package.json"), "utf8"));
|
|
8701
8858
|
return source.name || basename10(projectDirectory);
|
|
8702
8859
|
}
|
|
8703
8860
|
|
|
8704
8861
|
// src/update/planner.ts
|
|
8705
|
-
import { readFile as
|
|
8706
|
-
import { dirname as dirname9, join as
|
|
8862
|
+
import { readFile as readFile22 } from "fs/promises";
|
|
8863
|
+
import { dirname as dirname9, join as join27 } from "path";
|
|
8707
8864
|
|
|
8708
8865
|
// src/update/docker-copy-update-plan.ts
|
|
8709
8866
|
async function deriveDockerfilePlans(files, snapshots, paths, targetWorkspaceManifests) {
|
|
@@ -8791,16 +8948,16 @@ function matchesWorkspace(pattern, directory) {
|
|
|
8791
8948
|
}
|
|
8792
8949
|
|
|
8793
8950
|
// src/update/migration-reconciler.ts
|
|
8794
|
-
import { readFile as
|
|
8795
|
-
import { join as
|
|
8951
|
+
import { readFile as readFile19 } from "fs/promises";
|
|
8952
|
+
import { join as join23 } from "path";
|
|
8796
8953
|
|
|
8797
8954
|
// src/update/migration-adoption.ts
|
|
8798
|
-
import { readFile as
|
|
8799
|
-
import { join as
|
|
8955
|
+
import { readFile as readFile18 } from "fs/promises";
|
|
8956
|
+
import { join as join22 } from "path";
|
|
8800
8957
|
|
|
8801
8958
|
// src/update/migration-project-file.ts
|
|
8802
|
-
import { readFile as
|
|
8803
|
-
import { join as
|
|
8959
|
+
import { readFile as readFile16 } from "fs/promises";
|
|
8960
|
+
import { join as join21 } from "path";
|
|
8804
8961
|
async function readProjectJson(input, path2) {
|
|
8805
8962
|
const content = await readProjectFile(input, path2);
|
|
8806
8963
|
if (!content) {
|
|
@@ -8816,7 +8973,7 @@ async function readProjectFile(input, path2) {
|
|
|
8816
8973
|
}
|
|
8817
8974
|
let content;
|
|
8818
8975
|
try {
|
|
8819
|
-
content = await
|
|
8976
|
+
content = await readFile16(join21(input.projectDirectory, path2));
|
|
8820
8977
|
} catch (error) {
|
|
8821
8978
|
if (!isMissingFileError(error))
|
|
8822
8979
|
throw error;
|
|
@@ -8831,7 +8988,7 @@ function isMissingFileError(error) {
|
|
|
8831
8988
|
}
|
|
8832
8989
|
|
|
8833
8990
|
// src/update/migration-history.ts
|
|
8834
|
-
import { readFile as
|
|
8991
|
+
import { readFile as readFile17 } from "fs/promises";
|
|
8835
8992
|
var drizzleRoot = "packages/database/drizzle";
|
|
8836
8993
|
var journalPath = `${drizzleRoot}/meta/_journal.json`;
|
|
8837
8994
|
var migrationPattern = /^(\d{4})_(.+)$/;
|
|
@@ -8881,7 +9038,7 @@ function encodeJson(value) {
|
|
|
8881
9038
|
`);
|
|
8882
9039
|
}
|
|
8883
9040
|
async function readJson(path2) {
|
|
8884
|
-
return JSON.parse(await
|
|
9041
|
+
return JSON.parse(await readFile17(path2, "utf8"));
|
|
8885
9042
|
}
|
|
8886
9043
|
|
|
8887
9044
|
// src/update/snapshot-delta.ts
|
|
@@ -8957,10 +9114,10 @@ async function inspectPreexistingMigrationAdoptions(input) {
|
|
|
8957
9114
|
projectBeforeBytes,
|
|
8958
9115
|
projectAfterBytes
|
|
8959
9116
|
] = await Promise.all([
|
|
8960
|
-
|
|
9117
|
+
readFile18(join22(input.targetDirectory, `${drizzleRoot}/${candidate.tag}.sql`)),
|
|
8961
9118
|
readProjectFile(input, projectSqlPath),
|
|
8962
|
-
readJson(
|
|
8963
|
-
readJson(
|
|
9119
|
+
readJson(join22(input.targetDirectory, snapshotPath(previousTarget.tag))),
|
|
9120
|
+
readJson(join22(input.targetDirectory, snapshotPath(candidate.tag))),
|
|
8964
9121
|
readProjectFile(input, snapshotPath(previousProject.tag)),
|
|
8965
9122
|
readProjectFile(input, projectSnapshotPath)
|
|
8966
9123
|
]);
|
|
@@ -9087,7 +9244,7 @@ async function reconcileDrizzleMigrations(input) {
|
|
|
9087
9244
|
const tag = `${prefix}_${name}`;
|
|
9088
9245
|
const sqlPath = `${drizzleRoot}/${tag}.sql`;
|
|
9089
9246
|
const snapshotPath2 = `${drizzleRoot}/meta/${prefix}_snapshot.json`;
|
|
9090
|
-
const sql = await
|
|
9247
|
+
const sql = await readFile19(join23(input.targetDirectory, `${drizzleRoot}/${addition.tag}.sql`));
|
|
9091
9248
|
merged.id = targetAfter.id;
|
|
9092
9249
|
merged.prevId = currentSnapshot.id;
|
|
9093
9250
|
const snapshot2 = encodeJson(merged);
|
|
@@ -9134,9 +9291,9 @@ function unchanged(targetManifest) {
|
|
|
9134
9291
|
async function readJournals(input) {
|
|
9135
9292
|
try {
|
|
9136
9293
|
const [base, project, target] = await Promise.all([
|
|
9137
|
-
readJson(
|
|
9294
|
+
readJson(join23(input.baseDirectory, journalPath)),
|
|
9138
9295
|
readProjectJson(input, journalPath),
|
|
9139
|
-
readJson(
|
|
9296
|
+
readJson(join23(input.targetDirectory, journalPath))
|
|
9140
9297
|
]);
|
|
9141
9298
|
return { base, project, target };
|
|
9142
9299
|
} catch (error) {
|
|
@@ -9167,17 +9324,17 @@ async function readLatestSnapshot(input, journal) {
|
|
|
9167
9324
|
return JSON.parse(new TextDecoder().decode(content));
|
|
9168
9325
|
}
|
|
9169
9326
|
async function readSnapshot(root, tag) {
|
|
9170
|
-
return await readJson(
|
|
9327
|
+
return await readJson(join23(root, snapshotPath(tag)));
|
|
9171
9328
|
}
|
|
9172
9329
|
|
|
9173
9330
|
// src/update/planner-file.ts
|
|
9174
|
-
import { readFile as
|
|
9175
|
-
import { join as
|
|
9331
|
+
import { readFile as readFile20 } from "fs/promises";
|
|
9332
|
+
import { join as join25 } from "path";
|
|
9176
9333
|
|
|
9177
9334
|
// src/update/merge.ts
|
|
9178
9335
|
import { mkdtemp as mkdtemp2, rm as rm6, writeFile as writeFile12 } from "fs/promises";
|
|
9179
9336
|
import { tmpdir as tmpdir2 } from "os";
|
|
9180
|
-
import { join as
|
|
9337
|
+
import { join as join24 } from "path";
|
|
9181
9338
|
|
|
9182
9339
|
// src/update/merge-convergent-additions.ts
|
|
9183
9340
|
async function reconcileConvergentAdditions(input) {
|
|
@@ -9319,11 +9476,11 @@ function sameLines(left, right) {
|
|
|
9319
9476
|
|
|
9320
9477
|
// src/update/merge.ts
|
|
9321
9478
|
async function mergeTextFile(base, ours, theirs) {
|
|
9322
|
-
const root = await mkdtemp2(
|
|
9479
|
+
const root = await mkdtemp2(join24(tmpdir2(), "windy-merge-"));
|
|
9323
9480
|
try {
|
|
9324
|
-
const oursPath =
|
|
9325
|
-
const basePath =
|
|
9326
|
-
const theirsPath =
|
|
9481
|
+
const oursPath = join24(root, "ours");
|
|
9482
|
+
const basePath = join24(root, "base");
|
|
9483
|
+
const theirsPath = join24(root, "theirs");
|
|
9327
9484
|
await Promise.all([
|
|
9328
9485
|
writeFile12(oursPath, ours),
|
|
9329
9486
|
writeFile12(basePath, base),
|
|
@@ -9656,11 +9813,47 @@ function conflict(path2, reason, expectedProjectContent) {
|
|
|
9656
9813
|
};
|
|
9657
9814
|
}
|
|
9658
9815
|
|
|
9816
|
+
// src/update/recipe-project-owned-trajectory-test.ts
|
|
9817
|
+
var legacyAnchor = /^(\s*)traceId: "trace_1",\n\1attemptItems: \[$/gm;
|
|
9818
|
+
var migratedAnchor = /^(\s*)traceId: "trace_1",\n\1trajectory: \{\n\1 {2}available: true,\n\1 {2}events: \[\],\n\1\},\n\1attemptItems: \[$/gm;
|
|
9819
|
+
function addAiRuntimeTrajectoryTestFixture(source) {
|
|
9820
|
+
const migrated = [...source.matchAll(migratedAnchor)];
|
|
9821
|
+
if (migrated.length === 1)
|
|
9822
|
+
return { content: source };
|
|
9823
|
+
if (migrated.length > 1) {
|
|
9824
|
+
return { error: "AI Runtime trajectory \u6D4B\u8BD5 fixture \u5DF2\u8FC1\u79FB\u951A\u70B9\u4E0D\u552F\u4E00" };
|
|
9825
|
+
}
|
|
9826
|
+
const legacy = [...source.matchAll(legacyAnchor)];
|
|
9827
|
+
if (legacy.length !== 1) {
|
|
9828
|
+
return { error: "AI Runtime trajectory \u6D4B\u8BD5 fixture \u951A\u70B9\u4E0D\u552F\u4E00" };
|
|
9829
|
+
}
|
|
9830
|
+
const anchor = legacy[0];
|
|
9831
|
+
const indent = anchor[1];
|
|
9832
|
+
return {
|
|
9833
|
+
content: source.replace(anchor[0], [
|
|
9834
|
+
`${indent}traceId: "trace_1",`,
|
|
9835
|
+
`${indent}trajectory: {`,
|
|
9836
|
+
`${indent} available: true,`,
|
|
9837
|
+
`${indent} events: [],`,
|
|
9838
|
+
`${indent}},`,
|
|
9839
|
+
`${indent}attemptItems: [`
|
|
9840
|
+
].join(`
|
|
9841
|
+
`))
|
|
9842
|
+
};
|
|
9843
|
+
}
|
|
9844
|
+
|
|
9659
9845
|
// src/update/recipe-project-owned.ts
|
|
9660
9846
|
var managedPathsByRecipe = {
|
|
9661
9847
|
"starter-0.6.8-to-0.6.9": [
|
|
9662
9848
|
"apps/web/src/router/index.ts",
|
|
9663
9849
|
"apps/web/src/router/platform-admin-route-bindings.ts"
|
|
9850
|
+
],
|
|
9851
|
+
"starter-0.6.13-to-0.6.14": [
|
|
9852
|
+
"apps/web/src/pages/system/components/ai-runtime/AiRuntimeRunDetailDialog.webtest.ts",
|
|
9853
|
+
"apps/web/src/pages/system/components/ai-runtime/AiRuntimeRunDetailDialog.vue",
|
|
9854
|
+
"apps/web/src/router/index.ts",
|
|
9855
|
+
"apps/web/src/router/platform-admin-route-bindings.ts",
|
|
9856
|
+
"apps/web/src/services/ai-runtime-api.ts"
|
|
9664
9857
|
]
|
|
9665
9858
|
};
|
|
9666
9859
|
function recipeManagedProjectOwnedPaths(recipes2) {
|
|
@@ -9671,7 +9864,8 @@ async function planRecipeProjectOwned(input) {
|
|
|
9671
9864
|
return conflict2(input, "\u7248\u672C recipe \u6240\u9700\u7684\u9879\u76EE\u951A\u70B9\u7F3A\u5931");
|
|
9672
9865
|
}
|
|
9673
9866
|
const source = new TextDecoder().decode(input.ours);
|
|
9674
|
-
const
|
|
9867
|
+
const target = input.target ? new TextDecoder().decode(input.target) : undefined;
|
|
9868
|
+
const transformed = transformProjectOwnedAnchor(input.path, source, target);
|
|
9675
9869
|
if ("error" in transformed)
|
|
9676
9870
|
return conflict2(input, transformed.error);
|
|
9677
9871
|
if (transformed.content === source) {
|
|
@@ -9679,17 +9873,97 @@ async function planRecipeProjectOwned(input) {
|
|
|
9679
9873
|
}
|
|
9680
9874
|
return update(input, new TextEncoder().encode(transformed.content));
|
|
9681
9875
|
}
|
|
9682
|
-
function
|
|
9876
|
+
function transformProjectOwnedAnchor(path2, source, target) {
|
|
9683
9877
|
if (path2 === "apps/web/src/router/index.ts") {
|
|
9684
|
-
return addComponentPageLoader(source);
|
|
9878
|
+
return addComponentPageLoader(source, target);
|
|
9685
9879
|
}
|
|
9686
9880
|
if (path2 === "apps/web/src/router/platform-admin-route-bindings.ts") {
|
|
9687
|
-
return addComponentRouteBinding(source);
|
|
9881
|
+
return addComponentRouteBinding(source, target);
|
|
9882
|
+
}
|
|
9883
|
+
if (path2 === "apps/web/src/pages/system/components/ai-runtime/AiRuntimeRunDetailDialog.webtest.ts") {
|
|
9884
|
+
return addAiRuntimeTrajectoryTestFixture(source);
|
|
9885
|
+
}
|
|
9886
|
+
if (path2 === "apps/web/src/pages/system/components/ai-runtime/AiRuntimeRunDetailDialog.vue") {
|
|
9887
|
+
return addAiRuntimeTrajectoryView(source);
|
|
9888
|
+
}
|
|
9889
|
+
if (path2 === "apps/web/src/services/ai-runtime-api.ts") {
|
|
9890
|
+
return addAiRuntimeTrajectoryContract(source);
|
|
9688
9891
|
}
|
|
9689
9892
|
return { error: `\u7248\u672C recipe \u672A\u767B\u8BB0\u9879\u76EE\u951A\u70B9\uFF1A${path2}` };
|
|
9690
9893
|
}
|
|
9691
|
-
function
|
|
9692
|
-
|
|
9894
|
+
function addAiRuntimeTrajectoryContract(source) {
|
|
9895
|
+
let content = source;
|
|
9896
|
+
const typeField = ' readonly trajectory: RuntimeRunDetail["trajectory"];';
|
|
9897
|
+
if (!content.includes(typeField)) {
|
|
9898
|
+
const anchors = [
|
|
9899
|
+
...content.matchAll(/^(\s*)readonly attemptItems: readonly AiRuntimeAttempt\[\];$/gm)
|
|
9900
|
+
];
|
|
9901
|
+
if (anchors.length !== 1) {
|
|
9902
|
+
return { error: "AiRuntimeRunDetail attemptItems \u951A\u70B9\u4E0D\u552F\u4E00" };
|
|
9903
|
+
}
|
|
9904
|
+
content = content.replace(anchors[0][0], `${anchors[0][0]}
|
|
9905
|
+
${anchors[0][1]}readonly trajectory: RuntimeRunDetail["trajectory"];`);
|
|
9906
|
+
}
|
|
9907
|
+
const mapperField = " trajectory: value.trajectory,";
|
|
9908
|
+
if (!content.includes(mapperField)) {
|
|
9909
|
+
const anchors = [
|
|
9910
|
+
...content.matchAll(/^(\s*)attemptItems: value\.attempts\.map\(attemptItem\),$/gm)
|
|
9911
|
+
];
|
|
9912
|
+
if (anchors.length !== 1) {
|
|
9913
|
+
return { error: "runDetail attemptItems mapper \u951A\u70B9\u4E0D\u552F\u4E00" };
|
|
9914
|
+
}
|
|
9915
|
+
content = content.replace(anchors[0][0], `${anchors[0][0]}
|
|
9916
|
+
${anchors[0][1]}trajectory: value.trajectory,`);
|
|
9917
|
+
}
|
|
9918
|
+
return { content };
|
|
9919
|
+
}
|
|
9920
|
+
function addAiRuntimeTrajectoryView(source) {
|
|
9921
|
+
let content = source;
|
|
9922
|
+
const componentImport = 'import AiRuntimeTrajectory from "./AiRuntimeTrajectory.vue";';
|
|
9923
|
+
if (!content.includes(componentImport)) {
|
|
9924
|
+
const anchors = [
|
|
9925
|
+
...content.matchAll(/^} from "\.\.\/\.\.\/ai-runtime-presenter";$/gm)
|
|
9926
|
+
];
|
|
9927
|
+
if (anchors.length !== 1) {
|
|
9928
|
+
return { error: "AI Runtime presenter import \u951A\u70B9\u4E0D\u552F\u4E00" };
|
|
9929
|
+
}
|
|
9930
|
+
content = content.replace(anchors[0][0], `${anchors[0][0]}
|
|
9931
|
+
${componentImport}`);
|
|
9932
|
+
}
|
|
9933
|
+
const componentUsage = '<AiRuntimeTrajectory :trajectory="detail.trajectory" />';
|
|
9934
|
+
if (!content.includes(componentUsage)) {
|
|
9935
|
+
const providerSections = [
|
|
9936
|
+
...content.matchAll(/^(\s*)<section class="space-y-3">\n\s*<h3 class="text-sm font-medium">Provider Attempts<\/h3>$/gm)
|
|
9937
|
+
];
|
|
9938
|
+
if (providerSections.length !== 1) {
|
|
9939
|
+
return { error: "Provider Attempts section \u951A\u70B9\u4E0D\u552F\u4E00" };
|
|
9940
|
+
}
|
|
9941
|
+
const providerSection = providerSections[0];
|
|
9942
|
+
content = content.replace(providerSection[0], `${providerSection[1]}${componentUsage}
|
|
9943
|
+
|
|
9944
|
+
${providerSection[0]}`);
|
|
9945
|
+
}
|
|
9946
|
+
return { content };
|
|
9947
|
+
}
|
|
9948
|
+
function addComponentPageLoader(source, target) {
|
|
9949
|
+
const desired = [
|
|
9950
|
+
{
|
|
9951
|
+
key: "ui-components",
|
|
9952
|
+
value: '() => import("@/pages/ui/UiComponentPage.vue")'
|
|
9953
|
+
},
|
|
9954
|
+
...target?.includes('"agent-session": AgentSessionPage') ? [
|
|
9955
|
+
{
|
|
9956
|
+
key: "agent-session",
|
|
9957
|
+
value: '() => import("@/pages/system/AgentSessionPage.vue")'
|
|
9958
|
+
},
|
|
9959
|
+
{
|
|
9960
|
+
key: "agent-workflow",
|
|
9961
|
+
value: '() => import("@/pages/system/AgentWorkflowPage.vue")'
|
|
9962
|
+
}
|
|
9963
|
+
] : []
|
|
9964
|
+
];
|
|
9965
|
+
const missing = desired.filter(({ key }) => !new RegExp(`^\\s*"${key}"\\s*:`, "m").test(source));
|
|
9966
|
+
if (!missing.length)
|
|
9693
9967
|
return { content: source };
|
|
9694
9968
|
const declaration = source.indexOf("const platformAdminPageComponents");
|
|
9695
9969
|
const start = source.indexOf("= {", declaration);
|
|
@@ -9704,31 +9978,47 @@ function addComponentPageLoader(source) {
|
|
|
9704
9978
|
return { error: "platformAdminPageComponents profile \u951A\u70B9\u4E0D\u552F\u4E00" };
|
|
9705
9979
|
}
|
|
9706
9980
|
const profile = profiles[0];
|
|
9707
|
-
const insertion =
|
|
9708
|
-
|
|
9981
|
+
const insertion = [
|
|
9982
|
+
profile[0],
|
|
9983
|
+
...missing.map(({ key, value }) => `${profile[1]}"${key}": ${value},`)
|
|
9984
|
+
].join(`
|
|
9985
|
+
`);
|
|
9709
9986
|
return {
|
|
9710
9987
|
content: source.slice(0, start) + block.replace(profile[0], insertion) + source.slice(end)
|
|
9711
9988
|
};
|
|
9712
9989
|
}
|
|
9713
|
-
function addComponentRouteBinding(source) {
|
|
9990
|
+
function addComponentRouteBinding(source, target) {
|
|
9714
9991
|
const unionStart = source.indexOf("export type PlatformAdminPageKey =");
|
|
9715
9992
|
const interfaceStart = source.indexOf("export interface PlatformAdminRouteBinding", unionStart);
|
|
9716
9993
|
if (unionStart < 0 || interfaceStart < 0) {
|
|
9717
9994
|
return { error: "\u627E\u4E0D\u5230 PlatformAdminPageKey \u9879\u76EE\u951A\u70B9" };
|
|
9718
9995
|
}
|
|
9996
|
+
const desiredPages = [
|
|
9997
|
+
"ui-components",
|
|
9998
|
+
...target?.includes('routeKey: "system.agent-session"') ? ["agent-session", "agent-workflow"] : []
|
|
9999
|
+
];
|
|
9719
10000
|
let content = source;
|
|
9720
10001
|
const union = content.slice(unionStart, interfaceStart);
|
|
9721
|
-
|
|
10002
|
+
const missingPages = desiredPages.filter((page) => !union.includes(`"${page}"`));
|
|
10003
|
+
if (missingPages.length) {
|
|
9722
10004
|
const semicolon = content.lastIndexOf(";", interfaceStart);
|
|
9723
10005
|
if (semicolon < unionStart) {
|
|
9724
10006
|
return { error: "PlatformAdminPageKey \u7ED3\u675F\u951A\u70B9\u7F3A\u5931" };
|
|
9725
10007
|
}
|
|
9726
10008
|
content = `${content.slice(0, semicolon)}
|
|
9727
|
-
| "
|
|
9728
|
-
|
|
9729
|
-
|
|
10009
|
+
${missingPages.map((page) => ` | "${page}"`).join(`
|
|
10010
|
+
`)}${content.slice(semicolon)}`;
|
|
10011
|
+
}
|
|
10012
|
+
const desiredBindings = [
|
|
10013
|
+
{ routeKey: "system.ui-components", page: "ui-components" },
|
|
10014
|
+
...target?.includes('routeKey: "system.agent-session"') ? [
|
|
10015
|
+
{ routeKey: "system.agent-session", page: "agent-session" },
|
|
10016
|
+
{ routeKey: "system.agent-workflow", page: "agent-workflow" }
|
|
10017
|
+
] : []
|
|
10018
|
+
];
|
|
10019
|
+
const missingBindings = desiredBindings.filter(({ routeKey }) => !content.includes(`routeKey: "${routeKey}"`));
|
|
10020
|
+
if (!missingBindings.length)
|
|
9730
10021
|
return { content };
|
|
9731
|
-
}
|
|
9732
10022
|
const features = [
|
|
9733
10023
|
...content.matchAll(/^(\s*)\{ routeKey: "system\.feature", page: "resource", resourceKey: "features" \},$/gm)
|
|
9734
10024
|
];
|
|
@@ -9737,8 +10027,11 @@ function addComponentRouteBinding(source) {
|
|
|
9737
10027
|
}
|
|
9738
10028
|
const feature = features[0];
|
|
9739
10029
|
return {
|
|
9740
|
-
content: content.replace(feature[0],
|
|
9741
|
-
|
|
10030
|
+
content: content.replace(feature[0], [
|
|
10031
|
+
feature[0],
|
|
10032
|
+
...missingBindings.map(({ routeKey, page }) => `${feature[1]}{ routeKey: "${routeKey}", page: "${page}" },`)
|
|
10033
|
+
].join(`
|
|
10034
|
+
`))
|
|
9742
10035
|
};
|
|
9743
10036
|
}
|
|
9744
10037
|
function preserve(input, reason) {
|
|
@@ -9755,7 +10048,7 @@ function update(input, content) {
|
|
|
9755
10048
|
path: input.path,
|
|
9756
10049
|
ownership: "project-owned",
|
|
9757
10050
|
action: "update",
|
|
9758
|
-
reason: "\u7248\u672C recipe \u66F4\u65B0\u9879\u76EE
|
|
10051
|
+
reason: "\u7248\u672C recipe \u66F4\u65B0\u9879\u76EE\u6269\u5C55\u951A\u70B9",
|
|
9759
10052
|
expectedProjectContent: input.expected,
|
|
9760
10053
|
content
|
|
9761
10054
|
};
|
|
@@ -9774,14 +10067,14 @@ function conflict2(input, message) {
|
|
|
9774
10067
|
// src/update/planner-file.ts
|
|
9775
10068
|
async function planFile(path2, baseRoot, targetRoot, source, target, ours, provenance, targetContentOverride, manageGeneratedProjectOwned = false, forcePlatformBaseline = false, manageRecipeProjectOwned = false) {
|
|
9776
10069
|
const [base, theirs] = await Promise.all([
|
|
9777
|
-
readOptional(
|
|
9778
|
-
targetContentOverride ? Promise.resolve(targetContentOverride) : readOptional(
|
|
10070
|
+
readOptional(join25(baseRoot, path2)),
|
|
10071
|
+
targetContentOverride ? Promise.resolve(targetContentOverride) : readOptional(join25(targetRoot, path2))
|
|
9779
10072
|
]);
|
|
9780
10073
|
const ownership = source?.ownership ?? target?.ownership ?? classifyOwnership(path2);
|
|
9781
10074
|
const expected = expectationForSnapshot(ours);
|
|
9782
10075
|
if (ownership === "project-owned") {
|
|
9783
|
-
if (manageRecipeProjectOwned) {
|
|
9784
|
-
return planRecipeProjectOwned({ path: path2, ours, expected });
|
|
10076
|
+
if (manageRecipeProjectOwned && source) {
|
|
10077
|
+
return planRecipeProjectOwned({ path: path2, ours, target: theirs, expected });
|
|
9785
10078
|
}
|
|
9786
10079
|
if (manageGeneratedProjectOwned) {
|
|
9787
10080
|
return planGeneratedProjectOwned(path2, source, target, ours, theirs, expected);
|
|
@@ -9808,6 +10101,9 @@ async function planFile(path2, baseRoot, targetRoot, source, target, ours, prove
|
|
|
9808
10101
|
}
|
|
9809
10102
|
return hashContent(ours) === source.hash ? readyPlannedFile(path2, ownership, "delete", "\u76EE\u6807\u7248\u672C\u5220\u9664", expected) : conflict3(path2, ownership, "\u5BA2\u6237\u4FEE\u6539\u540E Windy \u53C8\u5220\u9664", expected);
|
|
9810
10103
|
}
|
|
10104
|
+
if (source && target && !ours) {
|
|
10105
|
+
return readyPlannedFile(path2, "project-owned", "preserve", "\u9879\u76EE\u5DF2\u5220\u9664", expected);
|
|
10106
|
+
}
|
|
9811
10107
|
if (!source || !target || !ours || !theirs) {
|
|
9812
10108
|
return conflict3(path2, ownership, "\u6587\u4EF6\u72B6\u6001\u4E0D\u5B8C\u6574\uFF0C\u4E0D\u80FD\u5B89\u5168\u63A8\u65AD", expected);
|
|
9813
10109
|
}
|
|
@@ -9885,7 +10181,7 @@ function conflict3(path2, ownership, reason, expectedProjectContent) {
|
|
|
9885
10181
|
}
|
|
9886
10182
|
async function readOptional(path2) {
|
|
9887
10183
|
try {
|
|
9888
|
-
return await
|
|
10184
|
+
return await readFile20(path2);
|
|
9889
10185
|
} catch (error) {
|
|
9890
10186
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
9891
10187
|
return;
|
|
@@ -9937,27 +10233,27 @@ function hasExistingSourceForTest(path2, sourcePaths) {
|
|
|
9937
10233
|
}
|
|
9938
10234
|
|
|
9939
10235
|
// src/update/planner-snapshots.ts
|
|
9940
|
-
import { readFile as
|
|
9941
|
-
import { join as
|
|
10236
|
+
import { readFile as readFile21, stat as stat2 } from "fs/promises";
|
|
10237
|
+
import { join as join26 } from "path";
|
|
9942
10238
|
async function snapshotProjectFiles(project, paths, seed) {
|
|
9943
10239
|
const snapshots = new Map(seed);
|
|
9944
10240
|
await Promise.all([...paths].filter((path2) => !snapshots.has(path2)).map(async (path2) => {
|
|
9945
|
-
snapshots.set(path2, await readOptional2(
|
|
10241
|
+
snapshots.set(path2, await readOptional2(join26(project, path2)));
|
|
9946
10242
|
}));
|
|
9947
10243
|
return snapshots;
|
|
9948
10244
|
}
|
|
9949
10245
|
async function snapshotProjectModes(project, paths) {
|
|
9950
|
-
return new Map(await Promise.all([...paths].map(async (path2) => [path2, await readModeOptional(
|
|
10246
|
+
return new Map(await Promise.all([...paths].map(async (path2) => [path2, await readModeOptional(join26(project, path2))])));
|
|
9951
10247
|
}
|
|
9952
10248
|
async function assertPlanSnapshots(project, expectations) {
|
|
9953
10249
|
const changed = [];
|
|
9954
10250
|
for (const expectation2 of expectations) {
|
|
9955
|
-
const actual = expectationForSnapshot(await readOptional2(
|
|
10251
|
+
const actual = expectationForSnapshot(await readOptional2(join26(project, expectation2.path)));
|
|
9956
10252
|
if (JSON.stringify(actual) !== JSON.stringify(expectation2.expected)) {
|
|
9957
10253
|
changed.push(expectation2.path);
|
|
9958
10254
|
continue;
|
|
9959
10255
|
}
|
|
9960
|
-
if ("mode" in expectation2 && await readModeOptional(
|
|
10256
|
+
if ("mode" in expectation2 && await readModeOptional(join26(project, expectation2.path)) !== expectation2.mode) {
|
|
9961
10257
|
changed.push(expectation2.path);
|
|
9962
10258
|
}
|
|
9963
10259
|
}
|
|
@@ -9989,7 +10285,7 @@ async function readSourceParentMode(path2) {
|
|
|
9989
10285
|
}
|
|
9990
10286
|
async function readOptional2(path2) {
|
|
9991
10287
|
try {
|
|
9992
|
-
return await
|
|
10288
|
+
return await readFile21(path2);
|
|
9993
10289
|
} catch (error) {
|
|
9994
10290
|
if (isMissing7(error))
|
|
9995
10291
|
return;
|
|
@@ -10033,8 +10329,8 @@ var oxcManagedPaths = new Set([
|
|
|
10033
10329
|
]);
|
|
10034
10330
|
async function createUpdatePlan(request, artifacts, dependencies = {}) {
|
|
10035
10331
|
await assertProjectReadyForUpdate(request.projectDirectory);
|
|
10036
|
-
const manifestPath =
|
|
10037
|
-
const expectedManifestHash = hashContent(await
|
|
10332
|
+
const manifestPath = join27(request.projectDirectory, ".windy/files.json");
|
|
10333
|
+
const expectedManifestHash = hashContent(await readFile22(manifestPath));
|
|
10038
10334
|
const generationSnapshot = await readGenerationProvenanceSnapshot(request.projectDirectory);
|
|
10039
10335
|
const provenance = generationSnapshot.provenance;
|
|
10040
10336
|
const targetModules = resolveUpdateTargetModules(provenance.modules.map(({ name }) => name), request.targetModules);
|
|
@@ -10081,8 +10377,8 @@ async function createUpdatePlan(request, artifacts, dependencies = {}) {
|
|
|
10081
10377
|
const paths = new Set([...sourceEntries.keys(), ...targetEntries.keys()]);
|
|
10082
10378
|
for (const path2 of paths) {
|
|
10083
10379
|
if (!projectSnapshots.has(path2)) {
|
|
10084
|
-
projectSnapshots.set(path2, await readOptional2(
|
|
10085
|
-
projectModes.set(path2, await readModeOptional(
|
|
10380
|
+
projectSnapshots.set(path2, await readOptional2(join27(request.projectDirectory, path2)));
|
|
10381
|
+
projectModes.set(path2, await readModeOptional(join27(request.projectDirectory, path2)));
|
|
10086
10382
|
}
|
|
10087
10383
|
}
|
|
10088
10384
|
const files = await planFiles({
|
|
@@ -10106,10 +10402,10 @@ async function createUpdatePlan(request, artifacts, dependencies = {}) {
|
|
|
10106
10402
|
for (const file of files) {
|
|
10107
10403
|
file.expectedProjectMode = projectModes.get(file.path);
|
|
10108
10404
|
if (file.action === "create" || file.action === "update") {
|
|
10109
|
-
file.mode = file.expectedProjectMode ?? await readModeOptional(
|
|
10405
|
+
file.mode = file.expectedProjectMode ?? await readModeOptional(join27(artifactSet.targetDirectory, file.path));
|
|
10110
10406
|
}
|
|
10111
10407
|
if (file.action === "create") {
|
|
10112
|
-
file.parentMode = await readSourceParentMode(
|
|
10408
|
+
file.parentMode = await readSourceParentMode(join27(artifactSet.targetDirectory, dirname9(file.path)));
|
|
10113
10409
|
}
|
|
10114
10410
|
}
|
|
10115
10411
|
const plannedPaths = new Set(files.map(({ path: path2 }) => path2));
|
|
@@ -10129,7 +10425,8 @@ async function createUpdatePlan(request, artifacts, dependencies = {}) {
|
|
|
10129
10425
|
...migrations.conflicts,
|
|
10130
10426
|
...files.flatMap((file) => file.conflict ? [`${file.path}\uFF1A${file.conflict}`] : [])
|
|
10131
10427
|
];
|
|
10132
|
-
|
|
10428
|
+
const manualCleanup = await inspectAdkRetirement(request.projectDirectory);
|
|
10429
|
+
if (hashContent(await readFile22(manifestPath)) !== expectedManifestHash) {
|
|
10133
10430
|
throw new Error("\u751F\u6210\u66F4\u65B0\u8BA1\u5212\u671F\u95F4\u53D7\u7BA1\u6E05\u5355\u53D1\u751F\u53D8\u5316");
|
|
10134
10431
|
}
|
|
10135
10432
|
await assertPlanSnapshots(request.projectDirectory, [
|
|
@@ -10153,6 +10450,7 @@ async function createUpdatePlan(request, artifacts, dependencies = {}) {
|
|
|
10153
10450
|
workspaceMembershipExpectations: workspaceSnapshot.membershipExpectations,
|
|
10154
10451
|
finalWorkspaceMembershipExpectations: deriveFinalWorkspaceMembership(workspaceSnapshot.membershipExpectations, targetWorkspaceSnapshot.membershipExpectations, files),
|
|
10155
10452
|
conflicts,
|
|
10453
|
+
manualCleanup,
|
|
10156
10454
|
detachedToolchain,
|
|
10157
10455
|
targetProvenance,
|
|
10158
10456
|
sourceManifest,
|
|
@@ -10254,9 +10552,9 @@ function frozenManifestHash(file, finalizedHashes) {
|
|
|
10254
10552
|
}
|
|
10255
10553
|
|
|
10256
10554
|
// src/update/format-stabilizer.ts
|
|
10257
|
-
import { mkdir as mkdir8, mkdtemp as mkdtemp3, readFile as
|
|
10555
|
+
import { mkdir as mkdir8, mkdtemp as mkdtemp3, readFile as readFile23, rm as rm7, writeFile as writeFile13 } from "fs/promises";
|
|
10258
10556
|
import { tmpdir as tmpdir3 } from "os";
|
|
10259
|
-
import { dirname as dirname10, extname as extname4, join as
|
|
10557
|
+
import { dirname as dirname10, extname as extname4, join as join28, resolve as resolve6, sep as sep5 } from "path";
|
|
10260
10558
|
var formattedExtensions = new Set([
|
|
10261
10559
|
".cjs",
|
|
10262
10560
|
".css",
|
|
@@ -10295,7 +10593,7 @@ async function stabilizeManagedContent(result2, execute, writeProjectFile) {
|
|
|
10295
10593
|
}
|
|
10296
10594
|
}
|
|
10297
10595
|
inputs.set(".windy/generation.json", new TextEncoder().encode(generationContent));
|
|
10298
|
-
const temporaryRoot = await mkdtemp3(
|
|
10596
|
+
const temporaryRoot = await mkdtemp3(join28(tmpdir3(), "windy-update-format-"));
|
|
10299
10597
|
try {
|
|
10300
10598
|
const stagedPaths = await stageInputs(temporaryRoot, inputs);
|
|
10301
10599
|
for (let offset = 0;offset < stagedPaths.length; offset += 80) {
|
|
@@ -10303,14 +10601,14 @@ async function stabilizeManagedContent(result2, execute, writeProjectFile) {
|
|
|
10303
10601
|
"x",
|
|
10304
10602
|
"oxfmt",
|
|
10305
10603
|
"--write",
|
|
10306
|
-
`--config=${
|
|
10604
|
+
`--config=${join28(result2.plan.projectDirectory, ".oxfmtrc.json")}`,
|
|
10307
10605
|
...stagedPaths.slice(offset, offset + 80)
|
|
10308
10606
|
], result2.plan.projectDirectory);
|
|
10309
10607
|
}
|
|
10310
10608
|
const hashes = plannedContentHashes(result2);
|
|
10311
10609
|
let formattedGeneration = generationContent;
|
|
10312
10610
|
for (const [path2, original] of inputs) {
|
|
10313
|
-
const formatted = await
|
|
10611
|
+
const formatted = await readFile23(safeTemporaryPath(temporaryRoot, path2));
|
|
10314
10612
|
if (path2 === ".windy/generation.json") {
|
|
10315
10613
|
formattedGeneration = formatted.toString();
|
|
10316
10614
|
continue;
|
|
@@ -10367,6 +10665,12 @@ async function writeUpdateReport(result2, steps, relativePath2, expected) {
|
|
|
10367
10665
|
] : [],
|
|
10368
10666
|
`- \u4FEE\u6539\u6587\u4EF6\uFF1A${result2.changedFiles.length}`,
|
|
10369
10667
|
`- Oxc \u4EE3\u7BA1\uFF1A${result2.plan.detachedToolchain ? "\u5DF2\u68C0\u6D4B\u5230\u5BA2\u6237\u63A5\u7BA1\u5E76\u4FDD\u7559" : "\u4FDD\u6301"}`,
|
|
10668
|
+
...result2.plan.manualCleanup?.length ? [
|
|
10669
|
+
"",
|
|
10670
|
+
"## \u4EBA\u5DE5\u6E05\u7406",
|
|
10671
|
+
"",
|
|
10672
|
+
...result2.plan.manualCleanup.map(({ message }) => `- ${message}`)
|
|
10673
|
+
] : [],
|
|
10370
10674
|
"",
|
|
10371
10675
|
"## \u9A8C\u8BC1",
|
|
10372
10676
|
"",
|
|
@@ -10464,7 +10768,7 @@ class DefaultStarterUpdater {
|
|
|
10464
10768
|
const plannedPaths = new Set(result2.plan.files.map(({ path: path2 }) => path2));
|
|
10465
10769
|
replaceExpectations(result2, verificationSnapshot.filter(({ path: path2 }) => !metadataPaths2.has(path2) && !plannedPaths.has(path2)));
|
|
10466
10770
|
verificationExpectationsFrozen = true;
|
|
10467
|
-
const packageJson = JSON.parse(await
|
|
10771
|
+
const packageJson = JSON.parse(await readFile24(join29(result2.plan.projectDirectory, "package.json"), "utf8"));
|
|
10468
10772
|
for (const name of ["lint", "typecheck", "test", "build"]) {
|
|
10469
10773
|
if (!packageJson.scripts?.[name]) {
|
|
10470
10774
|
steps.push({ name: `bun run ${name}`, status: "skipped" });
|
|
@@ -10492,7 +10796,8 @@ class DefaultStarterUpdater {
|
|
|
10492
10796
|
throw error;
|
|
10493
10797
|
}
|
|
10494
10798
|
if (error instanceof TransactionCasError) {
|
|
10495
|
-
|
|
10799
|
+
const conflictDetail = error.paths.length ? `\uFF1A${error.paths.join("\u3001")}` : "";
|
|
10800
|
+
throw new Error(`\u66F4\u65B0\u6700\u7EC8\u63D0\u4EA4\u53D1\u751F\u5E76\u53D1\u51B2\u7A81${conflictDetail}\uFF0C\u4E8B\u52A1\u73B0\u573A\u5DF2\u4FDD\u7559\uFF1B\u8BF7\u8FD0\u884C bun run windy doctor --repair`, { cause: error });
|
|
10496
10801
|
}
|
|
10497
10802
|
if (verificationExpectationsFrozen) {
|
|
10498
10803
|
const conflicts = await retainOwnedTransactionExpectationConflicts(result2.plan.projectDirectory, result2.transactionOwnerToken, result2.finalizationExpectations);
|
|
@@ -11317,6 +11622,9 @@ function printPlan(plan) {
|
|
|
11317
11622
|
console.log(` ${file.action.padEnd(6)} ${file.path}\uFF08${file.reason}\uFF09`);
|
|
11318
11623
|
for (const conflict4 of plan.conflicts)
|
|
11319
11624
|
console.log(` conflict ${conflict4}`);
|
|
11625
|
+
for (const finding of plan.manualCleanup ?? []) {
|
|
11626
|
+
console.log(` manual ${finding.message}`);
|
|
11627
|
+
}
|
|
11320
11628
|
if (plan.detachedToolchain)
|
|
11321
11629
|
console.log("Oxc\uFF1A\u68C0\u6D4B\u5230\u5BA2\u6237\u63A5\u7BA1\uFF0C\u76F8\u5173\u914D\u7F6E\u4FDD\u6301\u4E0D\u53D8");
|
|
11322
11630
|
}
|
|
@@ -11339,6 +11647,9 @@ function printDoctor(report) {
|
|
|
11339
11647
|
if (report.duplicateLocalEnvironmentKeys.length) {
|
|
11340
11648
|
console.log(`\u672C\u5730 .env \u91CD\u590D\u5B9A\u4E49\uFF1A${report.duplicateLocalEnvironmentKeys.join("\u3001")}\uFF08\u8BF7\u4EBA\u5DE5\u5904\u7406\uFF09`);
|
|
11341
11649
|
}
|
|
11650
|
+
for (const finding of report.manualCleanup) {
|
|
11651
|
+
console.log(`\u4EBA\u5DE5\u6E05\u7406\uFF1A${finding.message}`);
|
|
11652
|
+
}
|
|
11342
11653
|
if (report.recoveryRequired)
|
|
11343
11654
|
console.log("\u6062\u590D\uFF1A\u68C0\u6D4B\u5230\u4E2D\u65AD\u66F4\u65B0\uFF0C\u8BF7\u8FD0\u884C doctor --repair");
|
|
11344
11655
|
if (report.recoveryAction === "recovery-conflicts") {
|
|
@@ -11397,20 +11708,20 @@ import {
|
|
|
11397
11708
|
cp,
|
|
11398
11709
|
mkdir as mkdir9,
|
|
11399
11710
|
mkdtemp as mkdtemp4,
|
|
11400
|
-
readFile as
|
|
11711
|
+
readFile as readFile26,
|
|
11401
11712
|
readdir as readdir9,
|
|
11402
11713
|
rename as rename2,
|
|
11403
11714
|
rm as rm11,
|
|
11404
11715
|
writeFile as writeFile14
|
|
11405
11716
|
} from "fs/promises";
|
|
11406
|
-
import { dirname as dirname11, join as
|
|
11717
|
+
import { dirname as dirname11, join as join30, relative as relative7 } from "path";
|
|
11407
11718
|
|
|
11408
11719
|
// src/module-schema/config.ts
|
|
11409
|
-
import { readFile as
|
|
11720
|
+
import { readFile as readFile25 } from "fs/promises";
|
|
11410
11721
|
import { isAbsolute as isAbsolute2, relative as relative6, resolve as resolve9 } from "path";
|
|
11411
11722
|
async function readModuleSchemaLineageConfig(projectDirectory, configPath) {
|
|
11412
11723
|
const absolutePath = resolveProjectPath(projectDirectory, configPath);
|
|
11413
|
-
const parsed = JSON.parse(await
|
|
11724
|
+
const parsed = JSON.parse(await readFile25(absolutePath, "utf8"));
|
|
11414
11725
|
if (!isConfig(parsed)) {
|
|
11415
11726
|
throw new Error("Module schema lineage \u914D\u7F6E\u65E0\u6548");
|
|
11416
11727
|
}
|
|
@@ -11544,17 +11855,17 @@ async function handoffModuleSchemaLineages(options) {
|
|
|
11544
11855
|
async function stageModuleLineages(project, temporaryRoot, config, execute) {
|
|
11545
11856
|
const outputs = [];
|
|
11546
11857
|
for (const [index, module2] of config.modules.entries()) {
|
|
11547
|
-
const output =
|
|
11858
|
+
const output = join30(temporaryRoot, `module-${index}`);
|
|
11548
11859
|
await mkdir9(output, { recursive: true });
|
|
11549
|
-
const generatedConfig =
|
|
11860
|
+
const generatedConfig = join30(temporaryRoot, `module-${index}.config.ts`);
|
|
11550
11861
|
await writeDrizzleConfig(generatedConfig, project, module2.schema, relative7(temporaryRoot, output));
|
|
11551
11862
|
await execute(generatedConfig, temporaryRoot);
|
|
11552
11863
|
const sqlFiles = await listSqlFiles(output);
|
|
11553
11864
|
if (sqlFiles.length !== 1) {
|
|
11554
11865
|
throw new Error(`${module2.key} baseline \u5FC5\u987B\u6070\u597D\u751F\u6210\u4E00\u4E2A migration`);
|
|
11555
11866
|
}
|
|
11556
|
-
await writeFile14(
|
|
11557
|
-
await writeFile14(
|
|
11867
|
+
await writeFile14(join30(output, sqlFiles[0]), metadataOnlySql("module"));
|
|
11868
|
+
await writeFile14(join30(output, "lineage.json"), `${JSON.stringify({
|
|
11558
11869
|
schemaVersion: 1,
|
|
11559
11870
|
moduleKey: module2.key,
|
|
11560
11871
|
schema: module2.schema,
|
|
@@ -11568,25 +11879,25 @@ async function stageModuleLineages(project, temporaryRoot, config, execute) {
|
|
|
11568
11879
|
}
|
|
11569
11880
|
async function stagePlatformLineage(project, temporaryRoot, config, execute) {
|
|
11570
11881
|
const source = resolveProjectPath(project, config.platform.out);
|
|
11571
|
-
const output =
|
|
11882
|
+
const output = join30(temporaryRoot, "platform");
|
|
11572
11883
|
await cp(source, output, { recursive: true });
|
|
11573
11884
|
const before = new Set(await listSqlFiles(output));
|
|
11574
|
-
const generatedConfig =
|
|
11885
|
+
const generatedConfig = join30(temporaryRoot, "platform.config.ts");
|
|
11575
11886
|
await writeDrizzleConfig(generatedConfig, project, config.platform.schema, relative7(temporaryRoot, output));
|
|
11576
11887
|
await execute(generatedConfig, temporaryRoot);
|
|
11577
11888
|
const created = (await listSqlFiles(output)).filter((path2) => !before.has(path2));
|
|
11578
11889
|
if (created.length !== 1) {
|
|
11579
11890
|
throw new Error("\u5E73\u53F0 lineage handoff \u5FC5\u987B\u6070\u597D\u751F\u6210\u4E00\u4E2A migration");
|
|
11580
11891
|
}
|
|
11581
|
-
const sqlPath =
|
|
11892
|
+
const sqlPath = join30(output, created[0]);
|
|
11582
11893
|
const allowed = config.modules.flatMap(({ legacyPlatformTables }) => legacyPlatformTables);
|
|
11583
|
-
validatePlatformHandoffSql(await
|
|
11894
|
+
validatePlatformHandoffSql(await readFile26(sqlPath, "utf8"), allowed);
|
|
11584
11895
|
await writeFile14(sqlPath, metadataOnlySql("platform"));
|
|
11585
11896
|
return output;
|
|
11586
11897
|
}
|
|
11587
11898
|
async function installStagedLineages(project, temporaryRoot, config, stagedModules, stagedPlatform) {
|
|
11588
11899
|
const platform = resolveProjectPath(project, config.platform.out);
|
|
11589
|
-
const backup =
|
|
11900
|
+
const backup = join30(temporaryRoot, "platform-backup");
|
|
11590
11901
|
const installed = [];
|
|
11591
11902
|
await rename2(platform, backup);
|
|
11592
11903
|
try {
|
|
@@ -11633,9 +11944,9 @@ async function validateSchemaSources(project, config) {
|
|
|
11633
11944
|
}
|
|
11634
11945
|
}
|
|
11635
11946
|
async function createTemporaryRoot(project) {
|
|
11636
|
-
const windy =
|
|
11947
|
+
const windy = join30(project, ".windy");
|
|
11637
11948
|
await mkdir9(windy, { recursive: true });
|
|
11638
|
-
return await mkdtemp4(
|
|
11949
|
+
return await mkdtemp4(join30(windy, "module-schema-handoff-"));
|
|
11639
11950
|
}
|
|
11640
11951
|
async function listSqlFiles(root) {
|
|
11641
11952
|
return (await readdir9(root)).filter((path2) => path2.endsWith(".sql")).sort();
|