@tplog/pi-zendy 0.3.2 → 0.3.3
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/extensions/tools.ts +9 -1
- package/package.json +1 -1
package/extensions/tools.ts
CHANGED
|
@@ -48,7 +48,15 @@ function registerZendeskTools(pi: ExtensionAPI): void {
|
|
|
48
48
|
}),
|
|
49
49
|
async execute(_toolCallId: string, params: { query: string }, signal?: AbortSignal) {
|
|
50
50
|
const result = await zendesk.searchTickets(params.query, signal);
|
|
51
|
-
|
|
51
|
+
const lines = [`Zendesk search returned ${result.count} results for "${params.query}":`];
|
|
52
|
+
for (const r of result.results) {
|
|
53
|
+
const id = r.id ?? '?';
|
|
54
|
+
const subject = r.subject ?? '(no subject)';
|
|
55
|
+
const status = r.status ?? '?';
|
|
56
|
+
const created = r.created_at ? String(r.created_at).slice(0, 10) : '';
|
|
57
|
+
lines.push(` #${id} [${status}] ${subject}${created ? ` (${created})` : ''}`);
|
|
58
|
+
}
|
|
59
|
+
return textResult(lines.join('\n'), { results: result.results, count: result.count });
|
|
52
60
|
},
|
|
53
61
|
});
|
|
54
62
|
}
|