Fixing ticket refiner labels
All checks were successful
Publish Library / Build NPM Project (push) Successful in 6s
Publish Library / Tag Version (push) Successful in 4s

This commit is contained in:
2025-12-30 19:35:27 -05:00
parent 3c2d6f7824
commit 078892297e
2 changed files with 13 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@ztimson/ai-agents",
"version": "0.0.5",
"version": "0.0.6",
"description": "AI agents",
"keywords": ["ai", "review"],
"author": "ztimson",

View File

@@ -90,7 +90,7 @@ Implementation details, constraints, dependencies, design decisions
tools: [{
name: 'title',
description: 'Set the ticket title, must be called EXACTLY ONCE',
args: {value: {type: 'string', description: 'Ticket title, must match format: [Module] - [Verb] [noun]', required: true}},
args: {title: {type: 'string', description: 'Ticket title, must match format: [Module] - [Verb] [noun]', required: true}},
fn: (args) => title = args.title
}, {
name: 'type',
@@ -159,14 +159,17 @@ Output ONLY markdown. No explanations, labels, or extra formatting.`});
})
});
if(!updateRes.ok) throw new Error(`${updateRes.status} ${await updateRes.text()}`);
if(type) fetch(`${git}/api/v1/repos/${owner}/${repo}/issues/${ticket}/labels`, {
method: 'POST',
headers: {
'Authorization': `token ${auth}`,
'Content-Type': 'application/json'
},
body: `["Kind/${type[0].toUpperCase() + type.slice(1).toLowerCase()}"]`
})
if(type) {
const resp = await fetch(`${git}/api/v1/repos/${owner}/${repo}/issues/${ticket}/labels`, {
method: 'POST',
headers: {
'Authorization': `token ${auth}`,
'Content-Type': 'application/json'
},
body: JSON.stringify([`Kind/${type[0].toUpperCase() + type.slice(1).toLowerCase()}`])
});
if(!resp.ok) throw new Error(`${resp.status} ${await resp.text()}`);
}
console.log(`Title: ${title}\nType: ${type}\nBody:\n${body}`);
})();