From 5b9f8e0e131d9026d692bbce6ef19ab1ac012328 Mon Sep 17 00:00:00 2001 From: ztimson Date: Wed, 14 Jan 2026 13:14:03 -0500 Subject: [PATCH] Fixed minor bugs and typos --- src/refine.mjs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/refine.mjs b/src/refine.mjs index 477c1a5..9ce3b9c 100644 --- a/src/refine.mjs +++ b/src/refine.mjs @@ -42,7 +42,7 @@ dotenv.config({path: '.env.local', override: true, quiet: true, debug: false}); } // 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'); 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}}, fn: async (args) => { 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', headers: {'Authorization': `token ${auth}`, 'Content-Type': 'application/json'}, body: `{"labels":["${args.label}"]}` @@ -116,11 +116,11 @@ Implementation details, constraints, dependencies, design decisions **MANDATORY STEPS:** 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 -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 -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:** - 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}` }))?.pop()?.content; // 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`, { method: 'POST', headers: {'Authorization': `token ${auth}`, 'Content-Type': 'application/json'},