refactor: 어플리케이션 업무코드(DAP) 전면 전환에 따른 패키지 및 모듈명 대규모 리팩토링

This commit is contained in:
jade
2026-07-16 16:18:04 +09:00
parent 6159b0856a
commit a82bc1a196
285 changed files with 782 additions and 782 deletions

View File

@@ -0,0 +1,805 @@
<!DOCTYPE html>
<html lang="ko" class="dark" data-bs-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AX HUB Developer Portal</title>
<!-- Geist Fonts -->
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/400.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/500.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/geist-sans@5.0.1/600.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/geist-mono@5.0.1/400.css">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
:root {
--bg-color: #09090b;
--surface-color: #18181b;
--border-color: #3f3f46; /* zinc-700 */
--text-primary: #f4f4f5; /* zinc-100 */
--text-secondary: #a1a1aa; /* zinc-400 */
--accent-color: #3b82f6;
--accent-hover: #2563eb;
--link-color: #60a5fa; /* blue-400 */
--radius-md: 6px;
--radius-sm: 4px;
}
body {
font-family: 'Geist Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background-color: var(--bg-color);
color: var(--text-primary);
min-height: 100vh;
padding: 0;
-webkit-font-smoothing: antialiased;
}
.container {
max-width: 1000px; /* Tighter layout */
width: 95%;
margin: 0 auto;
}
/* Editorial / Tech Header */
.page-header {
text-align: left;
margin-bottom: 2rem;
padding-bottom: 2rem;
border-bottom: 1px solid var(--border-color);
}
.page-header h1 {
font-weight: 600;
font-size: 2rem;
letter-spacing: -0.04em;
color: var(--text-primary);
margin-bottom: 0.25rem;
}
.page-header p {
color: var(--text-secondary);
font-size: 0.95rem;
margin: 0;
}
/* Clean Panel */
.panel {
background: var(--surface-color);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
overflow: hidden;
}
/* Minimalist Tabs */
.nav-tabs {
border-bottom: 1px solid var(--border-color);
background: #0f0f11;
padding: 0 1.5rem;
gap: 1.5rem;
}
.nav-tabs .nav-item {
margin-bottom: -1px;
}
.nav-tabs .nav-link {
border: none;
color: var(--text-secondary);
font-weight: 500;
font-size: 0.875rem;
padding: 1rem 0;
border-bottom: 2px solid transparent;
transition: color 0.15s ease;
background: transparent !important;
}
.nav-tabs .nav-link:hover {
color: var(--text-primary);
border-color: transparent;
}
.nav-tabs .nav-link.active {
color: var(--text-primary);
border-bottom: 2px solid var(--text-primary);
font-weight: 600;
}
.tab-content {
padding: 2rem 1.5rem;
background: var(--surface-color);
}
/* Dense Forms */
.form-label {
font-weight: 500;
color: var(--text-primary);
font-size: 0.875rem;
margin-bottom: 0.35rem;
}
.form-control, .form-select {
border-radius: var(--radius-sm);
border: 1px solid var(--border-color);
padding: 0.5rem 0.75rem;
font-size: 0.875rem;
background-color: var(--surface-color);
color: var(--text-primary);
box-shadow: none;
}
.form-control:focus, .form-select:focus {
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
background-color: var(--surface-color);
color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
border-color: var(--text-secondary);
box-shadow: 0 0 0 1px var(--text-secondary);
outline: none;
}
.form-control::placeholder {
color: #a1a1aa; /* zinc-400 */
}
.input-hint {
font-size: 0.75rem;
color: var(--text-secondary);
margin-top: 0.35rem;
}
/* Utilitarian Button */
.btn-action {
background: var(--accent-color);
color: #ffffff;
border: none;
border-radius: var(--radius-sm);
padding: 0.5rem 1rem;
font-weight: 500;
font-size: 0.875rem;
transition: background-color 0.1s ease, transform 0.1s ease;
}
.btn-action:hover {
background: var(--accent-hover);
color: #ffffff;
}
.btn-action:active {
transform: scale(0.98); /* Tactile feedback */
}
.btn-secondary-action {
background: var(--surface-color);
color: var(--text-primary);
border: 1px solid var(--border-color);
border-radius: var(--radius-sm);
padding: 0.3rem 0.75rem;
font-size: 0.75rem;
font-weight: 500;
}
.btn-secondary-action:hover {
background: #f4f4f5;
}
/* Result Box - Terminal Style */
#resultBox {
display: none;
margin-top: 1.5rem;
border-radius: var(--radius-md);
padding: 1.25rem;
white-space: pre-wrap;
font-family: 'Geist Mono', Consolas, monospace;
font-size: 0.8rem;
line-height: 1.6;
background-color: #09090b; /* zinc-950 */
color: #e4e4e7; /* zinc-200 */
border: 1px solid #27272a;
}
#resultBox.success {
border-top: 3px solid #10b981;
}
#resultBox.error {
border-top: 3px solid #ef4444;
}
/* Dense Table */
.table {
font-size: 0.875rem;
margin-bottom: 0;
}
.table th {
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--text-secondary);
font-weight: 500;
border-bottom: 1px solid var(--border-color);
padding-bottom: 0.75rem;
background: transparent;
}
.table td {
vertical-align: middle;
padding: 1rem 0.5rem;
border-bottom: 1px solid var(--border-color);
color: var(--text-primary);
}
.table tr:last-child td {
border-bottom: none;
}
.badge-mono {
font-family: 'Geist Mono', monospace;
font-size: 0.7rem;
font-weight: 500;
padding: 0.25em 0.5em;
border-radius: 4px;
background: #f4f4f5;
color: var(--text-secondary);
border: 1px solid var(--border-color);
}
a.tool-link {
color: var(--text-primary);
text-decoration: none;
font-weight: 500;
}
a.tool-link:hover {
text-decoration: underline;
color: var(--link-color);
}
/* Modal styling overrides - DARK THEME */
.modal-content {
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
background-color: #18181b;
color: var(--text-primary);
}
.modal-header {
border-bottom: 1px solid var(--border-color);
padding: 1.25rem 1.5rem;
background-color: #18181b;
}
.modal-title {
font-size: 1.1rem;
font-weight: 600;
color: var(--text-primary);
}
.modal-body {
background-color: #18181b;
color: var(--text-primary);
}
.modal-body .form-label {
color: #d4d4d8 !important;
}
.modal-footer {
border-top: 1px solid var(--border-color);
padding: 1rem 1.5rem;
background-color: #18181b;
}
.modal-backdrop.show {
opacity: 0.7;
}
.btn-close {
filter: invert(1);
}
/* Badge overrides for dark theme */
.badge-mono {
font-family: 'Geist Mono', monospace;
font-size: 0.7rem;
font-weight: 500;
padding: 0.25em 0.5em;
border-radius: 4px;
background: #27272a;
color: #a1a1aa;
border: 1px solid #3f3f46;
}
/* Bootstrap secondary button override */
.btn-secondary-action:hover {
background: #27272a;
color: var(--text-primary);
}
/* Table hover for dark */
.table > tbody > tr:hover > td {
background-color: rgba(255,255,255,0.03);
}
/* Tool name in table - ensure visibility */
.table td {
color: #e4e4e7 !important;
}
.table td a.tool-link {
color: #e4e4e7 !important;
}
.table td a.tool-link:hover {
color: #60a5fa !important;
}
/* Category badge in table */
.badge {
font-size: 0.7rem;
font-weight: 500;
}
/* Alert/Notice dark theme */
.alert-warning {
background-color: rgba(245, 158, 11, 0.1);
border-color: rgba(245, 158, 11, 0.3);
color: #fbbf24;
}
/* Select option dark theme */
select option, select optgroup {
background-color: #18181b;
color: #f4f4f5;
}
.container {
max-width: 72rem !important;
padding-left: 1.5rem !important;
padding-right: 1.5rem !important;
width: 100% !important;
}
</style>
</head>
<body style="overflow-y: scroll;">
<header style="border-bottom: 1px solid #27272a; background: rgba(9,9,11,0.85); backdrop-filter: blur(16px);" class="sticky top-0 z-50">
<div class="max-w-6xl mx-auto px-6 h-14 flex items-center justify-between">
<div class="flex items-center space-x-5">
<a href="/index.html" class="flex items-center group">
<div class="w-2 h-2 rounded-full mr-2" style="background:#3b82f6; box-shadow: 0 0 8px rgba(59,130,246,0.8);"></div>
<span class="font-semibold tracking-tight text-sm" style="color:#f4f4f5;">AXHUB Gateway</span>
</a>
<div class="h-4 w-px" style="background:#27272a;"></div>
<nav class="flex space-x-5 text-[13px] font-medium">
<a href="/admin/scaffold.html" style="color:#ffffff;" class="font-semibold">Scaffold</a>
<a href="/catalog.html" style="color:#a1a1aa;" class="hover:text-white transition-colors">Catalog</a>
<a href="/playground.html" style="color:#a1a1aa;" class="hover:text-white transition-colors">Playground</a>
</nav>
</div>
<div class="flex items-center">
<span class="text-[10px] uppercase tracking-widest px-2 py-1 rounded font-bold" style="background:rgba(59,130,246,0.1); color:#60a5fa; border:1px solid rgba(59,130,246,0.2);">v0.0.1</span>
</div>
</div>
</header>
<div class="container">
<div class="page-header">
<h1>Developer Portal</h1>
<p>AX HUB No-Code Scaffolding Wizard</p>
</div>
<div class="panel">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="pod-tab" data-bs-toggle="tab" data-bs-target="#pod" type="button" role="tab">Pod Module</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="tool-tab" data-bs-toggle="tab" data-bs-target="#tool" type="button" role="tab">Tool Function</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="list-tab" data-bs-toggle="tab" data-bs-target="#list" type="button" role="tab" onclick="loadToolList()">Registry</button>
</li>
</ul>
<div class="card-body p-0">
<div class="tab-content" id="myTabContent">
<!-- Pod Creation Form -->
<div class="tab-pane fade show active" id="pod" role="tabpanel">
<form id="podForm">
<div class="mb-4">
<label class="form-label">Module Name</label>
<input type="text" class="form-control" name="moduleName" placeholder="e.g. hr (will be prefixed with axhub-tool-)" required>
</div>
<div class="mb-4">
<label class="form-label">Service Port</label>
<input type="number" class="form-control" name="port" placeholder="e.g. 8086" required>
<div class="input-hint">Unique port for Gateway routing and local development.</div>
</div>
<div class="row mb-4">
<div class="col-md-6">
<label class="form-label">Author</label>
<input type="text" class="form-control" name="author" placeholder="Defaults to OS user">
</div>
<div class="col-md-6 mt-3 mt-md-0">
<label class="form-label">Date</label>
<input type="text" class="form-control" name="date" placeholder="Defaults to today">
</div>
</div>
<div class="d-flex justify-content-end mt-4">
<button type="submit" class="btn-action">Generate Pod</button>
</div>
</form>
</div>
<!-- Tool Creation Form -->
<div class="tab-pane fade" id="tool" role="tabpanel">
<form id="toolForm">
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Base Name (PascalCase)</label>
<input type="text" class="form-control" name="baseName" placeholder="e.g. ExchangeRate" required>
<div class="input-hint">Used for class generation (ExchangeRateService).</div>
</div>
<div class="col-md-6 mt-3 mt-md-0">
<label class="form-label">Legacy Interface ID</label>
<input type="text" class="form-control" name="interfaceId" placeholder="e.g. EXCH_001" required>
</div>
</div>
<div class="mb-3">
<label class="form-label">Description (LLM Prompt)</label>
<input type="text" class="form-control" name="description" placeholder="e.g. Fetch current exchange rates for customers." required>
<div class="input-hint">Critical for AI agent intent matching. Be descriptive.</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Domain Category</label>
<input type="text" class="form-control" name="categoryKey" pattern="^[a-z0-9][a-z0-9_-]*$" list="groupList" placeholder="e.g. common, hr, payment" oninput="this.value = this.value.toLowerCase()" required>
<datalist id="groupList">
<option value="common">common</option>
<option value="customer">customer</option>
<option value="contract">contract</option>
<option value="claim">claim</option>
</datalist>
</div>
<div class="col-md-6 mt-3 mt-md-0">
<label class="form-label">Protocol</label>
<select class="form-select" name="routingType">
<option value="HTTP">HTTP (REST)</option>
<option value="TCP">TCP (Socket)</option>
<option value="MCI">MCI (Legacy)</option>
<option value="EAI">EAI (Internal)</option>
</select>
</div>
</div>
<div class="row mb-4">
<div class="col-md-6">
<label class="form-label">Target Module</label>
<select class="form-select" name="moduleName" id="targetModuleSelect" required>
<option value="axhub-tool-other">axhub-tool-other</option>
</select>
<div class="input-hint">Destination Pod directory.</div>
</div>
<div class="col-md-6 mt-3 mt-md-0">
<label class="form-label">Gateway Registration</label>
<select class="form-select" name="register">
<option value="true">True (Public)</option>
<option value="false">False (Private)</option>
</select>
<div class="input-hint">Controls dynamic routing exposure.</div>
</div>
</div>
<div class="row mb-4">
<div class="col-md-6">
<label class="form-label">Author</label>
<input type="text" class="form-control" name="author" placeholder="Defaults to OS user">
</div>
<div class="col-md-6 mt-3 mt-md-0">
<label class="form-label">Date</label>
<input type="text" class="form-control" name="date" placeholder="Defaults to today">
</div>
</div>
<div class="d-flex justify-content-end mt-4">
<button type="submit" class="btn-action">Generate Tool</button>
</div>
</form>
</div>
<!-- Tool List Form -->
<div class="tab-pane fade" id="list" role="tabpanel">
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h5 class="mb-1" style="font-size: 1rem; font-weight: 600;">Active Tools</h5>
<div class="input-hint mt-0">Tools dynamically registered in the Gateway.</div>
</div>
<div class="d-flex gap-2">
<select id="groupFilterSelect" class="form-select" style="width: auto; min-width: 140px; padding: 0.25rem 0.5rem; font-size: 0.8rem; height: 30px;" onchange="filterTools()">
<option value="ALL">All Categories</option>
</select>
<input type="text" id="toolFilter" class="form-control" style="padding: 0.25rem 0.5rem; font-size: 0.8rem; height: 30px;" placeholder="Search..." onkeyup="filterTools()">
<button class="btn-secondary-action text-nowrap" style="height: 30px;" onclick="loadToolList()">Refresh</button>
</div>
</div>
<div class="table-responsive">
<table class="table align-middle" id="toolTable">
<thead>
<tr>
<th style="width: 10%;">Category</th>
<th style="width: 20%;">Tool Name</th>
<th style="width: 40%;">Description</th>
<th style="width: 15%;">Pod</th>
<th style="width: 15%;">Interface</th>
</tr>
</thead>
<tbody id="toolListBody">
<tr>
<td colspan="5" class="text-center py-5 text-muted">Loading data...</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="resultBox"></div>
</div>
<!-- Edit Tool Modal -->
<div class="modal fade" id="editToolModal" tabindex="-1" aria-labelledby="editToolModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editToolModalLabel">Edit Tool Definition</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="editToolForm">
<div class="mb-3">
<label class="form-label">Tool Name</label>
<input type="text" class="form-control" id="editToolName" name="toolName" readonly style="background-color: #f4f4f5; color: #a1a1aa;">
</div>
<div class="mb-3">
<label class="form-label">Category</label>
<input type="text" class="form-control" id="editCategoryKey" name="categoryKey" pattern="^[a-z0-9][a-z0-9_-]*$" oninput="this.value = this.value.toLowerCase()">
</div>
<div class="mb-3">
<label class="form-label">Description</label>
<textarea class="form-control" id="editDescription" name="description" rows="3"></textarea>
</div>
<div class="mb-3">
<label class="form-label">Registry Exposure</label>
<select class="form-select" id="editRegister" name="register">
<option value="true">True (Public)</option>
<option value="false">False (Private)</option>
</select>
</div>
<div style="font-size: 0.8rem; color: #d97706; background: #fffbeb; padding: 0.75rem; border: 1px solid #fde68a; border-radius: var(--radius-sm); margin-top: 1rem;">
<strong>Notice:</strong> Applying edits modifies the physical Java source code. A rebuild of the backend container is required for changes to take effect.
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn-secondary-action" data-bs-dismiss="modal" style="padding: 0.5rem 1rem; font-size: 0.875rem;">Cancel</button>
<button type="button" class="btn-action" onclick="submitToolUpdate()">Apply Changes</button>
</div>
</div>
</div>
</div>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
function handleFormSubmit(formId, apiUrl) {
document.getElementById(formId).addEventListener('submit', function(e) {
e.preventDefault();
const formData = new FormData(this);
const data = Object.fromEntries(formData.entries());
const btn = this.querySelector('button[type="submit"]');
const originalText = btn.innerHTML;
btn.innerHTML = 'Processing...';
btn.disabled = true;
btn.style.opacity = '0.7';
fetch(apiUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
})
.then(response => response.text())
.then(result => {
const resultBox = document.getElementById('resultBox');
resultBox.style.display = 'block';
if (result.includes('[오류]') || result.includes('오류 발생:')) {
resultBox.className = 'error';
resultBox.textContent = result;
} else {
resultBox.className = 'success';
resultBox.textContent = result + "\n\n> Note: Please sync Gradle in your IDE to reflect source code generation.";
}
})
.catch(error => {
const resultBox = document.getElementById('resultBox');
resultBox.style.display = 'block';
resultBox.className = 'error';
resultBox.textContent = "Network error: " + error;
})
.finally(() => {
btn.innerHTML = originalText;
btn.disabled = false;
btn.style.opacity = '1';
});
});
}
document.addEventListener('DOMContentLoaded', function() {
fetch('/api/v1/scaffold/modules')
.then(res => res.json())
.then(modules => {
const select = document.getElementById('targetModuleSelect');
if (modules && modules.length > 0) {
select.innerHTML = modules.map(m => `<option value="${m}" ${m === 'axhub-tool-other' ? 'selected' : ''}>${m}</option>`).join('');
}
})
.catch(err => console.error('Failed to load modules:', err));
});
handleFormSubmit('podForm', '/api/v1/scaffold/pod');
handleFormSubmit('toolForm', '/api/v1/scaffold/tool');
function loadToolList() {
const tbody = document.getElementById('toolListBody');
tbody.innerHTML = '<tr><td colspan="5" class="text-center py-5 text-muted">Loading data...</td></tr>';
fetch('/mcp/api/v1/tools/list', {
method: 'GET',
})
.then(res => res.json())
.then(data => {
let tools = data.result.tools || [];
if (tools.length === 0) {
tbody.innerHTML = '<tr><td colspan="5" class="text-center py-5 text-muted">No tools registered.</td></tr>';
return;
}
tools.sort((a, b) => {
const gA = a.categoryKey || '';
const gB = b.categoryKey || '';
return gA.localeCompare(gB);
});
const groupSet = new Set();
tools.forEach(t => groupSet.add(t.categoryKey || 'unknown'));
const groupSelect = document.getElementById('groupFilterSelect');
const currentSelectedGroup = groupSelect.value;
groupSelect.innerHTML = '<option value="ALL">All Categories</option>';
Array.from(groupSet).sort().forEach(g => {
const opt = document.createElement('option');
opt.value = g;
opt.textContent = g;
groupSelect.appendChild(opt);
});
if (groupSet.has(currentSelectedGroup)) {
groupSelect.value = currentSelectedGroup;
}
tbody.innerHTML = tools.map(t => {
const isReg = t.registered !== false;
const badgeHtml = isReg ? '' : ' <span class="badge-mono" style="color:#d97706;border-color:#fde68a;background:#fffbeb;">Private</span>';
const escDesc = (t.description || '').replace(/'/g, "\\'").replace(/"/g, '&quot;');
return `
<tr class="tool-row">
<td><span class="badge-mono">${t.categoryKey || 'unknown'}</span></td>
<td>
<a href="javascript:void(0)" onclick="openEditModal('${t.name}', '${t.categoryKey}', '${escDesc}', ${isReg})" class="tool-link">
${t.name}
</a>
${badgeHtml}
</td>
<td class="text-secondary" style="font-size:0.8rem;">${t.description}</td>
<td><span class="badge-mono">${t.podUrl}</span></td>
<td><span class="badge-mono">${t.integrationType}</span> <span class="text-secondary ms-1" style="font-size:0.75rem;">${t.mciServiceId || '-'}</span></td>
</tr>
`}).join('');
filterTools();
})
.catch(err => {
tbody.innerHTML = `<tr><td colspan="5" class="text-center py-5 text-danger">Error loading data: ${err.message}</td></tr>`;
});
}
function filterTools() {
const input = document.getElementById('toolFilter').value.toLowerCase();
const selectedGroup = document.getElementById('groupFilterSelect').value;
const rows = document.querySelectorAll('.tool-row');
rows.forEach(row => {
const name = row.cells[1].textContent.toLowerCase();
const group = row.cells[0].textContent;
const matchText = name.includes(input) || group.toLowerCase().includes(input);
const matchGroup = (selectedGroup === 'ALL' || group === selectedGroup);
if (matchText && matchGroup) {
row.style.display = '';
} else {
row.style.display = 'none';
}
});
}
let editModalInstance = null;
function openEditModal(toolName, categoryKey, description, isReg) {
document.getElementById('editToolName').value = toolName;
document.getElementById('editCategoryKey').value = categoryKey !== 'null' ? categoryKey : '';
document.getElementById('editDescription').value = description;
document.getElementById('editRegister').value = isReg ? 'true' : 'false';
if (!editModalInstance) {
editModalInstance = new bootstrap.Modal(document.getElementById('editToolModal'));
}
editModalInstance.show();
}
function submitToolUpdate() {
const toolName = document.getElementById('editToolName').value;
const categoryKey = document.getElementById('editCategoryKey').value;
const description = document.getElementById('editDescription').value;
const register = document.getElementById('editRegister').value;
const btn = document.querySelector('#editToolModal .btn-action');
const originalText = btn.innerHTML;
btn.innerHTML = 'Processing...';
btn.disabled = true;
btn.style.opacity = '0.7';
fetch('/api/v1/scaffold/tool/update', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
toolName: toolName,
categoryKey: categoryKey,
description: description,
register: register
})
})
.then(response => response.text())
.then(result => {
if (result.includes('[오류]') || result.includes('오류 발생:')) {
alert('Error updating source:\n' + result);
} else {
alert('Source code updated successfully.\nPlease rebuild the Pod container to reflect changes.');
editModalInstance.hide();
loadToolList();
}
})
.catch(err => {
alert('Network error: ' + err);
})
.finally(() => {
btn.innerHTML = originalText;
btn.disabled = false;
btn.style.opacity = '1';
});
}
</script>
</body>
</html>

View File

@@ -0,0 +1,233 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Tool Catalog</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<style>
* { font-family: 'Geist', sans-serif; }
body { background-color: #09090b; color: #f4f4f5; }
.geist-mono { font-family: 'Geist Mono', monospace; }
.btn-primary {
background: linear-gradient(135deg, #3b82f6, #6366f1);
color: #ffffff;
font-weight: 600;
padding: 10px 24px;
border-radius: 8px;
font-size: 14px;
border: none;
cursor: pointer;
transition: all 0.2s;
box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(99, 102, 241, 0.5); transform: translateY(-1px); }
.tool-card {
background: #18181b;
border: 1px solid #3f3f46;
border-radius: 12px;
padding: 20px 24px;
transition: border-color 0.2s;
}
.tool-card:hover { border-color: #52525b; }
.param-table {
width: 100%;
font-size: 13px;
border-collapse: collapse;
}
.param-table th {
text-align: left;
padding: 8px 12px;
font-weight: 600;
color: #a1a1aa;
border-bottom: 1px solid #3f3f46;
font-size: 12px;
}
.param-table td {
padding: 8px 12px;
border-bottom: 1px solid #27272a;
color: #d4d4d8;
}
.param-table tr:last-child td { border-bottom: none; }
</style>
</head>
<body class="min-h-screen" style="overflow-y: scroll;">
<header style="border-bottom: 1px solid #27272a; background: rgba(9,9,11,0.85); backdrop-filter: blur(16px);" class="sticky top-0 z-50">
<div class="max-w-6xl mx-auto px-6 h-14 flex items-center justify-between">
<div class="flex items-center space-x-5">
<a href="/index.html" class="flex items-center group">
<div class="w-2 h-2 rounded-full mr-2" style="background:#3b82f6; box-shadow: 0 0 8px rgba(59,130,246,0.8);"></div>
<span class="font-semibold tracking-tight text-sm" style="color:#f4f4f5;">AXHUB Gateway</span>
</a>
<div class="h-4 w-px" style="background:#27272a;"></div>
<nav class="flex space-x-5 text-[13px] font-medium">
<a href="/admin/scaffold.html" style="color:#a1a1aa;" class="hover:text-white transition-colors">Scaffold</a>
<a href="/catalog.html" style="color:#ffffff;" class="font-semibold">Catalog</a>
<a href="/playground.html" style="color:#a1a1aa;" class="hover:text-white transition-colors">Playground</a>
</nav>
</div>
<div class="flex items-center">
<span class="text-[10px] uppercase tracking-widest px-2 py-1 rounded font-bold" style="background:rgba(59,130,246,0.1); color:#60a5fa; border:1px solid rgba(59,130,246,0.2);">v0.0.1</span>
</div>
</div>
</header>
<main class="max-w-6xl mx-auto px-6 py-10">
<div class="flex flex-col md:flex-row justify-between items-start md:items-end mb-8">
<div class="max-w-2xl">
<h1 class="text-3xl font-bold tracking-tight mb-2" style="color:#f4f4f5;">Registry Catalog</h1>
<p class="text-sm" style="color:#a1a1aa;">Currently integrated AI function tools across all modules. View parameters, descriptions, and integration types.</p>
</div>
<div class="mt-4 md:mt-0">
<button id="copyMdBtn" class="btn-primary flex items-center">
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"></path></svg>
<span id="copyBtnText">Copy Markdown Docs</span>
</button>
</div>
</div>
<div id="catalogContainer" class="space-y-12 pb-16">
<div class="flex justify-center py-20 text-sm geist-mono" style="color:#71717a;">
<div class="w-4 h-4 border-2 border-t-blue-500 rounded-full animate-spin mr-3" style="border-color:#3f3f46; border-top-color:#3b82f6;"></div>
Loading registry...
</div>
</div>
</main>
<script>
async function fetchTools() {
try {
const response = await fetch('/mcp/api/v1/tools/list');
const data = await response.json();
const tools = data.result?.tools || [];
renderCatalog(tools);
} catch (err) {
document.getElementById('catalogContainer').innerHTML = `
<div style="padding:16px; border:1px solid #7f1d1d; background:rgba(127,29,29,0.15); color:#fca5a5; font-size:14px; border-radius:8px;">
Failed to fetch tools from registry. Error: ${err.message}
</div>
`;
}
}
function renderCatalog(tools) {
const container = document.getElementById('catalogContainer');
container.innerHTML = '';
if (tools.length === 0) {
container.innerHTML = '<div style="padding:32px; text-align:center; color:#71717a; border:1px dashed #3f3f46; border-radius:8px;">No tools registered.</div>';
return;
}
const grouped = {};
tools.forEach(tool => {
const group = tool.categoryKey || 'Others';
if (!grouped[group]) grouped[group] = [];
grouped[group].push(tool);
});
Object.keys(grouped).sort().forEach(group => {
const section = document.createElement('section');
const header = document.createElement('div');
header.style.cssText = 'margin-bottom:16px; padding-bottom:8px; border-bottom:1px solid #27272a; display:flex; align-items:baseline; justify-content:space-between;';
header.innerHTML = `
<h2 style="font-size:20px; font-weight:600; color:#f4f4f5; text-transform:capitalize;">${group}</h2>
<span class="geist-mono" style="font-size:12px; color:#71717a;">${grouped[group].length} items</span>
`;
section.appendChild(header);
const grid = document.createElement('div');
grid.style.cssText = 'display:grid; grid-template-columns:1fr; gap:12px;';
grouped[group].forEach(tool => grid.appendChild(createToolCard(tool)));
section.appendChild(grid);
container.appendChild(section);
});
}
function createToolCard(tool) {
const card = document.createElement('div');
card.className = 'tool-card';
const isDirect = tool.integrationType === 'DIRECT';
const badgeBg = isDirect ? 'rgba(59,130,246,0.15)' : 'rgba(249,115,22,0.15)';
const badgeColor = isDirect ? '#60a5fa' : '#fb923c';
const badgeBorder = isDirect ? 'rgba(59,130,246,0.3)' : 'rgba(249,115,22,0.3)';
let paramHtml = '';
if (tool.parametersSchema && tool.parametersSchema.properties) {
const props = tool.parametersSchema.properties;
const required = tool.parametersSchema.required || [];
if (Object.keys(props).length > 0) {
paramHtml = `
<div style="margin-top:16px; padding-top:16px; border-top:1px solid #27272a;">
<div style="font-size:10px; font-weight:700; color:#71717a; margin-bottom:8px; letter-spacing:0.1em; text-transform:uppercase;">Parameters</div>
<table class="param-table">
<thead><tr><th style="width:25%;">Name</th><th style="width:15%;">Type</th><th>Description</th></tr></thead>
<tbody>
${Object.entries(props).map(([k,v]) => `
<tr>
<td class="geist-mono" style="color:#93c5fd;">${k}${required.includes(k) ? '<span style="color:#f87171; margin-left:4px;">*</span>' : ''}</td>
<td class="geist-mono" style="color:#a1a1aa;">${v.type || 'string'}</td>
<td style="color:#d4d4d8;">${v.description || '-'}</td>
</tr>
`).join('')}
</tbody>
</table>
</div>
`;
}
}
let promptHtml = '';
if (tool.actionPrompts && Object.keys(tool.actionPrompts).length > 0) {
promptHtml = `
<div style="margin-top:16px; padding-top:16px; border-top:1px solid #27272a;">
<div style="font-size:10px; font-weight:700; color:#71717a; margin-bottom:8px; letter-spacing:0.1em; text-transform:uppercase;">Action Prompts</div>
<ul style="list-style:disc; padding-left:20px; font-size:14px; color:#a1a1aa; space-y:2;">
${Object.values(tool.actionPrompts).map(p => `<li style="margin-bottom:4px;">${p}</li>`).join('')}
</ul>
</div>
`;
}
card.innerHTML = `
<div style="display:flex; align-items:flex-start; justify-content:space-between;">
<div style="flex:1;">
<div style="display:flex; align-items:center; margin-bottom:4px;">
<h3 style="font-size:16px; font-weight:600; color:#f4f4f5;">${tool.displayName || tool.name}</h3>
<span style="margin:0 8px; color:#3f3f46;">/</span>
<span class="geist-mono" style="font-size:12px; color:#71717a;">${tool.name}</span>
</div>
<p style="font-size:14px; color:#a1a1aa;">${tool.description || 'No description provided.'}</p>
</div>
<div style="margin-left:16px; padding:4px 10px; border-radius:6px; font-size:11px; font-weight:600; background:${badgeBg}; color:${badgeColor}; border:1px solid ${badgeBorder};" class="geist-mono">
${tool.integrationType || 'DIRECT'}
</div>
</div>
${paramHtml}
${promptHtml}
`;
return card;
}
document.getElementById('copyMdBtn').addEventListener('click', async (e) => {
const btn = e.currentTarget;
const textSpan = document.getElementById('copyBtnText');
const originalText = textSpan.textContent;
try {
const res = await fetch('/mcp/api/v1/tools/docs/markdown');
if(!res.ok) throw new Error('Failed to fetch markdown');
const mdText = await res.text();
await navigator.clipboard.writeText(mdText);
textSpan.textContent = 'Copied!';
setTimeout(() => { textSpan.textContent = originalText; }, 2000);
} catch (err) {
alert('Failed to copy markdown.');
}
});
document.addEventListener('DOMContentLoaded', fetchTools);
</script>
</body>
</html>

View File

@@ -0,0 +1,235 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AX HUB - ChatClient</title>
<script src="https://unpkg.com/@tailwindcss/browser@4"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
<style>
body { font-family: 'Inter', sans-serif; background-color: #0f1115; color: #e2e8f0; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.message-enter { animation: fadeInUp 0.3s ease-out forwards; }
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.typing-dot { animation: typing 1.4s infinite ease-in-out; fill: #94a3b8; }
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-3px); }
}
</style>
</head>
<body class="h-screen flex flex-col items-center justify-center p-4">
<!-- Chat Container -->
<div class="w-full max-w-3xl h-[85vh] flex flex-col bg-[#16181d] rounded-2xl shadow-2xl overflow-hidden border border-white/5 relative">
<!-- Header -->
<div class="px-6 py-4 border-b border-white/5 flex items-center justify-between bg-[#16181d] z-10">
<div class="flex items-center gap-3">
<div class="w-8 h-8 rounded-full bg-emerald-500/20 flex items-center justify-center">
<svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg>
</div>
<div>
<h1 class="text-sm font-semibold tracking-wide text-white">AX HUB Assistant</h1>
<p class="text-[11px] text-slate-500">Powered by Mock Engine & MCP Tools</p>
</div>
</div>
<div class="flex items-center gap-2">
<span class="relative flex h-2.5 w-2.5">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
<span class="relative inline-flex rounded-full h-2.5 w-2.5 bg-emerald-500"></span>
</span>
<span class="text-xs text-slate-400">Online</span>
</div>
</div>
<!-- Chat Area -->
<div id="chat-box" class="flex-1 overflow-y-auto p-6 flex flex-col gap-6 scrollbar-hide scroll-smooth">
<!-- System Greeting -->
<div class="flex gap-4 message-enter">
<div class="w-8 h-8 rounded-full bg-emerald-500/10 flex-shrink-0 flex items-center justify-center mt-1 border border-emerald-500/20">
<svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"></path></svg>
</div>
<div class="flex flex-col gap-1 max-w-[80%]">
<span class="text-xs text-slate-500 ml-1 font-medium">Assistant</span>
<div class="bg-[#1e2128] px-5 py-3.5 rounded-2xl rounded-tl-sm text-sm text-slate-200 leading-relaxed border border-white/5 shadow-sm">
안녕하세요! 저는 AX HUB Assistant입니다. <br>
채팅을 통해 MCP(도구)들을 직접 호출해보세요. <br><br>
💡 <strong>예시:</strong> "오늘 서울 날씨 어때?"
</div>
</div>
</div>
</div>
<!-- Input Area -->
<div class="p-4 bg-[#16181d] border-t border-white/5 relative">
<div class="relative flex items-center w-full max-w-full mx-auto group">
<input type="text" id="chat-input" placeholder="메시지를 입력하세요... (예: 서울 날씨 어때?)"
class="w-full bg-[#1e2128] text-slate-200 text-sm px-5 py-4 rounded-xl border border-white/5 focus:outline-none focus:border-emerald-500/50 focus:ring-1 focus:ring-emerald-500/50 transition-all placeholder-slate-600 pr-12 shadow-inner"
onkeypress="handleKeyPress(event)">
<button onclick="sendMessage()" class="absolute right-2 p-2 rounded-lg bg-emerald-500 hover:bg-emerald-400 text-white transition-colors flex items-center justify-center shadow-lg shadow-emerald-500/20">
<svg class="w-4 h-4 translate-x-[1px]" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"></path></svg>
</button>
</div>
</div>
</div>
<!-- 로딩 인디케이터 템플릿 -->
<template id="loading-template">
<div class="flex gap-4 message-enter" id="loading-indicator">
<div class="w-8 h-8 rounded-full bg-emerald-500/10 flex-shrink-0 flex items-center justify-center mt-1 border border-emerald-500/20">
<svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"></path></svg>
</div>
<div class="flex flex-col gap-1 max-w-[80%]">
<span class="text-xs text-slate-500 ml-1 font-medium">Assistant</span>
<div class="bg-[#1e2128] px-5 py-4 rounded-2xl rounded-tl-sm border border-white/5 flex items-center gap-1 shadow-sm h-[48px]">
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<circle class="typing-dot" cx="4" cy="12" r="3"/>
<circle class="typing-dot" cx="12" cy="12" r="3"/>
<circle class="typing-dot" cx="20" cy="12" r="3"/>
</svg>
</div>
</div>
</div>
</template>
<script>
const chatBox = document.getElementById('chat-box');
const chatInput = document.getElementById('chat-input');
const loadingTemplate = document.getElementById('loading-template');
let isLoading = false;
function handleKeyPress(e) {
if (e.key === 'Enter') {
sendMessage();
}
}
function appendUserMessage(text) {
const div = document.createElement('div');
div.className = 'flex gap-4 justify-end message-enter';
div.innerHTML = `
<div class="flex flex-col gap-1 max-w-[80%] items-end">
<span class="text-xs text-slate-500 mr-1 font-medium">You</span>
<div class="bg-emerald-500/10 px-5 py-3.5 rounded-2xl rounded-tr-sm text-sm text-emerald-50 leading-relaxed border border-emerald-500/20 shadow-sm whitespace-pre-wrap">${escapeHtml(text)}</div>
</div>
`;
chatBox.appendChild(div);
scrollToBottom();
}
function appendBotMessageContainer() {
const div = document.createElement('div');
div.className = 'flex gap-4 message-enter';
div.innerHTML = `
<div class="w-8 h-8 rounded-full bg-emerald-500/10 flex-shrink-0 flex items-center justify-center mt-1 border border-emerald-500/20">
<svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"></path></svg>
</div>
<div class="flex flex-col gap-1 max-w-[80%]">
<span class="text-xs text-slate-500 ml-1 font-medium">Assistant</span>
<div class="bg-[#1e2128] px-5 py-3.5 rounded-2xl rounded-tl-sm text-sm text-slate-200 leading-relaxed border border-white/5 shadow-sm whitespace-pre-wrap bot-text"></div>
</div>
`;
chatBox.appendChild(div);
scrollToBottom();
return div.querySelector('.bot-text');
}
function showLoading() {
const clone = loadingTemplate.content.cloneNode(true);
chatBox.appendChild(clone);
scrollToBottom();
}
function hideLoading() {
const loadingIndicator = document.getElementById('loading-indicator');
if (loadingIndicator) {
loadingIndicator.remove();
}
}
function scrollToBottom() {
chatBox.scrollTo({ top: chatBox.scrollHeight, behavior: 'smooth' });
}
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}
async function sendMessage() {
const text = chatInput.value.trim();
if (!text || isLoading) return;
// 1. 유저 메시지 추가
appendUserMessage(text);
chatInput.value = '';
isLoading = true;
// 2. 로딩 애니메이션
showLoading();
try {
// 3. 백엔드 통신 (SSE Stream)
const response = await fetch('/api/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Agent-Id': 'TESTER-DEV' // 권한 통과를 위한 테스트 Agent ID
},
body: JSON.stringify({ message: text })
});
if (!response.ok) throw new Error('Network response was not ok');
// 4. 로딩 숨기고 봇 응답 컨테이너 생성
hideLoading();
const textContainer = appendBotMessageContainer();
// 5. 스트림 읽기
const reader = response.body.getReader();
const decoder = new TextDecoder("utf-8");
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value, { stream: true });
const lines = chunk.split('\n');
for (const line of lines) {
if (line.startsWith('data:')) {
const data = line.substring(5);
textContainer.innerHTML += escapeHtml(data);
scrollToBottom();
}
}
}
} catch (error) {
console.error(error);
hideLoading();
const textContainer = appendBotMessageContainer();
textContainer.innerHTML = "서버와의 통신에 실패했습니다. Gateway가 켜져있는지 확인해주세요.";
} finally {
isLoading = false;
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,169 @@
<!DOCTYPE html>
<html lang="ko" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AXHUB Gateway</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: {
sans: ['Geist', 'sans-serif'],
mono: ['Geist Mono', 'monospace']
},
colors: {
background: '#09090b', /* zinc-950 */
panel: '#18181b', /* zinc-900 */
foreground: '#f4f4f5', /* zinc-100 */
muted: '#a1a1aa', /* zinc-400 */
border: 'rgba(255,255,255,0.1)',
primary: '#3b82f6', /* blue-500 */
primaryHover: '#2563eb', /* blue-600 */
}
}
}
}
</script>
<style>
body {
background-color: theme('colors.background');
color: theme('colors.foreground');
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Subtle radial background for depth */
body::before {
content: "";
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: radial-gradient(circle at 50% -20%, rgba(59, 130, 246, 0.15), transparent 70%);
pointer-events: none;
z-index: -1;
}
.geist-mono { font-family: 'Geist Mono', monospace; }
.card-panel {
background: rgba(24, 24, 27, 0.7); /* zinc-900 with transparency */
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid theme('colors.border');
border-radius: 12px;
box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-panel:hover {
transform: translateY(-4px);
box-shadow: 0 12px 20px -8px rgba(0,0,0,0.6), 0 0 15px rgba(59, 130, 246, 0.15), inset 0 1px 0 rgba(255,255,255,0.1);
border-color: rgba(255,255,255,0.2);
background: rgba(39, 39, 42, 0.8); /* zinc-800 */
}
.premium-text-gradient {
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-image: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
}
.icon-box {
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
transition: all 0.3s ease;
}
.card-panel:hover .icon-box {
background: rgba(59, 130, 246, 0.15);
border-color: rgba(59, 130, 246, 0.4);
color: #60a5fa; /* blue-400 */
box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
</style>
</head>
<body class="min-h-screen flex flex-col relative">
<!-- Header Navigation -->
<header class="border-b border-border sticky top-0 bg-background/80 backdrop-blur-xl z-50">
<div class="max-w-6xl mx-auto px-6 h-14 flex items-center justify-between">
<div class="flex items-center space-x-5">
<div class="flex items-center">
<div class="w-2 h-2 rounded-full bg-blue-500 shadow-[0_0_8px_rgba(59,130,246,0.8)] mr-2"></div>
<span class="font-semibold tracking-tight text-sm text-zinc-100">AXHUB Gateway</span>
</div>
<div class="h-4 w-px bg-white/10"></div>
<nav class="flex space-x-5 text-[13px] font-medium">
<a href="/admin/scaffold.html" class="text-zinc-400 hover:text-white transition-colors">Scaffold</a>
<a href="/catalog.html" class="text-zinc-400 hover:text-white transition-colors">Catalog</a>
<a href="/playground.html" class="text-zinc-400 hover:text-white transition-colors">Playground</a>
</nav>
</div>
<div class="flex items-center">
<span class="text-[10px] uppercase tracking-widest bg-blue-500/10 text-blue-400 px-2 py-1 rounded font-bold border border-blue-500/20">v0.0.1</span>
</div>
</div>
</header>
<main class="flex-grow max-w-6xl mx-auto px-6 py-20 w-full flex flex-col items-center justify-center relative z-10">
<div class="text-center mb-20 max-w-2xl">
<div class="inline-flex items-center justify-center px-3 py-1 mb-6 text-xs font-medium rounded-full bg-white/5 border border-white/10 shadow-sm backdrop-blur-md">
<span class="flex w-2 h-2 rounded-full bg-blue-400 shadow-[0_0_5px_rgba(96,165,250,0.8)] mr-2 animate-pulse"></span>
<span class="text-zinc-300">System Operational</span>
</div>
<h1 class="text-5xl font-bold tracking-tight mb-6 premium-text-gradient leading-tight">AI Plugin Gateway</h1>
<p class="text-[15px] text-zinc-400 leading-relaxed max-w-lg mx-auto">
The central hub for managing, discovering, and testing AI tool integrations. High-performance tooling for the modern enterprise.
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 w-full max-w-5xl">
<!-- Scaffold Card -->
<a href="/admin/scaffold.html" class="card-panel p-8 group block">
<div class="w-12 h-12 icon-box rounded-xl flex items-center justify-center mb-6 text-zinc-300">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path></svg>
</div>
<h2 class="text-lg font-semibold text-zinc-100 mb-3">Scaffold Tool</h2>
<p class="text-[13px] text-zinc-400 leading-relaxed">
Generate boilerplate code for new AI tool integrations automatically. Select a target module and build your plugin structure in seconds.
</p>
<div class="mt-6 flex items-center text-[12px] font-semibold text-zinc-300 group-hover:text-blue-400 group-hover:translate-x-1 transition-all">
Launch Scaffold <svg class="w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3"></path></svg>
</div>
</a>
<!-- Catalog Card -->
<a href="/catalog.html" class="card-panel p-8 group block">
<div class="w-12 h-12 icon-box rounded-xl flex items-center justify-center mb-6 text-zinc-300">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4 6h16M4 10h16M4 14h16M4 18h16"></path></svg>
</div>
<h2 class="text-lg font-semibold text-zinc-100 mb-3">Tool Catalog</h2>
<p class="text-[13px] text-zinc-400 leading-relaxed">
Browse all active tool integrations. View JSON schemas, parameters, and action prompts registered across the entire AXHUB ecosystem.
</p>
<div class="mt-6 flex items-center text-[12px] font-semibold text-zinc-300 group-hover:text-blue-400 group-hover:translate-x-1 transition-all">
View Catalog <svg class="w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3"></path></svg>
</div>
</a>
<!-- Playground Card -->
<a href="/playground.html" class="card-panel p-8 group block">
<div class="w-12 h-12 icon-box rounded-xl flex items-center justify-center mb-6 text-zinc-300">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
</div>
<h2 class="text-lg font-semibold text-zinc-100 mb-3">Playground</h2>
<p class="text-[13px] text-zinc-400 leading-relaxed">
Test and execute tools directly from the browser. Verify RPC calls, test inputs, and inspect raw JSON responses before using them in code.
</p>
<div class="mt-6 flex items-center text-[12px] font-semibold text-zinc-300 group-hover:text-blue-400 group-hover:translate-x-1 transition-all">
Enter Playground <svg class="w-3 h-3 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3"></path></svg>
</div>
</a>
</div>
</main>
</body>
</html>

View File

@@ -0,0 +1,400 @@
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tool Playground</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<style>
* { font-family: 'Geist', sans-serif; }
body { background-color: #09090b; color: #f4f4f5; }
.geist-mono { font-family: 'Geist Mono', monospace; }
.input-field {
width: 100%;
padding: 10px 14px;
font-size: 14px;
background-color: #18181b;
border: 1px solid #3f3f46;
border-radius: 8px;
color: #f4f4f5;
transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field:focus {
outline: none;
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.input-field::placeholder { color: #71717a; }
select.input-field {
appearance: none;
cursor: pointer;
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
background-position: right 12px center;
background-repeat: no-repeat;
background-size: 1.25em 1.25em;
padding-right: 2.5rem;
}
select.input-field option { background: #18181b; color: #f4f4f5; }
select.input-field optgroup { background: #27272a; color: #a1a1aa; font-weight: 600; }
.btn-execute {
background: linear-gradient(135deg, #3b82f6, #6366f1);
color: #ffffff;
font-weight: 600;
padding: 10px 24px;
border-radius: 8px;
font-size: 14px;
border: none;
cursor: pointer;
transition: all 0.2s;
box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}
.btn-execute:hover { box-shadow: 0 0 30px rgba(99, 102, 241, 0.5); transform: translateY(-1px); }
.btn-execute:disabled { background: #27272a; color: #52525b; box-shadow: none; transform: none; cursor: not-allowed; }
.card { background: #18181b; border: 1px solid #3f3f46; border-radius: 12px; }
.json-pre {
background: #09090b;
border: 1px solid #27272a;
border-radius: 8px;
padding: 16px;
overflow-x: auto;
font-size: 13px;
line-height: 1.6;
color: #d4d4d8;
}
.json-key { color: #93c5fd; }
.json-string { color: #86efac; }
.json-number { color: #fbbf24; }
.json-boolean { color: #f472b6; }
.json-null { color: #71717a; }
#loadingOverlay {
display: none;
position: absolute;
inset: 0;
background: rgba(9,9,11,0.85);
backdrop-filter: blur(4px);
border-radius: 12px;
z-index: 10;
align-items: center;
justify-content: center;
flex-direction: column;
}
#loadingOverlay.active { display: flex; }
.spinner {
width: 24px; height: 24px;
border: 2px solid #3f3f46;
border-top-color: #3b82f6;
border-radius: 50%;
animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
</style>
</head>
<body class="min-h-screen" style="overflow-y: scroll;">
<header style="border-bottom: 1px solid #27272a; background: rgba(9,9,11,0.85); backdrop-filter: blur(16px);" class="sticky top-0 z-50">
<div class="max-w-6xl mx-auto px-6 h-14 flex items-center justify-between">
<div class="flex items-center space-x-5">
<a href="/index.html" class="flex items-center group">
<div class="w-2 h-2 rounded-full mr-2" style="background:#3b82f6; box-shadow: 0 0 8px rgba(59,130,246,0.8);"></div>
<span class="font-semibold tracking-tight text-sm" style="color:#f4f4f5;">AXHUB Gateway</span>
</a>
<div class="h-4 w-px" style="background:#27272a;"></div>
<nav class="flex space-x-5 text-[13px] font-medium">
<a href="/admin/scaffold.html" style="color:#a1a1aa;" class="hover:text-white transition-colors">Scaffold</a>
<a href="/catalog.html" style="color:#a1a1aa;" class="hover:text-white transition-colors">Catalog</a>
<a href="/playground.html" style="color:#ffffff;" class="font-semibold">Playground</a>
</nav>
</div>
<div class="flex items-center space-x-3">
<label class="text-xs" style="color:#71717a;">Agent ID:</label>
<input type="text" id="agentId" value="TESTER-DEV" class="input-field" style="width:140px; padding:6px 10px; font-size:12px;">
<span class="text-[10px] uppercase tracking-widest px-2 py-1 rounded font-bold" style="background:rgba(59,130,246,0.1); color:#60a5fa; border:1px solid rgba(59,130,246,0.2);">v0.0.1</span>
</div>
</div>
</header>
<main class="max-w-4xl mx-auto px-6 py-10">
<div class="mb-8">
<h1 class="text-2xl font-bold tracking-tight mb-2" style="color:#f4f4f5;">Test & Execute</h1>
<p class="text-sm" style="color:#a1a1aa;">Simulate tool executions and view raw RPC responses. Select a tool to auto-generate the input schema.</p>
</div>
<div class="card p-6 relative mb-8">
<div id="loadingOverlay">
<div class="spinner mb-3"></div>
<div class="text-sm font-medium" style="color:#a1a1aa;">Executing RPC Call...</div>
</div>
<form id="mcpForm" class="space-y-6">
<div>
<label for="toolName" class="block text-sm font-semibold mb-2 flex items-center" style="color:#e4e4e7;">
Select Tool
<span id="integrationBadge" class="ml-3 px-2 py-0.5 rounded text-[10px] font-medium tracking-wide geist-mono hidden" style="background:#27272a; color:#a1a1aa; border:1px solid #3f3f46;"></span>
</label>
<select id="toolName" name="toolName" class="input-field">
<option value="">Loading tools...</option>
</select>
</div>
<div id="dynamicFormContainer" class="hidden">
<h3 class="text-sm font-semibold mb-3 pb-2" style="color:#e4e4e7; border-bottom: 1px solid #27272a;">Parameters</h3>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4" id="dynamicFields"></div>
</div>
<div id="manualInputContainer" class="hidden p-4 rounded-lg space-y-4" style="background:#0a0a0c; border:1px solid #27272a;">
<h3 class="text-sm font-semibold" style="color:#e4e4e7;">Manual Override (Hidden Tool)</h3>
<div>
<label class="block text-xs font-medium mb-1" style="color:#a1a1aa;">Tool Name</label>
<input type="text" id="manualToolName" class="input-field" value="get_template_file_url">
</div>
<div>
<label class="block text-xs font-medium mb-1" style="color:#a1a1aa;">JSON Parameters</label>
<textarea id="manualToolArgs" rows="3" class="input-field geist-mono">{"templateId": "test_excel"}</textarea>
</div>
</div>
<div>
<label for="userPrompt" class="block text-sm font-semibold mb-2" style="color:#e4e4e7;">Mock User Prompt</label>
<textarea id="userPrompt" name="userPrompt" rows="2" class="input-field" style="resize:none;" placeholder="Provide context for the execution log..."></textarea>
</div>
<div class="flex items-center justify-between pt-4" style="border-top:1px solid #27272a;">
<div class="flex items-center text-xs geist-mono">
<span class="font-bold px-2 py-1 rounded mr-2" style="background:#27272a; color:#a1a1aa; border:1px solid #3f3f46;">POST</span>
<span style="color:#71717a;">/mcp/api/v1/tools/call</span>
</div>
<button type="submit" class="btn-execute">Execute Tool</button>
</div>
</form>
</div>
<div id="resultContainer" class="hidden">
<h2 class="text-sm font-semibold tracking-tight mb-2 flex items-center justify-between" style="color:#e4e4e7;">
Execution Result
<span id="statusBadge" class="px-2 py-0.5 rounded text-[10px] font-medium tracking-wide geist-mono hidden"></span>
</h2>
<pre id="jsonResponse" class="json-pre geist-mono"></pre>
</div>
</main>
<script>
let actionPrompts = {};
let currentSchema = null;
const toolSelect = document.getElementById('toolName');
const dynamicFormContainer = document.getElementById('dynamicFormContainer');
const dynamicFields = document.getElementById('dynamicFields');
async function fetchTools() {
try {
const response = await fetch('/mcp/api/v1/tools/list');
const data = await response.json();
toolSelect.innerHTML = '<option value="" disabled selected>Select a tool to test...</option>';
actionPrompts = {};
const tools = data.result?.tools || [];
const groupedTools = {};
tools.forEach(tool => {
const group = tool.categoryKey || 'Others';
if (!groupedTools[group]) groupedTools[group] = [];
groupedTools[group].push(tool);
});
Object.keys(groupedTools).sort().forEach(group => {
const optgroup = document.createElement('optgroup');
optgroup.label = group;
groupedTools[group].forEach(tool => {
const option = document.createElement('option');
option.value = tool.name;
option.textContent = tool.name;
option.dataset.schema = JSON.stringify(tool.parametersSchema);
option.dataset.prompts = JSON.stringify(tool.actionPrompts || {});
option.dataset.integrationType = tool.integrationType || 'HTTP';
optgroup.appendChild(option);
if (tool.actionPrompts) Object.assign(actionPrompts, tool.actionPrompts);
});
toolSelect.appendChild(optgroup);
});
const optgroupManual = document.createElement('optgroup');
optgroupManual.label = 'Advanced';
const optionManual = document.createElement('option');
optionManual.value = 'MANUAL_INPUT';
optionManual.textContent = 'Custom/Hidden Tool';
optionManual.dataset.schema = "null";
optgroupManual.appendChild(optionManual);
toolSelect.appendChild(optgroupManual);
} catch (err) {
toolSelect.innerHTML = '<option value="">Failed to load tools</option>';
}
}
function renderDynamicForm() {
dynamicFields.innerHTML = '';
const selectedOption = toolSelect.options[toolSelect.selectedIndex];
if (!selectedOption || !selectedOption.dataset.schema) { dynamicFormContainer.classList.add('hidden'); return; }
const schemaStr = selectedOption.dataset.schema;
if (schemaStr === "null") { dynamicFormContainer.classList.add('hidden'); currentSchema = null; return; }
try {
const schema = JSON.parse(schemaStr);
currentSchema = schema;
if (!schema.properties || Object.keys(schema.properties).length === 0) { dynamicFormContainer.classList.add('hidden'); return; }
dynamicFormContainer.classList.remove('hidden');
for (const [key, value] of Object.entries(schema.properties)) {
const fieldDiv = document.createElement('div');
const label = document.createElement('label');
label.className = 'block text-xs font-medium mb-1.5';
label.style.color = '#a1a1aa';
label.textContent = `${key} ${value.description ? '— ' + value.description : ''}`;
fieldDiv.appendChild(label);
let input;
if (value.type === 'boolean') {
input = document.createElement('input');
input.type = 'checkbox';
input.id = 'param_' + key;
} else {
input = document.createElement('input');
input.type = value.type === 'number' || value.type === 'integer' ? 'number' : 'text';
input.id = 'param_' + key;
input.className = 'input-field';
input.placeholder = `Enter ${key}`;
}
fieldDiv.appendChild(input);
dynamicFields.appendChild(fieldDiv);
}
} catch(e) { dynamicFormContainer.classList.add('hidden'); }
}
function updatePrompt() {
const toolName = toolSelect.value;
const defaultPrompt = actionPrompts[toolName];
document.getElementById('userPrompt').value = defaultPrompt ? defaultPrompt : "Test execution";
}
toolSelect.addEventListener('change', () => {
const integrationBadge = document.getElementById('integrationBadge');
if (toolSelect.value === 'MANUAL_INPUT') {
document.getElementById('manualInputContainer').classList.remove('hidden');
dynamicFormContainer.classList.add('hidden');
document.getElementById('userPrompt').value = "Manual force execution";
integrationBadge.classList.add('hidden');
} else {
document.getElementById('manualInputContainer').classList.add('hidden');
// Show Integration Type Badge
const selectedOption = toolSelect.options[toolSelect.selectedIndex];
if (selectedOption && selectedOption.dataset.integrationType) {
let itype = selectedOption.dataset.integrationType;
integrationBadge.textContent = 'TYPE: ' + itype;
integrationBadge.classList.remove('hidden');
// Add distinct colors for MCI/EAI
if (itype === 'MCI') {
integrationBadge.style.color = '#60a5fa'; // Blue
integrationBadge.style.borderColor = 'rgba(59,130,246,0.3)';
} else if (itype === 'EAI') {
integrationBadge.style.color = '#34d399'; // Green
integrationBadge.style.borderColor = 'rgba(52,211,153,0.3)';
} else {
integrationBadge.style.color = '#a1a1aa'; // Default Gray
integrationBadge.style.borderColor = '#3f3f46';
}
} else {
integrationBadge.classList.add('hidden');
}
updatePrompt();
renderDynamicForm();
}
});
document.addEventListener('DOMContentLoaded', fetchTools);
function collectArguments() {
if (!currentSchema || !currentSchema.properties) return {};
const args = {};
for (const [key, value] of Object.entries(currentSchema.properties)) {
const input = document.getElementById('param_' + key);
if (input) {
if (value.type === 'boolean') args[key] = input.checked;
else if (value.type === 'number' || value.type === 'integer') args[key] = input.value ? Number(input.value) : 0;
else args[key] = input.value;
}
}
return args;
}
document.getElementById('mcpForm').addEventListener('submit', async function(e) {
e.preventDefault();
if(!toolSelect.value) return;
let finalToolName = toolSelect.value;
let finalArguments = {};
if (finalToolName === 'MANUAL_INPUT') {
finalToolName = document.getElementById('manualToolName').value.trim();
if (!finalToolName) return alert("Enter tool name");
try { finalArguments = JSON.parse(document.getElementById('manualToolArgs').value.trim() || '{}'); }
catch(err) { return alert("Invalid JSON format"); }
} else { finalArguments = collectArguments(); }
const loadingOverlay = document.getElementById('loadingOverlay');
const resultContainer = document.getElementById('resultContainer');
const jsonResponse = document.getElementById('jsonResponse');
const statusBadge = document.getElementById('statusBadge');
const btn = this.querySelector('button[type="submit"]');
resultContainer.classList.add('hidden');
loadingOverlay.classList.add('active');
btn.disabled = true;
const payload = { jsonrpc: "2.0", method: "tools/call", params: { name: finalToolName, arguments: finalArguments }, id: Date.now() };
try {
const startTime = Date.now();
const response = await fetch('/mcp/api/v1/tools/call', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Trace-Id': "MCP-REQ-" + Math.floor(Math.random() * 90000 + 10000),
'X-Agent-Id': document.getElementById('agentId').value,
'X-User-Prompt': encodeURIComponent(document.getElementById('userPrompt').value || '')
},
body: JSON.stringify(payload)
});
const data = await response.json();
const latency = Date.now() - startTime;
let formattedJson = JSON.stringify(data, null, 2)
.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
let cls = '';
if (/^"/.test(match)) { cls = /:$/.test(match) ? 'json-key' : 'json-string'; }
else if (/true|false/.test(match)) { cls = 'json-boolean'; }
else if (/null/.test(match)) { cls = 'json-null'; }
else { cls = 'json-number'; }
return '<span class="' + cls + '">' + match + '</span>';
});
jsonResponse.innerHTML = formattedJson;
statusBadge.classList.remove('hidden');
if(response.ok) {
statusBadge.innerHTML = `200 OK &middot; ${latency}ms`;
statusBadge.style.cssText = 'background:rgba(34,197,94,0.15); color:#4ade80; border:1px solid rgba(34,197,94,0.3); padding:2px 8px; border-radius:4px; font-size:10px;';
} else {
statusBadge.innerHTML = `${response.status} ERR &middot; ${latency}ms`;
statusBadge.style.cssText = 'background:rgba(239,68,68,0.15); color:#f87171; border:1px solid rgba(239,68,68,0.3); padding:2px 8px; border-radius:4px; font-size:10px;';
}
} catch (error) {
jsonResponse.textContent = "Error: " + error.message;
statusBadge.innerHTML = `FAILED`;
statusBadge.style.cssText = 'background:rgba(239,68,68,0.15); color:#f87171; border:1px solid rgba(239,68,68,0.3); padding:2px 8px; border-radius:4px; font-size:10px;';
statusBadge.classList.remove('hidden');
} finally {
loadingOverlay.classList.remove('active');
resultContainer.classList.remove('hidden');
btn.disabled = false;
}
});
</script>
</body>
</html>

View File

@@ -0,0 +1,512 @@
<!DOCTYPE html>
<html lang="ko" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shinhan AI MCP Gateway</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Pretendard:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap" rel="stylesheet">
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: {
sans: ['Pretendard', 'sans-serif'],
outfit: ['Outfit', 'sans-serif'],
mono: ['Fira Code', 'monospace']
},
colors: {
brand: {
50: '#eff6ff',
100: '#dbeafe',
400: '#60a5fa',
500: '#3b82f6',
600: '#2563eb',
900: '#1e3a8a',
950: '#172554',
}
},
animation: {
'float': 'float 8s ease-in-out infinite',
'float-delayed': 'float 8s ease-in-out 4s infinite',
'spin-slow': 'spin 3s linear infinite',
'pulse-glow': 'pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite',
},
keyframes: {
'float': {
'0%, 100%': { transform: 'translateY(0px) scale(1)' },
'50%': { transform: 'translateY(-20px) scale(1.05)' },
},
'pulse-glow': {
'0%, 100%': { opacity: 0.5, transform: 'scale(1)' },
'50%': { opacity: 1, transform: 'scale(1.05)' },
}
}
}
}
}
</script>
<style>
body {
background-color: #020617; /* slate-950 */
color: #f8fafc;
overflow-x: hidden;
min-height: 100vh;
display: flex;
align-items: flex-start;
justify-content: center;
padding: 2rem 0;
}
/* Premium Dark Grid Background */
.bg-grid {
position: fixed;
inset: 0;
background-size: 40px 40px;
background-image:
linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
pointer-events: none;
z-index: 0;
mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
-webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}
.glass-panel {
background: rgba(15, 23, 42, 0.6); /* slate-900 */
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.input-premium {
background: rgba(30, 41, 59, 0.5); /* slate-800 */
border: 1px solid rgba(255, 255, 255, 0.1);
color: #f8fafc;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.input-premium:focus {
background: rgba(30, 41, 59, 0.8);
border-color: #3b82f6;
box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), inset 0 2px 4px rgba(0,0,0,0.1);
outline: none;
}
/* Styling the select options for a dark theme (browser native fallback) */
select.input-premium option, select.input-premium optgroup {
background: #1e293b;
color: #f8fafc;
}
.json-pre {
background: transparent;
color: #cbd5e1;
font-size: 13px;
line-height: 1.6;
}
.btn-glow {
position: relative;
z-index: 1;
}
.btn-glow::before {
content: '';
position: absolute;
inset: -2px;
background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #3b82f6);
background-size: 200% auto;
z-index: -1;
border-radius: 12px;
filter: blur(10px);
opacity: 0;
transition: opacity 0.4s ease;
animation: gradient-shift 3s linear infinite;
}
.btn-glow:hover::before {
opacity: 0.8;
}
@keyframes gradient-shift {
0% { background-position: 0% center; }
100% { background-position: 200% center; }
}
/* Loading Overlay Overlay */
#loadingOverlay {
position: absolute;
inset: 0;
background: rgba(15, 23, 42, 0.85);
backdrop-filter: blur(12px);
border-radius: 1.5rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 50;
opacity: 0;
pointer-events: none;
transition: opacity 0.4s ease;
}
#loadingOverlay.active {
opacity: 1;
pointer-events: all;
}
/* Modern Spinner */
.modern-spinner {
width: 50px;
height: 50px;
border-radius: 50%;
border: 3px solid rgba(59, 130, 246, 0.1);
border-top-color: #3b82f6;
border-right-color: #8b5cf6;
animation: spin 1s linear infinite;
}
/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.5); }
::-webkit-scrollbar-thumb { background: rgba(71, 85, 105, 0.8); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 1); }
</style>
</head>
<body class="antialiased selection:bg-brand-500/30 selection:text-brand-50">
<div class="bg-grid"></div>
<!-- Premium Glowing Orbs -->
<div class="fixed top-0 left-[20%] w-[500px] h-[500px] bg-brand-600/20 rounded-full mix-blend-screen filter blur-[120px] animate-float pointer-events-none"></div>
<div class="fixed bottom-0 right-[20%] w-[600px] h-[600px] bg-purple-600/20 rounded-full mix-blend-screen filter blur-[150px] animate-float-delayed pointer-events-none"></div>
<div class="max-w-[850px] w-full px-5 z-10 relative flex flex-col">
<!-- Header (Luxurious) -->
<div class="text-center space-y-4 mb-8 shrink-0 pt-6 relative">
<!-- Agent ID Mini Badge -->
<div class="absolute right-0 top-2 flex items-center bg-slate-800/50 border border-slate-700/50 rounded-lg px-3 py-1.5 shadow-sm">
<svg class="w-3.5 h-3.5 mr-1.5 text-slate-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path></svg>
<input type="text" id="agentId" name="agentId" value="AGENT-AI-1" class="bg-transparent border-none text-xs text-slate-300 font-mono focus:outline-none w-20 text-right" readonly>
</div>
<div class="inline-flex items-center px-3 py-1 rounded-full border border-brand-500/30 bg-brand-500/10 text-brand-400 text-[10px] font-bold uppercase tracking-[0.2em] mb-2">
<span class="w-1.5 h-1.5 rounded-full bg-brand-400 mr-2 animate-pulse"></span>
Next-Gen Router
</div>
<h1 class="text-5xl font-outfit font-extrabold tracking-tight bg-clip-text text-transparent bg-gradient-to-br from-white via-slate-200 to-slate-500 drop-shadow-sm">
신한라이프 AI MCP Gateway
</h1>
<p class="text-sm text-slate-400 font-medium tracking-wide">
엔터프라이즈 환경을 위한 차세대 통합 라우팅 시스템
</p>
</div>
<!-- Main Configuration Panel -->
<div class="glass-panel rounded-[2rem] p-8 relative shrink-0">
<!-- Loading Overlay -->
<div id="loadingOverlay">
<div class="relative w-16 h-16 mb-6">
<div class="modern-spinner absolute inset-0"></div>
<div class="absolute inset-0 flex items-center justify-center">
<div class="w-2 h-2 bg-brand-400 rounded-full animate-ping"></div>
</div>
</div>
<h3 class="text-lg font-outfit font-semibold text-white tracking-wider">처리중 입니다...</h3>
<p class="text-slate-400 text-sm mt-2 font-medium">EIMS 시스템과 안전하게 통신 중입니다</p>
</div>
<form id="mcpForm" class="space-y-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- Target Tool Selection -->
<div class="group">
<label for="toolName" class="flex items-center text-xs font-bold text-slate-400 mb-2 uppercase tracking-widest transition-colors group-focus-within:text-brand-400">
<svg class="w-3.5 h-3.5 mr-1.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg>
대상 툴 (Target Tool)
</label>
<div class="relative">
<select id="toolName" name="toolName" class="input-premium block w-full pl-4 pr-10 py-3 text-sm rounded-xl appearance-none cursor-pointer font-medium">
<option value="">로딩 중...</option>
</select>
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-4 text-slate-500">
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 9l-7 7-7-7"></path></svg>
</div>
</div>
</div>
<!-- Target Action Selection -->
<div class="group">
<label for="toolAction" class="flex items-center text-xs font-bold text-slate-400 mb-2 uppercase tracking-widest transition-colors group-focus-within:text-brand-400">
<svg class="w-3.5 h-3.5 mr-1.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg>
실행 함수 (Action)
</label>
<div class="relative">
<select id="toolAction" name="toolAction" class="input-premium block w-full pl-4 pr-10 py-3 text-sm rounded-xl appearance-none cursor-pointer font-medium">
</select>
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-4 text-slate-500">
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 9l-7 7-7-7"></path></svg>
</div>
</div>
</div>
</div>
<!-- Agent ID moved to Header -->
<!-- User Prompt -->
<div class="group">
<label for="userPrompt" class="flex items-center text-xs font-bold text-slate-400 mb-2 uppercase tracking-widest transition-colors group-focus-within:text-brand-400">
<svg class="w-3.5 h-3.5 mr-1.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"></path></svg>
사용자 프롬프트 (User Prompt)
</label>
<textarea id="userPrompt" name="userPrompt" rows="2" class="input-premium block w-full py-3 px-4 text-sm rounded-xl resize-none placeholder-slate-600 font-medium" placeholder="요청하실 내용을 자유롭게 입력하세요. (예: 김신한 고객 정보 조회)"></textarea>
</div>
<!-- Action Area -->
<div class="flex items-center justify-between pt-4 mt-2 border-t border-white/5">
<div class="flex items-center">
<div class="text-xs font-mono bg-slate-900/80 px-3 py-2 rounded-lg border border-slate-700/50 flex items-center shadow-inner">
<span class="text-emerald-400 font-bold mr-2 text-[10px] tracking-wider">POST</span>
<span class="text-slate-300">/mcp/api/v1/tools/call</span>
</div>
</div>
<div class="btn-glow">
<button type="submit" class="relative inline-flex items-center px-8 py-3 text-sm font-bold rounded-xl text-white bg-gradient-to-r from-brand-600 to-indigo-600 hover:from-brand-500 hover:to-indigo-500 shadow-lg shadow-brand-500/25 transition-all transform hover:-translate-y-0.5 active:translate-y-0">
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg>
Execute
</button>
</div>
</div>
</form>
</div>
<!-- Terminal Result Panel -->
<div id="resultContainer" class="hidden transition-all duration-500 ease-out opacity-0 translate-y-8 mt-6 pb-6">
<div class="bg-[#0d1117] rounded-2xl shadow-2xl border border-slate-700/50 flex flex-col overflow-hidden relative group">
<!-- Header -->
<div class="bg-[#161b22] px-5 py-3 flex justify-between items-center border-b border-slate-800 shrink-0">
<div class="flex space-x-2">
<div class="w-3 h-3 rounded-full bg-[#ff5f56] border border-[#e0443e]"></div>
<div class="w-3 h-3 rounded-full bg-[#ffbd2e] border border-[#dea123]"></div>
<div class="w-3 h-3 rounded-full bg-[#27c93f] border border-[#1aab29]"></div>
</div>
<div class="text-[10px] font-mono font-medium text-slate-500 tracking-widest uppercase">Output_Terminal</div>
<span id="statusBadge" class="inline-flex items-center px-2.5 py-1 rounded-md text-[10px] font-bold font-mono hidden"></span>
</div>
<!-- Payload Output -->
<div class="p-6 relative">
<pre id="jsonResponse" class="json-pre m-0 whitespace-pre-wrap font-mono relative z-10 font-medium"></pre>
</div>
</div>
</div>
</div>
<script>
let toolFunctions = {};
let actionPrompts = {};
const toolSelect = document.getElementById('toolName');
const toolActionSelect = document.getElementById('toolAction');
async function fetchTools() {
try {
const response = await fetch('/mcp/api/v1/tools/list', {
});
const data = await response.json();
toolSelect.innerHTML = '';
toolFunctions = {};
actionPrompts = {};
const tools = data.result?.tools || [];
if (tools.length === 0) {
toolSelect.innerHTML = '<option value="">등록된 툴이 없습니다</option>';
updateActionDropdown();
return;
}
const groupedTools = {};
tools.forEach(tool => {
const group = tool.domainGroup || '기타 그룹';
if (!groupedTools[group]) {
groupedTools[group] = [];
}
groupedTools[group].push(tool);
});
Object.keys(groupedTools).sort().forEach(group => {
const optgroup = document.createElement('optgroup');
let label = group;
if (group.toLowerCase().startsWith('group_')) {
label = 'Group ' + group.split('_')[1];
}
optgroup.label = label;
groupedTools[group].forEach(tool => {
const option = document.createElement('option');
option.value = tool.toolName;
const commType = tool.integrationType ? tool.integrationType : 'HTTP';
option.textContent = tool.description ? `[${commType}] ${tool.description} (${tool.toolName})` : `[${commType}] ${tool.toolName}`;
option.dataset.schema = JSON.stringify(tool.parametersSchema);
option.dataset.prompts = JSON.stringify(tool.actionPrompts || {});
optgroup.appendChild(option);
const enums = tool.parametersSchema?.properties?.action?.enum || [];
const descStr = tool.parametersSchema?.properties?.action?.description || "";
let descMap = {};
if(descStr.includes(":")) {
const items = descStr.split(":")[1].split(",");
items.forEach(item => {
const parts = item.trim().split("(");
if(parts.length > 1) {
descMap[parts[0]] = parts[1].replace(")","");
}
});
}
toolFunctions[tool.toolName] = enums.map(e => {
return { value: e, label: descMap[e] || e };
});
if (tool.actionPrompts) {
Object.assign(actionPrompts, tool.actionPrompts);
}
});
toolSelect.appendChild(optgroup);
});
updateActionDropdown();
} catch (err) {
console.error("Failed to fetch tools", err);
toolSelect.innerHTML = '<option value="">데이터 로드 실패</option>';
}
}
function updateActionDropdown() {
const toolName = toolSelect.value;
const actions = toolFunctions[toolName] || [];
toolActionSelect.innerHTML = '';
if (actions.length === 0) {
const defaultOption = document.createElement('option');
defaultOption.value = 'default';
defaultOption.textContent = '기본 동작';
toolActionSelect.appendChild(defaultOption);
document.getElementById('userPrompt').value = "";
} else {
actions.forEach(action => {
const option = document.createElement('option');
option.value = action.value;
option.textContent = action.label;
toolActionSelect.appendChild(option);
});
updatePrompt(actions[0].value, toolName);
}
}
function updatePrompt(actionValue, toolName) {
let promptKey = actionValue;
if (toolName === "customer_info_tool" && actionValue === "detail") {
promptKey = "detail_cust";
}
document.getElementById('userPrompt').value = actionPrompts[promptKey] || "작업을 실행해주세요.";
}
toolSelect.addEventListener('change', updateActionDropdown);
toolActionSelect.addEventListener('change', function() {
updatePrompt(this.value, toolSelect.value);
});
document.addEventListener('DOMContentLoaded', fetchTools);
document.getElementById('mcpForm').addEventListener('submit', async function(e) {
e.preventDefault();
const loadingOverlay = document.getElementById('loadingOverlay');
const resultContainer = document.getElementById('resultContainer');
const jsonResponse = document.getElementById('jsonResponse');
const statusBadge = document.getElementById('statusBadge');
resultContainer.classList.add('opacity-0', 'translate-y-8');
setTimeout(() => resultContainer.classList.add('hidden'), 300);
// Show Loading
loadingOverlay.classList.add('active');
const payload = {
traceId: "MCP-REQ-" + Math.floor(Math.random() * 90000 + 10000),
agentId: document.getElementById('agentId').value,
userPrompt: document.getElementById('userPrompt').value || document.getElementById('userPrompt').placeholder,
toolName: document.getElementById('toolName').value,
action: document.getElementById('toolAction').value
};
try {
const startTime = Date.now();
const response = await fetch('/mcp/api/v1/tools/call', {
method: 'POST',
headers: { 'Content-Type': 'application/json', },
body: JSON.stringify(payload)
});
const data = await response.json();
const latency = Date.now() - startTime;
// Dark theme optimized syntax highlighting
let formattedJson = JSON.stringify(data, null, 4)
.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
let cls = 'text-slate-300';
if (/^"/.test(match)) {
if (/:$/.test(match)) {
cls = 'text-cyan-400 font-medium'; // Key
} else {
cls = 'text-emerald-400'; // String
}
} else if (/true|false/.test(match)) {
cls = 'text-amber-400 font-medium'; // Boolean
} else if (/null/.test(match)) {
cls = 'text-slate-500 italic'; // Null
} else {
cls = 'text-pink-400'; // Number
}
return '<span class="' + cls + '">' + match + '</span>';
});
jsonResponse.innerHTML = formattedJson;
statusBadge.classList.remove('hidden');
if(response.ok) {
statusBadge.innerHTML = `200 OK <span class="ml-2 opacity-60 font-medium">${latency}ms</span>`;
statusBadge.className = 'inline-flex items-center px-2.5 py-1 rounded-md text-[10px] font-bold font-mono bg-emerald-500/10 text-emerald-400 border border-emerald-500/20';
} else {
statusBadge.innerHTML = `${response.status} ERR <span class="ml-2 opacity-60 font-medium">${latency}ms</span>`;
statusBadge.className = 'inline-flex items-center px-2.5 py-1 rounded-md text-[10px] font-bold font-mono bg-rose-500/10 text-rose-400 border border-rose-500/20';
}
} catch (error) {
jsonResponse.textContent = "Error: " + error.message;
statusBadge.innerHTML = `FAILED`;
statusBadge.className = 'inline-flex items-center px-2.5 py-1 rounded-md text-[10px] font-bold font-mono bg-rose-500/10 text-rose-400 border border-rose-500/20';
statusBadge.classList.remove('hidden');
} finally {
setTimeout(() => {
loadingOverlay.classList.remove('active');
resultContainer.classList.remove('hidden');
void resultContainer.offsetWidth; // Force reflow
resultContainer.classList.remove('opacity-0', 'translate-y-8');
}, 800); // slightly longer loading effect for premium feel
}
});
</script>
</body>
</html>