@bluefly/openstandardagents 0.2.4 ā 0.2.5-RC
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/.cursorrules +84 -0
- package/.devfile.yaml +87 -0
- package/.env.example +25 -3
- package/.github/workflows/release.yml +1 -1
- package/.kiro/specs/agent-buildkit-templates/design.md +495 -0
- package/.kiro/specs/agent-buildkit-templates/requirements.md +165 -0
- package/.kiro/specs/kiro-ide-supercharger/README.md +202 -0
- package/.kiro/specs/kiro-ide-supercharger/design.md +1005 -0
- package/.kiro/specs/kiro-ide-supercharger/requirements.md +141 -0
- package/.kiro/specs/kiro-ide-supercharger/tasks.md +507 -0
- package/.kiro/specs/website-design-audit/design.md +679 -0
- package/.kiro/specs/website-design-audit/requirements.md +199 -0
- package/.releaserc.json +5 -4
- package/.version.json +6 -0
- package/CHANGELOG.md +140 -96
- package/CONTRIBUTING.md +23 -5
- package/README.md +121 -43
- package/bin/ossa +24 -3
- package/bin/ossa-validate-all +55 -0
- package/bin/ossa-version +23 -0
- package/bin/validate-ossa-0.2.4.ts +244 -0
- package/bin/validate-ossa-0.2.5-RC.ts +244 -0
- package/bin/validate-ossa.ts +273 -0
- package/dist/di-container.d.ts +1 -1
- package/dist/di-container.d.ts.map +1 -1
- package/dist/di-container.js.map +1 -1
- package/dist/repositories/schema.repository.d.ts +17 -2
- package/dist/repositories/schema.repository.d.ts.map +1 -1
- package/dist/repositories/schema.repository.js +96 -18
- package/dist/repositories/schema.repository.js.map +1 -1
- package/dist/services/generation.service.d.ts +7 -5
- package/dist/services/generation.service.d.ts.map +1 -1
- package/dist/services/generation.service.js +92 -44
- package/dist/services/generation.service.js.map +1 -1
- package/dist/services/gitlab-agent.service.d.ts +94 -0
- package/dist/services/gitlab-agent.service.d.ts.map +1 -0
- package/dist/services/gitlab-agent.service.js +162 -0
- package/dist/services/gitlab-agent.service.js.map +1 -0
- package/dist/services/migration.service.d.ts +3 -3
- package/dist/services/migration.service.d.ts.map +1 -1
- package/dist/services/migration.service.js +108 -61
- package/dist/services/migration.service.js.map +1 -1
- package/dist/services/release-automation/base-crud.service.d.ts +93 -0
- package/dist/services/release-automation/base-crud.service.d.ts.map +1 -0
- package/dist/services/release-automation/base-crud.service.js +68 -0
- package/dist/services/release-automation/base-crud.service.js.map +1 -0
- package/dist/services/release-automation/index.d.ts +12 -0
- package/dist/services/release-automation/index.d.ts.map +1 -0
- package/dist/services/release-automation/index.js +12 -0
- package/dist/services/release-automation/index.js.map +1 -0
- package/dist/services/release-automation/merge-request.service.d.ts +119 -0
- package/dist/services/release-automation/merge-request.service.d.ts.map +1 -0
- package/dist/services/release-automation/merge-request.service.js +212 -0
- package/dist/services/release-automation/merge-request.service.js.map +1 -0
- package/dist/services/release-automation/milestone.service.d.ts +104 -0
- package/dist/services/release-automation/milestone.service.d.ts.map +1 -0
- package/dist/services/release-automation/milestone.service.js +207 -0
- package/dist/services/release-automation/milestone.service.js.map +1 -0
- package/dist/services/release-automation/release.service.d.ts +118 -0
- package/dist/services/release-automation/release.service.d.ts.map +1 -0
- package/dist/services/release-automation/release.service.js +207 -0
- package/dist/services/release-automation/release.service.js.map +1 -0
- package/dist/services/release-automation/schemas/release.schema.d.ts +299 -0
- package/dist/services/release-automation/schemas/release.schema.d.ts.map +1 -0
- package/dist/services/release-automation/schemas/release.schema.js +269 -0
- package/dist/services/release-automation/schemas/release.schema.js.map +1 -0
- package/dist/services/release-automation/tag.service.d.ts +99 -0
- package/dist/services/release-automation/tag.service.d.ts.map +1 -0
- package/dist/services/release-automation/tag.service.js +180 -0
- package/dist/services/release-automation/tag.service.js.map +1 -0
- package/dist/services/release-automation/webhook.service.d.ts +37 -0
- package/dist/services/release-automation/webhook.service.d.ts.map +1 -0
- package/dist/services/release-automation/webhook.service.js +173 -0
- package/dist/services/release-automation/webhook.service.js.map +1 -0
- package/dist/services/runtime/openai.adapter.d.ts.map +1 -1
- package/dist/services/runtime/openai.adapter.js.map +1 -1
- package/dist/services/validation.service.d.ts.map +1 -1
- package/dist/services/validation.service.js +24 -11
- package/dist/services/validation.service.js.map +1 -1
- package/dist/services/validators/anthropic.validator.d.ts +2 -2
- package/dist/services/validators/anthropic.validator.d.ts.map +1 -1
- package/dist/services/validators/anthropic.validator.js +14 -9
- package/dist/services/validators/anthropic.validator.js.map +1 -1
- package/dist/services/validators/autogen.validator.d.ts +2 -2
- package/dist/services/validators/autogen.validator.d.ts.map +1 -1
- package/dist/services/validators/autogen.validator.js +18 -15
- package/dist/services/validators/autogen.validator.js.map +1 -1
- package/dist/services/validators/crewai.validator.d.ts +2 -2
- package/dist/services/validators/crewai.validator.d.ts.map +1 -1
- package/dist/services/validators/crewai.validator.js +18 -17
- package/dist/services/validators/crewai.validator.js.map +1 -1
- package/dist/services/validators/cursor.validator.d.ts +2 -2
- package/dist/services/validators/cursor.validator.d.ts.map +1 -1
- package/dist/services/validators/cursor.validator.js +15 -11
- package/dist/services/validators/cursor.validator.js.map +1 -1
- package/dist/services/validators/langchain.validator.d.ts +2 -2
- package/dist/services/validators/langchain.validator.d.ts.map +1 -1
- package/dist/services/validators/langchain.validator.js +14 -11
- package/dist/services/validators/langchain.validator.js.map +1 -1
- package/dist/services/validators/langflow.validator.d.ts +2 -2
- package/dist/services/validators/langflow.validator.d.ts.map +1 -1
- package/dist/services/validators/langflow.validator.js +14 -9
- package/dist/services/validators/langflow.validator.js.map +1 -1
- package/dist/services/validators/langgraph.validator.d.ts +2 -2
- package/dist/services/validators/langgraph.validator.d.ts.map +1 -1
- package/dist/services/validators/langgraph.validator.js +23 -18
- package/dist/services/validators/langgraph.validator.js.map +1 -1
- package/dist/services/validators/llamaindex.validator.d.ts +2 -2
- package/dist/services/validators/llamaindex.validator.d.ts.map +1 -1
- package/dist/services/validators/llamaindex.validator.js +19 -16
- package/dist/services/validators/llamaindex.validator.js.map +1 -1
- package/dist/services/validators/openai.validator.d.ts +2 -2
- package/dist/services/validators/openai.validator.d.ts.map +1 -1
- package/dist/services/validators/openai.validator.js +20 -16
- package/dist/services/validators/openai.validator.js.map +1 -1
- package/dist/services/validators/vercel-ai.validator.d.ts +2 -2
- package/dist/services/validators/vercel-ai.validator.d.ts.map +1 -1
- package/dist/services/validators/vercel-ai.validator.js +16 -15
- package/dist/services/validators/vercel-ai.validator.js.map +1 -1
- package/dist/spec/v0.2.0/ossa-0.2.0.schema.json +0 -0
- package/dist/spec/v0.2.1/ossa-0.2.1.schema.json +555 -0
- package/dist/spec/v0.2.3/CHANGELOG.md +7 -7
- package/dist/spec/v0.2.3/README.md +9 -9
- package/dist/spec/v0.2.3/migrations/v0.2.2-to-v0.2.3.md +18 -18
- package/{spec/v0.2.4-dev ā dist/spec/v0.2.4}/CHANGELOG.md +8 -8
- package/dist/spec/{v0.2.4-dev ā v0.2.4}/migrations/v0.2.3-to-v0.2.4.md +10 -10
- package/dist/spec/{v0.2.4-dev ā v0.2.4}/ossa-0.2.4-dev.yaml +1 -1
- package/dist/spec/v0.2.4/ossa-0.2.4.schema.json +1819 -0
- package/dist/spec/v0.2.5/CHANGELOG.md +401 -0
- package/dist/spec/v0.2.5/README.md +72 -0
- package/dist/spec/v0.2.5/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/dist/spec/{v0.2.5-dev/ossa-0.2.5-dev.schema.json ā v0.2.5/ossa-0.2.5.schema.json} +323 -359
- package/dist/spec/v0.2.5/ossa-0.2.5.yaml +581 -0
- package/dist/spec/v0.2.5-RC/CHANGELOG.md +401 -0
- package/dist/spec/v0.2.5-RC/README.md +72 -0
- package/{spec/v0.2.4-dev ā dist/spec/v0.2.5-RC}/migrations/v0.2.3-to-v0.2.4.md +10 -10
- package/dist/spec/v0.2.5-RC/ossa-0.2.5-RC.schema.json +1696 -0
- package/dist/spec/v0.2.5-RC/ossa-0.2.5-RC.yaml +581 -0
- package/dist/types/index.d.ts +6 -1
- package/dist/types/index.d.ts.map +1 -1
- package/docs/issue-19-completion-summary.md +648 -0
- package/docs/issue-19-validation.md +351 -0
- package/examples/anthropic/claude-assistant.ossa.json +1 -1
- package/examples/autogen/multi-agent.ossa.json +1 -1
- package/examples/bridges/Dockerfile.production +1 -1
- package/examples/crewai/research-team.ossa.json +1 -1
- package/examples/cursor/code-review-agent.ossa.json +1 -1
- package/examples/enterprise/agent.yml +1 -1
- package/examples/getting-started/hello-world-complete.ossa.yaml +2 -2
- package/examples/integration-patterns/agent-to-agent-orchestration.ossa.yaml +4 -4
- package/examples/langchain/chain-agent.ossa.json +1 -1
- package/examples/langflow/workflow-agent.ossa.json +1 -1
- package/examples/langgraph/state-machine-agent.ossa.json +1 -1
- package/examples/llamaindex/rag-agent.ossa.json +1 -1
- package/examples/openai/basic-agent.ossa.yaml +61 -0
- package/examples/openai/multi-tool-agent.ossa.json +165 -0
- package/examples/openai/swarm-agent.ossa.json +1 -1
- package/examples/openapi-extensions/README.md +1 -1
- package/examples/quickstart/support-agent.ossa.yaml +1 -1
- package/examples/vercel/edge-agent.ossa.json +1 -1
- package/infrastructure/gitlab-agent/rbac.yaml +126 -0
- package/infrastructure/gitlab-agent/values.yaml +150 -0
- package/infrastructure/k8s/monitoring/00-namespace.yaml +7 -0
- package/infrastructure/k8s/monitoring/01-prometheus.yaml +142 -0
- package/infrastructure/k8s/monitoring/02-grafana.yaml +63 -0
- package/infrastructure/k8s/monitoring/03-lightweight.yaml +121 -0
- package/infrastructure/k8s/monitoring/README.md +73 -0
- package/infrastructure/k8s/monitoring/deploy.sh +38 -0
- package/openapi/CHANGELOG.md +21 -0
- package/openapi/README.md +46 -0
- package/openapi/{ossa-core-api.openapi.yaml ā core/ossa-core-api.openapi.yaml} +59 -4
- package/openapi/{ossa-registry.openapi.yaml ā core/ossa-registry.openapi.yaml} +75 -2
- package/openapi/{unified-agent-gateway.openapi.yaml ā core/unified-agent-gateway.openapi.yaml} +3 -3
- package/openapi/reference-implementations/aiflow-bridge-api.openapi.yaml +136 -0
- package/openapi/reference-implementations/compliance-agent-api.openapi.yaml +192 -0
- package/openapi/reference-implementations/crewai-agent-api.openapi.yaml +149 -0
- package/openapi/reference-implementations/critic-agent-api.openapi.yaml +151 -0
- package/openapi/reference-implementations/document-analyzer-api.openapi.yaml +217 -0
- package/openapi/reference-implementations/getting-started-hello-world-api.openapi.yaml +149 -0
- package/openapi/reference-implementations/gitlab-ml-recommender-api.openapi.yaml +151 -0
- package/openapi/reference-implementations/governor-agent-api.openapi.yaml +193 -0
- package/openapi/reference-implementations/integrator-agent-api.openapi.yaml +165 -0
- package/openapi/reference-implementations/judge-agent-api.openapi.yaml +148 -0
- package/openapi/reference-implementations/k8s-troubleshooter-api.openapi.yaml +167 -0
- package/openapi/reference-implementations/langchain-agent-api.openapi.yaml +171 -0
- package/openapi/reference-implementations/monitor-agent-api.openapi.yaml +171 -0
- package/openapi/reference-implementations/orchestrator-agent-api.openapi.yaml +242 -0
- package/openapi/reference-implementations/quickstart-support-agent-api.openapi.yaml +187 -0
- package/openapi/{self-evolving-ecosystem.openapi.yaml ā reference-implementations/self-evolving-ecosystem.openapi.yaml} +2 -2
- package/openapi/reference-implementations/worker-agent-api.openapi.yaml +208 -0
- package/openapi/reference-implementations/workflow-orchestrator-api.openapi.yaml +193 -0
- package/package.json +31 -21
- package/release.config.js +20 -5
- package/scripts/bump-version.ts +57 -0
- package/scripts/enhanced-version-manager.ts +257 -0
- package/scripts/gen-types.ts +51 -0
- package/scripts/gen-zod.ts +51 -0
- package/scripts/lib/exec.ts +37 -0
- package/scripts/lib/file-ops.ts +58 -0
- package/scripts/lib/version.ts +83 -0
- package/scripts/process-doc-templates.ts +37 -0
- package/scripts/schemas/package.schema.ts +75 -0
- package/scripts/setup-branch-protection.sh +33 -0
- package/scripts/sync-version.ts +39 -0
- package/scripts/sync-versions.ts +488 -0
- package/scripts/validate-schema.ts +49 -0
- package/spec/v0.2.0/ossa-0.2.0.schema.json +0 -0
- package/spec/v0.2.1/ossa-0.2.1.schema.json +555 -0
- package/spec/v0.2.3/CHANGELOG.md +7 -7
- package/spec/v0.2.3/README.md +9 -9
- package/spec/v0.2.3/migrations/v0.2.2-to-v0.2.3.md +18 -18
- package/{dist/spec/v0.2.4-dev ā spec/v0.2.4}/CHANGELOG.md +8 -8
- package/spec/v0.2.4/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/spec/{v0.2.4-dev ā v0.2.4}/ossa-0.2.4-dev.yaml +1 -1
- package/spec/v0.2.4/ossa-0.2.4.schema.json +1819 -0
- package/spec/v0.2.5/CHANGELOG.md +401 -0
- package/spec/v0.2.5/README.md +72 -0
- package/spec/v0.2.5/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/spec/{v0.2.5-dev/ossa-0.2.5-dev.schema.json ā v0.2.5/ossa-0.2.5.schema.json} +323 -359
- package/spec/v0.2.5/ossa-0.2.5.yaml +581 -0
- package/spec/v0.2.5-RC/CHANGELOG.md +401 -0
- package/spec/v0.2.5-RC/README.md +72 -0
- package/spec/v0.2.5-RC/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/spec/v0.2.5-RC/ossa-0.2.5-RC.schema.json +1696 -0
- package/spec/v0.2.5-RC/ossa-0.2.5-RC.yaml +581 -0
- package/website/{.lighthouserc.js ā .lighthouserc.ts} +5 -1
- package/website/Dockerfile +18 -5
- package/website/app/about/page.tsx +7 -7
- package/website/app/blog/[slug]/page.tsx +61 -20
- package/website/app/blog/page.tsx +120 -33
- package/website/app/design-guide/page.tsx +511 -0
- package/website/app/docs/[[...slug]]/page.tsx +641 -143
- package/website/app/examples/page.tsx +51 -41
- package/website/app/{globals.css ā globals.scss} +50 -23
- package/website/app/layout.tsx +2 -2
- package/website/app/license/page.tsx +183 -0
- package/website/app/not-found.tsx +18 -0
- package/website/app/page.tsx +144 -79
- package/website/app/playground/page.tsx +25 -45
- package/website/app/schema/page.tsx +423 -392
- package/website/app/specification/page.tsx +245 -169
- package/website/components/Logo.tsx +75 -2
- package/website/components/docs/DocsSidebar.tsx +40 -3
- package/website/components/docs/MarkdownContent.tsx +265 -47
- package/website/components/docs/VersionSelector.tsx +64 -8
- package/website/components/examples/ExamplesViewer.tsx +2 -2
- package/website/components/layout/Footer.tsx +6 -1
- package/website/components/layout/Header.tsx +31 -33
- package/website/components/schema/SchemaComponentsAccordion.tsx +84 -0
- package/website/components/schema/SchemaExplorer.tsx +4 -4
- package/website/content/blog/OpenAPI-AI-Agents-Standard.md +276 -276
- package/website/content/blog/Why-Formal-Standards-Matter-Now.md +3 -14
- package/website/content/blog/gitlab-kubernetes-agent-ecosystem.md +286 -0
- package/website/content/blog/introducing-ossa-framework.md +1 -1
- package/website/content/blog/ossa-production-results.md +5 -5
- package/website/content/blog/welcome-to-ossa.md +2 -2
- package/website/content/blog/why-ai-agents-need-open-standard.md +5 -5
- package/website/content/docs/00-HOME.md +18 -25
- package/website/content/docs/AIFlow-Framework-Integration-with-OSSA.md +8 -8
- package/website/content/docs/OpenAPI-Extensions.md +576 -140
- package/website/content/docs/adapters/openai-adapter.md +693 -0
- package/website/content/docs/architecture/execution-flow.md +3 -3
- package/website/content/docs/architecture/multi-agent-systems.md +4 -4
- package/website/content/docs/architecture/overview.md +4 -4
- package/website/content/docs/architecture/stack-integration.md +4 -4
- package/website/content/docs/changelog.md +4 -4
- package/website/content/docs/contributing.md +2 -2
- package/website/content/docs/ecosystem/framework-support.md +0 -2
- package/website/content/docs/examples/AIFlow-Framework-Integration-with-OSSA.md +107 -0
- package/website/content/docs/examples/Migration-Guides.md +2 -2
- package/website/content/docs/for-audiences/{architects.md ā Architects.md} +1 -1
- package/website/content/docs/for-audiences/{developers.md ā Developers.md} +3 -3
- package/website/content/docs/for-audiences/Enterprises.md +2 -2
- package/website/content/docs/for-audiences/Students-Researchers.md +1 -1
- package/website/content/docs/getting-started/{5-minute-overview.md ā 5-Minute-Overview.md} +2 -2
- package/website/content/docs/getting-started/{first-agent.md ā First-Agent.md} +1 -1
- package/website/content/docs/getting-started/Hello-World.md +3 -3
- package/website/content/docs/getting-started/{installation.md ā Installation.md} +7 -7
- package/website/content/docs/getting-started/index.md +92 -0
- package/website/content/docs/getting-started/running-agents.md +215 -13
- package/{docs ā website/content/docs}/getting-started.md +10 -6
- package/website/content/docs/integrations/aiflow.md +2 -2
- package/website/content/docs/integrations/drupal.md +2 -2
- package/website/content/docs/migration-guides/README.md +1 -1
- package/website/content/docs/migration-guides/agent-schema-comparison.md +232 -0
- package/website/content/docs/migration-guides/anthropic-mcp-to-ossa.md +5 -5
- package/website/content/docs/migration-guides/crewai-to-ossa.md +3 -3
- package/website/content/docs/migration-guides/drupal-eca-to-ossa.md +11 -11
- package/{docs/migration ā website/content/docs/migration-guides}/general-agent-schema.yml +1 -9
- package/website/content/docs/migration-guides/index.md +1 -1
- package/website/content/docs/migration-guides/langchain-to-ossa.md +17 -17
- package/website/content/docs/migration-guides/langflow-to-ossa.md +3 -3
- package/website/content/docs/migration-guides/openai-to-ossa.md +10 -10
- package/website/content/docs/openapi-extensions/examples.md +9 -9
- package/website/content/docs/openapi-extensions/index.md +59 -3
- package/website/content/docs/openapi-extensions/operation-extensions.md +61 -2
- package/website/content/docs/openapi-extensions/root-extensions.md +49 -3
- package/{docs/OSSA-COMPLIANT-BADGE.md ā website/content/docs/ossa-compliant-badge.md} +18 -15
- package/website/content/docs/pre-release/index.md +10 -10
- package/website/content/docs/readme.md +35 -0
- package/website/content/docs/schema-reference/agent-spec.md +2 -2
- package/website/content/docs/schema-reference/autonomy.md +5 -5
- package/website/content/docs/schema-reference/constraints.md +5 -5
- package/website/content/docs/schema-reference/llm-config.md +1 -1
- package/website/content/docs/schema-reference/observability.md +5 -5
- package/website/content/docs/schema-reference/ossa-manifest.md +6 -6
- package/website/content/docs/schema-reference/taxonomy.md +3 -3
- package/website/content/docs/use-cases/00-index.md +1 -1
- package/{docs/VERSIONING.md ā website/content/docs/versioning.md} +9 -5
- package/website/lib/version.ts +18 -1
- package/website/lib/versions.json +78 -0
- package/website/next.config.ts +3 -1
- package/website/package-lock.json +552 -18
- package/website/package.json +11 -5
- package/website/postcss.config.mjs +1 -1
- package/website/scripts/fetch-versions.js +166 -0
- package/website/scripts/generate-examples-index.js +163 -0
- package/website/scripts/merge-docs-to-wiki.ts +207 -0
- package/website/scripts/sync-version.js +28 -0
- package/website/scripts/sync-wiki.ts +64 -3
- package/website/scripts/upload-wiki.ts +199 -0
- package/website/styles/_variables.scss +36 -0
- package/website/tailwind.config.ts +93 -22
- package/.releaserc.json.disabled +0 -81
- package/dist/spec/v0.2.5-dev/CHANGELOG.md +0 -171
- package/dist/spec/v0.2.5-dev/examples/customer-support-graph.ossa.yaml +0 -362
- package/dist/spec/v0.2.5-dev/examples/parallel-processors.ossa.yaml +0 -464
- package/dist/spec/v0.2.5-dev/examples/research-team.ossa.yaml +0 -440
- package/dist/spec/v0.2.5-dev/migrations/v0.2.4-to-v0.2.5.md +0 -317
- package/dist/spec/v0.2.5-dev/ossa-0.2.5-dev.yaml +0 -409
- package/docs/README.md +0 -31
- package/docs/agent-openapi-spec.yml +0 -942
- package/docs/openapi-extensions.md +0 -930
- package/docs/schemas/openapi-extensions.schema.json +0 -486
- package/openapi/gitlab-orchestrator.openapi.yaml +0 -330
- package/ossa-website-swarm-tasks.json +0 -105
- package/spec/v0.2.5-dev/CHANGELOG.md +0 -171
- package/spec/v0.2.5-dev/examples/customer-support-graph.ossa.yaml +0 -362
- package/spec/v0.2.5-dev/examples/parallel-processors.ossa.yaml +0 -464
- package/spec/v0.2.5-dev/examples/research-team.ossa.yaml +0 -440
- package/spec/v0.2.5-dev/migrations/v0.2.4-to-v0.2.5.md +0 -317
- package/spec/v0.2.5-dev/ossa-0.2.5-dev.yaml +0 -409
- package/website/app/api/validate/route.ts +0 -88
- package/website/next.config.js +0 -17
- package/website/postcss.config.js +0 -7
- package/website/tailwind.config.js +0 -58
- /package/dist/spec/{v0.2.4-dev ā v0.2.4}/ossa-0.2.4-dev.schema.json +0 -0
- /package/openapi/{ossa-registry-api.openapi.yaml ā core/ossa-registry-api.openapi.yaml} +0 -0
- /package/openapi/{drupal-agent-api.openapi.yaml ā reference-implementations/drupal-agent-api.openapi.yaml} +0 -0
- /package/openapi/{helm-generator.openapi.yaml ā reference-implementations/helm-generator.openapi.yaml} +0 -0
- /package/spec/{v0.2.4-dev ā v0.2.4}/ossa-0.2.4-dev.schema.json +0 -0
- /package/website/content/docs/{examples.md ā Examples.md} +0 -0
- /package/website/content/docs/core-concepts/{project-structure.md ā Project-Structure.md} +0 -0
- /package/website/content/docs/migration-guides/{00-index.md ā 00-INDEX.md} +0 -0
- /package/{docs/migration ā website/content/docs/migration-guides}/migration-manifest.json +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
const VERSION_FILE = path.join(process.cwd(), '.version.json');
|
|
6
|
+
const versionConfig = JSON.parse(fs.readFileSync(VERSION_FILE, 'utf-8'));
|
|
7
|
+
const { current } = versionConfig;
|
|
8
|
+
|
|
9
|
+
// Update package.json
|
|
10
|
+
const pkgPath = path.join(process.cwd(), 'package.json');
|
|
11
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
12
|
+
pkg.version = current;
|
|
13
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
14
|
+
|
|
15
|
+
// Update website package.json
|
|
16
|
+
const websitePkgPath = path.join(process.cwd(), 'website/package.json');
|
|
17
|
+
const websitePkg = JSON.parse(fs.readFileSync(websitePkgPath, 'utf-8'));
|
|
18
|
+
websitePkg.version = current;
|
|
19
|
+
fs.writeFileSync(websitePkgPath, JSON.stringify(websitePkg, null, 2) + '\n');
|
|
20
|
+
|
|
21
|
+
// Update README badge
|
|
22
|
+
const readmePath = path.join(process.cwd(), 'README.md');
|
|
23
|
+
let readme = fs.readFileSync(readmePath, 'utf-8');
|
|
24
|
+
readme = readme.replace(
|
|
25
|
+
/\[!\[Specification\]\(https:\/\/img\.shields\.io\/badge\/Spec-v[^-\)]+(-[^-\)]+)?-blue\)\]/g,
|
|
26
|
+
`[]`
|
|
27
|
+
);
|
|
28
|
+
fs.writeFileSync(readmePath, readme);
|
|
29
|
+
|
|
30
|
+
// Update website home
|
|
31
|
+
const homePath = path.join(process.cwd(), 'website/content/docs/00-HOME.md');
|
|
32
|
+
let home = fs.readFileSync(homePath, 'utf-8');
|
|
33
|
+
home = home.replace(
|
|
34
|
+
/\[!\[Specification\]\(https:\/\/img\.shields\.io\/badge\/Spec-v[^-\)]+(-[^-\)]+)?-blue\)\]/g,
|
|
35
|
+
`[]`
|
|
36
|
+
);
|
|
37
|
+
fs.writeFileSync(homePath, home);
|
|
38
|
+
|
|
39
|
+
console.log(`ā
Synced version to ${current}`);
|
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OSSA Version Sync Script (Zod Edition)
|
|
5
|
+
*
|
|
6
|
+
* Automatically synchronizes version references across the entire project.
|
|
7
|
+
* Single source of truth: package.json version field
|
|
8
|
+
*
|
|
9
|
+
* Uses Zod for runtime validation and type safety.
|
|
10
|
+
*
|
|
11
|
+
* Updates:
|
|
12
|
+
* - README.md (schema links, badges, examples)
|
|
13
|
+
* - spec/vX.Y.Z/ directory creation
|
|
14
|
+
* - website/docs version references
|
|
15
|
+
* - OpenAPI spec version fields
|
|
16
|
+
* - CHANGELOG.md unreleased section
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
* npx tsx scripts/sync-versions.ts [--check|--fix]
|
|
20
|
+
*
|
|
21
|
+
* --check: Validate version consistency (CI mode)
|
|
22
|
+
* --fix: Update all version references
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import fs from 'fs';
|
|
26
|
+
import path from 'path';
|
|
27
|
+
import { fileURLToPath } from 'url';
|
|
28
|
+
import { z } from 'zod';
|
|
29
|
+
|
|
30
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
31
|
+
const __dirname = path.dirname(__filename);
|
|
32
|
+
|
|
33
|
+
// ============================================================================
|
|
34
|
+
// Zod Schemas
|
|
35
|
+
// ============================================================================
|
|
36
|
+
|
|
37
|
+
const PackageJsonSchema = z.object({
|
|
38
|
+
name: z.string(),
|
|
39
|
+
version: z.string().regex(/^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?$/, 'Invalid semver version'),
|
|
40
|
+
exports: z.object({
|
|
41
|
+
'./schema': z.string().optional(),
|
|
42
|
+
}).passthrough().optional(),
|
|
43
|
+
}).passthrough();
|
|
44
|
+
|
|
45
|
+
const ConfigSchema = z.object({
|
|
46
|
+
root: z.string(),
|
|
47
|
+
packageJson: z.string(),
|
|
48
|
+
readme: z.string(),
|
|
49
|
+
changelog: z.string(),
|
|
50
|
+
releasing: z.string(),
|
|
51
|
+
specDir: z.string(),
|
|
52
|
+
mode: z.enum(['check', 'fix']),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const ResultSchema = z.object({
|
|
56
|
+
errors: z.array(z.string()),
|
|
57
|
+
changes: z.array(z.string()),
|
|
58
|
+
warnings: z.array(z.string()),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
type PackageJson = z.infer<typeof PackageJsonSchema>;
|
|
62
|
+
type Config = z.infer<typeof ConfigSchema>;
|
|
63
|
+
type Result = z.infer<typeof ResultSchema>;
|
|
64
|
+
|
|
65
|
+
// ============================================================================
|
|
66
|
+
// Configuration
|
|
67
|
+
// ============================================================================
|
|
68
|
+
|
|
69
|
+
const ROOT = path.resolve(__dirname, '..');
|
|
70
|
+
const PACKAGE_JSON = path.join(ROOT, 'package.json');
|
|
71
|
+
const README = path.join(ROOT, 'README.md');
|
|
72
|
+
const CHANGELOG = path.join(ROOT, 'CHANGELOG.md');
|
|
73
|
+
const RELEASING = path.join(ROOT, 'RELEASING.md');
|
|
74
|
+
const SPEC_DIR = path.join(ROOT, 'spec');
|
|
75
|
+
|
|
76
|
+
// Mode: check or fix
|
|
77
|
+
const MODE = process.argv[2] === '--check' ? 'check' : 'fix';
|
|
78
|
+
|
|
79
|
+
const config: Config = ConfigSchema.parse({
|
|
80
|
+
root: ROOT,
|
|
81
|
+
packageJson: PACKAGE_JSON,
|
|
82
|
+
readme: README,
|
|
83
|
+
changelog: CHANGELOG,
|
|
84
|
+
releasing: RELEASING,
|
|
85
|
+
specDir: SPEC_DIR,
|
|
86
|
+
mode: MODE,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const result: Result = {
|
|
90
|
+
errors: [],
|
|
91
|
+
changes: [],
|
|
92
|
+
warnings: [],
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// ============================================================================
|
|
96
|
+
// Version Management
|
|
97
|
+
// ============================================================================
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Get current version from package.json with validation
|
|
101
|
+
*/
|
|
102
|
+
function getCurrentVersion(): string {
|
|
103
|
+
try {
|
|
104
|
+
const pkgRaw = fs.readFileSync(config.packageJson, 'utf8');
|
|
105
|
+
const pkg = PackageJsonSchema.parse(JSON.parse(pkgRaw));
|
|
106
|
+
return pkg.version;
|
|
107
|
+
} catch (error) {
|
|
108
|
+
if (error instanceof z.ZodError) {
|
|
109
|
+
result.errors.push(`package.json validation failed: ${error.issues.map((e: z.ZodIssue) => e.message).join(', ')}`);
|
|
110
|
+
} else {
|
|
111
|
+
result.errors.push(`Failed to read package.json: ${error instanceof Error ? error.message : String(error)}`);
|
|
112
|
+
}
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Get package.json as validated object
|
|
119
|
+
*/
|
|
120
|
+
function getPackageJson(): PackageJson {
|
|
121
|
+
const pkgRaw = fs.readFileSync(config.packageJson, 'utf8');
|
|
122
|
+
return PackageJsonSchema.parse(JSON.parse(pkgRaw));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// ============================================================================
|
|
126
|
+
// Spec Directory Management
|
|
127
|
+
// ============================================================================
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Check if spec directory exists for version
|
|
131
|
+
*/
|
|
132
|
+
function checkSpecDirectory(version: string): boolean {
|
|
133
|
+
const specPath = path.join(config.specDir, `v${version}`);
|
|
134
|
+
return fs.existsSync(specPath);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Create spec directory for version (copy from latest)
|
|
139
|
+
*/
|
|
140
|
+
function createSpecDirectory(version: string): void {
|
|
141
|
+
const newSpecPath = path.join(config.specDir, `v${version}`);
|
|
142
|
+
|
|
143
|
+
if (fs.existsSync(newSpecPath)) {
|
|
144
|
+
console.log(`ā Spec directory already exists: spec/v${version}/`);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Find latest spec directory
|
|
149
|
+
const specDirs = fs.readdirSync(config.specDir)
|
|
150
|
+
.filter(d => d.startsWith('v') && !d.includes('-dev') && fs.statSync(path.join(config.specDir, d)).isDirectory())
|
|
151
|
+
.sort((a, b) => {
|
|
152
|
+
const aVer = a.slice(1).split('.').map(Number);
|
|
153
|
+
const bVer = b.slice(1).split('.').map(Number);
|
|
154
|
+
for (let i = 0; i < 3; i++) {
|
|
155
|
+
if (aVer[i] !== bVer[i]) return (bVer[i] || 0) - (aVer[i] || 0);
|
|
156
|
+
}
|
|
157
|
+
return 0;
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
if (specDirs.length === 0) {
|
|
161
|
+
result.errors.push(`No existing spec directories found to copy from`);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const latestSpec = specDirs[0];
|
|
166
|
+
const sourceSpecPath = path.join(config.specDir, latestSpec);
|
|
167
|
+
|
|
168
|
+
if (config.mode === 'check') {
|
|
169
|
+
result.errors.push(`Spec directory missing: spec/v${version}/`);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Copy directory
|
|
174
|
+
console.log(`Creating spec/v${version}/ from ${latestSpec}...`);
|
|
175
|
+
try {
|
|
176
|
+
fs.cpSync(sourceSpecPath, newSpecPath, { recursive: true });
|
|
177
|
+
} catch (error) {
|
|
178
|
+
result.errors.push(`Failed to copy spec directory: ${error instanceof Error ? error.message : String(error)}`);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Update schema version in copied files
|
|
183
|
+
const oldVersion = latestSpec.slice(1);
|
|
184
|
+
const schemaFile = path.join(newSpecPath, `ossa-${oldVersion}.schema.json`);
|
|
185
|
+
const newSchemaFile = path.join(newSpecPath, `ossa-${version}.schema.json`);
|
|
186
|
+
|
|
187
|
+
if (fs.existsSync(schemaFile)) {
|
|
188
|
+
try {
|
|
189
|
+
const schema = JSON.parse(fs.readFileSync(schemaFile, 'utf8'));
|
|
190
|
+
schema.$id = schema.$id.replace(`v${oldVersion}`, `v${version}`);
|
|
191
|
+
schema.properties.ossaVersion.const = version;
|
|
192
|
+
|
|
193
|
+
fs.writeFileSync(newSchemaFile, JSON.stringify(schema, null, 2));
|
|
194
|
+
|
|
195
|
+
if (schemaFile !== newSchemaFile) {
|
|
196
|
+
fs.unlinkSync(schemaFile);
|
|
197
|
+
}
|
|
198
|
+
} catch (error) {
|
|
199
|
+
result.errors.push(`Failed to update schema file: ${error instanceof Error ? error.message : String(error)}`);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
result.changes.push(`Created spec/v${version}/ directory`);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// ============================================================================
|
|
208
|
+
// File Updates
|
|
209
|
+
// ============================================================================
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Semver pattern that matches versions with optional pre-release tags
|
|
213
|
+
* Matches: 0.2.5, 0.2.5-RC, 0.2.5-alpha.1, 1.0.0-beta.2, etc.
|
|
214
|
+
*/
|
|
215
|
+
const SEMVER_PATTERN = '[\\d]+\\.[\\d]+\\.[\\d]+(?:-[a-zA-Z0-9.]+)?';
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Update README.md version references
|
|
219
|
+
*/
|
|
220
|
+
function updateReadme(version: string): void {
|
|
221
|
+
if (!fs.existsSync(config.readme)) {
|
|
222
|
+
result.errors.push('README.md not found');
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
let readme = fs.readFileSync(config.readme, 'utf8');
|
|
227
|
+
const original = readme;
|
|
228
|
+
|
|
229
|
+
// Update schema references (spec/vX.Y.Z/ossa-X.Y.Z.schema.json)
|
|
230
|
+
const schemaRegex = new RegExp(`spec/v${SEMVER_PATTERN}/ossa-${SEMVER_PATTERN}\\.schema\\.json`, 'g');
|
|
231
|
+
readme = readme.replace(schemaRegex, `spec/v${version}/ossa-${version}.schema.json`);
|
|
232
|
+
|
|
233
|
+
// Update version in YAML examples (ossaVersion: "X.Y.Z")
|
|
234
|
+
const yamlVersionRegex = new RegExp(`ossaVersion:\\s*["']${SEMVER_PATTERN}["']`, 'g');
|
|
235
|
+
readme = readme.replace(yamlVersionRegex, `ossaVersion: "${version}"`);
|
|
236
|
+
|
|
237
|
+
// Update "OSSA vX.Y.Z Schema:" header pattern
|
|
238
|
+
const headerRegex = new RegExp(`OSSA v${SEMVER_PATTERN} Schema:`, 'g');
|
|
239
|
+
readme = readme.replace(headerRegex, `OSSA v${version} Schema:`);
|
|
240
|
+
|
|
241
|
+
// Update version references in spec paths (e.g., spec/v0.2.5-RC/)
|
|
242
|
+
const versionLinkRegex = new RegExp(`spec/v${SEMVER_PATTERN}/`, 'g');
|
|
243
|
+
readme = readme.replace(versionLinkRegex, `spec/v${version}/`);
|
|
244
|
+
|
|
245
|
+
// Update ossa-X.Y.Z.yaml references
|
|
246
|
+
const yamlFileRegex = new RegExp(`ossa-${SEMVER_PATTERN}\\.yaml`, 'g');
|
|
247
|
+
readme = readme.replace(yamlFileRegex, `ossa-${version}.yaml`);
|
|
248
|
+
|
|
249
|
+
if (readme !== original) {
|
|
250
|
+
if (config.mode === 'check') {
|
|
251
|
+
result.errors.push('README.md has outdated version references');
|
|
252
|
+
} else {
|
|
253
|
+
fs.writeFileSync(config.readme, readme);
|
|
254
|
+
result.changes.push('Updated README.md version references');
|
|
255
|
+
}
|
|
256
|
+
} else {
|
|
257
|
+
console.log('ā README.md version references are current');
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Update RELEASING.md current version
|
|
263
|
+
*/
|
|
264
|
+
function updateReleasing(version: string): void {
|
|
265
|
+
if (!fs.existsSync(config.releasing)) {
|
|
266
|
+
result.warnings.push('RELEASING.md not found');
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
let releasing = fs.readFileSync(config.releasing, 'utf8');
|
|
271
|
+
const original = releasing;
|
|
272
|
+
|
|
273
|
+
// Update "Current Version: X.Y.Z" line
|
|
274
|
+
const currentVersionRegex = /\*\*Current Version\*\*:\s*[\d.\-a-zA-Z]+/;
|
|
275
|
+
if (currentVersionRegex.test(releasing)) {
|
|
276
|
+
releasing = releasing.replace(currentVersionRegex, `**Current Version**: ${version}`);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (releasing !== original) {
|
|
280
|
+
if (config.mode === 'check') {
|
|
281
|
+
result.errors.push(`RELEASING.md has outdated version (should be ${version})`);
|
|
282
|
+
} else {
|
|
283
|
+
fs.writeFileSync(config.releasing, releasing);
|
|
284
|
+
result.changes.push('Updated RELEASING.md current version');
|
|
285
|
+
}
|
|
286
|
+
} else {
|
|
287
|
+
console.log('ā RELEASING.md is current');
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Update CHANGELOG.md unreleased section
|
|
293
|
+
*/
|
|
294
|
+
function updateChangelog(version: string): void {
|
|
295
|
+
if (!fs.existsSync(config.changelog)) {
|
|
296
|
+
result.warnings.push('CHANGELOG.md not found');
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
let changelog = fs.readFileSync(config.changelog, 'utf8');
|
|
301
|
+
const original = changelog;
|
|
302
|
+
|
|
303
|
+
// Replace [Unreleased] with [vX.Y.Z] - YYYY-MM-DD
|
|
304
|
+
const today = new Date().toISOString().split('T')[0];
|
|
305
|
+
const unreleasedRegex = /## \[Unreleased\]/;
|
|
306
|
+
|
|
307
|
+
if (unreleasedRegex.test(changelog)) {
|
|
308
|
+
changelog = changelog.replace(
|
|
309
|
+
unreleasedRegex,
|
|
310
|
+
`## [v${version}] - ${today}`
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
if (config.mode === 'check') {
|
|
314
|
+
result.errors.push('CHANGELOG.md has [Unreleased] section that should be versioned');
|
|
315
|
+
} else {
|
|
316
|
+
fs.writeFileSync(config.changelog, changelog);
|
|
317
|
+
result.changes.push(`Updated CHANGELOG.md: [Unreleased] ā [v${version}]`);
|
|
318
|
+
}
|
|
319
|
+
} else {
|
|
320
|
+
console.log('ā CHANGELOG.md is current');
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Update package.json exports
|
|
326
|
+
*/
|
|
327
|
+
function updatePackageExports(version: string): void {
|
|
328
|
+
const pkg = getPackageJson();
|
|
329
|
+
|
|
330
|
+
if (pkg.exports && pkg.exports['./schema']) {
|
|
331
|
+
const expectedSchema = `./spec/v${version}/ossa-${version}.schema.json`;
|
|
332
|
+
const currentSchema = pkg.exports['./schema'];
|
|
333
|
+
|
|
334
|
+
// Check if current schema matches ANY version pattern (not just the expected one)
|
|
335
|
+
const schemaVersionRegex = new RegExp(`\\./spec/v${SEMVER_PATTERN}/ossa-${SEMVER_PATTERN}\\.schema\\.json`);
|
|
336
|
+
|
|
337
|
+
if (currentSchema !== expectedSchema) {
|
|
338
|
+
if (config.mode === 'check') {
|
|
339
|
+
result.errors.push(`package.json exports["./schema"] is "${currentSchema}", should be "${expectedSchema}"`);
|
|
340
|
+
} else {
|
|
341
|
+
pkg.exports['./schema'] = expectedSchema;
|
|
342
|
+
fs.writeFileSync(config.packageJson, JSON.stringify(pkg, null, 2) + '\n');
|
|
343
|
+
result.changes.push('Updated package.json schema export');
|
|
344
|
+
}
|
|
345
|
+
} else {
|
|
346
|
+
console.log('ā package.json schema export is current');
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Update website documentation
|
|
353
|
+
*/
|
|
354
|
+
function updateWebsiteDocs(version: string): void {
|
|
355
|
+
const websiteDir = path.join(config.root, 'website', 'content', 'docs');
|
|
356
|
+
|
|
357
|
+
if (!fs.existsSync(websiteDir)) {
|
|
358
|
+
result.warnings.push('website/content/docs/ not found (skipping)');
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Recursively find all .md files
|
|
363
|
+
function findMarkdownFiles(dir: string): string[] {
|
|
364
|
+
const files: string[] = [];
|
|
365
|
+
const items = fs.readdirSync(dir);
|
|
366
|
+
|
|
367
|
+
items.forEach(item => {
|
|
368
|
+
const fullPath = path.join(dir, item);
|
|
369
|
+
const stat = fs.statSync(fullPath);
|
|
370
|
+
|
|
371
|
+
if (stat.isDirectory()) {
|
|
372
|
+
files.push(...findMarkdownFiles(fullPath));
|
|
373
|
+
} else if (item.endsWith('.md') || item.endsWith('.mdx')) {
|
|
374
|
+
files.push(fullPath);
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
return files;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const mdFiles = findMarkdownFiles(websiteDir);
|
|
382
|
+
let updated = 0;
|
|
383
|
+
|
|
384
|
+
mdFiles.forEach(file => {
|
|
385
|
+
let content = fs.readFileSync(file, 'utf8');
|
|
386
|
+
const original = content;
|
|
387
|
+
|
|
388
|
+
// Update version references (but not version history sections)
|
|
389
|
+
// Use same SEMVER_PATTERN to catch pre-release versions like -RC, -alpha, -beta
|
|
390
|
+
const yamlVersionRegex = new RegExp(`ossaVersion:\\s*["']${SEMVER_PATTERN}["']`, 'g');
|
|
391
|
+
content = content.replace(yamlVersionRegex, `ossaVersion: "${version}"`);
|
|
392
|
+
|
|
393
|
+
const schemaRegex = new RegExp(`spec/v${SEMVER_PATTERN}/ossa-${SEMVER_PATTERN}\\.schema\\.json`, 'g');
|
|
394
|
+
content = content.replace(schemaRegex, `spec/v${version}/ossa-${version}.schema.json`);
|
|
395
|
+
|
|
396
|
+
// Also update spec directory links
|
|
397
|
+
const specLinkRegex = new RegExp(`spec/v${SEMVER_PATTERN}/`, 'g');
|
|
398
|
+
content = content.replace(specLinkRegex, `spec/v${version}/`);
|
|
399
|
+
|
|
400
|
+
if (content !== original) {
|
|
401
|
+
if (config.mode === 'check') {
|
|
402
|
+
result.errors.push(`${path.relative(config.root, file)} has outdated version references`);
|
|
403
|
+
} else {
|
|
404
|
+
fs.writeFileSync(file, content);
|
|
405
|
+
updated++;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
if (updated > 0) {
|
|
411
|
+
result.changes.push(`Updated ${updated} website documentation files`);
|
|
412
|
+
} else if (mdFiles.length > 0) {
|
|
413
|
+
console.log('ā Website documentation is current');
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// ============================================================================
|
|
418
|
+
// Main Execution
|
|
419
|
+
// ============================================================================
|
|
420
|
+
|
|
421
|
+
function main(): void {
|
|
422
|
+
console.log('š OSSA Version Sync (Zod Edition)');
|
|
423
|
+
console.log('==================================\n');
|
|
424
|
+
|
|
425
|
+
const version = getCurrentVersion();
|
|
426
|
+
console.log(`š¦ Current version: ${version}`);
|
|
427
|
+
console.log(`š§ Mode: ${config.mode.toUpperCase()}\n`);
|
|
428
|
+
|
|
429
|
+
// Run checks/fixes
|
|
430
|
+
createSpecDirectory(version);
|
|
431
|
+
updateReadme(version);
|
|
432
|
+
updateReleasing(version);
|
|
433
|
+
updateChangelog(version);
|
|
434
|
+
updatePackageExports(version);
|
|
435
|
+
updateWebsiteDocs(version);
|
|
436
|
+
|
|
437
|
+
// Report results
|
|
438
|
+
console.log('\n' + '='.repeat(50));
|
|
439
|
+
|
|
440
|
+
if (config.mode === 'check') {
|
|
441
|
+
if (result.errors.length > 0) {
|
|
442
|
+
console.log('\nā Version consistency check FAILED:\n');
|
|
443
|
+
result.errors.forEach(err => console.log(` ⢠${err}`));
|
|
444
|
+
console.log('\nRun with --fix to update all references');
|
|
445
|
+
process.exit(1);
|
|
446
|
+
} else {
|
|
447
|
+
console.log('\nā
All version references are consistent!');
|
|
448
|
+
if (result.warnings.length > 0) {
|
|
449
|
+
console.log('\nā ļø Warnings:\n');
|
|
450
|
+
result.warnings.forEach(warn => console.log(` ⢠${warn}`));
|
|
451
|
+
}
|
|
452
|
+
process.exit(0);
|
|
453
|
+
}
|
|
454
|
+
} else {
|
|
455
|
+
if (result.changes.length > 0) {
|
|
456
|
+
console.log('\nā
Version sync complete:\n');
|
|
457
|
+
result.changes.forEach(change => console.log(` ⢠${change}`));
|
|
458
|
+
console.log('\nš” Review changes and commit:');
|
|
459
|
+
console.log(` git add .`);
|
|
460
|
+
console.log(` git commit -m "chore: sync version references to v${version}"`);
|
|
461
|
+
} else {
|
|
462
|
+
console.log('\nā
All version references are already current!');
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
if (result.errors.length > 0) {
|
|
466
|
+
console.log('\nā Errors:\n');
|
|
467
|
+
result.errors.forEach(err => console.log(` ⢠${err}`));
|
|
468
|
+
process.exit(1);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
if (result.warnings.length > 0) {
|
|
472
|
+
console.log('\nā ļø Warnings:\n');
|
|
473
|
+
result.warnings.forEach(warn => console.log(` ⢠${warn}`));
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// Run
|
|
479
|
+
try {
|
|
480
|
+
main();
|
|
481
|
+
} catch (error) {
|
|
482
|
+
console.error('\nā Fatal Error:', error instanceof Error ? error.message : String(error));
|
|
483
|
+
if (error instanceof z.ZodError) {
|
|
484
|
+
console.error('\nValidation Errors:');
|
|
485
|
+
error.issues.forEach((err: z.ZodIssue) => console.error(` ⢠${err.path.join('.')}: ${err.message}`));
|
|
486
|
+
}
|
|
487
|
+
process.exit(1);
|
|
488
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Validate schema using current version from package.json
|
|
4
|
+
*
|
|
5
|
+
* Follows OpenAPI-first, DRY, and type-safe principles.
|
|
6
|
+
* Uses Zod for validation and shared utilities.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { join } from 'path';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
import { dirname } from 'path';
|
|
12
|
+
import { getCurrentVersion, getSchemaPath } from './lib/version.js';
|
|
13
|
+
import { requireFile } from './lib/file-ops.js';
|
|
14
|
+
import { execCommand } from './lib/exec.js';
|
|
15
|
+
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = dirname(__filename);
|
|
18
|
+
const ROOT = join(__dirname, '..');
|
|
19
|
+
|
|
20
|
+
async function main() {
|
|
21
|
+
try {
|
|
22
|
+
// Get version with validation
|
|
23
|
+
const version = getCurrentVersion();
|
|
24
|
+
console.log(`š¦ Current version: ${version}`);
|
|
25
|
+
|
|
26
|
+
// Build schema path
|
|
27
|
+
const schemaPath = join(ROOT, getSchemaPath(version));
|
|
28
|
+
|
|
29
|
+
// Validate schema exists
|
|
30
|
+
requireFile(schemaPath, `Schema not found at ${schemaPath}`);
|
|
31
|
+
console.log(`š Validating schema: ${schemaPath}`);
|
|
32
|
+
|
|
33
|
+
// Get additional args
|
|
34
|
+
const args = process.argv.slice(2);
|
|
35
|
+
// Use ajv-cli compile to validate schema syntax (no data file needed)
|
|
36
|
+
const command = `npx ajv-cli compile -s ${schemaPath} ${args.join(' ')}`;
|
|
37
|
+
|
|
38
|
+
// Run validation
|
|
39
|
+
execCommand(command, { stdio: 'inherit' });
|
|
40
|
+
console.log('ā
Schema validation passed');
|
|
41
|
+
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error('ā Error:', error instanceof Error ? error.message : String(error));
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
main();
|
|
49
|
+
|
|
File without changes
|