mirror of
https://github.com/blamouche/obsidian-any-ai-code.git
synced 2026-07-22 17:20:23 +00:00
Refactor the sidebar panel from a single-process view into a tabbed multi-session view: each tab is an independent CliSession with its own PTY process and xterm terminal. A New session / + control opens a session from any configured runtime; multiple sessions of the same runtime are allowed and labels are disambiguated. Stop/Restart/Clear and the @file/ @folder buttons act on the active tab; a single ResizeObserver refits only the visible terminal and re-fits on tab activation. Automations now spawn their own session tab for the declared runtime (or the default when none is declared), await CLI readiness, then send the prompt — replacing the old skip-if-not-running/runtime-mismatch logic. Add settings autoCloseAutomationSessions and maxConcurrentSessions; the Automations modal "Run now" button is always enabled. Extract pure helpers to session-utils.ts (resolveRuntimeForAutomation, runtimeMatches, nextSessionLabel, canOpenSession) with unit tests. Update README and the generated example automation. Bump to 0.2.9 (manifest, versions.json, package.json, prompt-hub version). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
698 lines
14 KiB
CSS
698 lines
14 KiB
CSS
.claude-cli-view {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
gap: 8px;
|
|
padding: 8px;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.claude-cli-toolbar {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
}
|
|
|
|
.claude-cli-toolbar-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.claude-cli-toolbar button {
|
|
border: 1px solid var(--background-modifier-border);
|
|
background: var(--interactive-normal);
|
|
color: var(--text-normal);
|
|
border-radius: 6px;
|
|
padding: 5px 12px;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
letter-spacing: 0.01em;
|
|
cursor: pointer;
|
|
transition:
|
|
background-color 120ms ease,
|
|
border-color 120ms ease,
|
|
color 120ms ease,
|
|
box-shadow 120ms ease,
|
|
transform 80ms ease;
|
|
}
|
|
|
|
.claude-cli-toolbar button:hover {
|
|
background: var(--interactive-hover);
|
|
border-color: var(--background-modifier-border-hover, var(--background-modifier-border));
|
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
}
|
|
|
|
.claude-cli-toolbar button:active {
|
|
transform: translateY(1px);
|
|
box-shadow: none;
|
|
}
|
|
|
|
.claude-cli-toolbar button:focus-visible {
|
|
outline: 2px solid var(--interactive-accent);
|
|
outline-offset: 1px;
|
|
}
|
|
|
|
.claude-cli-toolbar button:disabled,
|
|
.claude-cli-toolbar button[disabled] {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
transform: none;
|
|
box-shadow: none;
|
|
}
|
|
|
|
.claude-cli-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.claude-cli-btn-icon {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--text-muted);
|
|
transition: color 120ms ease;
|
|
}
|
|
|
|
.claude-cli-btn-icon svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
stroke-width: 2.1;
|
|
}
|
|
|
|
.claude-cli-toolbar button:hover .claude-cli-btn-icon {
|
|
color: var(--text-normal);
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-primary {
|
|
border-color: color-mix(in srgb, var(--color-green, #16a34a) 45%, var(--background-modifier-border));
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-primary .claude-cli-btn-icon {
|
|
color: var(--color-green, #16a34a);
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-primary:hover {
|
|
background: var(--color-green, #16a34a);
|
|
border-color: var(--color-green, #16a34a);
|
|
color: #ffffff;
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-primary:hover .claude-cli-btn-icon {
|
|
color: #ffffff;
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-danger {
|
|
border-color: color-mix(in srgb, var(--text-error, #d9534f) 35%, var(--background-modifier-border));
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-danger .claude-cli-btn-icon {
|
|
color: var(--text-error, #d9534f);
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-danger:hover {
|
|
background: var(--text-error, #d9534f);
|
|
border-color: var(--text-error, #d9534f);
|
|
color: #ffffff;
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-danger:hover .claude-cli-btn-icon {
|
|
color: #ffffff;
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-info {
|
|
border-color: color-mix(in srgb, var(--color-blue, #2563eb) 35%, var(--background-modifier-border));
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-info .claude-cli-btn-icon {
|
|
color: var(--color-blue, #2563eb);
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-info:hover {
|
|
background: var(--color-blue, #2563eb);
|
|
border-color: var(--color-blue, #2563eb);
|
|
color: #ffffff;
|
|
}
|
|
|
|
.claude-cli-toolbar .claude-cli-btn-info:hover .claude-cli-btn-icon {
|
|
color: #ffffff;
|
|
}
|
|
|
|
.claude-cli-runtime-picker {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
border: 1px solid var(--background-modifier-border);
|
|
background: var(--interactive-normal);
|
|
border-radius: 6px;
|
|
padding: 3px 8px;
|
|
transition:
|
|
background-color 120ms ease,
|
|
border-color 120ms ease,
|
|
box-shadow 120ms ease;
|
|
}
|
|
|
|
.claude-cli-runtime-picker:hover {
|
|
background: var(--interactive-hover);
|
|
border-color: var(--background-modifier-border-hover, var(--background-modifier-border));
|
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
}
|
|
|
|
.claude-cli-runtime-picker:focus-within {
|
|
border-color: var(--interactive-accent);
|
|
box-shadow: 0 0 0 2px color-mix(in srgb, var(--interactive-accent) 30%, transparent);
|
|
}
|
|
|
|
.claude-cli-runtime-picker-icon {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.claude-cli-runtime-picker-icon svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
stroke-width: 2.1;
|
|
}
|
|
|
|
.claude-cli-runtime-select {
|
|
appearance: none;
|
|
-webkit-appearance: none;
|
|
-moz-appearance: none;
|
|
border: 0;
|
|
background: transparent;
|
|
background-image: none;
|
|
color: var(--text-normal);
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
letter-spacing: 0.01em;
|
|
padding: 3px 0;
|
|
cursor: pointer;
|
|
outline: none;
|
|
box-shadow: none;
|
|
}
|
|
|
|
.claude-cli-runtime-select:disabled {
|
|
opacity: 0.6;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.claude-cli-runtime-picker-chevron {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--text-muted);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.claude-cli-runtime-picker-chevron svg {
|
|
width: 12px;
|
|
height: 12px;
|
|
stroke-width: 2.1;
|
|
}
|
|
|
|
.claude-cli-runtime-picker:hover .claude-cli-runtime-picker-chevron {
|
|
color: var(--text-normal);
|
|
}
|
|
|
|
.claude-cli-runtimes-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.claude-cli-runtime-item {
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 6px;
|
|
padding: 6px 8px;
|
|
background: var(--background-secondary);
|
|
}
|
|
|
|
.claude-cli-runtime-item .setting-item-control {
|
|
flex-wrap: wrap;
|
|
gap: 6px;
|
|
width: 100%;
|
|
}
|
|
|
|
.claude-cli-runtime-command-input {
|
|
flex: 1 1 240px;
|
|
min-width: 200px;
|
|
}
|
|
|
|
.claude-cli-status {
|
|
color: var(--text-muted);
|
|
font-size: 12px;
|
|
}
|
|
|
|
/* ----- Session tab bar ----- */
|
|
.claude-cli-tabbar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
flex-wrap: nowrap;
|
|
overflow-x: auto;
|
|
scrollbar-width: thin;
|
|
}
|
|
|
|
.claude-cli-tab {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 4px 8px;
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 6px 6px 0 0;
|
|
background: var(--background-secondary);
|
|
color: var(--text-muted);
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
max-width: 200px;
|
|
}
|
|
|
|
.claude-cli-tab:hover {
|
|
background: var(--interactive-hover);
|
|
color: var(--text-normal);
|
|
}
|
|
|
|
.claude-cli-tab.is-active {
|
|
background: var(--background-primary);
|
|
color: var(--text-normal);
|
|
border-bottom-color: var(--interactive-accent);
|
|
}
|
|
|
|
.claude-cli-tab-label {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.claude-cli-tab-dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
flex: 0 0 auto;
|
|
}
|
|
|
|
.claude-cli-tab-dot.is-running {
|
|
background: var(--color-green, #3fb950);
|
|
}
|
|
|
|
.claude-cli-tab-dot.is-stopped {
|
|
background: var(--text-faint);
|
|
}
|
|
|
|
.claude-cli-tab-auto {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
opacity: 0.7;
|
|
}
|
|
|
|
.claude-cli-tab-auto svg {
|
|
width: 12px;
|
|
height: 12px;
|
|
}
|
|
|
|
.claude-cli-tab-close {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
border-radius: 4px;
|
|
opacity: 0.6;
|
|
}
|
|
|
|
.claude-cli-tab-close:hover {
|
|
opacity: 1;
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
.claude-cli-tab-close svg {
|
|
width: 13px;
|
|
height: 13px;
|
|
}
|
|
|
|
.claude-cli-tab-new {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 26px;
|
|
height: 26px;
|
|
border-radius: 6px;
|
|
color: var(--text-muted);
|
|
cursor: pointer;
|
|
flex: 0 0 auto;
|
|
}
|
|
|
|
.claude-cli-tab-new:hover {
|
|
background: var(--interactive-hover);
|
|
color: var(--text-normal);
|
|
}
|
|
|
|
/* ----- Terminals container ----- */
|
|
.claude-cli-terminals {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 0;
|
|
position: relative;
|
|
}
|
|
|
|
.claude-cli-empty-hint {
|
|
color: var(--text-muted);
|
|
font-size: 13px;
|
|
padding: 16px;
|
|
text-align: center;
|
|
}
|
|
|
|
.claude-cli-empty-hint.is-hidden {
|
|
display: none;
|
|
}
|
|
|
|
.claude-cli-terminal {
|
|
flex: 1;
|
|
min-height: 220px;
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.claude-cli-terminal.is-hidden {
|
|
display: none;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm {
|
|
position: relative;
|
|
height: 100%;
|
|
padding: 8px;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm .xterm-helpers {
|
|
position: absolute;
|
|
top: 0;
|
|
z-index: 5;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm .xterm-helper-textarea {
|
|
position: absolute;
|
|
opacity: 0;
|
|
left: -9999em;
|
|
top: 0;
|
|
width: 0;
|
|
height: 0;
|
|
z-index: -5;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
resize: none;
|
|
border: 0;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
/* Match xterm default accessibility styles to avoid visible ghost text. */
|
|
.claude-cli-terminal .xterm .xterm-accessibility,
|
|
.claude-cli-terminal .xterm .xterm-message {
|
|
position: absolute;
|
|
left: 0;
|
|
top: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
z-index: 10;
|
|
color: transparent;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm .xterm-accessibility-tree *::selection {
|
|
color: transparent;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm .xterm-accessibility-tree {
|
|
font-family: monospace;
|
|
user-select: text;
|
|
white-space: pre;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm .xterm-accessibility-tree > div {
|
|
transform-origin: left;
|
|
width: fit-content;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm .live-region {
|
|
position: absolute;
|
|
left: -9999px;
|
|
width: 1px;
|
|
height: 1px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm .xterm-char-measure-element {
|
|
display: inline-block;
|
|
visibility: hidden;
|
|
position: absolute;
|
|
top: 0;
|
|
left: -9999em;
|
|
line-height: normal;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm .xterm-viewport {
|
|
position: absolute;
|
|
inset: 0;
|
|
overflow-y: auto;
|
|
background-color: inherit;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm .xterm-screen {
|
|
position: relative;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm .xterm-screen canvas {
|
|
position: absolute;
|
|
left: 0;
|
|
top: 0;
|
|
}
|
|
|
|
.claude-cli-terminal .xterm-cursor-layer {
|
|
position: relative;
|
|
}
|
|
|
|
.any-ai-cli-automations-modal {
|
|
max-width: 760px;
|
|
width: min(760px, 90vw);
|
|
}
|
|
|
|
.any-ai-cli-am-tabs {
|
|
display: flex;
|
|
gap: 4px;
|
|
border-bottom: 1px solid var(--background-modifier-border);
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.any-ai-cli-am-tab {
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 2px solid transparent;
|
|
color: var(--text-muted);
|
|
padding: 6px 12px;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.any-ai-cli-am-tab:hover {
|
|
color: var(--text-normal);
|
|
}
|
|
|
|
.any-ai-cli-am-tab.is-active {
|
|
color: var(--text-normal);
|
|
border-bottom-color: var(--interactive-accent);
|
|
}
|
|
|
|
.any-ai-cli-am-body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
}
|
|
|
|
.any-ai-cli-am-info {
|
|
color: var(--text-muted);
|
|
font-size: 12px;
|
|
margin: 0;
|
|
}
|
|
|
|
.any-ai-cli-am-empty {
|
|
color: var(--text-muted);
|
|
font-style: italic;
|
|
margin: 12px 0;
|
|
}
|
|
|
|
.any-ai-cli-am-errors {
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-left: 3px solid var(--color-orange, #d97706);
|
|
background: var(--background-secondary);
|
|
padding: 8px 10px;
|
|
border-radius: 4px;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.any-ai-cli-am-errors ul {
|
|
margin: 6px 0 0 0;
|
|
padding-left: 18px;
|
|
}
|
|
|
|
.any-ai-cli-am-error-path {
|
|
font-family: var(--font-monospace);
|
|
color: var(--text-normal);
|
|
}
|
|
|
|
.any-ai-cli-am-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.any-ai-cli-am-table th,
|
|
.any-ai-cli-am-table td {
|
|
text-align: left;
|
|
padding: 6px 8px;
|
|
border-bottom: 1px solid var(--background-modifier-border);
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.any-ai-cli-am-table th {
|
|
font-weight: 600;
|
|
color: var(--text-muted);
|
|
font-size: 11px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.04em;
|
|
}
|
|
|
|
.any-ai-cli-am-table tr.is-disabled {
|
|
opacity: 0.55;
|
|
}
|
|
|
|
.any-ai-cli-am-actions {
|
|
display: flex;
|
|
gap: 6px;
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.any-ai-cli-am-actions button {
|
|
padding: 3px 8px;
|
|
font-size: 11px;
|
|
border-radius: 4px;
|
|
border: 1px solid var(--background-modifier-border);
|
|
background: var(--interactive-normal);
|
|
color: var(--text-normal);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.any-ai-cli-am-actions button:hover:not(:disabled) {
|
|
background: var(--interactive-hover);
|
|
}
|
|
|
|
.any-ai-cli-am-actions button:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.any-ai-cli-am-badge {
|
|
display: inline-block;
|
|
padding: 2px 6px;
|
|
border-radius: 999px;
|
|
font-size: 11px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.any-ai-cli-am-badge.is-enabled,
|
|
.any-ai-cli-am-badge.is-ran {
|
|
background: rgba(34, 197, 94, 0.18);
|
|
color: var(--color-green, #16a34a);
|
|
}
|
|
|
|
.any-ai-cli-am-badge.is-disabled,
|
|
.any-ai-cli-am-badge.is-skipped {
|
|
background: rgba(234, 179, 8, 0.18);
|
|
color: var(--color-yellow, #ca8a04);
|
|
}
|
|
|
|
.any-ai-cli-am-badge.is-error {
|
|
background: rgba(239, 68, 68, 0.18);
|
|
color: var(--color-red, #dc2626);
|
|
}
|
|
|
|
.any-ai-cli-am-history-toolbar {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.any-ai-cli-am-history-actions {
|
|
display: flex;
|
|
gap: 6px;
|
|
}
|
|
|
|
.any-ai-cli-am-history-actions button {
|
|
padding: 4px 10px;
|
|
font-size: 11px;
|
|
border-radius: 4px;
|
|
border: 1px solid var(--background-modifier-border);
|
|
background: var(--interactive-normal);
|
|
color: var(--text-normal);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.any-ai-cli-am-history-actions button:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.any-ai-cli-am-history-list {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
max-height: 50vh;
|
|
overflow-y: auto;
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.any-ai-cli-am-history-item {
|
|
display: grid;
|
|
grid-template-columns: 140px 1fr auto auto;
|
|
gap: 8px;
|
|
align-items: center;
|
|
padding: 6px 10px;
|
|
border-bottom: 1px solid var(--background-modifier-border);
|
|
font-size: 12px;
|
|
}
|
|
|
|
.any-ai-cli-am-history-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.any-ai-cli-am-history-ts {
|
|
font-family: var(--font-monospace);
|
|
color: var(--text-muted);
|
|
font-size: 11px;
|
|
}
|
|
|
|
.any-ai-cli-am-history-name {
|
|
color: var(--text-normal);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.any-ai-cli-am-history-source {
|
|
font-size: 11px;
|
|
color: var(--text-muted);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.04em;
|
|
}
|
|
|
|
.any-ai-cli-am-history-detail {
|
|
grid-column: 2 / -1;
|
|
color: var(--text-muted);
|
|
font-size: 11px;
|
|
font-style: italic;
|
|
}
|