mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 03:03:48 +00:00
feat(inspector): update visual styling to match landing page
- Update color scheme to match website (black bg, white/10 borders) - Add Open Sans font - Update button styles (white primary buttons) - Add collapsible tool results and status messages - Replace avatar letters with icons (User, Settings, AlertTriangle) - Add status dividers for session/turn events - Update feature coverage badges to lighter grey - Remove pill styling from event times - Update popup menus to solid black background
This commit is contained in:
parent
89933c5f80
commit
f03b4e0203
4 changed files with 421 additions and 319 deletions
|
|
@ -5,31 +5,36 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<title>Sandbox Agent</title>
|
<title>Sandbox Agent</title>
|
||||||
|
<!-- Preconnect to font providers -->
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap" rel="stylesheet" />
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
--bg: #0a0a0a;
|
/* Match landing page colors */
|
||||||
--surface: #1c1c1e;
|
--bg: #000000;
|
||||||
--surface-2: #0f0f0f;
|
--surface: rgba(255, 255, 255, 0.02);
|
||||||
--border: #1c1c1e;
|
--surface-2: rgba(255, 255, 255, 0.01);
|
||||||
--border-2: #2c2c2e;
|
--border: rgba(255, 255, 255, 0.1);
|
||||||
--input-bg: #1c1c1e;
|
--border-2: rgba(255, 255, 255, 0.1);
|
||||||
--input-border: #2c2c2e;
|
--input-bg: rgba(255, 255, 255, 0.02);
|
||||||
--text: #f5f5f7;
|
--input-border: rgba(255, 255, 255, 0.1);
|
||||||
--text-secondary: #e5e5e7;
|
--text: #ffffff;
|
||||||
--muted: #6e6e73;
|
--text-secondary: #a1a1aa; /* zinc-400 */
|
||||||
--muted-2: #4a4a4c;
|
--muted: #71717a; /* zinc-500 */
|
||||||
|
--muted-2: #52525b; /* zinc-600 */
|
||||||
--accent: #ff4f00;
|
--accent: #ff4f00;
|
||||||
--accent-hover: #ff6a00;
|
--accent-hover: #ff6a00;
|
||||||
--success: #30d158;
|
--success: #4ade80; /* green-400 */
|
||||||
--warning: #ff9f0a;
|
--warning: #fbbf24; /* amber-400 */
|
||||||
--danger: #ff3b30;
|
--danger: #f87171; /* red-400 */
|
||||||
--purple: #bf5af2;
|
--purple: #a78bfa; /* violet-400 */
|
||||||
--cyan: #64d2ff;
|
--cyan: #22d3ee; /* cyan-400 */
|
||||||
--radius: 8px;
|
--radius: 8px;
|
||||||
--radius-sm: 6px;
|
--radius-sm: 6px;
|
||||||
--radius-lg: 12px;
|
--radius-lg: 16px;
|
||||||
--transition: 150ms ease;
|
--transition: 200ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
|
|
@ -45,9 +50,22 @@
|
||||||
|
|
||||||
body {
|
body {
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
|
font-family: 'Open Sans', system-ui, sans-serif;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.4;
|
line-height: 1.5;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Text selection - match landing page */
|
||||||
|
::selection {
|
||||||
|
background-color: rgba(255, 79, 0, 0.3);
|
||||||
|
color: #fed7aa;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-moz-selection {
|
||||||
|
background-color: rgba(255, 79, 0, 0.3);
|
||||||
|
color: #fed7aa;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
|
@ -110,25 +128,6 @@
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-link {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 5px;
|
|
||||||
padding: 5px 10px;
|
|
||||||
border: 1px solid var(--border-2);
|
|
||||||
border-radius: var(--radius-sm);
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--muted);
|
|
||||||
text-decoration: none;
|
|
||||||
transition: color var(--transition), border-color var(--transition);
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-link:hover {
|
|
||||||
color: var(--accent);
|
|
||||||
border-color: var(--accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-indicator.disconnected {
|
.status-indicator.disconnected {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -198,9 +197,14 @@
|
||||||
|
|
||||||
.connect-card {
|
.connect-card {
|
||||||
background: var(--surface);
|
background: var(--surface);
|
||||||
border: 1px solid var(--border-2);
|
border: 1px solid var(--border);
|
||||||
border-radius: var(--radius-lg);
|
border-radius: var(--radius-lg);
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
|
transition: border-color var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.connect-card:hover {
|
||||||
|
border-color: rgba(255, 255, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.connect-card-title {
|
.connect-card-title {
|
||||||
|
|
@ -287,36 +291,45 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
padding: 10px 16px;
|
padding: 10px 20px;
|
||||||
border-radius: var(--radius-sm);
|
border-radius: var(--radius);
|
||||||
border: none;
|
border: none;
|
||||||
font-size: 13px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 500;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background var(--transition), opacity var(--transition);
|
transition: all var(--transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
.button.primary {
|
.button.primary {
|
||||||
background: var(--accent);
|
background: #ffffff;
|
||||||
color: #fff;
|
color: #000000;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button.primary:hover:not(:disabled) {
|
.button.primary:hover:not(:disabled) {
|
||||||
background: var(--accent-hover);
|
background: #e4e4e7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button.secondary {
|
.button.secondary {
|
||||||
background: var(--border-2);
|
background: transparent;
|
||||||
|
border: 1px solid var(--border);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button.secondary:hover:not(:disabled) {
|
||||||
|
border-color: rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
.button.ghost {
|
.button.ghost {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
padding: 6px 10px;
|
padding: 6px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button.ghost:hover:not(:disabled) {
|
||||||
|
background: rgba(255, 79, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
.button.danger {
|
.button.danger {
|
||||||
background: var(--danger);
|
background: var(--danger);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
@ -324,12 +337,12 @@
|
||||||
|
|
||||||
.button.success {
|
.button.success {
|
||||||
background: var(--success);
|
background: var(--success);
|
||||||
color: #fff;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button.small {
|
.button.small {
|
||||||
padding: 6px 10px;
|
padding: 6px 12px;
|
||||||
font-size: 11px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:disabled {
|
.button:disabled {
|
||||||
|
|
@ -422,8 +435,8 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border-right: 1px solid var(--border);
|
border-right: 1px solid var(--border);
|
||||||
background: var(--surface-2);
|
background: var(--bg);
|
||||||
min-height: 0;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-header {
|
.sidebar-header {
|
||||||
|
|
@ -502,10 +515,10 @@
|
||||||
top: 36px;
|
top: 36px;
|
||||||
left: 0;
|
left: 0;
|
||||||
min-width: 220px;
|
min-width: 220px;
|
||||||
background: var(--surface);
|
background: #000000;
|
||||||
border: 1px solid var(--border-2);
|
border: 1px solid var(--border);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -574,20 +587,6 @@
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setup-custom-back {
|
|
||||||
flex-shrink: 0;
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
color: var(--accent);
|
|
||||||
font-size: 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 2px 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.setup-custom-back:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.session-create-section {
|
.session-create-section {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
@ -1024,8 +1023,8 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
border-radius: var(--radius-sm);
|
border-radius: var(--radius);
|
||||||
padding: 10px;
|
padding: 12px;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
@ -1038,12 +1037,12 @@
|
||||||
|
|
||||||
.session-item:hover {
|
.session-item:hover {
|
||||||
background: var(--surface);
|
background: var(--surface);
|
||||||
border-color: var(--border-2);
|
border-color: var(--border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.session-item.active {
|
.session-item.active {
|
||||||
background: rgba(255, 79, 0, 0.1);
|
background: rgba(255, 255, 255, 0.06);
|
||||||
border-color: var(--accent);
|
border-color: rgba(255, 255, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.session-item-id {
|
.session-item-id {
|
||||||
|
|
@ -1088,23 +1087,6 @@
|
||||||
color: var(--danger);
|
color: var(--danger);
|
||||||
}
|
}
|
||||||
|
|
||||||
.session-persistence-note {
|
|
||||||
padding: 8px 10px 10px;
|
|
||||||
border-top: 1px solid var(--border);
|
|
||||||
font-size: 10px;
|
|
||||||
line-height: 1.45;
|
|
||||||
color: var(--muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.session-persistence-note a {
|
|
||||||
color: var(--accent);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.session-persistence-note a:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Chat Panel */
|
/* Chat Panel */
|
||||||
.chat-panel {
|
.chat-panel {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -1117,7 +1099,7 @@
|
||||||
height: 41px;
|
height: 41px;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
border-bottom: 1px solid var(--border);
|
border-bottom: 1px solid var(--border);
|
||||||
background: var(--surface-2);
|
background: var(--bg);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -1218,6 +1200,26 @@
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mock-agent-hint {
|
||||||
|
margin-top: 16px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
background: var(--surface);
|
||||||
|
border: 1px solid var(--border-2);
|
||||||
|
border-radius: var(--radius);
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
max-width: 320px;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mock-agent-hint code {
|
||||||
|
background: var(--border-2);
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, monospace;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
.empty-state-menu-wrapper {
|
.empty-state-menu-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
@ -1272,23 +1274,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-content {
|
.message-content {
|
||||||
padding: 10px 14px;
|
padding: 12px 16px;
|
||||||
border-radius: var(--radius-lg);
|
border-radius: var(--radius-lg);
|
||||||
max-width: 80%;
|
max-width: 80%;
|
||||||
line-height: 1.5;
|
line-height: 1.6;
|
||||||
font-size: 13px;
|
font-size: 14px;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message.user .message-content {
|
.message.user .message-content {
|
||||||
background: var(--accent);
|
background: #ffffff;
|
||||||
color: #fff;
|
color: #000000;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message.assistant .message-content {
|
.message.assistant .message-content {
|
||||||
background: var(--surface);
|
background: var(--surface);
|
||||||
|
border: 1px solid var(--border);
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
@ -1326,6 +1329,106 @@
|
||||||
color: var(--danger);
|
color: var(--danger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.message.no-avatar {
|
||||||
|
padding-left: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-icon {
|
||||||
|
color: var(--danger);
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.system-icon {
|
||||||
|
color: var(--muted);
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-divider {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-divider-line {
|
||||||
|
flex: 1;
|
||||||
|
height: 1px;
|
||||||
|
background: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-divider-text {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--muted);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Collapsible Messages */
|
||||||
|
.collapsible-message {
|
||||||
|
border-radius: var(--radius);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 8px 12px;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: color var(--transition);
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-header:hover {
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-message.tool .collapsible-header {
|
||||||
|
color: var(--cyan);
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-message.tool .collapsible-header:hover {
|
||||||
|
color: var(--cyan);
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-message.error .collapsible-header {
|
||||||
|
color: var(--danger);
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-message.system .collapsible-header {
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-icon {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: rgba(100, 210, 255, 0.15);
|
||||||
|
color: var(--cyan);
|
||||||
|
font-size: 10px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsible-content {
|
||||||
|
padding: 0 12px 12px 38px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
.message-meta {
|
.message-meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -1372,64 +1475,6 @@
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-stack {
|
|
||||||
position: fixed;
|
|
||||||
right: 16px;
|
|
||||||
bottom: 16px;
|
|
||||||
z-index: 1000;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
width: min(420px, calc(100vw - 24px));
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast {
|
|
||||||
pointer-events: auto;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
gap: 10px;
|
|
||||||
padding: 10px 12px;
|
|
||||||
border-radius: var(--radius-sm);
|
|
||||||
border: 1px solid rgba(255, 59, 48, 0.35);
|
|
||||||
background: rgba(28, 8, 8, 0.95);
|
|
||||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-content {
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-title {
|
|
||||||
font-size: 10px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.4px;
|
|
||||||
color: var(--danger);
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-message {
|
|
||||||
color: var(--text-secondary);
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.4;
|
|
||||||
word-break: break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-close {
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
color: var(--muted);
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1;
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 2px;
|
|
||||||
margin-top: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-close:hover {
|
|
||||||
color: var(--text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor {
|
.cursor {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 2px;
|
width: 2px;
|
||||||
|
|
@ -1505,14 +1550,14 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
background: var(--surface);
|
background: var(--surface);
|
||||||
border: 1px solid var(--border-2);
|
border: 1px solid var(--border);
|
||||||
border-radius: var(--radius-lg);
|
border-radius: var(--radius-lg);
|
||||||
padding: 10px 12px;
|
padding: 12px 14px;
|
||||||
transition: border-color var(--transition);
|
transition: border-color var(--transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-wrapper:focus-within {
|
.input-wrapper:focus-within {
|
||||||
border-color: var(--accent);
|
border-color: rgba(255, 255, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-wrapper textarea {
|
.input-wrapper textarea {
|
||||||
|
|
@ -1589,7 +1634,7 @@
|
||||||
|
|
||||||
.session-config-value {
|
.session-config-value {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #8e8e93;
|
color: var(--muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setup Row */
|
/* Setup Row */
|
||||||
|
|
@ -1800,7 +1845,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 41px;
|
height: 41px;
|
||||||
border-bottom: 1px solid var(--border);
|
border-bottom: 1px solid var(--border);
|
||||||
background: var(--surface-2);
|
background: var(--bg);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
@ -1808,14 +1853,13 @@
|
||||||
.debug-tab {
|
.debug-tab {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
font-size: 11px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.5px;
|
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
border-bottom: 2px solid transparent;
|
border-bottom: 2px solid transparent;
|
||||||
|
margin-bottom: -1px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: color var(--transition), border-color var(--transition);
|
transition: color var(--transition), border-color var(--transition);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
@ -1873,10 +1917,15 @@
|
||||||
/* Cards */
|
/* Cards */
|
||||||
.card {
|
.card {
|
||||||
background: var(--surface);
|
background: var(--surface);
|
||||||
border: 1px solid var(--border-2);
|
border: 1px solid var(--border);
|
||||||
border-radius: var(--radius-sm);
|
border-radius: var(--radius);
|
||||||
padding: 12px;
|
padding: 16px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
|
transition: border-color var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card:hover {
|
||||||
|
border-color: rgba(255, 255, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card:last-child {
|
.card:last-child {
|
||||||
|
|
@ -1967,13 +2016,18 @@
|
||||||
|
|
||||||
.event-item {
|
.event-item {
|
||||||
background: var(--surface);
|
background: var(--surface);
|
||||||
border: 1px solid var(--border-2);
|
border: 1px solid var(--border);
|
||||||
border-radius: var(--radius-sm);
|
border-radius: var(--radius);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
transition: border-color var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-item:hover {
|
||||||
|
border-color: rgba(255, 255, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.event-item.expanded {
|
.event-item.expanded {
|
||||||
box-shadow: 0 0 0 1px rgba(255, 79, 0, 0.12);
|
border-color: rgba(255, 79, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.event-summary {
|
.event-summary {
|
||||||
|
|
@ -2040,89 +2094,87 @@
|
||||||
letter-spacing: 0.3px;
|
letter-spacing: 0.3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ACP event categories: connection */
|
.event-type.session,
|
||||||
.event-type.connection,
|
.event-type.session-started,
|
||||||
.event-type.session {
|
.event-type.session-ended {
|
||||||
color: var(--success);
|
color: var(--success);
|
||||||
}
|
}
|
||||||
.event-icon.connection,
|
|
||||||
.event-icon.session {
|
.event-type.item,
|
||||||
|
.event-type.item-started,
|
||||||
|
.event-type.item-completed {
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-type.item-delta {
|
||||||
|
color: var(--cyan);
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-type.error,
|
||||||
|
.event-type.agent-unparsed {
|
||||||
|
color: var(--danger);
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-type.question,
|
||||||
|
.event-type.question-requested,
|
||||||
|
.event-type.question-resolved {
|
||||||
|
color: var(--warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-type.permission,
|
||||||
|
.event-type.permission-requested,
|
||||||
|
.event-type.permission-resolved {
|
||||||
|
color: var(--purple);
|
||||||
|
}
|
||||||
|
|
||||||
|
.event-icon.session,
|
||||||
|
.event-icon.session-started,
|
||||||
|
.event-icon.session-ended {
|
||||||
color: var(--success);
|
color: var(--success);
|
||||||
border-color: rgba(48, 209, 88, 0.35);
|
border-color: rgba(48, 209, 88, 0.35);
|
||||||
background: rgba(48, 209, 88, 0.12);
|
background: rgba(48, 209, 88, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ACP event categories: prompt / tool */
|
.event-icon.item,
|
||||||
.event-type.prompt,
|
.event-icon.item-started,
|
||||||
.event-type.tool {
|
.event-icon.item-completed {
|
||||||
color: var(--accent);
|
|
||||||
}
|
|
||||||
.event-icon.prompt,
|
|
||||||
.event-icon.tool {
|
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
border-color: rgba(255, 79, 0, 0.35);
|
border-color: rgba(255, 79, 0, 0.35);
|
||||||
background: rgba(255, 79, 0, 0.12);
|
background: rgba(255, 79, 0, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ACP event categories: update / terminal (streaming, realtime) */
|
.event-icon.item-delta {
|
||||||
.event-type.update,
|
|
||||||
.event-type.terminal {
|
|
||||||
color: var(--cyan);
|
|
||||||
}
|
|
||||||
.event-icon.update,
|
|
||||||
.event-icon.terminal {
|
|
||||||
color: var(--cyan);
|
color: var(--cyan);
|
||||||
border-color: rgba(100, 210, 255, 0.35);
|
border-color: rgba(100, 210, 255, 0.35);
|
||||||
background: rgba(100, 210, 255, 0.12);
|
background: rgba(100, 210, 255, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ACP event categories: cancel */
|
.event-icon.error,
|
||||||
.event-type.cancel {
|
.event-icon.agent-unparsed {
|
||||||
color: var(--danger);
|
|
||||||
}
|
|
||||||
.event-icon.cancel {
|
|
||||||
color: var(--danger);
|
color: var(--danger);
|
||||||
border-color: rgba(255, 59, 48, 0.35);
|
border-color: rgba(255, 59, 48, 0.35);
|
||||||
background: rgba(255, 59, 48, 0.12);
|
background: rgba(255, 59, 48, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ACP event categories: filesystem */
|
.event-icon.question,
|
||||||
.event-type.filesystem {
|
.event-icon.question-requested,
|
||||||
color: var(--warning);
|
.event-icon.question-resolved {
|
||||||
}
|
|
||||||
.event-icon.filesystem {
|
|
||||||
color: var(--warning);
|
color: var(--warning);
|
||||||
border-color: rgba(255, 159, 10, 0.35);
|
border-color: rgba(255, 159, 10, 0.35);
|
||||||
background: rgba(255, 159, 10, 0.12);
|
background: rgba(255, 159, 10, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ACP event categories: config / permission */
|
.event-icon.permission,
|
||||||
.event-type.config,
|
.event-icon.permission-requested,
|
||||||
.event-type.permission {
|
.event-icon.permission-resolved {
|
||||||
color: var(--purple);
|
|
||||||
}
|
|
||||||
.event-icon.config,
|
|
||||||
.event-icon.permission {
|
|
||||||
color: var(--purple);
|
color: var(--purple);
|
||||||
border-color: rgba(191, 90, 242, 0.35);
|
border-color: rgba(191, 90, 242, 0.35);
|
||||||
background: rgba(191, 90, 242, 0.12);
|
background: rgba(191, 90, 242, 0.12);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ACP event categories: response (fallback) */
|
|
||||||
.event-type.response {
|
|
||||||
color: var(--muted);
|
|
||||||
}
|
|
||||||
.event-icon.response {
|
|
||||||
color: var(--muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.event-time {
|
.event-time {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
padding: 2px 8px;
|
|
||||||
border-radius: 999px;
|
|
||||||
border: 1px solid var(--border-2);
|
|
||||||
background: rgba(255, 255, 255, 0.04);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.event-id {
|
.event-id {
|
||||||
|
|
@ -2175,7 +2227,7 @@
|
||||||
.log-method {
|
.log-method {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: var(--accent);
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
||||||
.log-url {
|
.log-url {
|
||||||
|
|
@ -2283,8 +2335,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.feature-coverage-badge.enabled {
|
.feature-coverage-badge.enabled {
|
||||||
background: rgba(48, 209, 88, 0.12);
|
background: rgba(255, 255, 255, 0.08);
|
||||||
color: var(--success);
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
||||||
.feature-coverage-badge.disabled {
|
.feature-coverage-badge.disabled {
|
||||||
|
|
@ -2296,26 +2348,32 @@
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scrollbar */
|
/* Scrollbar - match landing page */
|
||||||
.messages-container::-webkit-scrollbar,
|
* {
|
||||||
.debug-content::-webkit-scrollbar {
|
scrollbar-width: thin;
|
||||||
width: 6px;
|
scrollbar-color: #3f3f46 transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.messages-container::-webkit-scrollbar-track,
|
::-webkit-scrollbar {
|
||||||
.debug-content::-webkit-scrollbar-track {
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.messages-container::-webkit-scrollbar-thumb,
|
::-webkit-scrollbar-thumb {
|
||||||
.debug-content::-webkit-scrollbar-thumb {
|
background: #3f3f46;
|
||||||
background: #3a3a3c;
|
border-radius: 9999px;
|
||||||
border-radius: 3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.messages-container::-webkit-scrollbar-thumb:hover,
|
::-webkit-scrollbar-thumb:hover {
|
||||||
.debug-content::-webkit-scrollbar-thumb:hover {
|
background: #52525b;
|
||||||
background: #48484a;
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-corner {
|
||||||
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Responsive */
|
/* Responsive */
|
||||||
|
|
@ -2353,13 +2411,6 @@
|
||||||
.header-title {
|
.header-title {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-stack {
|
|
||||||
left: 12px;
|
|
||||||
right: 12px;
|
|
||||||
bottom: 12px;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
||||||
|
|
@ -1,102 +1,150 @@
|
||||||
|
import { useState } from "react";
|
||||||
import { getAvatarLabel, getMessageClass } from "./messageUtils";
|
import { getAvatarLabel, getMessageClass } from "./messageUtils";
|
||||||
|
import renderContentPart from "./renderContentPart";
|
||||||
import type { TimelineEntry } from "./types";
|
import type { TimelineEntry } from "./types";
|
||||||
import { formatJson } from "../../utils/format";
|
import { AlertTriangle, Settings, ChevronRight, ChevronDown } from "lucide-react";
|
||||||
|
|
||||||
|
const CollapsibleMessage = ({
|
||||||
|
id,
|
||||||
|
icon,
|
||||||
|
label,
|
||||||
|
children,
|
||||||
|
className = ""
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
icon: React.ReactNode;
|
||||||
|
label: string;
|
||||||
|
children: React.ReactNode;
|
||||||
|
className?: string;
|
||||||
|
}) => {
|
||||||
|
const [expanded, setExpanded] = useState(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={`collapsible-message ${className}`}>
|
||||||
|
<button className="collapsible-header" onClick={() => setExpanded(!expanded)}>
|
||||||
|
{expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}
|
||||||
|
{icon}
|
||||||
|
<span>{label}</span>
|
||||||
|
</button>
|
||||||
|
{expanded && <div className="collapsible-content">{children}</div>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const ChatMessages = ({
|
const ChatMessages = ({
|
||||||
entries,
|
entries,
|
||||||
sessionError,
|
sessionError,
|
||||||
|
eventError,
|
||||||
messagesEndRef
|
messagesEndRef
|
||||||
}: {
|
}: {
|
||||||
entries: TimelineEntry[];
|
entries: TimelineEntry[];
|
||||||
sessionError: string | null;
|
sessionError: string | null;
|
||||||
|
eventError: string | null;
|
||||||
messagesEndRef: React.RefObject<HTMLDivElement>;
|
messagesEndRef: React.RefObject<HTMLDivElement>;
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div className="messages">
|
<div className="messages">
|
||||||
{entries.map((entry) => {
|
{entries.map((entry) => {
|
||||||
const messageClass = getMessageClass(entry);
|
|
||||||
|
|
||||||
if (entry.kind === "meta") {
|
if (entry.kind === "meta") {
|
||||||
return (
|
const isError = entry.meta?.severity === "error";
|
||||||
<div key={entry.id} className={`message ${messageClass}`}>
|
const title = entry.meta?.title ?? "Status";
|
||||||
<div className="avatar">{getAvatarLabel(messageClass)}</div>
|
const isStatusDivider = ["Session Started", "Turn Started", "Turn Ended"].includes(title);
|
||||||
<div className="message-content">
|
|
||||||
<div className="message-meta">
|
if (isStatusDivider) {
|
||||||
<span>{entry.meta?.title ?? "Status"}</span>
|
return (
|
||||||
</div>
|
<div key={entry.id} className="status-divider">
|
||||||
{entry.meta?.detail && <div className="part-body">{entry.meta.detail}</div>}
|
<div className="status-divider-line" />
|
||||||
|
<span className="status-divider-text">
|
||||||
|
<Settings size={12} />
|
||||||
|
{title}
|
||||||
|
</span>
|
||||||
|
<div className="status-divider-line" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Other status messages - collapsible
|
||||||
|
return (
|
||||||
|
<CollapsibleMessage
|
||||||
|
key={entry.id}
|
||||||
|
id={entry.id}
|
||||||
|
icon={isError ? <AlertTriangle size={14} className="error-icon" /> : <Settings size={14} className="system-icon" />}
|
||||||
|
label={title}
|
||||||
|
className={isError ? "error" : "system"}
|
||||||
|
>
|
||||||
|
{entry.meta?.detail && <div className="part-body">{entry.meta.detail}</div>}
|
||||||
|
</CollapsibleMessage>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.kind === "reasoning") {
|
const item = entry.item;
|
||||||
|
if (!item) return null;
|
||||||
|
const hasParts = (item.content ?? []).length > 0;
|
||||||
|
const isInProgress = item.status === "in_progress";
|
||||||
|
const isFailed = item.status === "failed";
|
||||||
|
const messageClass = getMessageClass(item);
|
||||||
|
const statusLabel = item.status !== "completed" ? item.status.replace("_", " ") : "";
|
||||||
|
const kindLabel = item.kind.replace("_", " ");
|
||||||
|
const isTool = messageClass === "tool";
|
||||||
|
|
||||||
|
// Tool results - collapsible
|
||||||
|
if (isTool) {
|
||||||
return (
|
return (
|
||||||
<div key={entry.id} className="message assistant">
|
<CollapsibleMessage
|
||||||
<div className="avatar">AI</div>
|
key={entry.id}
|
||||||
<div className="message-content">
|
id={entry.id}
|
||||||
<div className="message-meta">
|
icon={<span className="tool-icon">T</span>}
|
||||||
<span>reasoning - {entry.reasoning?.visibility ?? "public"}</span>
|
label={`${kindLabel}${statusLabel ? ` (${statusLabel})` : ""}`}
|
||||||
</div>
|
className="tool"
|
||||||
<div className="part-body muted">{entry.reasoning?.text ?? ""}</div>
|
>
|
||||||
</div>
|
{hasParts ? (
|
||||||
</div>
|
(item.content ?? []).map(renderContentPart)
|
||||||
|
) : entry.deltaText ? (
|
||||||
|
<span>{entry.deltaText}</span>
|
||||||
|
) : (
|
||||||
|
<span className="muted">No content.</span>
|
||||||
|
)}
|
||||||
|
</CollapsibleMessage>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.kind === "tool") {
|
return (
|
||||||
const isComplete = entry.toolStatus === "completed" || entry.toolStatus === "failed";
|
<div key={entry.id} className={`message ${messageClass} ${isFailed ? "error no-avatar" : ""}`}>
|
||||||
const isFailed = entry.toolStatus === "failed";
|
{!isFailed && <div className="avatar">{getAvatarLabel(messageClass)}</div>}
|
||||||
return (
|
<div className="message-content">
|
||||||
<div key={entry.id} className={`message tool ${isFailed ? "error" : ""}`}>
|
{(item.kind !== "message" || item.status !== "completed") && (
|
||||||
<div className="avatar">{getAvatarLabel(isFailed ? "error" : "tool")}</div>
|
|
||||||
<div className="message-content">
|
|
||||||
<div className="message-meta">
|
<div className="message-meta">
|
||||||
<span>tool call - {entry.toolName}</span>
|
{isFailed && <AlertTriangle size={14} className="error-icon" />}
|
||||||
{entry.toolStatus && entry.toolStatus !== "completed" && (
|
<span>{kindLabel}</span>
|
||||||
<span className={`pill ${isFailed ? "danger" : "accent"}`}>
|
{statusLabel && (
|
||||||
{entry.toolStatus.replace("_", " ")}
|
<span className={`pill ${item.status === "failed" ? "danger" : "accent"}`}>
|
||||||
|
{statusLabel}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{entry.toolInput && <pre className="code-block">{entry.toolInput}</pre>}
|
)}
|
||||||
{isComplete && entry.toolOutput && (
|
{hasParts ? (
|
||||||
<div className="part">
|
(item.content ?? []).map(renderContentPart)
|
||||||
<div className="part-title">result</div>
|
) : entry.deltaText ? (
|
||||||
<pre className="code-block">{entry.toolOutput}</pre>
|
<span>
|
||||||
</div>
|
{entry.deltaText}
|
||||||
)}
|
{isInProgress && <span className="cursor" />}
|
||||||
{!isComplete && !entry.toolInput && (
|
</span>
|
||||||
<span className="thinking-indicator">
|
) : isInProgress ? (
|
||||||
<span className="thinking-dot" />
|
|
||||||
<span className="thinking-dot" />
|
|
||||||
<span className="thinking-dot" />
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Message (user or assistant)
|
|
||||||
return (
|
|
||||||
<div key={entry.id} className={`message ${messageClass}`}>
|
|
||||||
<div className="avatar">{getAvatarLabel(messageClass)}</div>
|
|
||||||
<div className="message-content">
|
|
||||||
{entry.text ? (
|
|
||||||
<div className="part-body">{entry.text}</div>
|
|
||||||
) : (
|
|
||||||
<span className="thinking-indicator">
|
<span className="thinking-indicator">
|
||||||
<span className="thinking-dot" />
|
<span className="thinking-dot" />
|
||||||
<span className="thinking-dot" />
|
<span className="thinking-dot" />
|
||||||
<span className="thinking-dot" />
|
<span className="thinking-dot" />
|
||||||
</span>
|
</span>
|
||||||
|
) : (
|
||||||
|
<span className="muted">No content yet.</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
{sessionError && <div className="message-error">{sessionError}</div>}
|
{sessionError && <div className="message-error">{sessionError}</div>}
|
||||||
|
{eventError && <div className="message-error">{eventError}</div>}
|
||||||
<div ref={messagesEndRef} />
|
<div ref={messagesEndRef} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
import type { TimelineEntry } from "./types";
|
|
||||||
|
|
||||||
export const getMessageClass = (entry: TimelineEntry) => {
|
|
||||||
if (entry.kind === "tool") return "tool";
|
|
||||||
if (entry.kind === "meta") return entry.meta?.severity === "error" ? "error" : "system";
|
|
||||||
if (entry.kind === "reasoning") return "assistant";
|
|
||||||
if (entry.role === "user") return "user";
|
|
||||||
return "assistant";
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getAvatarLabel = (messageClass: string) => {
|
|
||||||
if (messageClass === "user") return "U";
|
|
||||||
if (messageClass === "tool") return "T";
|
|
||||||
if (messageClass === "system") return "S";
|
|
||||||
if (messageClass === "error") return "!";
|
|
||||||
return "AI";
|
|
||||||
};
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
import type { UniversalItem } from "sandbox-agent";
|
||||||
|
import { Settings, AlertTriangle, User } from "lucide-react";
|
||||||
|
import type { ReactNode } from "react";
|
||||||
|
|
||||||
|
export const getMessageClass = (item: UniversalItem) => {
|
||||||
|
if (item.kind === "tool_call" || item.kind === "tool_result") return "tool";
|
||||||
|
if (item.kind === "system" || item.kind === "status") return "system";
|
||||||
|
if (item.role === "user") return "user";
|
||||||
|
if (item.role === "tool") return "tool";
|
||||||
|
if (item.role === "system") return "system";
|
||||||
|
return "assistant";
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getAvatarLabel = (messageClass: string): ReactNode => {
|
||||||
|
if (messageClass === "user") return <User size={14} />;
|
||||||
|
if (messageClass === "tool") return "T";
|
||||||
|
if (messageClass === "system") return <Settings size={14} />;
|
||||||
|
if (messageClass === "error") return <AlertTriangle size={14} />;
|
||||||
|
return "AI";
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue