| 1 | import type { TextGenerationPolicy } from "@t3tools/provider-core/server/textGenerationPolicy"; |
| 2 | |
| 3 | export const conventionalCommitsTextGenerationPolicy: TextGenerationPolicy = { |
| 4 | kind: "conventional_commits", |
| 5 | commitInstructions: |
| 6 | "Use Conventional Commits when generating commit subjects. Prefer the narrowest accurate type and include a scope only when it is obvious from the diff.", |
| 7 | changeRequestInstructions: |
| 8 | "Keep the change request title concise. Do not force Conventional Commit syntax into the title unless the repository already uses it.", |
| 9 | inferRepositoryConventions: false, |
| 10 | }; |
| 11 | |
| 12 | export const repositoryConventionsTextGenerationPolicy: TextGenerationPolicy = { |
| 13 | kind: "repo_conventions", |
| 14 | commitInstructions: |
| 15 | "Follow the repository's established commit message style when examples are available.", |
| 16 | changeRequestInstructions: |
| 17 | "Follow the repository's established change request title and body style when examples are available.", |
| 18 | inferRepositoryConventions: true, |
| 19 | }; |
| 20 | |
| 21 | export const customTextGenerationPolicy = ( |
| 22 | overrides: Omit<Partial<TextGenerationPolicy>, "kind">, |
| 23 | ): TextGenerationPolicy => ({ |
| 24 | kind: "custom", |
| 25 | inferRepositoryConventions: false, |
| 26 | ...overrides, |
| 27 | }); |