Файли
openidea/src/features/agents/McpServers.module.css
T
Deng Liuтаdengliu 32abc77a74 feat(agents): multi-level MCP hub, CLI config discovery, and per-session MCP picker (#3626)
MCP servers can be configured at user and project level, imported from pasted JSON, tested with their tool list shown, and discovered from other agent CLIs' config files. Discovery reports only env and header key names, never values, and importing is explicit; external config files are never modified. Testing a server requires a trusted project. Each agent session can turn individual servers on or off from a picker; the overrides are stored with the task and applied when the session opens.

Closes #3608

Co-authored-by: dengliu <[email protected]>
2026-11-16 14:32:11 +08:00

666 рядки
11 KiB
CSS

.page {
display: flex;
flex-direction: column;
gap: var(--space-2);
font-size: var(--fs-ui);
color: var(--fg-strong);
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: var(--space-2);
}
.headerActions {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1-5);
}
.title {
margin: 0;
font-size: 16px;
font-weight: 600;
color: var(--fg-strong);
}
.lead {
margin: 0;
color: var(--fg-muted);
line-height: 1.45;
}
.link {
padding: 0;
border: none;
background: none;
color: var(--link);
font: inherit;
cursor: pointer;
}
.link:hover {
text-decoration: underline;
}
.topControls {
display: flex;
flex-direction: column;
gap: var(--space-2);
}
.tabBar {
border-bottom: 1px solid var(--border);
}
.search {
width: 100%;
}
.error {
display: flex;
align-items: flex-start;
gap: var(--space-1-5);
padding: 6px 8px;
border-radius: var(--radius-control);
background: color-mix(in srgb, var(--danger) 12%, transparent);
color: var(--danger);
font-size: var(--fs-small);
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.notice {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
padding: 6px 10px;
border-radius: var(--radius-control);
background: color-mix(in srgb, var(--accent) 14%, var(--bg-elev));
color: var(--fg);
font-size: var(--fs-small);
}
.noticeMain {
display: flex;
align-items: center;
gap: var(--space-1-5);
min-width: 0;
}
.builtinCard {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
padding: 8px 12px;
border-radius: var(--radius-control);
background: var(--bg-elev);
box-shadow: inset 0 0 0 1px var(--border);
}
.builtinMain {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
min-width: 0;
}
.builtinHeader {
display: flex;
align-items: center;
gap: var(--space-1-5);
flex-wrap: wrap;
}
.sections {
display: flex;
flex-direction: column;
gap: var(--space-3);
}
.section {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
}
.sectionBar {
display: flex;
align-items: center;
justify-content: space-between;
min-height: 28px;
padding: 2px 2px;
gap: var(--space-2);
}
.sectionToggle {
display: flex;
align-items: center;
gap: var(--space-1-5);
flex: 1;
min-width: 0;
padding: 4px 2px;
border: none;
background: none;
color: var(--fg-strong);
font: inherit;
font-weight: 600;
text-align: left;
cursor: pointer;
}
.chevron {
color: var(--fg-muted);
flex-shrink: 0;
}
.sectionTitle {
font-size: var(--fs-ui);
font-weight: 600;
}
.sectionHint {
color: var(--fg-muted);
font-size: var(--fs-small);
font-weight: 400;
}
.badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 18px;
height: 18px;
padding: 0 6px;
border-radius: 999px;
background: var(--bg-hover);
color: var(--fg-muted);
font-size: 11px;
font-weight: 600;
line-height: 1;
}
.sectionBody {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
}
.sectionNote {
margin: 0;
padding: 0 4px 2px 20px;
color: var(--fg-muted);
font-size: var(--fs-small);
line-height: 1.4;
}
.emptyBox {
padding: 12px 14px;
border-radius: var(--radius-control);
background: var(--bg-elev);
box-shadow: inset 0 0 0 1px var(--border);
color: var(--fg-muted);
font-size: var(--fs-small);
}
/* Cline-inspired expandable server card with OpenIDEA multi-level badges. */
.card {
display: flex;
flex-direction: column;
border-radius: var(--radius-control);
background: var(--bg-elev);
box-shadow: inset 0 0 0 1px var(--border);
overflow: hidden;
}
.cardHeader {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
padding: 8px 10px;
}
.cardHeader:hover {
background: var(--bg-hover);
}
.cardExpandBtn {
display: flex;
align-items: center;
gap: var(--space-2);
flex: 1;
min-width: 0;
padding: 0;
border: 0;
background: none;
color: inherit;
font: inherit;
text-align: left;
cursor: pointer;
}
.cardMain {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
min-width: 0;
flex: 1;
}
.cardTitleRow {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1-5);
min-width: 0;
}
.serverName {
font-weight: 600;
color: var(--fg-strong);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tag {
display: inline-flex;
align-items: center;
gap: var(--space-1);
height: 18px;
padding: 0 6px;
border-radius: var(--radius-small, 3px);
background: var(--bg-floating-toolbar);
color: var(--fg-secondary);
font-size: var(--fs-tiny);
font-weight: 500;
white-space: nowrap;
}
.tagAccent {
background: color-mix(in srgb, var(--accent) 18%, var(--bg-elev));
color: var(--link);
}
.tagWarning {
background: color-mix(in srgb, var(--warning) 18%, var(--bg-elev));
color: var(--warning);
}
.tagSuccess {
background: color-mix(in srgb, var(--success) 18%, var(--bg-elev));
color: var(--success);
}
.subtitle {
color: var(--fg-muted);
font-family: var(--font-mono);
font-size: var(--fs-small);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.rowActions {
display: flex;
align-items: center;
gap: var(--space-2);
flex-shrink: 0;
}
.statusDot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
background: var(--control-off);
}
.statusOn {
background: var(--success);
}
.statusProbing {
background: var(--warning);
}
.statusError {
background: var(--danger);
}
.cardDrawer {
display: flex;
flex-direction: column;
gap: var(--space-2);
padding: 8px 12px 10px 28px;
border-top: 1px solid var(--border);
background: var(--bg-app);
font-size: var(--fs-small);
}
.metaGrid {
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
gap: var(--space-1) var(--space-3);
align-items: baseline;
}
.metaLabel {
color: var(--fg-muted);
white-space: nowrap;
}
.metaValue {
color: var(--fg);
font-family: var(--font-mono);
overflow-wrap: anywhere;
}
.toolsPanel {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
padding-top: 4px;
border-top: 1px solid var(--border);
}
.toolsHeader {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
color: var(--fg-secondary);
font-weight: 600;
}
.toolsMeta {
color: var(--fg-muted);
font-weight: 400;
}
.toolsList {
display: flex;
flex-direction: column;
gap: var(--space-1);
max-height: 220px;
overflow-y: auto;
padding-right: 2px;
}
.toolRow {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
padding: 5px 8px;
border-radius: var(--radius-small, 3px);
background: var(--bg-elev);
box-shadow: inset 0 0 0 1px var(--border);
}
.toolName {
font-family: var(--font-mono);
font-weight: 600;
color: var(--fg-strong);
}
.toolDesc {
color: var(--fg-muted);
line-height: 1.35;
}
.drawerFooter {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: var(--space-2);
padding-top: 4px;
}
.drawerButtons {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-1-5);
}
/* Discovered external agent CLI sources. */
.importToolbar {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: var(--space-2);
padding: 8px 10px;
border-radius: var(--radius-control);
background: var(--bg-elev);
box-shadow: inset 0 0 0 1px var(--border);
}
.importControls {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-2);
}
.sourceCard {
display: flex;
flex-direction: column;
border-radius: var(--radius-control);
background: var(--bg-elev);
box-shadow: inset 0 0 0 1px var(--border);
overflow: hidden;
}
.sourceHeader {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: var(--space-2);
padding: 8px 12px;
border-bottom: 1px solid var(--border);
}
.sourceTitleGroup {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
min-width: 0;
}
.sourceTitleRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
font-weight: 600;
}
.sourcePath {
color: var(--fg-muted);
font-family: var(--font-mono);
font-size: var(--fs-tiny);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.discoveredList {
display: flex;
flex-direction: column;
}
.discoveredRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
padding: 6px 12px;
}
.discoveredRow + .discoveredRow {
border-top: 1px solid var(--border);
}
.discoveredMain {
display: flex;
align-items: center;
gap: var(--space-2);
min-width: 0;
flex: 1;
}
.discoveredInfo {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
min-width: 0;
}
/* Modal Form / JSON switcher and agent pills. */
.modalModeBar {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
padding: 8px 16px 0;
}
.segmented {
display: inline-flex;
padding: 2px;
border-radius: var(--radius-control);
background: var(--bg-elev);
box-shadow: inset 0 0 0 1px var(--border);
}
.segmentBtn {
padding: 3px 10px;
border: 0;
border-radius: var(--radius-small, 3px);
background: transparent;
color: var(--fg-muted);
font: inherit;
font-size: var(--fs-small);
font-weight: 500;
cursor: pointer;
}
.segmentActive {
background: var(--bg-selected);
color: var(--fg-strong);
}
.agentPicker {
display: flex;
flex-wrap: wrap;
gap: var(--space-1);
}
.agentChip {
display: inline-flex;
align-items: center;
gap: var(--space-1);
height: 24px;
padding: 0 8px;
border: 0;
border-radius: var(--radius-control);
background: var(--bg-elev);
box-shadow: inset 0 0 0 1px var(--border-button);
color: var(--fg-secondary);
font: inherit;
font-size: var(--fs-small);
cursor: pointer;
}
.agentChip:hover {
background: var(--bg-hover);
color: var(--fg-strong);
}
.agentChipSelected {
background: var(--bg-selected);
box-shadow: inset 0 0 0 1px var(--accent);
color: var(--fg-strong);
}
/* Server form: a label column, controls filling the rest. */
.form {
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
align-items: start;
gap: 10px var(--space-3);
padding: 12px 16px 4px;
}
.formWide {
grid-column: 1 / -1;
}
.formLabel {
line-height: var(--h-field, 28px);
color: var(--fg);
white-space: nowrap;
}
.formControl {
display: flex;
flex-direction: column;
gap: var(--space-1);
min-width: 0;
}
.formDivider {
grid-column: 1 / -1;
margin: 2px 0;
border: 0;
border-top: 1px solid var(--border);
}
/* Multi-line field framed like Input. */
.textarea {
width: 100%;
min-height: 64px;
padding: 6px 8px;
appearance: none;
border: 0;
border-radius: var(--radius-control, 4px);
background: var(--bg-field, var(--bg-input));
box-shadow: inset 0 0 0 1px var(--border-button);
color: var(--fg-strong);
font-family: var(--font-mono);
font-size: var(--fs-ui);
line-height: 1.45;
resize: vertical;
outline: none;
transition: box-shadow var(--dur-fast) var(--ease);
}
.jsonArea {
min-height: 168px;
}
.textarea::placeholder {
color: var(--fg-faint);
}
.textarea:focus {
box-shadow:
inset 0 0 0 1px var(--focus-ring),
0 0 0 1px var(--focus-ring);
}
.hint {
font-size: var(--fs-small);
color: var(--fg-muted);
line-height: 1.4;
}