fa-mcp-sdk 0.4.36 → 0.4.37
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.
|
@@ -119,8 +119,11 @@
|
|
|
119
119
|
<section class="config-section">
|
|
120
120
|
<div class="form-group">
|
|
121
121
|
<div class="prompt-label-row">
|
|
122
|
-
<label for="systemPrompt">Agent Prompt</label>
|
|
122
|
+
<label for="systemPrompt">Agent Prompt<span class="prompt-modified-badge" id="promptModifiedBadge" style="display:none">(modified)</span></label>
|
|
123
123
|
<div class="prompt-actions">
|
|
124
|
+
<button type="button" class="btn-view-original" id="btnViewOriginalPrompt" title="View original agent prompt" data-testid="at-system-prompt-view-original" style="display:none">
|
|
125
|
+
<span class="material-icons-round">visibility</span>
|
|
126
|
+
</button>
|
|
124
127
|
<button type="button" class="btn-reset-prompt" id="btnResetAgentPrompt" title="Reset to original agent prompt" data-testid="at-system-prompt-reset" style="display:none">
|
|
125
128
|
<span class="material-icons-round">restart_alt</span>
|
|
126
129
|
</button>
|
|
@@ -398,6 +398,8 @@ class McpAgentTester {
|
|
|
398
398
|
this.systemPromptTextarea = document.getElementById('systemPrompt');
|
|
399
399
|
this.customPromptTextarea = document.getElementById('customPrompt');
|
|
400
400
|
this.btnResetAgentPrompt = document.getElementById('btnResetAgentPrompt');
|
|
401
|
+
this.btnViewOriginalPrompt = document.getElementById('btnViewOriginalPrompt');
|
|
402
|
+
this.promptModifiedBadge = document.getElementById('promptModifiedBadge');
|
|
401
403
|
this.originalAgentPrompt = null;
|
|
402
404
|
|
|
403
405
|
this.connectedServersContainer = document.getElementById('connectedServers');
|
|
@@ -442,9 +444,13 @@ class McpAgentTester {
|
|
|
442
444
|
this.serverUrlDropdown.addEventListener('click', (e) => this.toggleUrlDropdown(e));
|
|
443
445
|
document.addEventListener('click', (e) => this.handleClickOutside(e));
|
|
444
446
|
|
|
445
|
-
this.systemPromptTextarea.addEventListener('input', () =>
|
|
447
|
+
this.systemPromptTextarea.addEventListener('input', () => {
|
|
448
|
+
this.saveFormValuesToStorage();
|
|
449
|
+
this.updatePromptModifiedState();
|
|
450
|
+
});
|
|
446
451
|
this.customPromptTextarea.addEventListener('input', () => this.saveFormValuesToStorage());
|
|
447
452
|
this.btnResetAgentPrompt.addEventListener('click', () => this.resetAgentPrompt());
|
|
453
|
+
this.btnViewOriginalPrompt.addEventListener('click', () => this.viewOriginalPrompt());
|
|
448
454
|
|
|
449
455
|
// LLM settings modal
|
|
450
456
|
this.llmSettingsBtn.addEventListener('click', () => this.openLlmModal());
|
|
@@ -532,7 +538,15 @@ class McpAgentTester {
|
|
|
532
538
|
}
|
|
533
539
|
|
|
534
540
|
closePromptModal () {
|
|
535
|
-
document.getElementById('promptModal')
|
|
541
|
+
const modal = document.getElementById('promptModal');
|
|
542
|
+
const textarea = document.getElementById('promptModalTextarea');
|
|
543
|
+
const saveBtn = document.getElementById('promptModalSave');
|
|
544
|
+
modal.style.display = 'none';
|
|
545
|
+
if (this._viewOriginalMode) {
|
|
546
|
+
textarea.readOnly = false;
|
|
547
|
+
saveBtn.style.display = '';
|
|
548
|
+
this._viewOriginalMode = false;
|
|
549
|
+
}
|
|
536
550
|
this._promptModalTarget = null;
|
|
537
551
|
}
|
|
538
552
|
|
|
@@ -1693,11 +1707,41 @@ class McpAgentTester {
|
|
|
1693
1707
|
this.systemPromptTextarea.value = this.originalAgentPrompt;
|
|
1694
1708
|
this.currentSystemPrompt = this.originalAgentPrompt;
|
|
1695
1709
|
this.saveFormValuesToStorage();
|
|
1710
|
+
this.updatePromptModifiedState();
|
|
1696
1711
|
}
|
|
1697
1712
|
}
|
|
1698
1713
|
|
|
1714
|
+
viewOriginalPrompt () {
|
|
1715
|
+
if (!this.originalAgentPrompt) { return; }
|
|
1716
|
+
const modal = document.getElementById('promptModal');
|
|
1717
|
+
const textarea = document.getElementById('promptModalTextarea');
|
|
1718
|
+
const title = document.getElementById('promptModalTitle');
|
|
1719
|
+
const saveBtn = document.getElementById('promptModalSave');
|
|
1720
|
+
title.textContent = 'Original Agent Prompt';
|
|
1721
|
+
textarea.value = this.originalAgentPrompt;
|
|
1722
|
+
textarea.readOnly = true;
|
|
1723
|
+
saveBtn.style.display = 'none';
|
|
1724
|
+
this._promptModalTarget = null;
|
|
1725
|
+
this._viewOriginalMode = true;
|
|
1726
|
+
modal.style.display = 'flex';
|
|
1727
|
+
textarea.focus();
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1699
1730
|
updateResetPromptButton () {
|
|
1700
1731
|
this.btnResetAgentPrompt.style.display = this.originalAgentPrompt ? '' : 'none';
|
|
1732
|
+
this.updatePromptModifiedState();
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
updatePromptModifiedState () {
|
|
1736
|
+
const hasOriginal = !!this.originalAgentPrompt;
|
|
1737
|
+
const isModified = hasOriginal && this.systemPromptTextarea.value.trim() !== this.originalAgentPrompt.trim();
|
|
1738
|
+
this.promptModifiedBadge.style.display = isModified ? '' : 'none';
|
|
1739
|
+
this.btnViewOriginalPrompt.style.display = isModified ? '' : 'none';
|
|
1740
|
+
if (isModified) {
|
|
1741
|
+
this.systemPromptTextarea.classList.add('prompt-modified');
|
|
1742
|
+
} else {
|
|
1743
|
+
this.systemPromptTextarea.classList.remove('prompt-modified');
|
|
1744
|
+
}
|
|
1701
1745
|
}
|
|
1702
1746
|
|
|
1703
1747
|
saveFormValuesToStorage () {
|
|
@@ -1391,6 +1391,40 @@ body {
|
|
|
1391
1391
|
gap: 2px;
|
|
1392
1392
|
}
|
|
1393
1393
|
|
|
1394
|
+
/* --- Prompt Modified Indicator --- */
|
|
1395
|
+
.prompt-modified-badge {
|
|
1396
|
+
font-size: 0.75em;
|
|
1397
|
+
color: var(--warning, #f0ad4e);
|
|
1398
|
+
margin-left: 6px;
|
|
1399
|
+
font-style: italic;
|
|
1400
|
+
font-weight: 400;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
textarea.prompt-modified {
|
|
1404
|
+
border-left: 3px solid var(--warning, #f0ad4e) !important;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
.btn-view-original {
|
|
1408
|
+
background: none;
|
|
1409
|
+
border: none;
|
|
1410
|
+
color: var(--text-muted);
|
|
1411
|
+
cursor: pointer;
|
|
1412
|
+
padding: 2px;
|
|
1413
|
+
display: flex;
|
|
1414
|
+
align-items: center;
|
|
1415
|
+
justify-content: center;
|
|
1416
|
+
border-radius: var(--radius-sm);
|
|
1417
|
+
transition: color 0.15s;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
.btn-view-original:hover {
|
|
1421
|
+
color: var(--primary);
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
.btn-view-original .material-icons-round {
|
|
1425
|
+
font-size: 16px;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1394
1428
|
.btn-reset-prompt {
|
|
1395
1429
|
background: none;
|
|
1396
1430
|
border: none;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fa-mcp-sdk",
|
|
3
3
|
"productName": "FA MCP SDK",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.37",
|
|
5
5
|
"description": "Core infrastructure and templates for building Model Context Protocol (MCP) servers with TypeScript",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/core/index.js",
|