@verygoodplugins/mcp-freescout 1.1.0 → 1.1.1
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/README.md +88 -15
- package/dist/freescout-api.d.ts +4 -0
- package/dist/freescout-api.d.ts.map +1 -1
- package/dist/freescout-api.js +80 -1
- package/dist/freescout-api.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -160,6 +160,8 @@ Analyze a ticket to determine issue type, root cause, and suggested solutions.
|
|
|
160
160
|
- Root cause analysis
|
|
161
161
|
- Bug vs feature request vs third-party issue determination
|
|
162
162
|
|
|
163
|
+
<img width="570" height="691" alt="image" src="https://github.com/user-attachments/assets/19080021-1f29-45a4-8601-556b55d379c3" />
|
|
164
|
+
|
|
163
165
|
#### `freescout_add_note`
|
|
164
166
|
Add an internal note to a ticket for team communication.
|
|
165
167
|
|
|
@@ -168,8 +170,6 @@ Add an internal note to a ticket for team communication.
|
|
|
168
170
|
- `note` (required): The note content
|
|
169
171
|
- `userId` (optional): User ID for the note (defaults to env setting)
|
|
170
172
|
|
|
171
|
-
<img width="570" height="691" alt="image" src="https://github.com/user-attachments/assets/19080021-1f29-45a4-8601-556b55d379c3" />
|
|
172
|
-
|
|
173
173
|
#### `freescout_update_ticket`
|
|
174
174
|
Update ticket status and/or assignment.
|
|
175
175
|
|
|
@@ -178,15 +178,42 @@ Update ticket status and/or assignment.
|
|
|
178
178
|
- `status` (optional): New status ('active', 'pending', 'closed', 'spam')
|
|
179
179
|
- `assignTo` (optional): User ID to assign the ticket to
|
|
180
180
|
|
|
181
|
-
#### `
|
|
182
|
-
|
|
181
|
+
#### `freescout_create_draft_reply`
|
|
182
|
+
Create a draft reply in FreeScout that can be edited before sending. This tool lets the LLM generate the reply content and saves it directly to FreeScout as a draft. **Automatically converts Markdown formatting to HTML** for proper display in FreeScout.
|
|
183
183
|
|
|
184
184
|
**Parameters:**
|
|
185
185
|
- `ticket` (required): Ticket ID, number, or FreeScout URL
|
|
186
|
-
- `
|
|
187
|
-
- `
|
|
186
|
+
- `replyText` (required): The draft reply content (generated by the LLM, supports Markdown formatting)
|
|
187
|
+
- `userId` (optional): User ID creating the draft (defaults to env setting)
|
|
188
|
+
|
|
189
|
+
**Markdown Support:**
|
|
190
|
+
- **Bold text**: `**text**` or `__text__` → **text**
|
|
191
|
+
- *Italic text*: `*text*` or `_text_` → *text*
|
|
192
|
+
- `Code`: `` `code` `` → `code`
|
|
193
|
+
- Numbered lists: `1. item` → proper ordered lists
|
|
194
|
+
- Bullet lists: `- item` or `* item` → proper unordered lists
|
|
195
|
+
- Line breaks: Double newlines create paragraphs, single newlines create line breaks
|
|
188
196
|
|
|
189
|
-
|
|
197
|
+
**Workflow:**
|
|
198
|
+
1. Use `freescout_get_ticket_context` to get customer info and ticket details
|
|
199
|
+
2. Let the LLM craft a personalized reply using Markdown formatting
|
|
200
|
+
3. Use `freescout_create_draft_reply` to save the draft in FreeScout (Markdown automatically converted to HTML)
|
|
201
|
+
4. Review and edit the draft in FreeScout before sending
|
|
202
|
+
|
|
203
|
+
<img width="572" height="522" alt="image" src="https://github.com/user-attachments/assets/a4f9eb6c-3204-4744-8aed-8d16d7c7641c" />
|
|
204
|
+
|
|
205
|
+
#### `freescout_get_ticket_context`
|
|
206
|
+
Get ticket context and customer information to help craft personalized replies.
|
|
207
|
+
|
|
208
|
+
**Parameters:**
|
|
209
|
+
- `ticket` (required): Ticket ID, number, or FreeScout URL
|
|
210
|
+
|
|
211
|
+
**Returns:**
|
|
212
|
+
- Customer name and email
|
|
213
|
+
- Ticket subject and status
|
|
214
|
+
- Issue description and analysis
|
|
215
|
+
- Recent customer and team messages
|
|
216
|
+
- Analysis results (bug vs feature vs third-party issue)
|
|
190
217
|
|
|
191
218
|
#### `freescout_search_tickets`
|
|
192
219
|
Search for tickets across your FreeScout instance.
|
|
@@ -280,19 +307,33 @@ Fixes the validation error reported in the checkout process.
|
|
|
280
307
|
ticketId: '12345' // Automatically adds FreeScout link to PR
|
|
281
308
|
});
|
|
282
309
|
|
|
283
|
-
// 3.
|
|
284
|
-
const
|
|
285
|
-
ticket: '12345'
|
|
286
|
-
fixDescription: 'Fixed the validation error in the checkout process'
|
|
310
|
+
// 3. Get ticket context to craft a personalized reply
|
|
311
|
+
const context = await mcp.callTool('freescout_get_ticket_context', {
|
|
312
|
+
ticket: '12345'
|
|
287
313
|
});
|
|
288
314
|
|
|
289
|
-
// 4.
|
|
290
|
-
await mcp.callTool('
|
|
315
|
+
// 4. Create a draft reply directly in FreeScout (LLM generates the content with Markdown)
|
|
316
|
+
await mcp.callTool('freescout_create_draft_reply', {
|
|
291
317
|
ticket: '12345',
|
|
292
|
-
|
|
318
|
+
replyText: `Hi ${context.customer.name},
|
|
319
|
+
|
|
320
|
+
Thank you for working through that validation issue with us! Your detailed report was really helpful.
|
|
321
|
+
|
|
322
|
+
I've just implemented a fix that addresses the checkout validation error you experienced. The fix includes:
|
|
323
|
+
|
|
324
|
+
1. **Improved validation logic** in the checkout process
|
|
325
|
+
2. **Better error handling** for edge cases
|
|
326
|
+
3. **Additional safeguards** to prevent similar issues
|
|
327
|
+
|
|
328
|
+
The fix has been submitted for review and will be included in the next plugin update. You'll receive the update through WordPress's automatic update system.
|
|
329
|
+
|
|
330
|
+
Thanks again for your patience and for helping us improve the plugin!
|
|
331
|
+
|
|
332
|
+
Best regards,
|
|
333
|
+
[Your name]`
|
|
293
334
|
});
|
|
294
335
|
|
|
295
|
-
// 5. Update ticket status and assignment
|
|
336
|
+
// 5. Update ticket status and assignment
|
|
296
337
|
await mcp.callTool('freescout_update_ticket', {
|
|
297
338
|
ticket: '12345',
|
|
298
339
|
status: 'active',
|
|
@@ -305,6 +346,38 @@ await mcp.callTool('git_remove_worktree', {
|
|
|
305
346
|
});
|
|
306
347
|
```
|
|
307
348
|
|
|
349
|
+
### Draft Reply Workflow
|
|
350
|
+
```javascript
|
|
351
|
+
// 1. Get ticket context for personalized reply
|
|
352
|
+
const context = await mcp.callTool('freescout_get_ticket_context', {
|
|
353
|
+
ticket: '34811'
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
// 2. Create draft reply in FreeScout (LLM crafts the content)
|
|
357
|
+
await mcp.callTool('freescout_create_draft_reply', {
|
|
358
|
+
ticket: '34811',
|
|
359
|
+
replyText: `Hi ${context.customer.name},
|
|
360
|
+
|
|
361
|
+
Thank you for reporting the HighLevel OAuth authorization issue! Your experience with the EngageBay LiveChat plugin conflict has been really valuable.
|
|
362
|
+
|
|
363
|
+
Based on what we learned from your case, I've added a new plugin conflict detection system to WP Fusion. In the next update (v3.46.7), users will see:
|
|
364
|
+
|
|
365
|
+
🔍 **Plugin Conflict Detection**
|
|
366
|
+
- Automatic detection of known conflicting plugins
|
|
367
|
+
- Warning messages before HighLevel authorization
|
|
368
|
+
- Clear guidance when conflicts are detected
|
|
369
|
+
|
|
370
|
+
This should prevent the confusion you experienced and help other users avoid similar issues.
|
|
371
|
+
|
|
372
|
+
The update should be available within the next few weeks. Thanks for your patience and for helping us improve the plugin!
|
|
373
|
+
|
|
374
|
+
Best regards,
|
|
375
|
+
Jack`
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
// The draft is now saved in FreeScout and can be reviewed/edited before sending
|
|
379
|
+
```
|
|
380
|
+
|
|
308
381
|
### Handling Non-Bug Issues
|
|
309
382
|
```javascript
|
|
310
383
|
// For third-party issues or feature requests
|
package/dist/freescout-api.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ export declare class FreeScoutAPI {
|
|
|
3
3
|
private baseUrl;
|
|
4
4
|
private apiKey;
|
|
5
5
|
constructor(baseUrl: string, apiKey: string);
|
|
6
|
+
/**
|
|
7
|
+
* Convert Markdown formatting to HTML for FreeScout
|
|
8
|
+
*/
|
|
9
|
+
private markdownToHtml;
|
|
6
10
|
private request;
|
|
7
11
|
getConversation(ticketId: string, includeThreads?: boolean): Promise<FreeScoutConversation>;
|
|
8
12
|
addThread(ticketId: string, type: 'note' | 'message' | 'customer', text: string, userId?: number, state?: 'draft' | 'published'): Promise<FreeScoutThread>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"freescout-api.d.ts","sourceRoot":"","sources":["../src/freescout-api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"freescout-api.d.ts","sourceRoot":"","sources":["../src/freescout-api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAK3C;;OAEG;IACH,OAAO,CAAC,cAAc;YAqFR,OAAO;IA6Bf,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,OAAc,GAC7B,OAAO,CAAC,qBAAqB,CAAC;IAO3B,SAAS,CACb,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,EACrC,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,OAAO,GAAG,WAAW,GAC5B,OAAO,CAAC,eAAe,CAAC;IAqBrB,gBAAgB,CACpB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,eAAe,CAAC;IAMrB,kBAAkB,CACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;QACP,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;QAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GACA,OAAO,CAAC,qBAAqB,CAAC;IAQ3B,mBAAmB,CACvB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;IAUvD,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAQlD,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAoBxC"}
|
package/dist/freescout-api.js
CHANGED
|
@@ -6,6 +6,83 @@ export class FreeScoutAPI {
|
|
|
6
6
|
this.baseUrl = baseUrl.replace(/\/$/, ''); // Remove trailing slash
|
|
7
7
|
this.apiKey = apiKey;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Convert Markdown formatting to HTML for FreeScout
|
|
11
|
+
*/
|
|
12
|
+
markdownToHtml(text) {
|
|
13
|
+
let html = text;
|
|
14
|
+
// Convert bold text: **text** or __text__ -> <strong>text</strong>
|
|
15
|
+
html = html.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
|
|
16
|
+
html = html.replace(/__(.*?)__/g, '<strong>$1</strong>');
|
|
17
|
+
// Convert italic text: *text* or _text_ -> <em>text</em> (but not if already in bold)
|
|
18
|
+
html = html.replace(/(?<!\*)\*([^*]+)\*(?!\*)/g, '<em>$1</em>');
|
|
19
|
+
html = html.replace(/(?<!_)_([^_]+)_(?!_)/g, '<em>$1</em>');
|
|
20
|
+
// Convert code: `text` -> <code>text</code>
|
|
21
|
+
html = html.replace(/`(.*?)`/g, '<code>$1</code>');
|
|
22
|
+
// Handle numbered lists
|
|
23
|
+
const lines = html.split('\n');
|
|
24
|
+
const processedLines = [];
|
|
25
|
+
let inOrderedList = false;
|
|
26
|
+
let inUnorderedList = false;
|
|
27
|
+
for (let i = 0; i < lines.length; i++) {
|
|
28
|
+
const line = lines[i].trim();
|
|
29
|
+
// Check for numbered list items
|
|
30
|
+
if (/^\d+\.\s+/.test(line)) {
|
|
31
|
+
if (!inOrderedList) {
|
|
32
|
+
if (inUnorderedList) {
|
|
33
|
+
processedLines.push('</ul>');
|
|
34
|
+
inUnorderedList = false;
|
|
35
|
+
}
|
|
36
|
+
processedLines.push('<ol>');
|
|
37
|
+
inOrderedList = true;
|
|
38
|
+
}
|
|
39
|
+
const content = line.replace(/^\d+\.\s+/, '');
|
|
40
|
+
processedLines.push(`<li>${content}</li>`);
|
|
41
|
+
}
|
|
42
|
+
// Check for bullet list items
|
|
43
|
+
else if (/^[-*]\s+/.test(line)) {
|
|
44
|
+
if (!inUnorderedList) {
|
|
45
|
+
if (inOrderedList) {
|
|
46
|
+
processedLines.push('</ol>');
|
|
47
|
+
inOrderedList = false;
|
|
48
|
+
}
|
|
49
|
+
processedLines.push('<ul>');
|
|
50
|
+
inUnorderedList = true;
|
|
51
|
+
}
|
|
52
|
+
const content = line.replace(/^[-*]\s+/, '');
|
|
53
|
+
processedLines.push(`<li>${content}</li>`);
|
|
54
|
+
}
|
|
55
|
+
// Regular line
|
|
56
|
+
else {
|
|
57
|
+
if (inOrderedList) {
|
|
58
|
+
processedLines.push('</ol>');
|
|
59
|
+
inOrderedList = false;
|
|
60
|
+
}
|
|
61
|
+
if (inUnorderedList) {
|
|
62
|
+
processedLines.push('</ul>');
|
|
63
|
+
inUnorderedList = false;
|
|
64
|
+
}
|
|
65
|
+
processedLines.push(line);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Close any remaining lists
|
|
69
|
+
if (inOrderedList)
|
|
70
|
+
processedLines.push('</ol>');
|
|
71
|
+
if (inUnorderedList)
|
|
72
|
+
processedLines.push('</ul>');
|
|
73
|
+
html = processedLines.join('\n');
|
|
74
|
+
// Convert line breaks: double newlines -> paragraph breaks, single newlines -> <br>
|
|
75
|
+
html = html.replace(/\n\n+/g, '</p>\n\n<p>');
|
|
76
|
+
html = html.replace(/\n/g, '<br>\n');
|
|
77
|
+
// Wrap content in paragraphs, but don't wrap lists
|
|
78
|
+
html = html.replace(/^(?!<[uo]l>|<\/[uo]l>|<li>)/gm, '<p>')
|
|
79
|
+
.replace(/(?<!<\/li>)$/gm, '</p>');
|
|
80
|
+
// Clean up paragraph tags around lists
|
|
81
|
+
html = html.replace(/<p>(<[uo]l>)/g, '$1');
|
|
82
|
+
html = html.replace(/(<\/[uo]l>)<\/p>/g, '$1');
|
|
83
|
+
html = html.replace(/<p><\/p>/g, '');
|
|
84
|
+
return html;
|
|
85
|
+
}
|
|
9
86
|
async request(path, method = 'GET', body) {
|
|
10
87
|
const url = `${this.baseUrl}/api${path}`;
|
|
11
88
|
const headers = {
|
|
@@ -43,7 +120,9 @@ export class FreeScoutAPI {
|
|
|
43
120
|
return this.request(`/conversations/${ticketId}/threads`, 'POST', body);
|
|
44
121
|
}
|
|
45
122
|
async createDraftReply(ticketId, text, userId) {
|
|
46
|
-
|
|
123
|
+
// Convert Markdown formatting to HTML for proper display in FreeScout
|
|
124
|
+
const htmlText = this.markdownToHtml(text);
|
|
125
|
+
return this.addThread(ticketId, 'message', htmlText, userId, 'draft');
|
|
47
126
|
}
|
|
48
127
|
async updateConversation(ticketId, updates) {
|
|
49
128
|
return this.request(`/conversations/${ticketId}`, 'PUT', updates);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"freescout-api.js","sourceRoot":"","sources":["../src/freescout-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAO/B,MAAM,OAAO,YAAY;IACf,OAAO,CAAS;IAChB,MAAM,CAAS;IAEvB,YAAY,OAAe,EAAE,MAAc;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB;QACnE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CA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