mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-09-27 03:31:48 +02:00
chore: ai inference refresh
This commit is contained in:
@@ -0,0 +1,76 @@
|
|||||||
|
messages:
|
||||||
|
- role: system
|
||||||
|
content: |-
|
||||||
|
You are an issue validation assistant for Donut Browser, an anti-detect browser.
|
||||||
|
|
||||||
|
Analyze the provided issue content and determine if it contains sufficient information based on these requirements:
|
||||||
|
|
||||||
|
For Bug Reports, the issue should include:
|
||||||
|
1. Clear description of the problem
|
||||||
|
2. Steps to reproduce the issue (numbered list preferred)
|
||||||
|
3. Expected vs actual behavior
|
||||||
|
4. Environment information (OS, browser version, etc.)
|
||||||
|
5. Error messages, stack traces, or screenshots if applicable
|
||||||
|
|
||||||
|
For Feature Requests, the issue should include:
|
||||||
|
1. Clear description of the requested feature
|
||||||
|
2. Use case or problem it solves
|
||||||
|
3. Proposed solution or how it should work
|
||||||
|
4. Priority level or importance
|
||||||
|
|
||||||
|
General Requirements for all issues:
|
||||||
|
1. Descriptive title
|
||||||
|
2. Sufficient detail to understand and act upon
|
||||||
|
3. Professional tone and clear communication
|
||||||
|
|
||||||
|
Constraints:
|
||||||
|
- Maximum 3 items in missing_info array
|
||||||
|
- Maximum 3 items in suggestions array
|
||||||
|
- Each array item must be under 80 characters
|
||||||
|
- overall_assessment must be under 100 characters
|
||||||
|
- role: user
|
||||||
|
content: |-
|
||||||
|
## Issue Content to Analyze:
|
||||||
|
|
||||||
|
**Title:** {{issue_title}}
|
||||||
|
|
||||||
|
**Body:**
|
||||||
|
{{issue_body}}
|
||||||
|
|
||||||
|
**Labels:** {{issue_labels}}
|
||||||
|
model: openai/gpt-4.1
|
||||||
|
responseFormat: json_schema
|
||||||
|
jsonSchema: |-
|
||||||
|
{
|
||||||
|
"name": "issue_validation",
|
||||||
|
"strict": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"is_valid": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the issue contains sufficient information"
|
||||||
|
},
|
||||||
|
"issue_type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["bug_report", "feature_request", "other"]
|
||||||
|
},
|
||||||
|
"missing_info": {
|
||||||
|
"type": "array",
|
||||||
|
"items": { "type": "string" },
|
||||||
|
"description": "Missing information items (max 3, each under 80 characters)"
|
||||||
|
},
|
||||||
|
"suggestions": {
|
||||||
|
"type": "array",
|
||||||
|
"items": { "type": "string" },
|
||||||
|
"description": "Suggestions for improvement (max 3, each under 80 characters)"
|
||||||
|
},
|
||||||
|
"overall_assessment": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "One sentence assessment under 100 characters"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["is_valid", "issue_type", "missing_info", "suggestions", "overall_assessment"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
messages:
|
||||||
|
- role: system
|
||||||
|
content: |-
|
||||||
|
You are a code review assistant for Donut Browser, an open-source anti-detect browser built with Tauri, Next.js, and Rust.
|
||||||
|
|
||||||
|
Review the provided pull request and provide constructive feedback. Focus on:
|
||||||
|
1. Code quality and best practices
|
||||||
|
2. Potential bugs or issues
|
||||||
|
3. Security concerns (especially important for an anti-detect browser)
|
||||||
|
4. Performance implications
|
||||||
|
5. Consistency with the project's patterns
|
||||||
|
|
||||||
|
Constraints:
|
||||||
|
- Maximum 4 items in feedback array
|
||||||
|
- Maximum 3 items in suggestions array
|
||||||
|
- Maximum 2 items in security_notes array
|
||||||
|
- Each array item must be under 150 characters
|
||||||
|
- summary must be under 200 characters
|
||||||
|
- Be constructive and helpful, not harsh
|
||||||
|
- role: user
|
||||||
|
content: |-
|
||||||
|
## Pull Request to Review:
|
||||||
|
|
||||||
|
**Title:** {{pr_title}}
|
||||||
|
|
||||||
|
**Description:**
|
||||||
|
{{pr_body}}
|
||||||
|
|
||||||
|
**Diff:**
|
||||||
|
{{pr_diff}}
|
||||||
|
model: openai/gpt-4.1
|
||||||
|
responseFormat: json_schema
|
||||||
|
jsonSchema: |-
|
||||||
|
{
|
||||||
|
"name": "pr_review",
|
||||||
|
"strict": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"summary": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Brief 1-2 sentence summary under 200 characters"
|
||||||
|
},
|
||||||
|
"quality_score": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["good", "needs_work", "critical_issues"]
|
||||||
|
},
|
||||||
|
"feedback": {
|
||||||
|
"type": "array",
|
||||||
|
"items": { "type": "string" },
|
||||||
|
"description": "Feedback points (max 4, each under 150 characters)"
|
||||||
|
},
|
||||||
|
"suggestions": {
|
||||||
|
"type": "array",
|
||||||
|
"items": { "type": "string" },
|
||||||
|
"description": "Suggestions (max 3, each under 150 characters)"
|
||||||
|
},
|
||||||
|
"security_notes": {
|
||||||
|
"type": "array",
|
||||||
|
"items": { "type": "string" },
|
||||||
|
"description": "Security notes if any (max 2, each under 150 characters)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["summary", "quality_score", "feedback", "suggestions", "security_notes"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
messages:
|
||||||
|
- role: system
|
||||||
|
content: |-
|
||||||
|
You are an expert technical writer tasked with generating comprehensive release notes for Donut Browser, a powerful anti-detect browser desktop app built with Tauri + Next.js that helps users manage multiple browser profiles with proxy support.
|
||||||
|
|
||||||
|
Guidelines:
|
||||||
|
- Use clear, user-friendly language
|
||||||
|
- Group related commits logically
|
||||||
|
- Omit minor commits like formatting, typos unless significant
|
||||||
|
- Focus on user-facing changes
|
||||||
|
- Use emojis sparingly and consistently
|
||||||
|
- Keep descriptions concise but informative
|
||||||
|
- If commits are unclear, infer the purpose from the context
|
||||||
|
- Only include sections that have relevant changes
|
||||||
|
- role: user
|
||||||
|
content: |-
|
||||||
|
Generate release notes for version {{version}} based on these commits:
|
||||||
|
|
||||||
|
{{commits}}
|
||||||
|
|
||||||
|
Use this format:
|
||||||
|
|
||||||
|
## What's New in {{version}}
|
||||||
|
|
||||||
|
[Brief 1-2 sentence overview]
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
### Bug Fixes
|
||||||
|
### Improvements
|
||||||
|
### Documentation
|
||||||
|
### Dependencies
|
||||||
|
### Developer Experience
|
||||||
|
model: openai/gpt-4.1
|
||||||
@@ -26,81 +26,22 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
|
||||||
|
|
||||||
- name: Get issue templates
|
- name: Save issue body to file
|
||||||
id: get-templates
|
|
||||||
run: |
|
|
||||||
if [ -f ".github/ISSUE_TEMPLATE/01-bug-report.md" ]; then
|
|
||||||
echo "bug-template-exists=true" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f ".github/ISSUE_TEMPLATE/02-feature-request.md" ]; then
|
|
||||||
echo "feature-template-exists=true" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Create issue analysis prompt
|
|
||||||
id: create-prompt
|
|
||||||
env:
|
env:
|
||||||
ISSUE_TITLE: ${{ github.event.issue.title }}
|
|
||||||
ISSUE_BODY: ${{ github.event.issue.body }}
|
ISSUE_BODY: ${{ github.event.issue.body }}
|
||||||
ISSUE_LABELS: ${{ join(github.event.issue.labels.*.name, ', ') }}
|
run: printf '%s' "${ISSUE_BODY:-}" > issue_body.txt
|
||||||
run: |
|
|
||||||
cat > issue_analysis.txt << EOF
|
|
||||||
## Issue Content to Analyze:
|
|
||||||
|
|
||||||
**Title:** $ISSUE_TITLE
|
|
||||||
|
|
||||||
**Body:**
|
|
||||||
$ISSUE_BODY
|
|
||||||
|
|
||||||
**Labels:** $ISSUE_LABELS
|
|
||||||
EOF
|
|
||||||
|
|
||||||
- name: Validate issue with AI
|
- name: Validate issue with AI
|
||||||
id: validate
|
id: validate
|
||||||
uses: actions/ai-inference@a380166897b5408b8fb7dddd148142794cb5624a # v2.0.6
|
uses: actions/ai-inference@a380166897b5408b8fb7dddd148142794cb5624a # v2.0.6
|
||||||
with:
|
with:
|
||||||
prompt-file: issue_analysis.txt
|
prompt-file: .github/prompts/issue-validation.prompt.yml
|
||||||
system-prompt: |
|
input: |
|
||||||
You are an issue validation assistant for Donut Browser, an anti-detect browser.
|
issue_title: ${{ github.event.issue.title }}
|
||||||
|
issue_labels: ${{ join(github.event.issue.labels.*.name, ', ') }}
|
||||||
Analyze the provided issue content and determine if it contains sufficient information based on these requirements:
|
file_input: |
|
||||||
|
issue_body: ./issue_body.txt
|
||||||
**For Bug Reports, the issue should include:**
|
max-tokens: 1024
|
||||||
1. Clear description of the problem
|
|
||||||
2. Steps to reproduce the issue (numbered list preferred)
|
|
||||||
3. Expected vs actual behavior
|
|
||||||
4. Environment information (OS, browser version, etc.)
|
|
||||||
5. Error messages, stack traces, or screenshots if applicable
|
|
||||||
|
|
||||||
**For Feature Requests, the issue should include:**
|
|
||||||
1. Clear description of the requested feature
|
|
||||||
2. Use case or problem it solves
|
|
||||||
3. Proposed solution or how it should work
|
|
||||||
4. Priority level or importance
|
|
||||||
|
|
||||||
**General Requirements for all issues:**
|
|
||||||
1. Descriptive title
|
|
||||||
2. Sufficient detail to understand and act upon
|
|
||||||
3. Professional tone and clear communication
|
|
||||||
|
|
||||||
Respond ONLY with valid JSON (no markdown fences). Keep responses concise.
|
|
||||||
|
|
||||||
JSON structure:
|
|
||||||
{
|
|
||||||
"is_valid": true|false,
|
|
||||||
"issue_type": "bug_report"|"feature_request"|"other",
|
|
||||||
"missing_info": ["item1", "item2"],
|
|
||||||
"suggestions": ["suggestion1", "suggestion2"],
|
|
||||||
"overall_assessment": "One sentence assessment"
|
|
||||||
}
|
|
||||||
|
|
||||||
IMPORTANT CONSTRAINTS:
|
|
||||||
- Maximum 3 items in missing_info array
|
|
||||||
- Maximum 3 items in suggestions array
|
|
||||||
- Each array item must be under 80 characters
|
|
||||||
- overall_assessment must be under 100 characters
|
|
||||||
- Output ONLY the JSON object, nothing else
|
|
||||||
model: gpt-5-mini
|
|
||||||
|
|
||||||
- name: Check if first-time contributor
|
- name: Check if first-time contributor
|
||||||
id: check-first-time
|
id: check-first-time
|
||||||
@@ -210,7 +151,7 @@ jobs:
|
|||||||
model: zai-coding-plan/glm-4.7
|
model: zai-coding-plan/glm-4.7
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
run: rm -f issue_analysis.txt comment.md
|
run: rm -f issue_body.txt comment.md
|
||||||
|
|
||||||
handle-pr:
|
handle-pr:
|
||||||
if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
|
if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
|
||||||
@@ -245,54 +186,22 @@ jobs:
|
|||||||
gh pr diff ${{ github.event.pull_request.number }} > pr_diff.txt
|
gh pr diff ${{ github.event.pull_request.number }} > pr_diff.txt
|
||||||
head -c 10000 pr_diff.txt > pr_diff_truncated.txt
|
head -c 10000 pr_diff.txt > pr_diff_truncated.txt
|
||||||
|
|
||||||
- name: Create PR analysis prompt
|
- name: Save PR body to file
|
||||||
env:
|
env:
|
||||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
||||||
PR_BODY: ${{ github.event.pull_request.body }}
|
PR_BODY: ${{ github.event.pull_request.body }}
|
||||||
run: |
|
run: printf '%s' "${PR_BODY:-No description provided}" > pr_body.txt
|
||||||
{
|
|
||||||
printf "## Pull Request to Review:\n\n"
|
|
||||||
printf "**Title:** %s\n\n" "$PR_TITLE"
|
|
||||||
printf "**Description:**\n%s\n\n" "$PR_BODY"
|
|
||||||
printf "**Diff:**\n"
|
|
||||||
cat pr_diff_truncated.txt
|
|
||||||
} > pr_analysis.txt
|
|
||||||
|
|
||||||
- name: Analyze PR with AI
|
- name: Analyze PR with AI
|
||||||
id: analyze
|
id: analyze
|
||||||
uses: actions/ai-inference@a380166897b5408b8fb7dddd148142794cb5624a # v2.0.6
|
uses: actions/ai-inference@a380166897b5408b8fb7dddd148142794cb5624a # v2.0.6
|
||||||
with:
|
with:
|
||||||
prompt-file: pr_analysis.txt
|
prompt-file: .github/prompts/pr-review.prompt.yml
|
||||||
system-prompt: |
|
input: |
|
||||||
You are a code review assistant for Donut Browser, an open-source anti-detect browser built with Tauri, Next.js, and Rust.
|
pr_title: ${{ github.event.pull_request.title }}
|
||||||
|
file_input: |
|
||||||
Review the provided pull request and provide constructive feedback. Focus on:
|
pr_body: ./pr_body.txt
|
||||||
1. Code quality and best practices
|
pr_diff: ./pr_diff_truncated.txt
|
||||||
2. Potential bugs or issues
|
max-tokens: 1024
|
||||||
3. Security concerns (especially important for an anti-detect browser)
|
|
||||||
4. Performance implications
|
|
||||||
5. Consistency with the project's patterns
|
|
||||||
|
|
||||||
Respond ONLY with valid JSON (no markdown fences).
|
|
||||||
|
|
||||||
JSON structure:
|
|
||||||
{
|
|
||||||
"summary": "Brief 1-2 sentence summary of what this PR does",
|
|
||||||
"quality_score": "good"|"needs_work"|"critical_issues",
|
|
||||||
"feedback": ["feedback point 1", "feedback point 2"],
|
|
||||||
"suggestions": ["suggestion 1", "suggestion 2"],
|
|
||||||
"security_notes": ["security note if any"] or []
|
|
||||||
}
|
|
||||||
|
|
||||||
IMPORTANT CONSTRAINTS:
|
|
||||||
- Maximum 4 items in feedback array
|
|
||||||
- Maximum 3 items in suggestions array
|
|
||||||
- Maximum 2 items in security_notes array
|
|
||||||
- Each array item must be under 150 characters
|
|
||||||
- summary must be under 200 characters
|
|
||||||
- Be constructive and helpful, not harsh
|
|
||||||
- Output ONLY the JSON object, nothing else
|
|
||||||
model: gpt-5-mini
|
|
||||||
|
|
||||||
- name: Post PR feedback comment
|
- name: Post PR feedback comment
|
||||||
env:
|
env:
|
||||||
@@ -371,7 +280,7 @@ jobs:
|
|||||||
model: zai-coding-plan/glm-4.7
|
model: zai-coding-plan/glm-4.7
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
run: rm -f pr_diff.txt pr_diff_truncated.txt pr_analysis.txt comment.md
|
run: rm -f pr_diff.txt pr_diff_truncated.txt pr_body.txt comment.md
|
||||||
|
|
||||||
opencode-command:
|
opencode-command:
|
||||||
if: |
|
if: |
|
||||||
|
|||||||
@@ -84,45 +84,12 @@ jobs:
|
|||||||
if: steps.get-release.outputs.is-prerelease == 'false'
|
if: steps.get-release.outputs.is-prerelease == 'false'
|
||||||
uses: actions/ai-inference@a380166897b5408b8fb7dddd148142794cb5624a # v2.0.6
|
uses: actions/ai-inference@a380166897b5408b8fb7dddd148142794cb5624a # v2.0.6
|
||||||
with:
|
with:
|
||||||
prompt-file: commits.txt
|
prompt-file: .github/prompts/release-notes.prompt.yml
|
||||||
system-prompt: |
|
input: |
|
||||||
You are an expert technical writer tasked with generating comprehensive release notes for Donut Browser, a powerful anti-detect browser.
|
version: ${{ steps.get-previous-tag.outputs.current-tag }}
|
||||||
|
file_input: |
|
||||||
Analyze the provided commit messages and generate well-structured release notes following this format:
|
commits: ./commits.txt
|
||||||
|
max-tokens: 4096
|
||||||
## What's New in ${{ steps.get-previous-tag.outputs.current-tag }}
|
|
||||||
|
|
||||||
[Brief 1-2 sentence overview of the release]
|
|
||||||
|
|
||||||
### ✨ New Features
|
|
||||||
[List new features with brief descriptions]
|
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
|
||||||
[List bug fixes]
|
|
||||||
|
|
||||||
### 🔧 Improvements
|
|
||||||
[List improvements and enhancements]
|
|
||||||
|
|
||||||
### 📚 Documentation
|
|
||||||
[List documentation updates if any]
|
|
||||||
|
|
||||||
### 🔄 Dependencies
|
|
||||||
[List dependency updates if any]
|
|
||||||
|
|
||||||
### 🛠️ Developer Experience
|
|
||||||
[List development-related changes if any]
|
|
||||||
|
|
||||||
Guidelines:
|
|
||||||
- Use clear, user-friendly language
|
|
||||||
- Group related commits logically
|
|
||||||
- Omit minor commits like formatting, typos unless significant
|
|
||||||
- Focus on user-facing changes
|
|
||||||
- Use emojis sparingly and consistently
|
|
||||||
- Keep descriptions concise but informative
|
|
||||||
- If commits are unclear, infer the purpose from the context
|
|
||||||
|
|
||||||
The application is a desktop app built with Tauri + Next.js that helps users manage multiple browser profiles with proxy support.
|
|
||||||
model: gpt-5-mini
|
|
||||||
|
|
||||||
- name: Update release with generated notes
|
- name: Update release with generated notes
|
||||||
if: steps.get-release.outputs.is-prerelease == 'false'
|
if: steps.get-release.outputs.is-prerelease == 'false'
|
||||||
|
|||||||
Reference in New Issue
Block a user