4 Commits

Author SHA1 Message Date
5b9f8e0e13 Fixed minor bugs and typos
All checks were successful
Code review / review (pull_request) Successful in 51s
Publish Library / Build NPM Project (push) Successful in 4s
Publish Library / Tag Version (push) Successful in 5s
2026-01-14 13:14:03 -05:00
019b05105a Merge branch 'master' of git.zakscode.com:ztimson/ai-agents into ticket-duplicates
All checks were successful
Publish Library / Build NPM Project (push) Successful in 4s
Publish Library / Tag Version (push) Successful in 16s
Code review / review (pull_request) Successful in 51s
2026-01-14 13:11:07 -05:00
7becf99be2 Update .github/issue_template/ai-refinement.md
All checks were successful
Publish Library / Build NPM Project (push) Successful in 8s
Publish Library / Tag Version (push) Successful in 5s
2026-01-14 12:11:07 -05:00
99a1e55471 Merge pull request 'Check for duplicates before adding tickets' (#12) from ticket-duplicates into master
All checks were successful
Publish Library / Build NPM Project (push) Successful in 6s
Publish Library / Tag Version (push) Successful in 7s
Reviewed-on: #12
2025-12-31 00:02:18 -05:00
2 changed files with 7 additions and 7 deletions

View File

@@ -16,4 +16,4 @@ How can it be fixed or improved?
Steps to reproduce? Steps to reproduce?
Anything other useful information, logs or screenshots? Any other useful information? Logs, screenshots, steps to reproduce?

View File

@@ -42,7 +42,7 @@ dotenv.config({path: '.env.local', override: true, quiet: true, debug: false});
} }
// Gather readme & template // Gather readme & template
let title = '', type = '', labels = [], readme = '', readmeP = path.join(process.cwd(), 'README.md'); let title = '', labels = [], readme = '', readmeP = path.join(process.cwd(), 'README.md');
if(fs.existsSync(readmeP)) readme = fs.readFileSync(readmeP, 'utf-8'); if(fs.existsSync(readmeP)) readme = fs.readFileSync(readmeP, 'utf-8');
const template = p ? fs.readFileSync(p, 'utf-8') : `## Description const template = p ? fs.readFileSync(p, 'utf-8') : `## Description
@@ -105,7 +105,7 @@ Implementation details, constraints, dependencies, design decisions
args: {label: {type: 'string', description: 'Label name', required: true}}, args: {label: {type: 'string', description: 'Label name', required: true}},
fn: async (args) => { fn: async (args) => {
labels.push(args.label); labels.push(args.label);
fetch(`${git}/api/v1/repos/${owner}/${repo}/issues/${ticket}/labels`, { return await fetch(`${git}/api/v1/repos/${owner}/${repo}/issues/${ticket}/labels`, {
method: 'POST', method: 'POST',
headers: {'Authorization': `token ${auth}`, 'Content-Type': 'application/json'}, headers: {'Authorization': `token ${auth}`, 'Content-Type': 'application/json'},
body: `{"labels":["${args.label}"]}` body: `{"labels":["${args.label}"]}`
@@ -116,11 +116,11 @@ Implementation details, constraints, dependencies, design decisions
**MANDATORY STEPS:** **MANDATORY STEPS:**
1. Call \`title\` tool EXACTLY ONCE in format: "[Module] - [Verb] [subject]" (example: Storage - fix file uploads) 1. Call \`title\` tool EXACTLY ONCE in format: "[Module] - [Verb] [subject]" (example: Storage - fix file uploads)
2. Identify one label from each group which best applies to the ticket: ${labelsReq.replace(',', ', ')} 2. Identify one label from each group which best applies to the ticket: ${labelsReq.replaceAll(',', ', ')}
3. Call the \`add_label\` tool ONCE FOR EVERY LABEL identified in the previous step 3. Call the \`add_label\` tool ONCE FOR EVERY LABEL identified in the previous step
4. Filter the following labels to any that apply to this ticket: ${labelsOpt.replace(',', ', ')} 4. Filter the following labels to any that apply to this ticket: ${labelsOpt.replaceAll(',', ', ')}
5. Call the \`add_label\` tool ONCE FOR EVERY LABEL identified in the previous step 5. Call the \`add_label\` tool ONCE FOR EVERY LABEL identified in the previous step
6. Output the new ticket description in formated markdown matching the following rules: 6. Output the new ticket description in formatted markdown matching the following rules:
**TEMPLATE RULES:** **TEMPLATE RULES:**
- Use ## headers (match template exactly) - Use ## headers (match template exactly)
@@ -182,7 +182,7 @@ Output ONLY markdown. No explanations, labels, or extra formatting.`});
system: `Your job is to identify duplicates. Respond ONLY with the duplicate's ID number or "NONE" if no match exists\n\n${dupes}` system: `Your job is to identify duplicates. Respond ONLY with the duplicate's ID number or "NONE" if no match exists\n\n${dupes}`
}))?.pop()?.content; }))?.pop()?.content;
// Handle duplicates // Handle duplicates
if(hasDuplicates && hasDuplicates !== 'NONE' && (dupeId = dupeIds.find(id => id === hasDuplicates.trim()))) { if(hasDuplicates && hasDuplicates !== 'NONE' && (dupeId = dupeIds.find(id => id == hasDuplicates.trim()))) {
await fetch(`${git}/api/v1/repos/${owner}/${repo}/issues/${ticket}/comments`, { await fetch(`${git}/api/v1/repos/${owner}/${repo}/issues/${ticket}/comments`, {
method: 'POST', method: 'POST',
headers: {'Authorization': `token ${auth}`, 'Content-Type': 'application/json'}, headers: {'Authorization': `token ${auth}`, 'Content-Type': 'application/json'},