mux-sesh 1.6.1 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/src/app.tsx +68 -31
- package/src/preview/project.ts +24 -2
- package/src/styles/opencode-tui-colors.ts +1 -0
- package/src/styles/theme.tsx +2 -164
- package/src/tmux/index.ts +56 -1
- package/src/tmux/projects.ts +115 -25
- package/src/types/index.ts +2 -1
- package/src/ui/SessionDetailsPanel.tsx +13 -0
- package/src/update/index.ts +6 -2
- package/src/update/installation.ts +92 -2
- package/src/util/perf.ts +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mux-sesh",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "A beautiful tmux session manager built with OpenTUI - fuzzy search sessions, manage projects, clone from GitHub",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@opentui/core": "0.1.60",
|
|
51
51
|
"@opentui/react": "0.1.60",
|
|
52
|
+
"mux-sesh": "^1.6.2",
|
|
52
53
|
"react": "^19.2.2"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
package/src/app.tsx
CHANGED
|
@@ -8,12 +8,13 @@ import { orderProjectItems, orderSessionItems } from './items/order'
|
|
|
8
8
|
import { annotateProjectItemsWithSessionLinks } from './projects/session-links'
|
|
9
9
|
import { listTmuxSessions } from './tmux'
|
|
10
10
|
import { filterHiddenSessions } from './tmux/workflows'
|
|
11
|
-
import { getProjectItems } from './tmux/projects'
|
|
11
|
+
import { getProjectItems, getSessionCandidateItems } from './tmux/projects'
|
|
12
12
|
import { filterAndSortItems, clearMatchIndices } from './search'
|
|
13
13
|
import { isGitHubURL } from './util/github'
|
|
14
14
|
import { getOpencodeSessionStats } from './opencode'
|
|
15
15
|
import { ThemeProvider, getPanelStyle, resolveTheme } from './styles/theme'
|
|
16
16
|
import { useTerminalSize, shouldShowDetailPanel } from './util/terminal'
|
|
17
|
+
import { mark, measure } from './util/perf'
|
|
17
18
|
import Toast from './ui/Toast'
|
|
18
19
|
import { checkAndUpdate, updateEvents } from './update'
|
|
19
20
|
import { CURRENT_VERSION } from './update/version'
|
|
@@ -71,7 +72,9 @@ export function App() {
|
|
|
71
72
|
const [viewMode, setViewMode] = useState(ViewMode.Sessions)
|
|
72
73
|
const [items, setItems] = useState<Item[]>([])
|
|
73
74
|
const [allItems, setAllItems] = useState<Item[]>([])
|
|
75
|
+
const [projectSourceItems, setProjectSourceItems] = useState<Item[]>([])
|
|
74
76
|
const [projectItems, setProjectItems] = useState<Item[]>([])
|
|
77
|
+
const [sessionCandidateItems, setSessionCandidateItems] = useState<Item[]>([])
|
|
75
78
|
const [sessionItems, setSessionItems] = useState<Item[]>([])
|
|
76
79
|
const [cursor, setCursor] = useState(0)
|
|
77
80
|
const [opencodeCursor, setOpencodeCursor] = useState(0)
|
|
@@ -154,9 +157,17 @@ export function App() {
|
|
|
154
157
|
setItems(applyState)
|
|
155
158
|
}
|
|
156
159
|
|
|
160
|
+
async function loadLinkedProjectItems(nextConfig: Config, liveSessions: Item[], sourceItems = projectSourceItems) {
|
|
161
|
+
return orderProjectItems(
|
|
162
|
+
await measure('linkProjectItems', () => annotateProjectItemsWithSessionLinks(sourceItems, liveSessions, nextConfig)),
|
|
163
|
+
nextConfig.sortOrder
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
157
167
|
useEffect(() => {
|
|
158
168
|
async function init() {
|
|
159
|
-
|
|
169
|
+
mark('startup begin')
|
|
170
|
+
const cfg = await measure('loadConfig', loadConfig)
|
|
160
171
|
setConfig(cfg)
|
|
161
172
|
|
|
162
173
|
// Standard mode always starts in search mode (non-modal)
|
|
@@ -164,7 +175,9 @@ export function App() {
|
|
|
164
175
|
setAppMode(AppMode.Search)
|
|
165
176
|
}
|
|
166
177
|
|
|
167
|
-
const [sessions, listedSessions] = await
|
|
178
|
+
const [sessions, listedSessions] = await measure('loadSessionsAndListed', () =>
|
|
179
|
+
Promise.all([listTmuxSessions(), getListedSessionItems(cfg)])
|
|
180
|
+
)
|
|
168
181
|
const visibleSessions = filterHiddenSessions(sessions, cfg.hiddenSessions)
|
|
169
182
|
const combinedSessions = orderSessionItems(mergeSessionItems(visibleSessions, listedSessions), cfg.sortOrder)
|
|
170
183
|
|
|
@@ -176,20 +189,22 @@ export function App() {
|
|
|
176
189
|
setCursor(getSessionSelectionIndex(combinedSessions))
|
|
177
190
|
}
|
|
178
191
|
|
|
179
|
-
const rawProjects = await getProjectItems(cfg)
|
|
180
|
-
const
|
|
181
|
-
await annotateProjectItemsWithSessionLinks(rawProjects, visibleSessions, cfg),
|
|
182
|
-
cfg.sortOrder
|
|
183
|
-
)
|
|
192
|
+
const rawProjects = await measure('getProjectItems', () => getProjectItems(cfg))
|
|
193
|
+
const orderedProjects = orderProjectItems(rawProjects, cfg.sortOrder)
|
|
184
194
|
|
|
185
|
-
|
|
195
|
+
setProjectSourceItems(orderedProjects)
|
|
196
|
+
setProjectItems(orderedProjects)
|
|
186
197
|
|
|
187
198
|
if (combinedSessions.length === 0) {
|
|
199
|
+
const linkedProjects = await loadLinkedProjectItems(cfg, visibleSessions, orderedProjects)
|
|
200
|
+
setProjectItems(linkedProjects)
|
|
188
201
|
setViewMode(ViewMode.Projects)
|
|
189
|
-
setAllItems(
|
|
190
|
-
setItems(
|
|
191
|
-
setCursor(getProjectSelectionIndex(
|
|
202
|
+
setAllItems(linkedProjects)
|
|
203
|
+
setItems(linkedProjects)
|
|
204
|
+
setCursor(getProjectSelectionIndex(linkedProjects))
|
|
192
205
|
}
|
|
206
|
+
|
|
207
|
+
mark('startup complete')
|
|
193
208
|
}
|
|
194
209
|
init()
|
|
195
210
|
}, [])
|
|
@@ -215,29 +230,24 @@ export function App() {
|
|
|
215
230
|
const targetMode = forceViewMode ?? viewMode
|
|
216
231
|
|
|
217
232
|
if (targetMode === ViewMode.Sessions) {
|
|
218
|
-
const sessions = await listTmuxSessions
|
|
233
|
+
const sessions = await measure('refresh:listTmuxSessions', listTmuxSessions)
|
|
219
234
|
const visibleSessions = filterHiddenSessions(sessions, nextConfig.hiddenSessions)
|
|
220
|
-
const listedSessions = await getListedSessionItems(nextConfig)
|
|
235
|
+
const listedSessions = await measure('refresh:getListedSessionItems', () => getListedSessionItems(nextConfig))
|
|
221
236
|
const cleanSessions = clearMatchIndices(
|
|
222
237
|
orderSessionItems(mergeSessionItems(visibleSessions, listedSessions), nextConfig.sortOrder)
|
|
223
238
|
)
|
|
224
|
-
const linkedProjects = orderProjectItems(
|
|
225
|
-
await annotateProjectItemsWithSessionLinks(projectItems, visibleSessions, nextConfig),
|
|
226
|
-
nextConfig.sortOrder
|
|
227
|
-
)
|
|
228
239
|
setSessionItems(cleanSessions)
|
|
229
|
-
setProjectItems(linkedProjects)
|
|
230
240
|
setAllItems(cleanSessions)
|
|
231
241
|
setItems(cleanSessions)
|
|
232
242
|
setCursor(getSessionSelectionIndex(cleanSessions))
|
|
233
243
|
} else {
|
|
234
|
-
const sessions = await listTmuxSessions
|
|
244
|
+
const sessions = await measure('refresh:listTmuxSessions', listTmuxSessions)
|
|
235
245
|
const visibleSessions = filterHiddenSessions(sessions, nextConfig.hiddenSessions)
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
)
|
|
240
|
-
const cleanProjects = clearMatchIndices(
|
|
246
|
+
const rawProjects = await measure('refresh:getProjectItems', () => getProjectItems(nextConfig))
|
|
247
|
+
const orderedProjects = orderProjectItems(rawProjects, nextConfig.sortOrder)
|
|
248
|
+
setProjectSourceItems(orderedProjects)
|
|
249
|
+
const linkedProjects = await loadLinkedProjectItems(nextConfig, visibleSessions, orderedProjects)
|
|
250
|
+
const cleanProjects = clearMatchIndices(linkedProjects)
|
|
241
251
|
setProjectItems(cleanProjects)
|
|
242
252
|
setAllItems(cleanProjects)
|
|
243
253
|
setItems(cleanProjects)
|
|
@@ -448,9 +458,9 @@ export function App() {
|
|
|
448
458
|
closeModal()
|
|
449
459
|
setAppMode(AppMode.NewSession)
|
|
450
460
|
setViewMode(ViewMode.Projects)
|
|
451
|
-
setAllItems(
|
|
452
|
-
setItems(
|
|
453
|
-
setCursor(Math.max(0,
|
|
461
|
+
setAllItems(sessionCandidateItems.length > 0 ? sessionCandidateItems : projectSourceItems)
|
|
462
|
+
setItems(sessionCandidateItems.length > 0 ? sessionCandidateItems : projectSourceItems)
|
|
463
|
+
setCursor(Math.max(0, (sessionCandidateItems.length > 0 ? sessionCandidateItems : projectSourceItems).length - 1))
|
|
454
464
|
setSearchQuery('')
|
|
455
465
|
return
|
|
456
466
|
case 'open-settings':
|
|
@@ -562,7 +572,7 @@ export function App() {
|
|
|
562
572
|
searchQuery,
|
|
563
573
|
renameTarget,
|
|
564
574
|
prefixKey: config?.prefixKey,
|
|
565
|
-
projectItems,
|
|
575
|
+
projectItems: sessionCandidateItems.length > 0 ? sessionCandidateItems : projectSourceItems,
|
|
566
576
|
sessionItems,
|
|
567
577
|
prefixActive,
|
|
568
578
|
prefixTimeoutRef,
|
|
@@ -726,9 +736,36 @@ export function App() {
|
|
|
726
736
|
|
|
727
737
|
useEffect(() => {
|
|
728
738
|
if (appMode === AppMode.NewSession && viewMode === ViewMode.Projects) {
|
|
729
|
-
setCursor(getProjectSelectionIndex(
|
|
739
|
+
setCursor(getProjectSelectionIndex(sessionCandidateItems.length > 0 ? sessionCandidateItems : projectSourceItems))
|
|
740
|
+
}
|
|
741
|
+
}, [appMode, viewMode, projectSourceItems, sessionCandidateItems])
|
|
742
|
+
|
|
743
|
+
useEffect(() => {
|
|
744
|
+
if (appMode !== AppMode.NewSession || !config) {
|
|
745
|
+
return
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
const nextConfig = config
|
|
749
|
+
let cancelled = false
|
|
750
|
+
|
|
751
|
+
async function loadSessionCandidates() {
|
|
752
|
+
const candidates = await measure('loadSessionCandidateItems', () => getSessionCandidateItems(nextConfig))
|
|
753
|
+
if (cancelled) {
|
|
754
|
+
return
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
setSessionCandidateItems(candidates)
|
|
758
|
+
setAllItems(candidates)
|
|
759
|
+
setItems(candidates)
|
|
760
|
+
setCursor(getProjectSelectionIndex(candidates))
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
void loadSessionCandidates()
|
|
764
|
+
|
|
765
|
+
return () => {
|
|
766
|
+
cancelled = true
|
|
730
767
|
}
|
|
731
|
-
}, [appMode,
|
|
768
|
+
}, [appMode, config])
|
|
732
769
|
|
|
733
770
|
useEffect(() => {
|
|
734
771
|
if (filteredCommandEntries.length === 0) {
|
package/src/preview/project.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { getGitRoot, resolveProjectSession } from '../config/session-rules'
|
|
|
8
8
|
const MAX_PREVIEW_LINES = 24
|
|
9
9
|
const MAX_PREVIEW_LINE_LENGTH = 120
|
|
10
10
|
const PREVIEW_COMMAND_TIMEOUT_MS = 1500
|
|
11
|
+
const PROJECT_PREVIEW_CACHE_TTL_MS = 4000
|
|
12
|
+
const projectPreviewCache = new Map<string, { preview: ProjectPreview; expiresAt: number }>()
|
|
11
13
|
|
|
12
14
|
export interface ProjectPreview {
|
|
13
15
|
path: string
|
|
@@ -184,6 +186,12 @@ export async function getProjectPreview(
|
|
|
184
186
|
config: Config,
|
|
185
187
|
linkedSessionName?: string
|
|
186
188
|
): Promise<ProjectPreview> {
|
|
189
|
+
const cacheKey = `${projectPath}::${linkedSessionName ?? ''}`
|
|
190
|
+
const cached = projectPreviewCache.get(cacheKey)
|
|
191
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
192
|
+
return cached.preview
|
|
193
|
+
}
|
|
194
|
+
|
|
187
195
|
const [resolvedSession, gitRootPath, gitBranch, linkedSession] = await Promise.all([
|
|
188
196
|
resolveProjectSession(projectPath, config),
|
|
189
197
|
getGitRoot(projectPath),
|
|
@@ -196,7 +204,7 @@ export async function getProjectPreview(
|
|
|
196
204
|
const formattedCommandOutput = commandResult?.output ? formatPreviewOutput(commandResult.output) : undefined
|
|
197
205
|
|
|
198
206
|
if (formattedCommandOutput && formattedCommandOutput.lines.length > 0) {
|
|
199
|
-
|
|
207
|
+
const preview: ProjectPreview = {
|
|
200
208
|
path: displayPath(projectPath),
|
|
201
209
|
sessionName: resolvedSession.sessionName,
|
|
202
210
|
source: resolvedSession.source,
|
|
@@ -212,12 +220,19 @@ export async function getProjectPreview(
|
|
|
212
220
|
? 'Preview output truncated to fit the panel.'
|
|
213
221
|
: undefined,
|
|
214
222
|
}
|
|
223
|
+
|
|
224
|
+
projectPreviewCache.set(cacheKey, {
|
|
225
|
+
preview,
|
|
226
|
+
expiresAt: Date.now() + PROJECT_PREVIEW_CACHE_TTL_MS,
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
return preview
|
|
215
230
|
}
|
|
216
231
|
|
|
217
232
|
const fallbackLines = await getDirectoryPreviewLines(projectPath)
|
|
218
233
|
const formattedDirectoryOutput = formatPreviewOutput(fallbackLines.join('\n'))
|
|
219
234
|
|
|
220
|
-
|
|
235
|
+
const preview: ProjectPreview = {
|
|
221
236
|
path: displayPath(projectPath),
|
|
222
237
|
sessionName: resolvedSession.sessionName,
|
|
223
238
|
source: resolvedSession.source,
|
|
@@ -232,4 +247,11 @@ export async function getProjectPreview(
|
|
|
232
247
|
previewNotice: commandResult?.notice ??
|
|
233
248
|
(formattedDirectoryOutput.truncated ? 'Directory listing truncated to fit the panel.' : undefined),
|
|
234
249
|
}
|
|
250
|
+
|
|
251
|
+
projectPreviewCache.set(cacheKey, {
|
|
252
|
+
preview,
|
|
253
|
+
expiresAt: Date.now() + PROJECT_PREVIEW_CACHE_TTL_MS,
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
return preview
|
|
235
257
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const TUI_THEME_COLORS={"aura":{"dark":{"background":"#0f0f0f","surface":"#15141b","surfaceAlt":"#15141b","surfaceModal":"#15141b","overlay":"#000000","border":"#2d2d2d","borderMuted":"#2d2d2d","text":"#edecee","textMuted":"#6d6d6d","textSubtle":"#6d6d6d","primary":"#a277ff","secondary":"#f694ff","accent":"#a277ff","active":"#61ffca","inactive":"#6d6d6d","key":"#ffca85","action":"#a277ff","separator":"#6d6d6d","program":"#61ffca","fileTree":"#f694ff","danger":"#ff6767","dangerSurface":"#3f191a","selection":"#a277ff","selectionText":"#f5f5f5"},"light":{"background":"#0f0f0f","surface":"#15141b","surfaceAlt":"#15141b","surfaceModal":"#15141b","overlay":"#000000","border":"#2d2d2d","borderMuted":"#2d2d2d","text":"#edecee","textMuted":"#6d6d6d","textSubtle":"#6d6d6d","primary":"#a277ff","secondary":"#f694ff","accent":"#a277ff","active":"#61ffca","inactive":"#6d6d6d","key":"#ffca85","action":"#a277ff","separator":"#6d6d6d","program":"#61ffca","fileTree":"#f694ff","danger":"#ff6767","dangerSurface":"#3f191a","selection":"#a277ff","selectionText":"#f5f5f5"}},"ayu":{"dark":{"background":"#0B0E14","surface":"#0F131A","surfaceAlt":"#0D1017","surfaceModal":"#0F131A","overlay":"#000000","border":"#6C7380","borderMuted":"#11151C","text":"#BFBDB6","textMuted":"#565B66","textSubtle":"#565B66","primary":"#59C2FF","secondary":"#D2A6FF","accent":"#E6B450","active":"#7FD962","inactive":"#565B66","key":"#E6B673","action":"#39BAE6","separator":"#565B66","program":"#AAD94C","fileTree":"#59C2FF","danger":"#D95757","dangerSurface":"#37222c","selection":"#59C2FF","selectionText":"#171717"},"light":{"background":"#0B0E14","surface":"#0F131A","surfaceAlt":"#0D1017","surfaceModal":"#0F131A","overlay":"#000000","border":"#6C7380","borderMuted":"#11151C","text":"#BFBDB6","textMuted":"#565B66","textSubtle":"#565B66","primary":"#59C2FF","secondary":"#D2A6FF","accent":"#E6B450","active":"#7FD962","inactive":"#565B66","key":"#E6B673","action":"#39BAE6","separator":"#565B66","program":"#AAD94C","fileTree":"#59C2FF","danger":"#D95757","dangerSurface":"#37222c","selection":"#59C2FF","selectionText":"#171717"}},"carbonfox":{"dark":{"background":"#161616","surface":"#1a1a1a","surfaceAlt":"#1e1e1e","surfaceModal":"#1a1a1a","overlay":"#000000","border":"#303030","borderMuted":"#262626","text":"#f2f4f8","textMuted":"#7d848f","textSubtle":"#7d848f","primary":"#33b1ff","secondary":"#78a9ff","accent":"#ff7eb6","active":"#25be6a","inactive":"#7d848f","key":"#f1c21b","action":"#33b1ff","separator":"#303030","program":"#25be6a","fileTree":"#78a9ff","danger":"#ee5396","dangerSurface":"#2a1216","selection":"#33b1ff","selectionText":"#f5f5f5"},"light":{"background":"#ffffff","surface":"#f4f4f4","surfaceAlt":"#f4f4f4","surfaceModal":"#f4f4f4","overlay":"#000000","border":"#dcdcdc","borderMuted":"#e8e8e8","text":"#161616","textMuted":"#6f6f6f","textSubtle":"#6f6f6f","primary":"#0043ce","secondary":"#0043ce","accent":"#9f1853","active":"#198038","inactive":"#6f6f6f","key":"#007d79","action":"#0072c3","separator":"#dcdcdc","program":"#198038","fileTree":"#0043ce","danger":"#9f1853","dangerSurface":"#fff1f1","selection":"#0043ce","selectionText":"#f5f5f5"}},"catppuccin-frappe":{"dark":{"background":"#303446","surface":"#292c3c","surfaceAlt":"#232634","surfaceModal":"#292c3c","overlay":"#000000","border":"#414559","borderMuted":"#626880","text":"#c6d0f5","textMuted":"#b5bfe2","textSubtle":"#b5bfe2","primary":"#8da4e2","secondary":"#ca9ee6","accent":"#f4b8e4","active":"#a6d189","inactive":"#b5bfe2","key":"#e5c890","action":"#99d1db","separator":"#a5adce","program":"#a6d189","fileTree":"#8da4e2","danger":"#e78284","dangerSurface":"#3a2a31","selection":"#8da4e2","selectionText":"#171717"},"light":{"background":"#303446","surface":"#292c3c","surfaceAlt":"#232634","surfaceModal":"#292c3c","overlay":"#000000","border":"#414559","borderMuted":"#626880","text":"#c6d0f5","textMuted":"#b5bfe2","textSubtle":"#b5bfe2","primary":"#8da4e2","secondary":"#ca9ee6","accent":"#f4b8e4","active":"#a6d189","inactive":"#b5bfe2","key":"#e5c890","action":"#99d1db","separator":"#a5adce","program":"#a6d189","fileTree":"#8da4e2","danger":"#e78284","dangerSurface":"#3a2a31","selection":"#8da4e2","selectionText":"#171717"}},"catppuccin-macchiato":{"dark":{"background":"#24273a","surface":"#1e2030","surfaceAlt":"#181926","surfaceModal":"#1e2030","overlay":"#000000","border":"#363a4f","borderMuted":"#5b6078","text":"#cad3f5","textMuted":"#b8c0e0","textSubtle":"#b8c0e0","primary":"#8aadf4","secondary":"#c6a0f6","accent":"#f5bde6","active":"#a6da95","inactive":"#b8c0e0","key":"#eed49f","action":"#91d7e3","separator":"#a5adcb","program":"#a6da95","fileTree":"#8aadf4","danger":"#ed8796","dangerSurface":"#3a2a31","selection":"#8aadf4","selectionText":"#171717"},"light":{"background":"#24273a","surface":"#1e2030","surfaceAlt":"#181926","surfaceModal":"#1e2030","overlay":"#000000","border":"#363a4f","borderMuted":"#5b6078","text":"#cad3f5","textMuted":"#b8c0e0","textSubtle":"#b8c0e0","primary":"#8aadf4","secondary":"#c6a0f6","accent":"#f5bde6","active":"#a6da95","inactive":"#b8c0e0","key":"#eed49f","action":"#91d7e3","separator":"#a5adcb","program":"#a6da95","fileTree":"#8aadf4","danger":"#ed8796","dangerSurface":"#3a2a31","selection":"#8aadf4","selectionText":"#171717"}},"catppuccin":{"dark":{"background":"#1e1e2e","surface":"#181825","surfaceAlt":"#11111b","surfaceModal":"#181825","overlay":"#000000","border":"#313244","borderMuted":"#585b70","text":"#cdd6f4","textMuted":"#bac2de","textSubtle":"#bac2de","primary":"#89b4fa","secondary":"#cba6f7","accent":"#f5c2e7","active":"#a6e3a1","inactive":"#bac2de","key":"#f9e2af","action":"#89dceb","separator":"#a6adc8","program":"#a6e3a1","fileTree":"#89b4fa","danger":"#f38ba8","dangerSurface":"#3c2a32","selection":"#89b4fa","selectionText":"#171717"},"light":{"background":"#eff1f5","surface":"#e6e9ef","surfaceAlt":"#dce0e8","surfaceModal":"#e6e9ef","overlay":"#000000","border":"#ccd0da","borderMuted":"#acb0be","text":"#4c4f69","textMuted":"#5c5f77","textSubtle":"#5c5f77","primary":"#1e66f5","secondary":"#8839ef","accent":"#ea76cb","active":"#40a02b","inactive":"#5c5f77","key":"#df8e1d","action":"#04a5e5","separator":"#6c6f85","program":"#40a02b","fileTree":"#1e66f5","danger":"#d20f39","dangerSurface":"#f6dfe2","selection":"#1e66f5","selectionText":"#f5f5f5"}},"cobalt2":{"dark":{"background":"#193549","surface":"#122738","surfaceAlt":"#1f4662","surfaceModal":"#122738","overlay":"#000000","border":"#1f4662","borderMuted":"#0e1e2e","text":"#ffffff","textMuted":"#adb7c9","textSubtle":"#adb7c9","primary":"#0088ff","secondary":"#9a5feb","accent":"#2affdf","active":"#9eff80","inactive":"#adb7c9","key":"#ffc600","action":"#2affdf","separator":"#2d5a7b","program":"#9eff80","fileTree":"#0088ff","danger":"#ff0088","dangerSurface":"#3a1a2a","selection":"#0088ff","selectionText":"#f5f5f5"},"light":{"background":"#ffffff","surface":"#f5f7fa","surfaceAlt":"#e8ecf1","surfaceModal":"#f5f7fa","overlay":"#000000","border":"#d3dae3","borderMuted":"#e8ecf1","text":"#193549","textMuted":"#5c6b7d","textSubtle":"#5c6b7d","primary":"#0066cc","secondary":"#7c4dff","accent":"#00acc1","active":"#4caf50","inactive":"#5c6b7d","key":"#ff9800","action":"#00acc1","separator":"#d3dae3","program":"#4caf50","fileTree":"#0066cc","danger":"#e91e63","dangerSurface":"#ffebee","selection":"#0066cc","selectionText":"#f5f5f5"}},"cursor":{"dark":{"background":"#181818","surface":"#141414","surfaceAlt":"#262626","surfaceModal":"#141414","overlay":"#000000","border":"#e4e4e413","borderMuted":"#0f0f0f","text":"#e4e4e4","textMuted":"#e4e4e45e","textSubtle":"#e4e4e45e","primary":"#88c0d0","secondary":"#81a1c1","accent":"#88c0d0","active":"#3fa266","inactive":"#e4e4e45e","key":"#f1b467","action":"#81a1c1","separator":"#e4e4e45e","program":"#E394DC","fileTree":"#82D2CE","danger":"#e34671","dangerSurface":"#b8004933","selection":"#88c0d0","selectionText":"#171717"},"light":{"background":"#fcfcfc","surface":"#f3f3f3","surfaceAlt":"#ededed","surfaceModal":"#f3f3f3","overlay":"#000000","border":"#14141413","borderMuted":"#e0e0e0","text":"#141414","textMuted":"#141414ad","textSubtle":"#141414ad","primary":"#6f9ba6","secondary":"#3c7cab","accent":"#6f9ba6","active":"#1f8a65","inactive":"#141414ad","key":"#db704b","action":"#141414ad","separator":"#141414ad","program":"#1f8a65","fileTree":"#206595","danger":"#cf2d56","dangerSurface":"#cf2d5614","selection":"#6f9ba6","selectionText":"#f5f5f5"}},"dracula":{"dark":{"background":"#282a36","surface":"#21222c","surfaceAlt":"#44475a","surfaceModal":"#21222c","overlay":"#000000","border":"#44475a","borderMuted":"#191a21","text":"#f8f8f2","textMuted":"#6272a4","textSubtle":"#6272a4","primary":"#bd93f9","secondary":"#ff79c6","accent":"#8be9fd","active":"#50fa7b","inactive":"#6272a4","key":"#f1fa8c","action":"#ff79c6","separator":"#6272a4","program":"#50fa7b","fileTree":"#8be9fd","danger":"#ff5555","dangerSurface":"#3a1a1a","selection":"#bd93f9","selectionText":"#171717"},"light":{"background":"#f8f8f2","surface":"#e8e8e2","surfaceAlt":"#d8d8d2","surfaceModal":"#e8e8e2","overlay":"#000000","border":"#c8c8c2","borderMuted":"#e0e0e0","text":"#282a36","textMuted":"#6272a4","textSubtle":"#6272a4","primary":"#bd93f9","secondary":"#ff79c6","accent":"#8be9fd","active":"#50fa7b","inactive":"#6272a4","key":"#f1fa8c","action":"#ff79c6","separator":"#6272a4","program":"#50fa7b","fileTree":"#8be9fd","danger":"#ff5555","dangerSurface":"#ffe0e0","selection":"#bd93f9","selectionText":"#171717"}},"everforest":{"dark":{"background":"#2d353b","surface":"#333c43","surfaceAlt":"#343f44","surfaceModal":"#333c43","overlay":"#000000","border":"#859289","borderMuted":"#7a8478","text":"#d3c6aa","textMuted":"#7a8478","textSubtle":"#7a8478","primary":"#a7c080","secondary":"#7fbbb3","accent":"#d699b6","active":"#a7c080","inactive":"#7a8478","key":"#e69875","action":"#83c092","separator":"#7a8478","program":"#a7c080","fileTree":"#a7c080","danger":"#e67e80","dangerSurface":"#37222c","selection":"#a7c080","selectionText":"#171717"},"light":{"background":"#fdf6e3","surface":"#efebd4","surfaceAlt":"#f4f0d9","surfaceModal":"#efebd4","overlay":"#000000","border":"#939f91","borderMuted":"#a6b0a0","text":"#5c6a72","textMuted":"#a6b0a0","textSubtle":"#a6b0a0","primary":"#8da101","secondary":"#3a94c5","accent":"#df69ba","active":"#8da101","inactive":"#a6b0a0","key":"#f57d26","action":"#35a77c","separator":"#a6b0a0","program":"#8da101","fileTree":"#8da101","danger":"#f85552","dangerSurface":"#f7d8db","selection":"#8da101","selectionText":"#f5f5f5"}},"flexoki":{"dark":{"background":"#100F0F","surface":"#1C1B1A","surfaceAlt":"#282726","surfaceModal":"#1C1B1A","overlay":"#000000","border":"#575653","borderMuted":"#403E3C","text":"#CECDC3","textMuted":"#6F6E69","textSubtle":"#6F6E69","primary":"#DA702C","secondary":"#4385BE","accent":"#8B7EC8","active":"#879A39","inactive":"#6F6E69","key":"#DA702C","action":"#3AA99F","separator":"#6F6E69","program":"#3AA99F","fileTree":"#4385BE","danger":"#D14D41","dangerSurface":"#2D1A1A","selection":"#DA702C","selectionText":"#f5f5f5"},"light":{"background":"#FFFCF0","surface":"#F2F0E5","surfaceAlt":"#E6E4D9","surfaceModal":"#F2F0E5","overlay":"#000000","border":"#B7B5AC","borderMuted":"#CECDC3","text":"#100F0F","textMuted":"#6F6E69","textSubtle":"#6F6E69","primary":"#205EA6","secondary":"#5E409D","accent":"#BC5215","active":"#66800B","inactive":"#6F6E69","key":"#BC5215","action":"#24837B","separator":"#6F6E69","program":"#24837B","fileTree":"#205EA6","danger":"#AF3029","dangerSurface":"#F7D8DB","selection":"#205EA6","selectionText":"#f5f5f5"}},"github":{"dark":{"background":"#0d1117","surface":"#010409","surfaceAlt":"#161b22","surfaceModal":"#010409","overlay":"#000000","border":"#30363d","borderMuted":"#21262d","text":"#c9d1d9","textMuted":"#8b949e","textSubtle":"#8b949e","primary":"#58a6ff","secondary":"#bc8cff","accent":"#39c5cf","active":"#3fb950","inactive":"#8b949e","key":"#e3b341","action":"#39c5cf","separator":"#30363d","program":"#ff7b72","fileTree":"#58a6ff","danger":"#f85149","dangerSurface":"#67060c","selection":"#58a6ff","selectionText":"#171717"},"light":{"background":"#ffffff","surface":"#f6f8fa","surfaceAlt":"#f0f3f6","surfaceModal":"#f6f8fa","overlay":"#000000","border":"#d0d7de","borderMuted":"#d8dee4","text":"#24292f","textMuted":"#57606a","textSubtle":"#57606a","primary":"#0969da","secondary":"#8250df","accent":"#1b7c83","active":"#1a7f37","inactive":"#57606a","key":"#9a6700","action":"#1b7c83","separator":"#d0d7de","program":"#bf3989","fileTree":"#0969da","danger":"#cf222e","dangerSurface":"#ffebe9","selection":"#0969da","selectionText":"#f5f5f5"}},"gruvbox":{"dark":{"background":"#282828","surface":"#3c3836","surfaceAlt":"#504945","surfaceModal":"#3c3836","overlay":"#000000","border":"#665c54","borderMuted":"#504945","text":"#ebdbb2","textMuted":"#928374","textSubtle":"#928374","primary":"#83a598","secondary":"#d3869b","accent":"#8ec07c","active":"#b8bb26","inactive":"#928374","key":"#fe8019","action":"#b8bb26","separator":"#928374","program":"#fabd2f","fileTree":"#8ec07c","danger":"#fb4934","dangerSurface":"#322929","selection":"#83a598","selectionText":"#171717"},"light":{"background":"#fbf1c7","surface":"#ebdbb2","surfaceAlt":"#d5c4a1","surfaceModal":"#ebdbb2","overlay":"#000000","border":"#bdae93","borderMuted":"#d5c4a1","text":"#3c3836","textMuted":"#7c6f64","textSubtle":"#7c6f64","primary":"#076678","secondary":"#8f3f71","accent":"#427b58","active":"#79740e","inactive":"#7c6f64","key":"#af3a03","action":"#79740e","separator":"#7c6f64","program":"#b57614","fileTree":"#427b58","danger":"#9d0006","dangerSurface":"#e2c7c3","selection":"#076678","selectionText":"#f5f5f5"}},"kanagawa":{"dark":{"background":"#1F1F28","surface":"#2A2A37","surfaceAlt":"#363646","surfaceModal":"#2A2A37","overlay":"#000000","border":"#54546D","borderMuted":"#363646","text":"#DCD7BA","textMuted":"#727169","textSubtle":"#727169","primary":"#7E9CD8","secondary":"#957FB8","accent":"#D27E99","active":"#98BB6C","inactive":"#727169","key":"#D7A657","action":"#76946A","separator":"#727169","program":"#98BB6C","fileTree":"#7E9CD8","danger":"#E82424","dangerSurface":"#362020","selection":"#7E9CD8","selectionText":"#171717"},"light":{"background":"#F2E9DE","surface":"#EAE4D7","surfaceAlt":"#E3DCD2","surfaceModal":"#EAE4D7","overlay":"#000000","border":"#D4CBBF","borderMuted":"#DCD4C9","text":"#54433A","textMuted":"#9E9389","textSubtle":"#9E9389","primary":"#2D4F67","secondary":"#957FB8","accent":"#D27E99","active":"#98BB6C","inactive":"#9E9389","key":"#D7A657","action":"#76946A","separator":"#9E9389","program":"#98BB6C","fileTree":"#2D4F67","danger":"#E82424","dangerSurface":"#FBE6E6","selection":"#2D4F67","selectionText":"#f5f5f5"}},"lucent-orng":{"dark":{"background":"#000000","surface":"#000000","surfaceAlt":"#000000","surfaceModal":"#000000","overlay":"#000000","border":"#EC5B2B","borderMuted":"#3c3c3c","text":"#eeeeee","textMuted":"#808080","textSubtle":"#808080","primary":"#EC5B2B","secondary":"#EE7948","accent":"#FFF7F1","active":"#6ba1e6","inactive":"#808080","key":"#EC5B2B","action":"#56b6c2","separator":"#808080","program":"#6ba1e6","fileTree":"#EC5B2B","danger":"#e06c75","dangerSurface":"#000000","selection":"#EC5B2B","selectionText":"#f5f5f5"},"light":{"background":"#000000","surface":"#000000","surfaceAlt":"#000000","surfaceModal":"#000000","overlay":"#000000","border":"#EC5B2B","borderMuted":"#d4d4d4","text":"#1a1a1a","textMuted":"#8a8a8a","textSubtle":"#8a8a8a","primary":"#EC5B2B","secondary":"#EE7948","accent":"#c94d24","active":"#0062d1","inactive":"#8a8a8a","key":"#EC5B2B","action":"#318795","separator":"#8a8a8a","program":"#0062d1","fileTree":"#EC5B2B","danger":"#d1383d","dangerSurface":"#000000","selection":"#EC5B2B","selectionText":"#f5f5f5"}},"material":{"dark":{"background":"#263238","surface":"#1e272c","surfaceAlt":"#37474f","surfaceModal":"#1e272c","overlay":"#000000","border":"#37474f","borderMuted":"#1e272c","text":"#eeffff","textMuted":"#546e7a","textSubtle":"#546e7a","primary":"#82aaff","secondary":"#c792ea","accent":"#89ddff","active":"#c3e88d","inactive":"#546e7a","key":"#ffcb6b","action":"#c792ea","separator":"#37474f","program":"#c3e88d","fileTree":"#89ddff","danger":"#f07178","dangerSurface":"#3c2b2b","selection":"#82aaff","selectionText":"#171717"},"light":{"background":"#fafafa","surface":"#f5f5f5","surfaceAlt":"#e7e7e8","surfaceModal":"#f5f5f5","overlay":"#000000","border":"#e0e0e0","borderMuted":"#eeeeee","text":"#263238","textMuted":"#90a4ae","textSubtle":"#90a4ae","primary":"#6182b8","secondary":"#7c4dff","accent":"#39adb5","active":"#91b859","inactive":"#90a4ae","key":"#ffb300","action":"#7c4dff","separator":"#e0e0e0","program":"#91b859","fileTree":"#39adb5","danger":"#e53935","dangerSurface":"#ffebee","selection":"#6182b8","selectionText":"#f5f5f5"}},"matrix":{"dark":{"background":"#0a0e0a","surface":"#0e130d","surfaceAlt":"#141c12","surfaceModal":"#0e130d","overlay":"#000000","border":"#1e2a1b","borderMuted":"#141c12","text":"#62ff94","textMuted":"#8ca391","textSubtle":"#8ca391","primary":"#2eff6a","secondary":"#00efff","accent":"#c770ff","active":"#62ff94","inactive":"#8ca391","key":"#e6ff57","action":"#24f6d9","separator":"#8ca391","program":"#1cc24b","fileTree":"#30b3ff","danger":"#ff4b4b","dangerSurface":"#261212","selection":"#2eff6a","selectionText":"#171717"},"light":{"background":"#eef3ea","surface":"#e4ebe1","surfaceAlt":"#dae1d7","surfaceModal":"#e4ebe1","overlay":"#000000","border":"#748476","borderMuted":"#dae1d7","text":"#203022","textMuted":"#748476","textSubtle":"#748476","primary":"#1cc24b","secondary":"#24f6d9","accent":"#c770ff","active":"#1cc24b","inactive":"#748476","key":"#e6ff57","action":"#24f6d9","separator":"#748476","program":"#1cc24b","fileTree":"#30b3ff","danger":"#ff4b4b","dangerSurface":"#f9e5e5","selection":"#1cc24b","selectionText":"#f5f5f5"}},"mercury":{"dark":{"background":"#171721","surface":"#10101a","surfaceAlt":"#272735","surfaceModal":"#10101a","overlay":"#000000","border":"#b4b7c81f","borderMuted":"#b4b7c814","text":"#dddde5","textMuted":"#9d9da8","textSubtle":"#9d9da8","primary":"#8da4f5","secondary":"#a7b6f8","accent":"#8da4f5","active":"#77c599","inactive":"#9d9da8","key":"#fc9b6f","action":"#a7b6f8","separator":"#b4b7c81f","program":"#77c599","fileTree":"#8da4f5","danger":"#fc92b4","dangerSurface":"#fc92b433","selection":"#8da4f5","selectionText":"#171717"},"light":{"background":"#ffffff","surface":"#fbfcfd","surfaceAlt":"#f4f5f9","surfaceModal":"#fbfcfd","overlay":"#000000","border":"#7073931a","borderMuted":"#7073930f","text":"#363644","textMuted":"#70707d","textSubtle":"#70707d","primary":"#5266eb","secondary":"#465bd1","accent":"#8da4f5","active":"#036e43","inactive":"#70707d","key":"#a44200","action":"#5266eb","separator":"#7073931a","program":"#036e43","fileTree":"#465bd1","danger":"#b0175f","dangerSurface":"#d032751a","selection":"#5266eb","selectionText":"#f5f5f5"}},"monokai":{"dark":{"background":"#272822","surface":"#1e1f1c","surfaceAlt":"#3e3d32","surfaceModal":"#1e1f1c","overlay":"#000000","border":"#3e3d32","borderMuted":"#1e1f1c","text":"#f8f8f2","textMuted":"#75715e","textSubtle":"#75715e","primary":"#66d9ef","secondary":"#ae81ff","accent":"#a6e22e","active":"#a6e22e","inactive":"#75715e","key":"#e6db74","action":"#ae81ff","separator":"#75715e","program":"#a6e22e","fileTree":"#66d9ef","danger":"#f92672","dangerSurface":"#3a1a1a","selection":"#66d9ef","selectionText":"#171717"},"light":{"background":"#fafafa","surface":"#f0f0f0","surfaceAlt":"#e0e0e0","surfaceModal":"#f0f0f0","overlay":"#000000","border":"#d0d0d0","borderMuted":"#e8e8e8","text":"#272822","textMuted":"#75715e","textSubtle":"#75715e","primary":"#66d9ef","secondary":"#ae81ff","accent":"#a6e22e","active":"#a6e22e","inactive":"#75715e","key":"#fd971f","action":"#ae81ff","separator":"#75715e","program":"#a6e22e","fileTree":"#66d9ef","danger":"#f92672","dangerSurface":"#ffe0e0","selection":"#66d9ef","selectionText":"#171717"}},"nightowl":{"dark":{"background":"#011627","surface":"#0b253a","surfaceAlt":"#0b253a","surfaceModal":"#0b253a","overlay":"#000000","border":"#5f7e97","borderMuted":"#5f7e97","text":"#d6deeb","textMuted":"#5f7e97","textSubtle":"#5f7e97","primary":"#82AAFF","secondary":"#7fdbca","accent":"#c792ea","active":"#c5e478","inactive":"#5f7e97","key":"#ecc48d","action":"#82AAFF","separator":"#5f7e97","program":"#c5e478","fileTree":"#7fdbca","danger":"#EF5350","dangerSurface":"#2d1b1b","selection":"#82AAFF","selectionText":"#171717"},"light":{"background":"#011627","surface":"#0b253a","surfaceAlt":"#0b253a","surfaceModal":"#0b253a","overlay":"#000000","border":"#5f7e97","borderMuted":"#5f7e97","text":"#d6deeb","textMuted":"#5f7e97","textSubtle":"#5f7e97","primary":"#82AAFF","secondary":"#7fdbca","accent":"#c792ea","active":"#c5e478","inactive":"#5f7e97","key":"#ecc48d","action":"#82AAFF","separator":"#5f7e97","program":"#c5e478","fileTree":"#7fdbca","danger":"#EF5350","dangerSurface":"#2d1b1b","selection":"#82AAFF","selectionText":"#171717"}},"nord":{"dark":{"background":"#2E3440","surface":"#3B4252","surfaceAlt":"#434C5E","surfaceModal":"#3B4252","overlay":"#000000","border":"#434C5E","borderMuted":"#434C5E","text":"#ECEFF4","textMuted":"#8B95A7","textSubtle":"#8B95A7","primary":"#88C0D0","secondary":"#81A1C1","accent":"#8FBCBB","active":"#A3BE8C","inactive":"#8B95A7","key":"#D08770","action":"#8FBCBB","separator":"#8B95A7","program":"#A3BE8C","fileTree":"#81A1C1","danger":"#BF616A","dangerSurface":"#3B4252","selection":"#88C0D0","selectionText":"#171717"},"light":{"background":"#ECEFF4","surface":"#E5E9F0","surfaceAlt":"#D8DEE9","surfaceModal":"#E5E9F0","overlay":"#000000","border":"#4C566A","borderMuted":"#4C566A","text":"#2E3440","textMuted":"#3B4252","textSubtle":"#3B4252","primary":"#5E81AC","secondary":"#81A1C1","accent":"#8FBCBB","active":"#A3BE8C","inactive":"#3B4252","key":"#D08770","action":"#8FBCBB","separator":"#4C566A","program":"#A3BE8C","fileTree":"#81A1C1","danger":"#BF616A","dangerSurface":"#E5E9F0","selection":"#5E81AC","selectionText":"#f5f5f5"}},"one-dark":{"dark":{"background":"#282c34","surface":"#21252b","surfaceAlt":"#353b45","surfaceModal":"#21252b","overlay":"#000000","border":"#393f4a","borderMuted":"#2c313a","text":"#abb2bf","textMuted":"#5c6370","textSubtle":"#5c6370","primary":"#61afef","secondary":"#c678dd","accent":"#56b6c2","active":"#98c379","inactive":"#5c6370","key":"#e5c07b","action":"#56b6c2","separator":"#5c6370","program":"#98c379","fileTree":"#61afef","danger":"#e06c75","dangerSurface":"#3a2d2f","selection":"#61afef","selectionText":"#171717"},"light":{"background":"#fafafa","surface":"#f0f0f1","surfaceAlt":"#eaeaeb","surfaceModal":"#f0f0f1","overlay":"#000000","border":"#d1d1d2","borderMuted":"#e0e0e1","text":"#383a42","textMuted":"#a0a1a7","textSubtle":"#a0a1a7","primary":"#4078f2","secondary":"#a626a4","accent":"#0184bc","active":"#50a14f","inactive":"#a0a1a7","key":"#c18401","action":"#0184bc","separator":"#a0a1a7","program":"#50a14f","fileTree":"#4078f2","danger":"#e45649","dangerSurface":"#fce9e8","selection":"#4078f2","selectionText":"#f5f5f5"}},"opencode":{"dark":{"background":"#0a0a0a","surface":"#141414","surfaceAlt":"#1e1e1e","surfaceModal":"#141414","overlay":"#000000","border":"#484848","borderMuted":"#3c3c3c","text":"#eeeeee","textMuted":"#808080","textSubtle":"#808080","primary":"#fab283","secondary":"#5c9cf5","accent":"#9d7cd8","active":"#7fd88f","inactive":"#808080","key":"#f5a742","action":"#56b6c2","separator":"#808080","program":"#7fd88f","fileTree":"#fab283","danger":"#e06c75","dangerSurface":"#37222c","selection":"#fab283","selectionText":"#171717"},"light":{"background":"#ffffff","surface":"#fafafa","surfaceAlt":"#f5f5f5","surfaceModal":"#fafafa","overlay":"#000000","border":"#b8b8b8","borderMuted":"#d4d4d4","text":"#1a1a1a","textMuted":"#8a8a8a","textSubtle":"#8a8a8a","primary":"#3b7dd8","secondary":"#7b5bb6","accent":"#d68c27","active":"#3d9a57","inactive":"#8a8a8a","key":"#d68c27","action":"#318795","separator":"#8a8a8a","program":"#3d9a57","fileTree":"#3b7dd8","danger":"#d1383d","dangerSurface":"#f7d8db","selection":"#3b7dd8","selectionText":"#f5f5f5"}},"orng":{"dark":{"background":"#0a0a0a","surface":"#141414","surfaceAlt":"#1e1e1e","surfaceModal":"#141414","overlay":"#000000","border":"#EC5B2B","borderMuted":"#3c3c3c","text":"#eeeeee","textMuted":"#808080","textSubtle":"#808080","primary":"#EC5B2B","secondary":"#EE7948","accent":"#FFF7F1","active":"#6ba1e6","inactive":"#808080","key":"#EC5B2B","action":"#56b6c2","separator":"#808080","program":"#6ba1e6","fileTree":"#EC5B2B","danger":"#e06c75","dangerSurface":"#37222c","selection":"#EC5B2B","selectionText":"#f5f5f5"},"light":{"background":"#ffffff","surface":"#FFF7F1","surfaceAlt":"#f5f0eb","surfaceModal":"#FFF7F1","overlay":"#000000","border":"#EC5B2B","borderMuted":"#d4d4d4","text":"#1a1a1a","textMuted":"#8a8a8a","textSubtle":"#8a8a8a","primary":"#EC5B2B","secondary":"#EE7948","accent":"#c94d24","active":"#0062d1","inactive":"#8a8a8a","key":"#EC5B2B","action":"#318795","separator":"#8a8a8a","program":"#0062d1","fileTree":"#EC5B2B","danger":"#d1383d","dangerSurface":"#f7d8db","selection":"#EC5B2B","selectionText":"#f5f5f5"}},"osaka-jade":{"dark":{"background":"#111c18","surface":"#1a2520","surfaceAlt":"#23372B","surfaceModal":"#1a2520","overlay":"#000000","border":"#3d4a44","borderMuted":"#23372B","text":"#C1C497","textMuted":"#53685B","textSubtle":"#53685B","primary":"#2DD5B7","secondary":"#D2689C","accent":"#549e6a","active":"#549e6a","inactive":"#53685B","key":"#E5C736","action":"#549e6a","separator":"#53685B","program":"#63b07a","fileTree":"#8CD3CB","danger":"#FF5345","dangerSurface":"#241515","selection":"#2DD5B7","selectionText":"#171717"},"light":{"background":"#F6F5DD","surface":"#E8E7CC","surfaceAlt":"#D5D4B8","surfaceModal":"#E8E7CC","overlay":"#000000","border":"#A8A78C","borderMuted":"#D5D4B8","text":"#111c18","textMuted":"#53685B","textSubtle":"#53685B","primary":"#1faa90","secondary":"#a8527a","accent":"#3d7a52","active":"#3d7a52","inactive":"#53685B","key":"#b5a020","action":"#3d7a52","separator":"#53685B","program":"#3d7a52","fileTree":"#1faa90","danger":"#c7392d","dangerSurface":"#eee0e0","selection":"#1faa90","selectionText":"#f5f5f5"}},"palenight":{"dark":{"background":"#292d3e","surface":"#1e2132","surfaceAlt":"#32364a","surfaceModal":"#1e2132","overlay":"#000000","border":"#32364a","borderMuted":"#1e2132","text":"#a6accd","textMuted":"#676e95","textSubtle":"#676e95","primary":"#82aaff","secondary":"#c792ea","accent":"#89ddff","active":"#c3e88d","inactive":"#676e95","key":"#ffcb6b","action":"#89ddff","separator":"#676e95","program":"#c3e88d","fileTree":"#82aaff","danger":"#f07178","dangerSurface":"#3c2b2b","selection":"#82aaff","selectionText":"#171717"},"light":{"background":"#fafafa","surface":"#f5f5f5","surfaceAlt":"#e7e7e8","surfaceModal":"#f5f5f5","overlay":"#000000","border":"#e0e0e0","borderMuted":"#eeeeee","text":"#292d3e","textMuted":"#8796b0","textSubtle":"#8796b0","primary":"#4976eb","secondary":"#a854f2","accent":"#00acc1","active":"#91b859","inactive":"#8796b0","key":"#ffb300","action":"#00acc1","separator":"#8796b0","program":"#91b859","fileTree":"#4976eb","danger":"#e53935","dangerSurface":"#ffebee","selection":"#4976eb","selectionText":"#f5f5f5"}},"rosepine":{"dark":{"background":"#191724","surface":"#191724","surfaceAlt":"#26233a","surfaceModal":"#1f1d2e","overlay":"#000000","border":"#403d52","borderMuted":"#21202e","text":"#e0def4","textMuted":"#6e6a86","textSubtle":"#6e6a86","primary":"#9ccfd8","secondary":"#c4a7e7","accent":"#ebbcba","active":"#31748f","inactive":"#6e6a86","key":"#f6c177","action":"#ebbcba","separator":"#403d52","program":"#31748f","fileTree":"#9ccfd8","danger":"#eb6f92","dangerSurface":"#3a1f2d","selection":"#9ccfd8","selectionText":"#171717"},"light":{"background":"#faf4ed","surface":"#fffaf3","surfaceAlt":"#f2e9e1","surfaceModal":"#fffaf3","overlay":"#000000","border":"#dfdad9","borderMuted":"#f4ede8","text":"#575279","textMuted":"#9893a5","textSubtle":"#9893a5","primary":"#31748f","secondary":"#907aa9","accent":"#d7827e","active":"#286983","inactive":"#9893a5","key":"#ea9d34","action":"#d7827e","separator":"#dfdad9","program":"#286983","fileTree":"#31748f","danger":"#b4637a","dangerSurface":"#fce5e8","selection":"#31748f","selectionText":"#f5f5f5"}},"solarized":{"dark":{"background":"#002b36","surface":"#073642","surfaceAlt":"#073642","surfaceModal":"#073642","overlay":"#000000","border":"#073642","borderMuted":"#073642","text":"#839496","textMuted":"#586e75","textSubtle":"#586e75","primary":"#268bd2","secondary":"#6c71c4","accent":"#2aa198","active":"#859900","inactive":"#586e75","key":"#b58900","action":"#6c71c4","separator":"#586e75","program":"#859900","fileTree":"#2aa198","danger":"#dc322f","dangerSurface":"#073642","selection":"#268bd2","selectionText":"#f5f5f5"},"light":{"background":"#fdf6e3","surface":"#eee8d5","surfaceAlt":"#eee8d5","surfaceModal":"#eee8d5","overlay":"#000000","border":"#eee8d5","borderMuted":"#eee8d5","text":"#657b83","textMuted":"#93a1a1","textSubtle":"#93a1a1","primary":"#268bd2","secondary":"#6c71c4","accent":"#2aa198","active":"#859900","inactive":"#93a1a1","key":"#b58900","action":"#6c71c4","separator":"#93a1a1","program":"#859900","fileTree":"#2aa198","danger":"#dc322f","dangerSurface":"#eee8d5","selection":"#268bd2","selectionText":"#f5f5f5"}},"synthwave84":{"dark":{"background":"#262335","surface":"#1e1a29","surfaceAlt":"#2a2139","surfaceModal":"#1e1a29","overlay":"#000000","border":"#495495","borderMuted":"#241b2f","text":"#ffffff","textMuted":"#848bbd","textSubtle":"#848bbd","primary":"#36f9f6","secondary":"#ff7edb","accent":"#b084eb","active":"#72f1b8","inactive":"#848bbd","key":"#fede5d","action":"#b084eb","separator":"#495495","program":"#72f1b8","fileTree":"#36f9f6","danger":"#fe4450","dangerSurface":"#3a1a2a","selection":"#36f9f6","selectionText":"#171717"},"light":{"background":"#fafafa","surface":"#f5f5f5","surfaceAlt":"#eeeeee","surfaceModal":"#f5f5f5","overlay":"#000000","border":"#e0e0e0","borderMuted":"#f0f0f0","text":"#262335","textMuted":"#5c5c8a","textSubtle":"#5c5c8a","primary":"#00bcd4","secondary":"#e91e63","accent":"#9c27b0","active":"#4caf50","inactive":"#5c5c8a","key":"#ff9800","action":"#9c27b0","separator":"#e0e0e0","program":"#4caf50","fileTree":"#00bcd4","danger":"#f44336","dangerSurface":"#ffebee","selection":"#00bcd4","selectionText":"#f5f5f5"}},"tokyonight":{"dark":{"background":"#1a1b26","surface":"#1e2030","surfaceAlt":"#222436","surfaceModal":"#1e2030","overlay":"#000000","border":"#737aa2","borderMuted":"#545c7e","text":"#c8d3f5","textMuted":"#828bb8","textSubtle":"#828bb8","primary":"#82aaff","secondary":"#c099ff","accent":"#ff966c","active":"#c3e88d","inactive":"#828bb8","key":"#ff966c","action":"#86e1fc","separator":"#828bb8","program":"#c3e88d","fileTree":"#82aaff","danger":"#ff757f","dangerSurface":"#37222c","selection":"#82aaff","selectionText":"#171717"},"light":{"background":"#e1e2e7","surface":"#d5d6db","surfaceAlt":"#c8c9ce","surfaceModal":"#d5d6db","overlay":"#000000","border":"#737a8c","borderMuted":"#9699a8","text":"#3760bf","textMuted":"#8990a3","textSubtle":"#8990a3","primary":"#2e7de9","secondary":"#9854f1","accent":"#b15c00","active":"#587539","inactive":"#8990a3","key":"#b15c00","action":"#007197","separator":"#8990a3","program":"#587539","fileTree":"#2e7de9","danger":"#f52a65","dangerSurface":"#f7d8db","selection":"#2e7de9","selectionText":"#f5f5f5"}},"vercel":{"dark":{"background":"#000000","surface":"#1A1A1A","surfaceAlt":"#292929","surfaceModal":"#1A1A1A","overlay":"#000000","border":"#1F1F1F","borderMuted":"#1A1A1A","text":"#EDEDED","textMuted":"#878787","textSubtle":"#878787","primary":"#0070F3","secondary":"#52A8FF","accent":"#8E4EC6","active":"#46A758","inactive":"#878787","key":"#FFB224","action":"#0AC7AC","separator":"#454545","program":"#63C46D","fileTree":"#52A8FF","danger":"#E5484D","dangerSurface":"#2A1314","selection":"#0070F3","selectionText":"#f5f5f5"},"light":{"background":"#FFFFFF","surface":"#FAFAFA","surfaceAlt":"#EAEAEA","surfaceModal":"#FAFAFA","overlay":"#000000","border":"#EAEAEA","borderMuted":"#EAEAEA","text":"#171717","textMuted":"#666666","textSubtle":"#666666","primary":"#0070F3","secondary":"#0062D1","accent":"#8E4EC6","active":"#388E3C","inactive":"#666666","key":"#FF9500","action":"#12A594","separator":"#999999","program":"#46A758","fileTree":"#0070F3","danger":"#DC3545","dangerSurface":"#FDECED","selection":"#0070F3","selectionText":"#f5f5f5"}},"vesper":{"dark":{"background":"#101010","surface":"#101010","surfaceAlt":"#101010","surfaceModal":"#101010","overlay":"#000000","border":"#282828","borderMuted":"#1C1C1C","text":"#FFF","textMuted":"#A0A0A0","textSubtle":"#A0A0A0","primary":"#FFC799","secondary":"#99FFE4","accent":"#FFC799","active":"#99FFE4","inactive":"#A0A0A0","key":"#FFC799","action":"#A0A0A0","separator":"#65737E","program":"#A0A0A0","fileTree":"#FFC799","danger":"#FF8080","dangerSurface":"#281a1a","selection":"#FFC799","selectionText":"#171717"},"light":{"background":"#FFF","surface":"#F0F0F0","surfaceAlt":"#E0E0E0","surfaceModal":"#F0F0F0","overlay":"#000000","border":"#D0D0D0","borderMuted":"#E8E8E8","text":"#101010","textMuted":"#A0A0A0","textSubtle":"#A0A0A0","primary":"#FFC799","secondary":"#99FFE4","accent":"#FFC799","active":"#99FFE4","inactive":"#A0A0A0","key":"#FFC799","action":"#A0A0A0","separator":"#65737E","program":"#A0A0A0","fileTree":"#FFC799","danger":"#FF8080","dangerSurface":"#f5e8e8","selection":"#FFC799","selectionText":"#171717"}},"zenburn":{"dark":{"background":"#3f3f3f","surface":"#4f4f4f","surfaceAlt":"#5f5f5f","surfaceModal":"#4f4f4f","overlay":"#000000","border":"#5f5f5f","borderMuted":"#4f4f4f","text":"#dcdccc","textMuted":"#9f9f9f","textSubtle":"#9f9f9f","primary":"#8cd0d3","secondary":"#dc8cc3","accent":"#93e0e3","active":"#7f9f7f","inactive":"#9f9f9f","key":"#f0dfaf","action":"#93e0e3","separator":"#9f9f9f","program":"#7f9f7f","fileTree":"#8cd0d3","danger":"#cc9393","dangerSurface":"#5f4f4f","selection":"#8cd0d3","selectionText":"#171717"},"light":{"background":"#ffffef","surface":"#f5f5e5","surfaceAlt":"#ebebdb","surfaceModal":"#f5f5e5","overlay":"#000000","border":"#d0d0c0","borderMuted":"#e0e0d0","text":"#3f3f3f","textMuted":"#6f6f6f","textSubtle":"#6f6f6f","primary":"#5f7f8f","secondary":"#8f5f8f","accent":"#5f8f8f","active":"#5f8f5f","inactive":"#6f6f6f","key":"#8f8f5f","action":"#5f8f8f","separator":"#6f6f6f","program":"#5f8f5f","fileTree":"#5f7f8f","danger":"#8f5f5f","dangerSurface":"#ffefef","selection":"#5f7f8f","selectionText":"#f5f5f5"}}} as const
|
package/src/styles/theme.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
ThemeDefinition,
|
|
7
7
|
ThemeVariant,
|
|
8
8
|
} from '../types'
|
|
9
|
+
import { TUI_THEME_COLORS } from './opencode-tui-colors'
|
|
9
10
|
import { THEMES_A } from './opencode-themes-a'
|
|
10
11
|
import { THEMES_B } from './opencode-themes-b'
|
|
11
12
|
|
|
@@ -58,170 +59,7 @@ function readableText(background: string) {
|
|
|
58
59
|
return luminance(background) > 150 ? '#171717' : '#f5f5f5'
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
const EXACT_TUI_THEME_COLORS: Partial<Record<string, Record<'light' | 'dark', ThemeColors>>> =
|
|
62
|
-
rosepine: {
|
|
63
|
-
dark: {
|
|
64
|
-
background: '#191724',
|
|
65
|
-
surface: '#191724',
|
|
66
|
-
surfaceAlt: '#26233a',
|
|
67
|
-
surfaceModal: '#1f1d2e',
|
|
68
|
-
overlay: '#000000',
|
|
69
|
-
border: '#403d52',
|
|
70
|
-
borderMuted: '#21202e',
|
|
71
|
-
text: '#e0def4',
|
|
72
|
-
textMuted: '#908caa',
|
|
73
|
-
textSubtle: '#6e6a86',
|
|
74
|
-
primary: '#9ccfd8',
|
|
75
|
-
secondary: '#c4a7e7',
|
|
76
|
-
accent: '#ebbcba',
|
|
77
|
-
active: '#31748f',
|
|
78
|
-
inactive: '#6e6a86',
|
|
79
|
-
key: '#f6c177',
|
|
80
|
-
action: '#ebbcba',
|
|
81
|
-
separator: '#403d52',
|
|
82
|
-
program: '#31748f',
|
|
83
|
-
fileTree: '#9ccfd8',
|
|
84
|
-
danger: '#eb6f92',
|
|
85
|
-
dangerSurface: '#3a1f2d',
|
|
86
|
-
selection: '#9ccfd8',
|
|
87
|
-
selectionText: readableText('#9ccfd8'),
|
|
88
|
-
},
|
|
89
|
-
light: {
|
|
90
|
-
background: '#faf4ed',
|
|
91
|
-
surface: '#fffaf3',
|
|
92
|
-
surfaceAlt: '#f2e9e1',
|
|
93
|
-
surfaceModal: '#fffaf3',
|
|
94
|
-
overlay: '#000000',
|
|
95
|
-
border: '#dfdad9',
|
|
96
|
-
borderMuted: '#f4ede8',
|
|
97
|
-
text: '#575279',
|
|
98
|
-
textMuted: '#797593',
|
|
99
|
-
textSubtle: '#9893a5',
|
|
100
|
-
primary: '#31748f',
|
|
101
|
-
secondary: '#907aa9',
|
|
102
|
-
accent: '#d7827e',
|
|
103
|
-
active: '#286983',
|
|
104
|
-
inactive: '#9893a5',
|
|
105
|
-
key: '#ea9d34',
|
|
106
|
-
action: '#d7827e',
|
|
107
|
-
separator: '#dfdad9',
|
|
108
|
-
program: '#286983',
|
|
109
|
-
fileTree: '#31748f',
|
|
110
|
-
danger: '#b4637a',
|
|
111
|
-
dangerSurface: '#fce5e8',
|
|
112
|
-
selection: '#31748f',
|
|
113
|
-
selectionText: readableText('#31748f'),
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
opencode: {
|
|
117
|
-
dark: {
|
|
118
|
-
background: '#0a0a0a',
|
|
119
|
-
surface: '#141414',
|
|
120
|
-
surfaceAlt: '#1e1e1e',
|
|
121
|
-
surfaceModal: '#141414',
|
|
122
|
-
overlay: '#000000',
|
|
123
|
-
border: '#484848',
|
|
124
|
-
borderMuted: '#3c3c3c',
|
|
125
|
-
text: '#eeeeee',
|
|
126
|
-
textMuted: '#a0a0a0',
|
|
127
|
-
textSubtle: '#808080',
|
|
128
|
-
primary: '#fab283',
|
|
129
|
-
secondary: '#5c9cf5',
|
|
130
|
-
accent: '#9d7cd8',
|
|
131
|
-
active: '#7fd88f',
|
|
132
|
-
inactive: '#808080',
|
|
133
|
-
key: '#f5a742',
|
|
134
|
-
action: '#56b6c2',
|
|
135
|
-
separator: '#808080',
|
|
136
|
-
program: '#7fd88f',
|
|
137
|
-
fileTree: '#fab283',
|
|
138
|
-
danger: '#e06c75',
|
|
139
|
-
dangerSurface: '#37222c',
|
|
140
|
-
selection: '#fab283',
|
|
141
|
-
selectionText: readableText('#fab283'),
|
|
142
|
-
},
|
|
143
|
-
light: {
|
|
144
|
-
background: '#ffffff',
|
|
145
|
-
surface: '#fafafa',
|
|
146
|
-
surfaceAlt: '#f5f5f5',
|
|
147
|
-
surfaceModal: '#fafafa',
|
|
148
|
-
overlay: '#000000',
|
|
149
|
-
border: '#b8b8b8',
|
|
150
|
-
borderMuted: '#d4d4d4',
|
|
151
|
-
text: '#1a1a1a',
|
|
152
|
-
textMuted: '#8a8a8a',
|
|
153
|
-
textSubtle: '#a0a0a0',
|
|
154
|
-
primary: '#3b7dd8',
|
|
155
|
-
secondary: '#7b5bb6',
|
|
156
|
-
accent: '#d68c27',
|
|
157
|
-
active: '#3d9a57',
|
|
158
|
-
inactive: '#8a8a8a',
|
|
159
|
-
key: '#d68c27',
|
|
160
|
-
action: '#318795',
|
|
161
|
-
separator: '#8a8a8a',
|
|
162
|
-
program: '#3d9a57',
|
|
163
|
-
fileTree: '#3b7dd8',
|
|
164
|
-
danger: '#d1383d',
|
|
165
|
-
dangerSurface: '#f7d8db',
|
|
166
|
-
selection: '#3b7dd8',
|
|
167
|
-
selectionText: readableText('#3b7dd8'),
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
'oc-2': {
|
|
171
|
-
dark: {
|
|
172
|
-
background: '#1f1f1f',
|
|
173
|
-
surface: '#232323',
|
|
174
|
-
surfaceAlt: '#282828',
|
|
175
|
-
surfaceModal: '#232323',
|
|
176
|
-
overlay: '#000000',
|
|
177
|
-
border: '#282828',
|
|
178
|
-
borderMuted: '#232323',
|
|
179
|
-
text: '#ededed',
|
|
180
|
-
textMuted: '#a0a0a0',
|
|
181
|
-
textSubtle: '#707070',
|
|
182
|
-
primary: '#fab283',
|
|
183
|
-
secondary: '#034cff',
|
|
184
|
-
accent: '#edb2f1',
|
|
185
|
-
active: '#12c905',
|
|
186
|
-
inactive: '#707070',
|
|
187
|
-
key: '#fcd53a',
|
|
188
|
-
action: '#edb2f1',
|
|
189
|
-
separator: '#505050',
|
|
190
|
-
program: '#00ceb9',
|
|
191
|
-
fileTree: '#93e9f6',
|
|
192
|
-
danger: '#fc533a',
|
|
193
|
-
dangerSurface: '#1f0603',
|
|
194
|
-
selection: '#fab283',
|
|
195
|
-
selectionText: readableText('#fab283'),
|
|
196
|
-
},
|
|
197
|
-
light: {
|
|
198
|
-
background: '#f8f8f8',
|
|
199
|
-
surface: '#f3f3f3',
|
|
200
|
-
surfaceAlt: '#ededed',
|
|
201
|
-
surfaceModal: '#ffffff',
|
|
202
|
-
overlay: '#000000',
|
|
203
|
-
border: '#dbdbdb',
|
|
204
|
-
borderMuted: '#e8e8e8',
|
|
205
|
-
text: '#171717',
|
|
206
|
-
textMuted: '#6f6f6f',
|
|
207
|
-
textSubtle: '#8f8f8f',
|
|
208
|
-
primary: '#dcde8d',
|
|
209
|
-
secondary: '#034cff',
|
|
210
|
-
accent: '#a753ae',
|
|
211
|
-
active: '#12c905',
|
|
212
|
-
inactive: '#8f8f8f',
|
|
213
|
-
key: '#ffdc17',
|
|
214
|
-
action: '#a753ae',
|
|
215
|
-
separator: '#c7c7c7',
|
|
216
|
-
program: '#00ceb9',
|
|
217
|
-
fileTree: '#007b80',
|
|
218
|
-
danger: '#fc533a',
|
|
219
|
-
dangerSurface: '#fff2f0',
|
|
220
|
-
selection: '#dcde8d',
|
|
221
|
-
selectionText: readableText('#dcde8d'),
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
}
|
|
62
|
+
const EXACT_TUI_THEME_COLORS: Partial<Record<string, Record<'light' | 'dark', ThemeColors>>> = TUI_THEME_COLORS
|
|
225
63
|
|
|
226
64
|
function mix(colorA: string, colorB: string, ratio: number) {
|
|
227
65
|
const from = hexToRgb(colorA)
|
package/src/tmux/index.ts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { spawn } from 'bun'
|
|
2
2
|
import type { Item, SessionDetails, WindowInfo } from '../types'
|
|
3
3
|
|
|
4
|
+
const SESSION_DETAILS_CACHE_TTL_MS = 4000
|
|
5
|
+
const sessionDetailsCache = new Map<string, { details: SessionDetails; expiresAt: number }>()
|
|
6
|
+
|
|
7
|
+
function stripAnsi(value: string): string {
|
|
8
|
+
return value.replace(/\u001b\[[0-9;?]*[ -/]*[@-~]/g, '')
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function formatPanePreview(output: string): string[] {
|
|
12
|
+
return stripAnsi(output)
|
|
13
|
+
.replace(/\r/g, '')
|
|
14
|
+
.split('\n')
|
|
15
|
+
.map(line => line.trimEnd())
|
|
16
|
+
.filter(line => line.length > 0)
|
|
17
|
+
.slice(-8)
|
|
18
|
+
}
|
|
19
|
+
|
|
4
20
|
export interface CreateTmuxSessionOptions {
|
|
5
21
|
startupCommand?: string
|
|
6
22
|
}
|
|
@@ -161,6 +177,11 @@ export async function renameTmuxSession(oldName: string, newName: string): Promi
|
|
|
161
177
|
}
|
|
162
178
|
|
|
163
179
|
export async function getSessionDetails(sessionName: string): Promise<SessionDetails> {
|
|
180
|
+
const cached = sessionDetailsCache.get(sessionName)
|
|
181
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
182
|
+
return cached.details
|
|
183
|
+
}
|
|
184
|
+
|
|
164
185
|
// Get session status
|
|
165
186
|
const statusProc = spawn([
|
|
166
187
|
'tmux',
|
|
@@ -222,10 +243,44 @@ export async function getSessionDetails(sessionName: string): Promise<SessionDet
|
|
|
222
243
|
})
|
|
223
244
|
}
|
|
224
245
|
|
|
225
|
-
|
|
246
|
+
const activeWindowProc = spawn([
|
|
247
|
+
'tmux',
|
|
248
|
+
'display-message',
|
|
249
|
+
'-t',
|
|
250
|
+
sessionName,
|
|
251
|
+
'-p',
|
|
252
|
+
'#{window_index}',
|
|
253
|
+
])
|
|
254
|
+
const activeWindowIndex = (await new Response(activeWindowProc.stdout).text()).trim()
|
|
255
|
+
|
|
256
|
+
let panePreviewLines: string[] | undefined
|
|
257
|
+
if (activeWindowIndex.length > 0) {
|
|
258
|
+
const paneProc = spawn([
|
|
259
|
+
'tmux',
|
|
260
|
+
'capture-pane',
|
|
261
|
+
'-p',
|
|
262
|
+
'-t',
|
|
263
|
+
`${sessionName}:${activeWindowIndex}`,
|
|
264
|
+
'-S',
|
|
265
|
+
'-16',
|
|
266
|
+
])
|
|
267
|
+
const paneOutput = await new Response(paneProc.stdout).text()
|
|
268
|
+
const formatted = formatPanePreview(paneOutput)
|
|
269
|
+
panePreviewLines = formatted.length > 0 ? formatted : undefined
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const details = {
|
|
226
273
|
name: sessionName,
|
|
227
274
|
isAttached: attached === '1',
|
|
228
275
|
windowCount,
|
|
229
276
|
windows,
|
|
277
|
+
panePreviewLines,
|
|
230
278
|
}
|
|
279
|
+
|
|
280
|
+
sessionDetailsCache.set(sessionName, {
|
|
281
|
+
details,
|
|
282
|
+
expiresAt: Date.now() + SESSION_DETAILS_CACHE_TTL_MS,
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
return details
|
|
231
286
|
}
|
package/src/tmux/projects.ts
CHANGED
|
@@ -9,7 +9,18 @@ interface ZoxideEntry {
|
|
|
9
9
|
path: string
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
interface DiscoveryCacheEntry {
|
|
13
|
+
expiresAt: number
|
|
14
|
+
items: Item[]
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
const PROJECT_MARKERS = ['.git', '.jj', 'package.json', 'Cargo.toml', 'go.mod', 'pyproject.toml', 'flake.nix']
|
|
18
|
+
const DISCOVERY_CACHE_TTL_MS = 15000
|
|
19
|
+
const PROJECT_SCAN_DEPTH = 3
|
|
20
|
+
const SESSION_CANDIDATE_SCAN_DEPTH = 5
|
|
21
|
+
const projectItemsCache = new Map<string, DiscoveryCacheEntry>()
|
|
22
|
+
const sessionCandidateCache = new Map<string, DiscoveryCacheEntry>()
|
|
23
|
+
|
|
13
24
|
function isIgnoredProjectDirectory(baseName: string): boolean {
|
|
14
25
|
return (
|
|
15
26
|
baseName.startsWith('.') ||
|
|
@@ -30,6 +41,18 @@ function toProjectItem(projectPath: string): Item {
|
|
|
30
41
|
}
|
|
31
42
|
}
|
|
32
43
|
|
|
44
|
+
function uniqueNormalizedPaths(paths: string[]): string[] {
|
|
45
|
+
return [...new Set(paths.map(path => normalizePathForMatching(path)))]
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function buildCacheKey(config: Config, scope: 'projects' | 'session-candidates'): string {
|
|
49
|
+
return JSON.stringify({
|
|
50
|
+
scope,
|
|
51
|
+
roots: uniqueNormalizedPaths(config.projectPaths),
|
|
52
|
+
zoxideMode: config.zoxideMode,
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
|
|
33
56
|
async function hasProjectMarker(projectPath: string): Promise<boolean> {
|
|
34
57
|
for (const marker of PROJECT_MARKERS) {
|
|
35
58
|
try {
|
|
@@ -42,7 +65,7 @@ async function hasProjectMarker(projectPath: string): Promise<boolean> {
|
|
|
42
65
|
}
|
|
43
66
|
|
|
44
67
|
export async function filterProjectCandidatePaths(projectPaths: string[]): Promise<string[]> {
|
|
45
|
-
const uniquePaths =
|
|
68
|
+
const uniquePaths = uniqueNormalizedPaths(projectPaths)
|
|
46
69
|
const matches = await Promise.all(
|
|
47
70
|
uniquePaths.map(async projectPath => ({
|
|
48
71
|
projectPath,
|
|
@@ -84,13 +107,14 @@ function isWithinProjectRoots(projectPath: string, projectRoots: string[]): bool
|
|
|
84
107
|
})
|
|
85
108
|
}
|
|
86
109
|
|
|
87
|
-
|
|
110
|
+
function rankItemsByZoxide(items: Item[], entries: ZoxideEntry[], config: Config): Item[] {
|
|
88
111
|
if (config.zoxideMode === 'off' || entries.length === 0) {
|
|
89
112
|
return items.sort((a, b) => a.title.localeCompare(b.title))
|
|
90
113
|
}
|
|
91
114
|
|
|
92
115
|
const zoxideScores = new Map(entries.map(entry => [normalizePathForMatching(entry.path), entry.score]))
|
|
93
|
-
|
|
116
|
+
|
|
117
|
+
return [...items].sort((left, right) => {
|
|
94
118
|
const scoreDifference =
|
|
95
119
|
(zoxideScores.get(normalizePathForMatching(right.path)) ?? 0) -
|
|
96
120
|
(zoxideScores.get(normalizePathForMatching(left.path)) ?? 0)
|
|
@@ -101,6 +125,10 @@ export function applyZoxideMode(items: Item[], entries: ZoxideEntry[], config: C
|
|
|
101
125
|
|
|
102
126
|
return left.title.localeCompare(right.title)
|
|
103
127
|
})
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function applyZoxideMode(items: Item[], entries: ZoxideEntry[], config: Config): Item[] {
|
|
131
|
+
const rankedItems = rankItemsByZoxide(items, entries, config)
|
|
104
132
|
|
|
105
133
|
if (config.zoxideMode !== 'merge') {
|
|
106
134
|
return rankedItems
|
|
@@ -126,7 +154,7 @@ export function applyZoxideMode(items: Item[], entries: ZoxideEntry[], config: C
|
|
|
126
154
|
return [...rankedItems, ...mergedItems]
|
|
127
155
|
}
|
|
128
156
|
|
|
129
|
-
async function getZoxideEntries(projectRoots: string[]): Promise<ZoxideEntry[]> {
|
|
157
|
+
async function getZoxideEntries(projectRoots: string[], requireProjectMarker: boolean): Promise<ZoxideEntry[]> {
|
|
130
158
|
try {
|
|
131
159
|
const proc = spawn(['zoxide', 'query', '--list', '--score'])
|
|
132
160
|
const output = await new Response(proc.stdout).text()
|
|
@@ -137,6 +165,11 @@ async function getZoxideEntries(projectRoots: string[]): Promise<ZoxideEntry[]>
|
|
|
137
165
|
}
|
|
138
166
|
|
|
139
167
|
const entriesWithinRoots = parseZoxideOutput(output).filter(entry => isWithinProjectRoots(entry.path, projectRoots))
|
|
168
|
+
|
|
169
|
+
if (!requireProjectMarker) {
|
|
170
|
+
return entriesWithinRoots.filter(entry => !isIgnoredProjectDirectory(basename(entry.path)))
|
|
171
|
+
}
|
|
172
|
+
|
|
140
173
|
const projectCandidatePaths = await filterProjectCandidatePaths(entriesWithinRoots.map(entry => entry.path))
|
|
141
174
|
const projectCandidates = new Set(projectCandidatePaths)
|
|
142
175
|
|
|
@@ -146,41 +179,98 @@ async function getZoxideEntries(projectRoots: string[]): Promise<ZoxideEntry[]>
|
|
|
146
179
|
}
|
|
147
180
|
}
|
|
148
181
|
|
|
149
|
-
|
|
150
|
-
const items: Item[] = []
|
|
151
|
-
|
|
182
|
+
async function getExistingProjectRoots(projectPaths: string[]): Promise<string[]> {
|
|
152
183
|
const existingPaths: string[] = []
|
|
153
|
-
for (const path of
|
|
184
|
+
for (const path of projectPaths) {
|
|
154
185
|
try {
|
|
155
|
-
await stat(path)
|
|
156
|
-
|
|
186
|
+
const pathStat = await stat(path)
|
|
187
|
+
if (pathStat.isDirectory()) {
|
|
188
|
+
existingPaths.push(path)
|
|
189
|
+
}
|
|
157
190
|
} catch {}
|
|
158
191
|
}
|
|
159
192
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
193
|
+
return existingPaths
|
|
194
|
+
}
|
|
163
195
|
|
|
164
|
-
|
|
196
|
+
async function scanDirectories(projectRoots: string[], maxDepth: number): Promise<string[]> {
|
|
197
|
+
if (projectRoots.length === 0) {
|
|
198
|
+
return []
|
|
199
|
+
}
|
|
165
200
|
|
|
166
|
-
const
|
|
201
|
+
const args = [...projectRoots, '-mindepth', '1', '-maxdepth', String(maxDepth), '-type', 'd']
|
|
202
|
+
const proc = spawn(['find', ...args], {
|
|
203
|
+
stderr: 'pipe',
|
|
204
|
+
})
|
|
167
205
|
const output = await new Response(proc.stdout).text()
|
|
206
|
+
const stderrPromise = new Response(proc.stderr).text()
|
|
207
|
+
await proc.exited
|
|
208
|
+
await stderrPromise
|
|
168
209
|
|
|
169
|
-
|
|
210
|
+
return output
|
|
211
|
+
.trim()
|
|
212
|
+
.split('\n')
|
|
213
|
+
.filter(Boolean)
|
|
214
|
+
.map(path => normalizePathForMatching(path))
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function filterSessionCandidatePaths(paths: string[]): string[] {
|
|
218
|
+
return uniqueNormalizedPaths(paths).filter(path => !isIgnoredProjectDirectory(basename(path)))
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
async function getCachedDiscovery(
|
|
222
|
+
cache: Map<string, DiscoveryCacheEntry>,
|
|
223
|
+
cacheKey: string,
|
|
224
|
+
load: () => Promise<Item[]>
|
|
225
|
+
): Promise<Item[]> {
|
|
226
|
+
const cached = cache.get(cacheKey)
|
|
227
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
228
|
+
return cached.items
|
|
229
|
+
}
|
|
170
230
|
|
|
171
|
-
const
|
|
231
|
+
const items = await load()
|
|
232
|
+
cache.set(cacheKey, {
|
|
233
|
+
items,
|
|
234
|
+
expiresAt: Date.now() + DISCOVERY_CACHE_TTL_MS,
|
|
235
|
+
})
|
|
172
236
|
|
|
173
|
-
|
|
174
|
-
|
|
237
|
+
return items
|
|
238
|
+
}
|
|
175
239
|
|
|
176
|
-
|
|
177
|
-
|
|
240
|
+
export async function getProjectItems(config: Config): Promise<Item[]> {
|
|
241
|
+
const cacheKey = buildCacheKey(config, 'projects')
|
|
242
|
+
|
|
243
|
+
return getCachedDiscovery(projectItemsCache, cacheKey, async () => {
|
|
244
|
+
const existingPaths = await getExistingProjectRoots(config.projectPaths)
|
|
245
|
+
if (existingPaths.length === 0) {
|
|
246
|
+
return []
|
|
178
247
|
}
|
|
179
248
|
|
|
180
|
-
|
|
181
|
-
|
|
249
|
+
const scannedPaths = await scanDirectories(existingPaths, PROJECT_SCAN_DEPTH)
|
|
250
|
+
const projectCandidatePaths = await filterProjectCandidatePaths(scannedPaths)
|
|
251
|
+
const items = projectCandidatePaths
|
|
252
|
+
.filter(path => !isIgnoredProjectDirectory(basename(path)))
|
|
253
|
+
.map(toProjectItem)
|
|
254
|
+
|
|
255
|
+
const zoxideEntries = config.zoxideMode === 'off' ? [] : await getZoxideEntries(existingPaths, true)
|
|
256
|
+
return applyZoxideMode(items, zoxideEntries, config)
|
|
257
|
+
})
|
|
258
|
+
}
|
|
182
259
|
|
|
183
|
-
|
|
260
|
+
export async function getSessionCandidateItems(config: Config): Promise<Item[]> {
|
|
261
|
+
const cacheKey = buildCacheKey(config, 'session-candidates')
|
|
184
262
|
|
|
185
|
-
return
|
|
263
|
+
return getCachedDiscovery(sessionCandidateCache, cacheKey, async () => {
|
|
264
|
+
const existingPaths = await getExistingProjectRoots(config.projectPaths)
|
|
265
|
+
if (existingPaths.length === 0) {
|
|
266
|
+
return []
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const scannedPaths = await scanDirectories(existingPaths, SESSION_CANDIDATE_SCAN_DEPTH)
|
|
270
|
+
const candidatePaths = filterSessionCandidatePaths(scannedPaths)
|
|
271
|
+
const items = candidatePaths.map(toProjectItem)
|
|
272
|
+
const zoxideEntries = config.zoxideMode === 'off' ? [] : await getZoxideEntries(existingPaths, false)
|
|
273
|
+
|
|
274
|
+
return applyZoxideMode(items, zoxideEntries, config)
|
|
275
|
+
})
|
|
186
276
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -186,6 +186,7 @@ export interface SessionDetails {
|
|
|
186
186
|
isAttached: boolean
|
|
187
187
|
windowCount: string
|
|
188
188
|
windows: WindowInfo[]
|
|
189
|
+
panePreviewLines?: string[]
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
export interface SearchResult {
|
|
@@ -198,7 +199,7 @@ export interface FuzzyMatch {
|
|
|
198
199
|
indices: number[]
|
|
199
200
|
}
|
|
200
201
|
|
|
201
|
-
export type InstallMethod = 'npm' | 'bun' | 'brew' | 'unknown'
|
|
202
|
+
export type InstallMethod = 'npm' | 'bun' | 'brew' | 'source' | 'unknown'
|
|
202
203
|
|
|
203
204
|
export type UpdateEvent =
|
|
204
205
|
| {
|
|
@@ -109,6 +109,19 @@ function SessionDetailsView({ details }: { details: SessionDetails }) {
|
|
|
109
109
|
))
|
|
110
110
|
)}
|
|
111
111
|
</box>
|
|
112
|
+
|
|
113
|
+
{details.panePreviewLines && details.panePreviewLines.length > 0 && (
|
|
114
|
+
<>
|
|
115
|
+
<SectionLabel>Preview</SectionLabel>
|
|
116
|
+
<box style={{ flexDirection: 'column', marginTop: 1 }}>
|
|
117
|
+
{details.panePreviewLines.map((line, index) => (
|
|
118
|
+
<text key={`${details.name}:preview:${index}`} style={{ fg: theme.textMuted }}>
|
|
119
|
+
{line}
|
|
120
|
+
</text>
|
|
121
|
+
))}
|
|
122
|
+
</box>
|
|
123
|
+
</>
|
|
124
|
+
)}
|
|
112
125
|
</box>
|
|
113
126
|
)
|
|
114
127
|
}
|
package/src/update/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config } from '../types'
|
|
2
2
|
import { CURRENT_VERSION, getLatestVersion, isNewerVersion } from './version'
|
|
3
|
-
import { canAutoUpdate, detectInstallMethod, performUpgrade } from './installation'
|
|
3
|
+
import { canAutoUpdate, detectInstallMethod, getInstalledVersion, performUpgrade } from './installation'
|
|
4
4
|
import { updateEvents } from './events'
|
|
5
5
|
|
|
6
6
|
interface UpdateDependencies {
|
|
@@ -8,6 +8,7 @@ interface UpdateDependencies {
|
|
|
8
8
|
isNewerVersion: typeof isNewerVersion
|
|
9
9
|
detectInstallMethod: typeof detectInstallMethod
|
|
10
10
|
canAutoUpdate: typeof canAutoUpdate
|
|
11
|
+
getInstalledVersion: typeof getInstalledVersion
|
|
11
12
|
performUpgrade: typeof performUpgrade
|
|
12
13
|
emit: typeof updateEvents.emit
|
|
13
14
|
}
|
|
@@ -17,6 +18,7 @@ const defaultDependencies: UpdateDependencies = {
|
|
|
17
18
|
isNewerVersion,
|
|
18
19
|
detectInstallMethod,
|
|
19
20
|
canAutoUpdate,
|
|
21
|
+
getInstalledVersion,
|
|
20
22
|
performUpgrade,
|
|
21
23
|
emit: updateEvents.emit.bind(updateEvents),
|
|
22
24
|
}
|
|
@@ -58,7 +60,9 @@ export async function checkAndUpdate(config: Config, dependencies: Partial<Updat
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
const success = await resolvedDependencies.performUpgrade(method, latest)
|
|
61
|
-
|
|
63
|
+
const installedVersion = success ? await resolvedDependencies.getInstalledVersion() : null
|
|
64
|
+
|
|
65
|
+
if (success && installedVersion === latest) {
|
|
62
66
|
resolvedDependencies.emit({
|
|
63
67
|
kind: 'updated',
|
|
64
68
|
currentVersion: CURRENT_VERSION,
|
|
@@ -1,8 +1,82 @@
|
|
|
1
1
|
import type { InstallMethod } from '../types'
|
|
2
2
|
|
|
3
|
+
interface PackageMetadata {
|
|
4
|
+
name?: string
|
|
5
|
+
version?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
const PACKAGE_NAME = 'mux-sesh'
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
function normalizePath(path: string): string {
|
|
11
|
+
return path.replaceAll('\\', '/')
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function getDefaultRuntimePath(): string {
|
|
15
|
+
return process.argv[1] ?? import.meta.path
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function findPackageRoot(startPath: string): Promise<string | null> {
|
|
19
|
+
let current = normalizePath(startPath)
|
|
20
|
+
|
|
21
|
+
if (!current) {
|
|
22
|
+
return null
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const lastSlash = current.lastIndexOf('/')
|
|
26
|
+
if (lastSlash === -1) {
|
|
27
|
+
return null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
current = current.slice(0, lastSlash)
|
|
31
|
+
|
|
32
|
+
while (current) {
|
|
33
|
+
const packageFile = Bun.file(`${current}/package.json`)
|
|
34
|
+
|
|
35
|
+
if (await packageFile.exists()) {
|
|
36
|
+
try {
|
|
37
|
+
const packageJson = (await packageFile.json()) as PackageMetadata
|
|
38
|
+
if (packageJson.name === PACKAGE_NAME) {
|
|
39
|
+
return current
|
|
40
|
+
}
|
|
41
|
+
} catch {
|
|
42
|
+
return null
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const parent = current.slice(0, current.lastIndexOf('/')) || '/'
|
|
47
|
+
if (parent === current) {
|
|
48
|
+
return null
|
|
49
|
+
}
|
|
50
|
+
current = parent
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return null
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function detectInstallMethodFromPath(runtimePath: string): Promise<InstallMethod> {
|
|
57
|
+
const normalizedPath = normalizePath(runtimePath)
|
|
58
|
+
|
|
59
|
+
if (normalizedPath.includes(`/.bun/install/global/node_modules/${PACKAGE_NAME}/`)) {
|
|
60
|
+
return 'bun'
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (normalizedPath.includes(`/Cellar/${PACKAGE_NAME}/`)) {
|
|
64
|
+
return 'brew'
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (normalizedPath.includes(`/node_modules/${PACKAGE_NAME}/`)) {
|
|
68
|
+
return 'npm'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return (await findPackageRoot(normalizedPath)) ? 'source' : 'unknown'
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export async function detectInstallMethod(runtimePath = getDefaultRuntimePath()): Promise<InstallMethod> {
|
|
75
|
+
const activeMethod = await detectInstallMethodFromPath(runtimePath)
|
|
76
|
+
if (activeMethod !== 'unknown') {
|
|
77
|
+
return activeMethod
|
|
78
|
+
}
|
|
79
|
+
|
|
6
80
|
const checks = [
|
|
7
81
|
{
|
|
8
82
|
name: 'npm' as const,
|
|
@@ -37,11 +111,27 @@ export function canAutoUpdate(method: InstallMethod): boolean {
|
|
|
37
111
|
return method === 'npm' || method === 'bun'
|
|
38
112
|
}
|
|
39
113
|
|
|
114
|
+
export async function getInstalledVersion(runtimePath = getDefaultRuntimePath()): Promise<string | null> {
|
|
115
|
+
const packageRoot = await findPackageRoot(runtimePath)
|
|
116
|
+
|
|
117
|
+
if (!packageRoot) {
|
|
118
|
+
return null
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
const packageJson = (await Bun.file(`${packageRoot}/package.json`).json()) as PackageMetadata
|
|
123
|
+
return typeof packageJson.version === 'string' ? packageJson.version : null
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error('Failed to read installed version:', error)
|
|
126
|
+
return null
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
40
130
|
export async function performUpgrade(
|
|
41
131
|
method: InstallMethod,
|
|
42
132
|
targetVersion: string
|
|
43
133
|
): Promise<boolean> {
|
|
44
|
-
if (method === 'unknown') {
|
|
134
|
+
if (method === 'unknown' || method === 'source') {
|
|
45
135
|
return false
|
|
46
136
|
}
|
|
47
137
|
let command: string[]
|
package/src/util/perf.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const PERF_ENABLED = process.env.MUX_SESH_DEBUG_PERF === '1'
|
|
2
|
+
|
|
3
|
+
export async function measure<T>(label: string, fn: () => Promise<T>): Promise<T> {
|
|
4
|
+
if (!PERF_ENABLED) {
|
|
5
|
+
return fn()
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const start = performance.now()
|
|
9
|
+
try {
|
|
10
|
+
return await fn()
|
|
11
|
+
} finally {
|
|
12
|
+
const duration = performance.now() - start
|
|
13
|
+
console.error(`[perf] ${label}: ${duration.toFixed(1)}ms`)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function mark(label: string): void {
|
|
18
|
+
if (!PERF_ENABLED) {
|
|
19
|
+
return
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
console.error(`[perf] ${label}`)
|
|
23
|
+
}
|