@ztimson/ai-agents 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/refine.mjs +13 -10
package/package.json
CHANGED
package/src/refine.mjs
CHANGED
|
@@ -90,7 +90,7 @@ Implementation details, constraints, dependencies, design decisions
|
|
|
90
90
|
tools: [{
|
|
91
91
|
name: 'title',
|
|
92
92
|
description: 'Set the ticket title, must be called EXACTLY ONCE',
|
|
93
|
-
args: {
|
|
93
|
+
args: {title: {type: 'string', description: 'Ticket title, must match format: Module - Verb noun', required: true}},
|
|
94
94
|
fn: (args) => title = args.title
|
|
95
95
|
}, {
|
|
96
96
|
name: 'type',
|
|
@@ -103,7 +103,7 @@ Implementation details, constraints, dependencies, design decisions
|
|
|
103
103
|
**MANDATORY STEPS:**
|
|
104
104
|
1. Identify ticket type: Bug, DevOps, Document, Enhancement, Refactor, or Security
|
|
105
105
|
2. Call \`type\` tool EXACTLY ONCE with the type from step 1
|
|
106
|
-
3. Call \`title\` tool EXACTLY ONCE in format: "[Module] - [Verb] [subject]"
|
|
106
|
+
3. Call \`title\` tool EXACTLY ONCE in format: "[Module] - [Verb] [subject]" (example: Storage - fix file uploads)
|
|
107
107
|
4. Output formatted markdown matching template structure below
|
|
108
108
|
|
|
109
109
|
**TEMPLATE RULES:**
|
|
@@ -159,14 +159,17 @@ Output ONLY markdown. No explanations, labels, or extra formatting.`});
|
|
|
159
159
|
})
|
|
160
160
|
});
|
|
161
161
|
if(!updateRes.ok) throw new Error(`${updateRes.status} ${await updateRes.text()}`);
|
|
162
|
-
if(type)
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
162
|
+
if(type) {
|
|
163
|
+
const resp = await fetch(`${git}/api/v1/repos/${owner}/${repo}/issues/${ticket}/labels`, {
|
|
164
|
+
method: 'POST',
|
|
165
|
+
headers: {
|
|
166
|
+
'Authorization': `token ${auth}`,
|
|
167
|
+
'Content-Type': 'application/json'
|
|
168
|
+
},
|
|
169
|
+
body: JSON.stringify({labels: [`Kind/${type[0].toUpperCase() + type.slice(1).toLowerCase()}`]})
|
|
170
|
+
});
|
|
171
|
+
if(!resp.ok) throw new Error(`${resp.status} ${await resp.text()}`);
|
|
172
|
+
}
|
|
170
173
|
|
|
171
174
|
console.log(`Title: ${title}\nType: ${type}\nBody:\n${body}`);
|
|
172
175
|
})();
|