@bluefly/openstandardagents 0.2.5-RC → 0.2.8
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/.devfile.yaml +1 -1
- package/.env.example +1 -1
- package/.github/ISSUE_TEMPLATE/bug_report.yml +63 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +40 -0
- package/.github/workflows/dependabot-comment.yml +34 -0
- package/.github/workflows/pr-comment.yml +33 -0
- package/.husky/pre-commit +5 -0
- package/.kiro/config.json +21 -0
- package/.kiro/settings/mcp.json +61 -0
- package/.kiro/specs/scripts-migration-api-first/design.md +883 -0
- package/.kiro/specs/scripts-migration-api-first/requirements.md +165 -0
- package/.kiro/specs/scripts-migration-api-first/tasks.md +539 -0
- package/.kiro/specs/{website-design-audit → website-brand-identity}/design.md +381 -0
- package/.kiro/specs/{website-design-audit → website-brand-identity}/requirements.md +88 -0
- package/.kiro/specs/website-brand-identity/tasks.md +981 -0
- package/.version.json +2 -2
- package/.wiki-config.json +24 -0
- package/CHANGELOG.md +34 -18
- package/CODEOWNERS +75 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +176 -239
- package/bin/ossa-dev +42 -0
- package/bin/ossa-export +32 -0
- package/bin/ossa-generate +60 -0
- package/bin/ossa-health +40 -0
- package/bin/ossa-init +26 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/repositories/schema.repository.d.ts +6 -1
- package/dist/repositories/schema.repository.d.ts.map +1 -1
- package/dist/repositories/schema.repository.js +63 -36
- package/dist/repositories/schema.repository.js.map +1 -1
- package/dist/services/github-sync/github-client.d.ts +14 -0
- package/dist/services/github-sync/github-client.d.ts.map +1 -0
- package/dist/services/github-sync/github-client.js +41 -0
- package/dist/services/github-sync/github-client.js.map +1 -0
- package/dist/services/github-sync/gitlab-client.d.ts +17 -0
- package/dist/services/github-sync/gitlab-client.d.ts.map +1 -0
- package/dist/services/github-sync/gitlab-client.js +42 -0
- package/dist/services/github-sync/gitlab-client.js.map +1 -0
- package/dist/services/github-sync/schemas.d.ts +46 -0
- package/dist/services/github-sync/schemas.d.ts.map +1 -0
- package/dist/services/github-sync/schemas.js +36 -0
- package/dist/services/github-sync/schemas.js.map +1 -0
- package/dist/services/github-sync/sync.service.d.ts +27 -0
- package/dist/services/github-sync/sync.service.d.ts.map +1 -0
- package/dist/services/github-sync/sync.service.js +99 -0
- package/dist/services/github-sync/sync.service.js.map +1 -0
- package/dist/services/migration.service.d.ts +4 -3
- package/dist/services/migration.service.d.ts.map +1 -1
- package/dist/services/migration.service.js +11 -10
- package/dist/services/migration.service.js.map +1 -1
- package/dist/services/release-automation/release.service.js +1 -1
- package/dist/services/release-automation/release.service.js.map +1 -1
- package/dist/services/release-automation/schemas/release.schema.js +1 -1
- package/dist/services/runtime/claude/capability-mapper.d.ts +84 -0
- package/dist/services/runtime/claude/capability-mapper.d.ts.map +1 -0
- package/dist/services/runtime/claude/capability-mapper.js +245 -0
- package/dist/services/runtime/claude/capability-mapper.js.map +1 -0
- package/dist/services/runtime/claude/claude-adapter.d.ts +80 -0
- package/dist/services/runtime/claude/claude-adapter.d.ts.map +1 -0
- package/dist/services/runtime/claude/claude-adapter.js +287 -0
- package/dist/services/runtime/claude/claude-adapter.js.map +1 -0
- package/dist/services/runtime/claude/manifest-parser.d.ts +77 -0
- package/dist/services/runtime/claude/manifest-parser.d.ts.map +1 -0
- package/dist/services/runtime/claude/manifest-parser.js +169 -0
- package/dist/services/runtime/claude/manifest-parser.js.map +1 -0
- package/dist/services/runtime/claude/types.d.ts +115 -0
- package/dist/services/runtime/claude/types.d.ts.map +1 -0
- package/dist/services/runtime/claude/types.js +6 -0
- package/dist/services/runtime/claude/types.js.map +1 -0
- package/dist/services/validation.service.d.ts.map +1 -1
- package/dist/services/validation.service.js +12 -1
- package/dist/services/validation.service.js.map +1 -1
- package/dist/spec/v0.2.4/ossa-0.2.4.schema.json +85 -208
- package/dist/spec/v0.2.6/CHANGELOG.md +401 -0
- package/dist/spec/v0.2.6/README.md +72 -0
- package/dist/spec/v0.2.6/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/dist/spec/v0.2.6/migrations/v0.2.5-RC-to-v0.2.6.md +65 -0
- package/dist/spec/{v0.2.4/ossa-0.2.4-dev.schema.json → v0.2.6/ossa-0.2.6.schema.json} +128 -38
- package/dist/spec/v0.2.6/ossa-0.2.6.yaml +581 -0
- package/dist/spec/v0.2.6-dev/CHANGELOG.md +164 -0
- package/dist/spec/v0.2.6-dev/README.md +75 -0
- package/dist/spec/v0.2.6-dev/migrations/v0.2.2-to-v0.2.3.md +343 -0
- package/dist/spec/v0.2.6-dev/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/dist/spec/v0.2.6-dev/ossa-0.2.5.yaml +581 -0
- package/dist/spec/v0.2.6-dev/ossa-0.2.6-dev.yaml +448 -0
- package/dist/spec/v0.2.7/core/agentgraph.md +324 -0
- package/dist/spec/v0.2.7/resources/agentgraph.yaml +135 -0
- package/dist/spec/v0.2.8/CHANGELOG.md +401 -0
- package/dist/spec/v0.2.8/README.md +72 -0
- package/dist/spec/v0.2.8/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/dist/spec/v0.2.8/migrations/v0.2.5-RC-to-v0.2.6.md +65 -0
- package/dist/spec/v0.2.8/migrations/v0.2.6-to-v0.2.8.md +81 -0
- package/dist/spec/v0.2.8/ossa-0.2.8.schema.json +3153 -0
- package/dist/spec/v0.2.8/ossa-0.2.8.yaml +581 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/version.d.ts +68 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +156 -0
- package/dist/utils/version.js.map +1 -0
- package/docs/brand-guide/01-brand-overview.md +37 -0
- package/docs/brand-guide/02-logo-usage.md +43 -0
- package/docs/brand-guide/03-color-palette.md +70 -0
- package/docs/brand-guide/04-typography.md +82 -0
- package/docs/brand-guide/05-voice-and-tone.md +108 -0
- package/docs/brand-guide/06-visual-elements.md +137 -0
- package/docs/brand-guide/07-application-examples.md +153 -0
- package/docs/brand-guide/OssaLogo/OssA_Logo.svg +21 -0
- package/docs/brand-guide/OssaLogo/brand.af +0 -0
- package/docs/brand-guide/README.md +107 -0
- package/docs/comparison.md +315 -0
- package/docs/operations/automation-roadmap.md +245 -0
- package/docs/operations/github-sync-strategy.md +357 -0
- package/eslint-report.json +1 -0
- package/examples/adk-integration/code-review-workflow.yml +1 -1
- package/examples/adk-integration/customer-support.yml +1 -1
- package/examples/adk-integration/data-pipeline.yml +1 -1
- package/examples/advanced/workflows/hybrid-model-strategy.yaml +1 -1
- package/examples/agent-manifests/critics/critic-agent.yaml +1 -1
- package/examples/agent-manifests/governors/governor-agent.yaml +1 -1
- package/examples/agent-manifests/integrators/integrator-agent.yaml +1 -1
- package/examples/agent-manifests/judges/judge-agent.yaml +1 -1
- package/examples/agent-manifests/monitors/monitor-agent.yaml +1 -1
- package/examples/agent-manifests/orchestrators/orchestrator-agent.yaml +1 -1
- package/examples/agent-manifests/sample-compliant-agent.yaml +1 -1
- package/examples/agent-manifests/workers/worker-agent.yaml +1 -1
- package/examples/anthropic/claude-assistant.ossa.json +5 -4
- package/examples/autogen/multi-agent.ossa.json +6 -4
- package/examples/claude-code/code-reviewer.ossa.yaml +78 -0
- package/examples/claude-code/ossa-validator.ossa.yaml +80 -0
- package/examples/common_npm/agent-router.ossa.yaml +1 -0
- package/examples/common_npm/agent-router.v0.2.2.ossa.yaml +1 -1
- package/examples/crewai/research-team.ossa.json +14 -5
- package/examples/cursor/code-review-agent.ossa.json +21 -6
- package/examples/drupal/gitlab-ml-recommender.ossa.yaml +1 -0
- package/examples/drupal/gitlab-ml-recommender.v0.2.2.ossa.yaml +1 -1
- package/examples/extensions/drupal-v1.yml +1 -1
- package/examples/extensions/kagent-v1.yml +1 -1
- package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
- package/examples/integration-patterns/agent-to-agent-orchestration.ossa.yaml +4 -4
- package/examples/kagent/compliance-validator.ossa.yaml +1 -1
- package/examples/kagent/cost-optimizer.ossa.yaml +1 -1
- package/examples/kagent/documentation-agent.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter-v1.ossa.yaml +1 -0
- package/examples/kagent/k8s-troubleshooter-v1.v0.2.2.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter.ossa.yaml +1 -1
- package/examples/kagent/security-scanner.ossa.yaml +1 -1
- package/examples/langchain/chain-agent.ossa.json +21 -5
- package/examples/langflow/workflow-agent.ossa.json +2 -3
- package/examples/langgraph/state-machine-agent.ossa.json +2 -3
- package/examples/llamaindex/rag-agent.ossa.json +2 -3
- package/examples/migration-guides/from-langchain-to-ossa.yaml +4 -4
- package/examples/multi-agent/README.md +74 -0
- package/examples/multi-agent/conditional-router.ossa.yaml +42 -0
- package/examples/multi-agent/parallel-execution.ossa.yaml +54 -0
- package/examples/multi-agent/sequential-pipeline.ossa.yaml +45 -0
- package/examples/openai/basic-agent.ossa.yaml +1 -1
- package/examples/openai/multi-tool-agent.ossa.json +33 -10
- package/examples/openai/swarm-agent.ossa.json +18 -5
- package/examples/production/document-analyzer-openai.yml +1 -1
- package/examples/quickstart/support-agent.ossa.yaml +1 -1
- package/examples/spec-examples/audit-agent.yml +1 -1
- package/examples/spec-examples/chat-agent.yml +1 -1
- package/examples/spec-examples/compliance-agent.yml +1 -1
- package/examples/spec-examples/monitoring-agent.yml +1 -1
- package/examples/spec-examples/workflow-agent.yml +1 -1
- package/examples/templates/ossa-compliance.yaml +1 -1
- package/examples/vercel/edge-agent.ossa.json +5 -4
- package/gl-code-quality-report.json +62 -0
- package/llms-ctx-full.txt +39 -0
- package/llms-ctx.txt +39 -0
- package/llms.txt +47 -0
- package/openapi/github-sync.yaml +115 -0
- package/package.json +26 -4
- package/scripts/README.md +103 -0
- package/scripts/auto-rebase-mrs.ts +106 -0
- package/scripts/batch-dependabot.sh +57 -0
- package/scripts/configure-gitlab-branch-protection.ts +95 -0
- package/scripts/create-issue-helper.ts +238 -0
- package/scripts/create-milestone-issue.ts +73 -0
- package/scripts/eslint-to-codequality.cjs +34 -0
- package/scripts/fix-schema-formats.js +82 -0
- package/scripts/generate-agents-catalog.ts +77 -0
- package/scripts/generate-api-docs.ts +218 -0
- package/scripts/generate-cli-docs.ts +410 -0
- package/scripts/generate-config-docs.ts +109 -0
- package/scripts/generate-errors-docs.ts +76 -0
- package/scripts/generate-examples-docs.ts +99 -0
- package/scripts/generate-llms-ctx.sh +17 -0
- package/scripts/generate-schema-docs.ts +317 -0
- package/scripts/generate-types-docs.ts +48 -0
- package/scripts/lowercase-docs.ts +43 -0
- package/scripts/manage-milestone-mrs.ts +279 -0
- package/scripts/rebase-all-mrs.sh +75 -0
- package/scripts/sync-github-pr.sh +48 -0
- package/scripts/sync-version.js +32 -0
- package/scripts/sync-wiki.sh +50 -0
- package/scripts/validate-all.js +127 -0
- package/scripts/validate-schema.ts +2 -1
- package/spec/v0.2.4/ossa-0.2.4.schema.json +85 -208
- package/spec/v0.2.6/CHANGELOG.md +401 -0
- package/spec/v0.2.6/README.md +72 -0
- package/spec/v0.2.6/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/spec/v0.2.6/migrations/v0.2.5-RC-to-v0.2.6.md +65 -0
- package/spec/{v0.2.4/ossa-0.2.4-dev.schema.json → v0.2.6/ossa-0.2.6.schema.json} +128 -38
- package/spec/v0.2.6/ossa-0.2.6.yaml +581 -0
- package/spec/v0.2.6-dev/CHANGELOG.md +164 -0
- package/spec/v0.2.6-dev/README.md +75 -0
- package/spec/v0.2.6-dev/migrations/v0.2.2-to-v0.2.3.md +343 -0
- package/spec/v0.2.6-dev/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/spec/v0.2.6-dev/ossa-0.2.5.yaml +581 -0
- package/spec/v0.2.6-dev/ossa-0.2.6-dev.yaml +448 -0
- package/spec/v0.2.7/core/agentgraph.md +324 -0
- package/spec/v0.2.7/resources/agentgraph.yaml +135 -0
- package/spec/v0.2.8/CHANGELOG.md +401 -0
- package/spec/v0.2.8/README.md +72 -0
- package/spec/v0.2.8/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/spec/v0.2.8/migrations/v0.2.5-RC-to-v0.2.6.md +65 -0
- package/spec/v0.2.8/migrations/v0.2.6-to-v0.2.8.md +81 -0
- package/spec/v0.2.8/ossa-0.2.8.schema.json +3153 -0
- package/spec/v0.2.8/ossa-0.2.8.yaml +581 -0
- package/test-results/junit.xml +299 -0
- package/.kiro/specs/agent-buildkit-templates/design.md +0 -495
- package/.kiro/specs/agent-buildkit-templates/requirements.md +0 -165
- package/.kiro/specs/kiro-ide-supercharger/README.md +0 -202
- package/.kiro/specs/kiro-ide-supercharger/design.md +0 -1005
- package/.kiro/specs/kiro-ide-supercharger/requirements.md +0 -141
- package/.kiro/specs/kiro-ide-supercharger/tasks.md +0 -507
- package/bin/validate-ossa-0.2.5-RC.ts +0 -244
- package/docs/issue-19-completion-summary.md +0 -648
- package/docs/issue-19-validation.md +0 -351
- package/scripts/lib/exec.ts +0 -37
- package/scripts/lib/file-ops.ts +0 -58
- package/scripts/lib/version.ts +0 -83
- package/website/.lighthouserc.ts +0 -24
- package/website/.prettierrc +0 -10
- package/website/Dockerfile +0 -30
- package/website/app/about/page.tsx +0 -295
- package/website/app/blog/[slug]/page.tsx +0 -208
- package/website/app/blog/page.tsx +0 -249
- package/website/app/design-guide/page.tsx +0 -511
- package/website/app/docs/[[...slug]]/page.tsx +0 -847
- package/website/app/docs/core-concepts/project-structure/page.tsx +0 -349
- package/website/app/ecosystem/page.tsx +0 -375
- package/website/app/examples/page.tsx +0 -133
- package/website/app/globals.scss +0 -135
- package/website/app/layout.tsx +0 -106
- package/website/app/license/page.tsx +0 -183
- package/website/app/not-found.tsx +0 -18
- package/website/app/page.tsx +0 -474
- package/website/app/playground/page.tsx +0 -487
- package/website/app/robots.ts +0 -19
- package/website/app/rss.xml/route.ts +0 -74
- package/website/app/schema/page.tsx +0 -1001
- package/website/app/sitemap.ts +0 -56
- package/website/app/specification/page.tsx +0 -287
- package/website/components/InstallCommand.tsx +0 -96
- package/website/components/Logo.tsx +0 -97
- package/website/components/StructuredData.tsx +0 -65
- package/website/components/docs/DocsSearch.tsx +0 -104
- package/website/components/docs/DocsSidebar.tsx +0 -155
- package/website/components/docs/MarkdownContent.tsx +0 -401
- package/website/components/docs/VersionSelector.tsx +0 -105
- package/website/components/examples/ExamplesViewer.tsx +0 -293
- package/website/components/layout/Footer.tsx +0 -116
- package/website/components/layout/Header.tsx +0 -168
- package/website/components/schema/SchemaComponentsAccordion.tsx +0 -84
- package/website/components/schema/SchemaExplorer.tsx +0 -213
- package/website/content/blog/OpenAPI-AI-Agents-Standard.md +0 -285
- package/website/content/blog/Why-Formal-Standards-Matter-Now.md +0 -198
- package/website/content/blog/gitlab-kubernetes-agent-ecosystem.md +0 -286
- package/website/content/blog/introducing-ossa-framework.md +0 -328
- package/website/content/blog/ossa-production-results.md +0 -279
- package/website/content/blog/welcome-to-ossa.md +0 -43
- package/website/content/blog/why-ai-agents-need-open-standard.md +0 -98
- package/website/content/docs/00-HOME.md +0 -153
- package/website/content/docs/AIFlow-Framework-Integration-with-OSSA.md +0 -107
- package/website/content/docs/Examples.md +0 -71
- package/website/content/docs/OpenAPI-Extensions.md +0 -934
- package/website/content/docs/adapters/openai-adapter.md +0 -693
- package/website/content/docs/architecture/execution-flow.md +0 -335
- package/website/content/docs/architecture/multi-agent-systems.md +0 -737
- package/website/content/docs/architecture/overview.md +0 -121
- package/website/content/docs/architecture/stack-integration.md +0 -461
- package/website/content/docs/changelog.md +0 -246
- package/website/content/docs/contributing.md +0 -599
- package/website/content/docs/core-concepts/Project-Structure.md +0 -348
- package/website/content/docs/ecosystem/framework-support.md +0 -819
- package/website/content/docs/ecosystem/overview.md +0 -366
- package/website/content/docs/examples/AIFlow-Framework-Integration-with-OSSA.md +0 -107
- package/website/content/docs/examples/Migration-Guides.md +0 -214
- package/website/content/docs/for-audiences/Architects.md +0 -224
- package/website/content/docs/for-audiences/Developers.md +0 -220
- package/website/content/docs/for-audiences/Enterprises.md +0 -256
- package/website/content/docs/for-audiences/Students-Researchers.md +0 -122
- package/website/content/docs/getting-started/5-Minute-Overview.md +0 -85
- package/website/content/docs/getting-started/First-Agent.md +0 -196
- package/website/content/docs/getting-started/Hello-World.md +0 -184
- package/website/content/docs/getting-started/Installation.md +0 -155
- package/website/content/docs/getting-started/index.md +0 -92
- package/website/content/docs/getting-started/running-agents.md +0 -309
- package/website/content/docs/getting-started.md +0 -91
- package/website/content/docs/integrations/aiflow.md +0 -104
- package/website/content/docs/integrations/drupal.md +0 -105
- package/website/content/docs/migration-guides/00-INDEX.md +0 -76
- package/website/content/docs/migration-guides/README.md +0 -133
- package/website/content/docs/migration-guides/agent-schema-comparison.md +0 -232
- package/website/content/docs/migration-guides/anthropic-mcp-to-ossa.md +0 -1750
- package/website/content/docs/migration-guides/crewai-to-ossa.md +0 -274
- package/website/content/docs/migration-guides/drupal-eca-to-ossa.md +0 -2017
- package/website/content/docs/migration-guides/general-agent-schema.yml +0 -247
- package/website/content/docs/migration-guides/index.md +0 -133
- package/website/content/docs/migration-guides/langchain-to-ossa.md +0 -1714
- package/website/content/docs/migration-guides/langflow-to-ossa.md +0 -2075
- package/website/content/docs/migration-guides/migration-manifest.json +0 -64
- package/website/content/docs/migration-guides/openai-to-ossa.md +0 -1202
- package/website/content/docs/openapi-extensions/examples.md +0 -550
- package/website/content/docs/openapi-extensions/index.md +0 -551
- package/website/content/docs/openapi-extensions/operation-extensions.md +0 -457
- package/website/content/docs/openapi-extensions/root-extensions.md +0 -410
- package/website/content/docs/ossa-compliant-badge.md +0 -251
- package/website/content/docs/pre-release/index.md +0 -175
- package/website/content/docs/quick-reference.md +0 -17
- package/website/content/docs/readme.md +0 -35
- package/website/content/docs/schema-reference/agent-spec.md +0 -406
- package/website/content/docs/schema-reference/autonomy.md +0 -568
- package/website/content/docs/schema-reference/constraints.md +0 -543
- package/website/content/docs/schema-reference/index.md +0 -176
- package/website/content/docs/schema-reference/llm-config.md +0 -445
- package/website/content/docs/schema-reference/observability.md +0 -654
- package/website/content/docs/schema-reference/ossa-manifest.md +0 -309
- package/website/content/docs/schema-reference/taxonomy.md +0 -509
- package/website/content/docs/schema-reference/tools.md +0 -628
- package/website/content/docs/templates/blog-post.md +0 -43
- package/website/content/docs/use-cases/00-index.md +0 -395
- package/website/content/docs/use-cases/cicd-code-review.md +0 -1236
- package/website/content/docs/use-cases/customer-support.md +0 -1234
- package/website/content/docs/use-cases/enterprise-compliance.md +0 -1208
- package/website/content/docs/use-cases/research-multi-agent.md +0 -1161
- package/website/content/docs/versioning.md +0 -288
- package/website/lib/version.ts +0 -35
- package/website/lib/versions.json +0 -78
- package/website/next.config.ts +0 -18
- package/website/nginx.conf +0 -32
- package/website/package-lock.json +0 -9679
- package/website/package.json +0 -59
- package/website/postcss.config.mjs +0 -9
- package/website/scripts/fetch-versions.js +0 -166
- package/website/scripts/generate-examples-index.js +0 -163
- package/website/scripts/merge-docs-to-wiki.ts +0 -207
- package/website/scripts/sync-version.js +0 -72
- package/website/scripts/sync-wiki.ts +0 -322
- package/website/scripts/upload-wiki.ts +0 -199
- package/website/styles/_variables.scss +0 -36
- package/website/tailwind.config.ts +0 -136
- /package/dist/spec/v0.2.4/{ossa-0.2.4-dev.yaml → ossa-0.2.4.yaml} +0 -0
- /package/spec/v0.2.4/{ossa-0.2.4-dev.yaml → ossa-0.2.4.yaml} +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Validation Scripts
|
|
2
|
+
|
|
3
|
+
Automated validation and maintenance scripts for OSSA.
|
|
4
|
+
|
|
5
|
+
## Scripts
|
|
6
|
+
|
|
7
|
+
### validate-all.js
|
|
8
|
+
|
|
9
|
+
Comprehensive validation suite:
|
|
10
|
+
- Version consistency across packages
|
|
11
|
+
- Schema exports and files
|
|
12
|
+
- Spec directory structure
|
|
13
|
+
- Schema validation
|
|
14
|
+
- Version reference checks
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm run validate:all
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### fix-schema-formats.js
|
|
21
|
+
|
|
22
|
+
Automatically fixes unsupported format constraints in JSON schemas.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm run fix:schemas
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Removes format constraints like `"format": "uri"` that aren't supported by ajv-cli.
|
|
29
|
+
|
|
30
|
+
### sync-version.js (website)
|
|
31
|
+
|
|
32
|
+
Syncs version from package.json to website code.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cd website && npm run sync-version
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## CI/CD Integration
|
|
39
|
+
|
|
40
|
+
Validation runs automatically on:
|
|
41
|
+
- Merge requests
|
|
42
|
+
- Commits to main/development
|
|
43
|
+
|
|
44
|
+
See `.gitlab-ci-validation.yml` for configuration.
|
|
45
|
+
|
|
46
|
+
## Pre-commit Hook
|
|
47
|
+
|
|
48
|
+
Install husky to run validations before commit:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm install
|
|
52
|
+
npm run prepare
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Maintenance
|
|
56
|
+
|
|
57
|
+
### Adding New Validations
|
|
58
|
+
|
|
59
|
+
Edit `scripts/validate-all.js`:
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
check('New Check', () => {
|
|
63
|
+
// Your validation logic
|
|
64
|
+
if (somethingWrong) {
|
|
65
|
+
throw new Error('Description');
|
|
66
|
+
}
|
|
67
|
+
console.log('✓ Check passed');
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Adding Unsupported Formats
|
|
72
|
+
|
|
73
|
+
Edit `scripts/fix-schema-formats.js`:
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
const UNSUPPORTED_FORMATS = ['uri', 'new-format'];
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Troubleshooting
|
|
80
|
+
|
|
81
|
+
### Schema validation fails
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm run fix:schemas
|
|
85
|
+
npm run validate:schema
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Version mismatch
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Update root version
|
|
92
|
+
npm version patch
|
|
93
|
+
|
|
94
|
+
# Sync to website
|
|
95
|
+
cd website && npm run sync-version
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Pre-commit hook not running
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm run prepare
|
|
102
|
+
chmod +x .husky/pre-commit
|
|
103
|
+
```
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
/**
|
|
3
|
+
* Auto-rebase all open MRs onto their target branches
|
|
4
|
+
* Runs in CI or manually to keep MRs up to date
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Gitlab } from '@gitbeaker/rest';
|
|
8
|
+
import { execSync } from 'child_process';
|
|
9
|
+
|
|
10
|
+
const PROJECT_ID = 'blueflyio/openstandardagents';
|
|
11
|
+
const TOKEN = process.env.GITLAB_TOKEN || process.env.SERVICE_ACCOUNT_OSSA_TOKEN || process.env.GITLAB_PUSH_TOKEN;
|
|
12
|
+
|
|
13
|
+
if (!TOKEN) {
|
|
14
|
+
console.error('❌ Error: GITLAB_TOKEN or SERVICE_ACCOUNT_OSSA_TOKEN required');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const gitlab = new Gitlab({
|
|
19
|
+
host: 'https://gitlab.com',
|
|
20
|
+
token: TOKEN,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
async function rebaseMR(mr: any): Promise<boolean> {
|
|
24
|
+
const { iid, source_branch, target_branch, merge_status } = mr;
|
|
25
|
+
|
|
26
|
+
console.log(`\n🔄 Rebasing MR !${iid}: ${source_branch} -> ${target_branch}`);
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
// Fetch branches
|
|
30
|
+
execSync(`git fetch origin ${source_branch} ${target_branch}`, { stdio: 'inherit' });
|
|
31
|
+
|
|
32
|
+
// Check if behind
|
|
33
|
+
const behind = execSync(
|
|
34
|
+
`git rev-list --count origin/${target_branch}..origin/${source_branch} 2>/dev/null || echo 0`
|
|
35
|
+
).toString().trim();
|
|
36
|
+
|
|
37
|
+
if (behind === '0') {
|
|
38
|
+
console.log(` ✅ Already up to date`);
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.log(` ⚠️ ${behind} commits behind, rebasing...`);
|
|
43
|
+
|
|
44
|
+
// Create worktree
|
|
45
|
+
const worktreePath = `../rebase-${iid}-${source_branch.replace(/\//g, '-')}`;
|
|
46
|
+
try {
|
|
47
|
+
execSync(`git worktree remove ${worktreePath}`, { stdio: 'ignore' });
|
|
48
|
+
} catch {}
|
|
49
|
+
|
|
50
|
+
execSync(`git worktree add ${worktreePath} origin/${source_branch}`, { stdio: 'inherit' });
|
|
51
|
+
|
|
52
|
+
// Rebase
|
|
53
|
+
try {
|
|
54
|
+
execSync(`cd ${worktreePath} && git rebase origin/${target_branch}`, { stdio: 'inherit' });
|
|
55
|
+
|
|
56
|
+
// Push
|
|
57
|
+
execSync(`cd ${worktreePath} && git push origin ${source_branch} --force-with-lease`, { stdio: 'inherit' });
|
|
58
|
+
|
|
59
|
+
console.log(` ✅ Rebased and pushed successfully`);
|
|
60
|
+
|
|
61
|
+
// Cleanup
|
|
62
|
+
execSync(`git worktree remove ${worktreePath}`, { stdio: 'ignore' });
|
|
63
|
+
|
|
64
|
+
return true;
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error(` ❌ Rebase failed - conflicts may exist`);
|
|
67
|
+
console.error(` Worktree: ${worktreePath}`);
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
} catch (error: any) {
|
|
71
|
+
console.error(` ❌ Error: ${error.message}`);
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function main() {
|
|
77
|
+
console.log('🔄 Auto-rebasing all open MRs\n');
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
const mrs = await gitlab.MergeRequests.all({
|
|
81
|
+
projectId: PROJECT_ID,
|
|
82
|
+
state: 'opened',
|
|
83
|
+
perPage: 20,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
console.log(`Found ${mrs.length} open MRs\n`);
|
|
87
|
+
|
|
88
|
+
const results = await Promise.all(mrs.map(rebaseMR));
|
|
89
|
+
|
|
90
|
+
const success = results.filter(Boolean).length;
|
|
91
|
+
const failed = results.length - success;
|
|
92
|
+
|
|
93
|
+
console.log(`\n✅ Summary:`);
|
|
94
|
+
console.log(` Successfully rebased: ${success}`);
|
|
95
|
+
console.log(` Failed: ${failed}`);
|
|
96
|
+
|
|
97
|
+
if (failed > 0) {
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
} catch (error: any) {
|
|
101
|
+
console.error('❌ Error:', error.message);
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
main();
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# Batch merge Dependabot PRs from GitHub
|
|
5
|
+
# Creates a single GitLab MR with all updates
|
|
6
|
+
|
|
7
|
+
REPO="blueflyio/openstandardagents"
|
|
8
|
+
BRANCH="batch-dependabot-$(date +%Y%m%d)"
|
|
9
|
+
|
|
10
|
+
echo "🤖 Batching Dependabot PRs..."
|
|
11
|
+
|
|
12
|
+
# Get all open Dependabot PRs
|
|
13
|
+
DEPENDABOT_PRS=$(gh pr list --repo $REPO --author app/dependabot --state open --json number -q '.[].number')
|
|
14
|
+
|
|
15
|
+
if [ -z "$DEPENDABOT_PRS" ]; then
|
|
16
|
+
echo "No Dependabot PRs found"
|
|
17
|
+
exit 0
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
echo "Found PRs: $DEPENDABOT_PRS"
|
|
21
|
+
|
|
22
|
+
# Create new branch
|
|
23
|
+
git checkout -b $BRANCH main
|
|
24
|
+
|
|
25
|
+
# Merge each PR
|
|
26
|
+
for PR in $DEPENDABOT_PRS; do
|
|
27
|
+
echo "Merging PR #$PR..."
|
|
28
|
+
gh pr checkout $PR
|
|
29
|
+
git merge --no-ff --no-edit FETCH_HEAD || {
|
|
30
|
+
echo "⚠️ Conflict in PR #$PR, skipping"
|
|
31
|
+
git merge --abort
|
|
32
|
+
continue
|
|
33
|
+
}
|
|
34
|
+
done
|
|
35
|
+
|
|
36
|
+
# Push to GitLab
|
|
37
|
+
git push origin $BRANCH
|
|
38
|
+
|
|
39
|
+
# Create GitLab MR
|
|
40
|
+
glab mr create \
|
|
41
|
+
--title "chore(deps): batch Dependabot updates $(date +%Y-%m-%d)" \
|
|
42
|
+
--description "Batched Dependabot PRs from GitHub:
|
|
43
|
+
|
|
44
|
+
$(echo "$DEPENDABOT_PRS" | while read pr; do
|
|
45
|
+
echo "- https://github.com/$REPO/pull/$pr"
|
|
46
|
+
done)
|
|
47
|
+
|
|
48
|
+
**Changes:**
|
|
49
|
+
- Dependency updates from Dependabot
|
|
50
|
+
- Tested in CI before merge
|
|
51
|
+
|
|
52
|
+
**GitHub PRs will auto-close** when this merges and syncs back." \
|
|
53
|
+
--source-branch $BRANCH \
|
|
54
|
+
--target-branch main \
|
|
55
|
+
--label "dependencies"
|
|
56
|
+
|
|
57
|
+
echo "✅ Created GitLab MR with batched updates"
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
/**
|
|
3
|
+
* Configure GitLab Branch Protection Rules
|
|
4
|
+
* Sets up protection for main and development branches via GitLab API
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Gitlab } from '@gitbeaker/rest';
|
|
8
|
+
|
|
9
|
+
const PROJECT_ID = 'blueflyio/openstandardagents';
|
|
10
|
+
const TOKEN = process.env.GITLAB_TOKEN || process.env.SERVICE_ACCOUNT_OSSA_TOKEN || process.env.GITLAB_PUSH_TOKEN;
|
|
11
|
+
|
|
12
|
+
if (!TOKEN) {
|
|
13
|
+
console.error('❌ Error: GITLAB_TOKEN or SERVICE_ACCOUNT_OSSA_TOKEN required');
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const gitlab = new Gitlab({
|
|
18
|
+
host: 'https://gitlab.com',
|
|
19
|
+
token: TOKEN,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
interface ProtectionRule {
|
|
23
|
+
name: string;
|
|
24
|
+
push_access_levels?: Array<{ access_level: number }>;
|
|
25
|
+
merge_access_levels?: Array<{ access_level: number }>;
|
|
26
|
+
allow_force_push?: boolean;
|
|
27
|
+
allowed_to_push?: Array<{ user_id?: number; group_id?: number }>;
|
|
28
|
+
allowed_to_merge?: Array<{ user_id?: number; group_id?: number }>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function protectBranch(branch: string, rules: ProtectionRule): Promise<void> {
|
|
32
|
+
try {
|
|
33
|
+
console.log(`\n🔒 Protecting branch: ${branch}`);
|
|
34
|
+
|
|
35
|
+
// Check if branch is already protected
|
|
36
|
+
const existing = await gitlab.ProtectedBranches.all(PROJECT_ID);
|
|
37
|
+
const isProtected = existing.some((pb: any) => pb.name === branch);
|
|
38
|
+
|
|
39
|
+
if (isProtected) {
|
|
40
|
+
console.log(` ⚠️ ${branch} is already protected. Updating...`);
|
|
41
|
+
await gitlab.ProtectedBranches.unprotect(PROJECT_ID, branch);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Protect the branch
|
|
45
|
+
await gitlab.ProtectedBranches.protect(PROJECT_ID, branch, {
|
|
46
|
+
push_access_levels: [{ access_level: 0 }], // No one can push
|
|
47
|
+
merge_access_levels: [{ access_level: 40 }], // Maintainers can merge
|
|
48
|
+
allow_force_push: false,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
console.log(` ✅ ${branch} protected successfully`);
|
|
52
|
+
console.log(` - Push: Blocked (no direct pushes)`);
|
|
53
|
+
console.log(` - Merge: Maintainers only (via MR)`);
|
|
54
|
+
console.log(` - Force push: Disabled`);
|
|
55
|
+
} catch (error: any) {
|
|
56
|
+
console.error(` ❌ Failed to protect ${branch}:`, error.message);
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function main() {
|
|
62
|
+
console.log('🔒 Configuring GitLab Branch Protection Rules\n');
|
|
63
|
+
console.log(`Project: ${PROJECT_ID}`);
|
|
64
|
+
console.log(`Token: ${TOKEN.substring(0, 10)}...`);
|
|
65
|
+
|
|
66
|
+
try {
|
|
67
|
+
// Protect main branch
|
|
68
|
+
await protectBranch('main', {
|
|
69
|
+
name: 'main',
|
|
70
|
+
push_access_levels: [{ access_level: 0 }], // No one
|
|
71
|
+
merge_access_levels: [{ access_level: 40 }], // Maintainers
|
|
72
|
+
allow_force_push: false,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// Protect development branch
|
|
76
|
+
await protectBranch('development', {
|
|
77
|
+
name: 'development',
|
|
78
|
+
push_access_levels: [{ access_level: 0 }], // No one
|
|
79
|
+
merge_access_levels: [{ access_level: 40 }], // Maintainers
|
|
80
|
+
allow_force_push: false,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
console.log('\n✅ Branch protection configured successfully!');
|
|
84
|
+
console.log('\nProtected branches:');
|
|
85
|
+
console.log(' - main: No direct pushes, MR required');
|
|
86
|
+
console.log(' - development: No direct pushes, MR required');
|
|
87
|
+
console.log('\nView in GitLab:');
|
|
88
|
+
console.log(` https://gitlab.com/${PROJECT_ID}/-/settings/repository#protected-branches`);
|
|
89
|
+
} catch (error: any) {
|
|
90
|
+
console.error('\n❌ Error configuring branch protection:', error.message);
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
main();
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* GitLab Issue Creation Helper (Zod Edition)
|
|
5
|
+
*
|
|
6
|
+
* Creates GitLab issues via API with proper validation and error handling.
|
|
7
|
+
* Uses Zod for runtime validation and type safety.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* npx tsx scripts/create-issue-helper.ts <title> <milestone-id> <labels> [description-file]
|
|
11
|
+
*
|
|
12
|
+
* Example:
|
|
13
|
+
* npx tsx scripts/create-issue-helper.ts "Enhance bin" 3 "enhancement,cli,bin" .gitlab/ISSUE-BIN-ENHANCEMENT.md
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import fs from 'fs';
|
|
17
|
+
import path from 'path';
|
|
18
|
+
import { fileURLToPath } from 'url';
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
|
|
21
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
22
|
+
const __dirname = path.dirname(__filename);
|
|
23
|
+
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// Zod Schemas
|
|
26
|
+
// ============================================================================
|
|
27
|
+
|
|
28
|
+
const ConfigSchema = z.object({
|
|
29
|
+
gitlabApiUrl: z.string().url(),
|
|
30
|
+
gitlabToken: z.string().min(1, 'GitLab token is required'),
|
|
31
|
+
projectId: z.string().min(1, 'Project ID is required'),
|
|
32
|
+
title: z.string().min(1, 'Title is required'),
|
|
33
|
+
milestoneId: z.number().int().positive('Milestone ID must be a positive integer'),
|
|
34
|
+
labels: z.array(z.string().min(1)).min(1, 'At least one label is required'),
|
|
35
|
+
description: z.string().optional(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const GitLabIssueResponseSchema = z.object({
|
|
39
|
+
iid: z.number(),
|
|
40
|
+
web_url: z.string().url(),
|
|
41
|
+
title: z.string(),
|
|
42
|
+
state: z.string(),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const GitLabErrorResponseSchema = z.object({
|
|
46
|
+
message: z.string().optional(),
|
|
47
|
+
error: z.string().optional(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
type Config = z.infer<typeof ConfigSchema>;
|
|
51
|
+
type GitLabIssueResponse = z.infer<typeof GitLabIssueResponseSchema>;
|
|
52
|
+
type GitLabErrorResponse = z.infer<typeof GitLabErrorResponseSchema>;
|
|
53
|
+
|
|
54
|
+
// ============================================================================
|
|
55
|
+
// Configuration
|
|
56
|
+
// ============================================================================
|
|
57
|
+
|
|
58
|
+
function getConfig(): Config {
|
|
59
|
+
const args = process.argv.slice(2);
|
|
60
|
+
|
|
61
|
+
if (args.length < 3) {
|
|
62
|
+
console.error('❌ Usage: tsx scripts/create-issue-helper.ts <title> <milestone-id> <labels> [description-file]');
|
|
63
|
+
console.error(' Example: tsx scripts/create-issue-helper.ts "Enhance bin" 3 "enhancement,cli,bin" .gitlab/ISSUE-BIN-ENHANCEMENT.md');
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const [title, milestoneIdStr, labelsStr, descFile] = args;
|
|
68
|
+
|
|
69
|
+
// Parse milestone ID
|
|
70
|
+
const milestoneId = parseInt(milestoneIdStr, 10);
|
|
71
|
+
if (isNaN(milestoneId) || milestoneId <= 0) {
|
|
72
|
+
console.error(`❌ Invalid milestone ID: ${milestoneIdStr}`);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Parse labels
|
|
77
|
+
const labels = labelsStr.split(',').map(l => l.trim()).filter(l => l.length > 0);
|
|
78
|
+
if (labels.length === 0) {
|
|
79
|
+
console.error(`❌ No valid labels provided: ${labelsStr}`);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Read description file if provided
|
|
84
|
+
let description: string | undefined;
|
|
85
|
+
if (descFile) {
|
|
86
|
+
const descPath = path.isAbsolute(descFile) ? descFile : path.join(process.cwd(), descFile);
|
|
87
|
+
if (!fs.existsSync(descPath)) {
|
|
88
|
+
console.error(`❌ Description file not found: ${descPath}`);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
description = fs.readFileSync(descPath, 'utf-8');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Get GitLab token (try multiple sources)
|
|
95
|
+
const gitlabToken = process.env.SERVICE_ACCOUNT_OSSA_TOKEN ||
|
|
96
|
+
process.env.SERVICE_ACCOUNT_VERSION_MANAGER_TOKEN ||
|
|
97
|
+
process.env.GITLAB_TOKEN ||
|
|
98
|
+
process.env.GITLAB_PUSH_TOKEN ||
|
|
99
|
+
'';
|
|
100
|
+
|
|
101
|
+
if (!gitlabToken) {
|
|
102
|
+
console.error('❌ No GitLab token found. Please set one of:');
|
|
103
|
+
console.error(' - SERVICE_ACCOUNT_OSSA_TOKEN');
|
|
104
|
+
console.error(' - SERVICE_ACCOUNT_VERSION_MANAGER_TOKEN');
|
|
105
|
+
console.error(' - GITLAB_TOKEN');
|
|
106
|
+
console.error(' - GITLAB_PUSH_TOKEN');
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Get project ID
|
|
111
|
+
const projectId = process.env.CI_PROJECT_ID ||
|
|
112
|
+
process.env.GITLAB_PROJECT_ID ||
|
|
113
|
+
'blueflyio/openstandardagents';
|
|
114
|
+
|
|
115
|
+
// Get API URL
|
|
116
|
+
const gitlabApiUrl = process.env.CI_API_V4_URL ||
|
|
117
|
+
process.env.GITLAB_API_URL ||
|
|
118
|
+
'https://gitlab.com/api/v4';
|
|
119
|
+
|
|
120
|
+
try {
|
|
121
|
+
return ConfigSchema.parse({
|
|
122
|
+
gitlabApiUrl,
|
|
123
|
+
gitlabToken,
|
|
124
|
+
projectId,
|
|
125
|
+
title,
|
|
126
|
+
milestoneId,
|
|
127
|
+
labels,
|
|
128
|
+
description,
|
|
129
|
+
});
|
|
130
|
+
} catch (error) {
|
|
131
|
+
if (error instanceof z.ZodError) {
|
|
132
|
+
console.error('❌ Configuration validation failed:');
|
|
133
|
+
error.issues.forEach((issue) => {
|
|
134
|
+
console.error(` • ${issue.path.join('.')}: ${issue.message}`);
|
|
135
|
+
});
|
|
136
|
+
} else {
|
|
137
|
+
console.error('❌ Configuration error:', error instanceof Error ? error.message : String(error));
|
|
138
|
+
}
|
|
139
|
+
process.exit(1);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// ============================================================================
|
|
144
|
+
// GitLab API
|
|
145
|
+
// ============================================================================
|
|
146
|
+
|
|
147
|
+
async function createIssue(config: Config): Promise<GitLabIssueResponse> {
|
|
148
|
+
const projectPath = encodeURIComponent(config.projectId);
|
|
149
|
+
const url = `${config.gitlabApiUrl}/projects/${projectPath}/issues`;
|
|
150
|
+
|
|
151
|
+
const payload = {
|
|
152
|
+
title: config.title,
|
|
153
|
+
description: config.description || '',
|
|
154
|
+
milestone_id: config.milestoneId,
|
|
155
|
+
labels: config.labels.join(','),
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
try {
|
|
159
|
+
const response = await fetch(url, {
|
|
160
|
+
method: 'POST',
|
|
161
|
+
headers: {
|
|
162
|
+
'PRIVATE-TOKEN': config.gitlabToken,
|
|
163
|
+
'Content-Type': 'application/json',
|
|
164
|
+
},
|
|
165
|
+
body: JSON.stringify(payload),
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
const responseText = await response.text();
|
|
169
|
+
let responseData: unknown;
|
|
170
|
+
|
|
171
|
+
try {
|
|
172
|
+
responseData = JSON.parse(responseText);
|
|
173
|
+
} catch {
|
|
174
|
+
responseData = responseText;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (!response.ok) {
|
|
178
|
+
// Try to parse as error response
|
|
179
|
+
const errorData = GitLabErrorResponseSchema.safeParse(responseData);
|
|
180
|
+
if (errorData.success) {
|
|
181
|
+
const error = errorData.data;
|
|
182
|
+
throw new Error(`GitLab API error: ${error.message || error.error || responseText}`);
|
|
183
|
+
}
|
|
184
|
+
throw new Error(`GitLab API error (HTTP ${response.status}): ${responseText}`);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Validate response
|
|
188
|
+
const issue = GitLabIssueResponseSchema.parse(responseData);
|
|
189
|
+
return issue;
|
|
190
|
+
} catch (error) {
|
|
191
|
+
if (error instanceof z.ZodError) {
|
|
192
|
+
console.error('❌ Invalid response from GitLab API:');
|
|
193
|
+
error.issues.forEach((issue) => {
|
|
194
|
+
console.error(` • ${issue.path.join('.')}: ${issue.message}`);
|
|
195
|
+
});
|
|
196
|
+
throw new Error('Failed to parse GitLab API response');
|
|
197
|
+
}
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// ============================================================================
|
|
203
|
+
// Main
|
|
204
|
+
// ============================================================================
|
|
205
|
+
|
|
206
|
+
async function main(): Promise<void> {
|
|
207
|
+
console.log('🔧 GitLab Issue Creation Helper (Zod Edition)');
|
|
208
|
+
console.log('==============================================\n');
|
|
209
|
+
|
|
210
|
+
const config = getConfig();
|
|
211
|
+
|
|
212
|
+
console.log(`📋 Configuration:`);
|
|
213
|
+
console.log(` Project: ${config.projectId}`);
|
|
214
|
+
console.log(` Title: ${config.title}`);
|
|
215
|
+
console.log(` Milestone: #${config.milestoneId}`);
|
|
216
|
+
console.log(` Labels: ${config.labels.join(', ')}`);
|
|
217
|
+
console.log(` Description: ${config.description ? `${config.description.length} chars` : 'none'}`);
|
|
218
|
+
console.log('');
|
|
219
|
+
|
|
220
|
+
try {
|
|
221
|
+
const issue = await createIssue(config);
|
|
222
|
+
|
|
223
|
+
console.log('✅ Issue created successfully!');
|
|
224
|
+
console.log(` Issue: !${issue.iid}`);
|
|
225
|
+
console.log(` URL: ${issue.web_url}`);
|
|
226
|
+
console.log(` State: ${issue.state}`);
|
|
227
|
+
} catch (error) {
|
|
228
|
+
console.error('❌ Failed to create issue:', error instanceof Error ? error.message : String(error));
|
|
229
|
+
process.exit(1);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Run
|
|
234
|
+
main().catch((error) => {
|
|
235
|
+
console.error('❌ Fatal error:', error instanceof Error ? error.message : String(error));
|
|
236
|
+
process.exit(1);
|
|
237
|
+
});
|
|
238
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Create GitLab Issue for Milestone
|
|
5
|
+
* Quick script to create issues via GitLab API
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { readFileSync } from 'fs';
|
|
9
|
+
|
|
10
|
+
const GITLAB_API_URL = process.env.CI_API_V4_URL || 'https://gitlab.com/api/v4';
|
|
11
|
+
const GITLAB_TOKEN = process.env.SERVICE_ACCOUNT_OSSA_TOKEN ||
|
|
12
|
+
process.env.GITLAB_TOKEN ||
|
|
13
|
+
process.env.GITLAB_PUSH_TOKEN || '';
|
|
14
|
+
const PROJECT_ID = process.env.CI_PROJECT_ID || 'blueflyio/openstandardagents';
|
|
15
|
+
|
|
16
|
+
async function createIssue(
|
|
17
|
+
title: string,
|
|
18
|
+
description: string,
|
|
19
|
+
milestoneId: number,
|
|
20
|
+
labels: string[] = []
|
|
21
|
+
) {
|
|
22
|
+
if (!GITLAB_TOKEN) {
|
|
23
|
+
console.error('❌ GITLAB_TOKEN or SERVICE_ACCOUNT_OSSA_TOKEN required');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const projectPath = encodeURIComponent(PROJECT_ID);
|
|
28
|
+
const url = `${GITLAB_API_URL}/projects/${projectPath}/issues`;
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const response = await fetch(url, {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
headers: {
|
|
34
|
+
'PRIVATE-TOKEN': GITLAB_TOKEN,
|
|
35
|
+
'Content-Type': 'application/json',
|
|
36
|
+
},
|
|
37
|
+
body: JSON.stringify({
|
|
38
|
+
title,
|
|
39
|
+
description,
|
|
40
|
+
milestone_id: milestoneId,
|
|
41
|
+
labels: labels.join(','),
|
|
42
|
+
}),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
if (!response.ok) {
|
|
46
|
+
const error = await response.text();
|
|
47
|
+
throw new Error(`Failed to create issue: ${error}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const issue = await response.json();
|
|
51
|
+
console.log(`✅ Issue created: !${issue.iid}`);
|
|
52
|
+
console.log(` URL: ${issue.web_url}`);
|
|
53
|
+
return issue.iid;
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error('❌ Error creating issue:', error);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Main
|
|
61
|
+
const args = process.argv.slice(2);
|
|
62
|
+
if (args.length < 3) {
|
|
63
|
+
console.log('Usage: tsx scripts/create-milestone-issue.ts <title> <milestone-id> <labels> [description-file]');
|
|
64
|
+
console.log('Example: tsx scripts/create-milestone-issue.ts "Enhance bin" 3 "enhancement,cli"');
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const [title, milestoneId, labelsStr, descFile] = args;
|
|
69
|
+
const labels = labelsStr.split(',').map(l => l.trim());
|
|
70
|
+
const description = descFile && readFileSync(descFile, 'utf-8') || '';
|
|
71
|
+
|
|
72
|
+
createIssue(title, description, parseInt(milestoneId), labels);
|
|
73
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const crypto = require('crypto');
|
|
4
|
+
|
|
5
|
+
const eslintResults = JSON.parse(fs.readFileSync(process.argv[2] || 'eslint-report.json', 'utf8'));
|
|
6
|
+
|
|
7
|
+
const codeQualityReport = [];
|
|
8
|
+
|
|
9
|
+
eslintResults.forEach(file => {
|
|
10
|
+
file.messages.forEach(msg => {
|
|
11
|
+
const fingerprint = crypto
|
|
12
|
+
.createHash('md5')
|
|
13
|
+
.update(`${file.filePath}:${msg.line}:${msg.ruleId}`)
|
|
14
|
+
.digest('hex');
|
|
15
|
+
|
|
16
|
+
codeQualityReport.push({
|
|
17
|
+
description: msg.message,
|
|
18
|
+
check_name: msg.ruleId || 'eslint',
|
|
19
|
+
fingerprint,
|
|
20
|
+
severity: msg.severity === 2 ? 'major' : 'minor',
|
|
21
|
+
location: {
|
|
22
|
+
path: file.filePath.replace(process.cwd() + '/', ''),
|
|
23
|
+
lines: {
|
|
24
|
+
begin: msg.line
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
fs.writeFileSync(
|
|
32
|
+
process.argv[3] || 'gl-code-quality-report.json',
|
|
33
|
+
JSON.stringify(codeQualityReport, null, 2)
|
|
34
|
+
);
|