mux-sesh 1.10.0 → 2.0.1

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.
Files changed (124) hide show
  1. package/README.md +133 -86
  2. package/bin/mux-sesh +45 -17
  3. package/bin/platform.sh +139 -0
  4. package/bin/postinstall +22 -0
  5. package/package.json +27 -38
  6. package/src/agents/index.ts +0 -1
  7. package/src/agents/session-name.ts +0 -24
  8. package/src/app/commands.ts +0 -138
  9. package/src/app/controller.ts +0 -437
  10. package/src/app/controls.ts +0 -123
  11. package/src/app/core-state.ts +0 -75
  12. package/src/app/data.ts +0 -130
  13. package/src/app/derived.ts +0 -77
  14. package/src/app/effects.ts +0 -650
  15. package/src/app/handlers.ts +0 -406
  16. package/src/app/keyboard.ts +0 -165
  17. package/src/app/modal-keyboard.ts +0 -137
  18. package/src/app/modal-state.ts +0 -53
  19. package/src/app/modals-layer.tsx +0 -159
  20. package/src/app/modals.ts +0 -108
  21. package/src/app/notifications.ts +0 -21
  22. package/src/app/opencode.ts +0 -49
  23. package/src/app/operations.ts +0 -31
  24. package/src/app/runtime.ts +0 -79
  25. package/src/app/screen.tsx +0 -240
  26. package/src/app/state.ts +0 -178
  27. package/src/app/textarea.ts +0 -16
  28. package/src/app/view.ts +0 -101
  29. package/src/app.tsx +0 -50
  30. package/src/config/index.ts +0 -475
  31. package/src/config/listed-sessions.ts +0 -33
  32. package/src/config/paths.ts +0 -13
  33. package/src/config/session-rules.ts +0 -100
  34. package/src/config/store.ts +0 -33
  35. package/src/files/target.ts +0 -96
  36. package/src/handlers/action-helpers.ts +0 -83
  37. package/src/handlers/actions.ts +0 -216
  38. package/src/handlers/keyboard/agents.ts +0 -134
  39. package/src/handlers/keyboard/index.ts +0 -5
  40. package/src/handlers/keyboard/new-session.ts +0 -58
  41. package/src/handlers/keyboard/normal.ts +0 -220
  42. package/src/handlers/keyboard/search.ts +0 -118
  43. package/src/handlers/keyboard/shared.ts +0 -117
  44. package/src/herdr/backend.ts +0 -357
  45. package/src/herdr/protocol.ts +0 -268
  46. package/src/index.tsx +0 -23
  47. package/src/items/order.ts +0 -95
  48. package/src/multiplexer/backend.ts +0 -43
  49. package/src/multiplexer/command.ts +0 -48
  50. package/src/multiplexer/index.ts +0 -21
  51. package/src/multiplexer/items.ts +0 -66
  52. package/src/multiplexer/resolve.ts +0 -109
  53. package/src/multiplexer/tmux-backend.ts +0 -87
  54. package/src/multiplexer/types.ts +0 -93
  55. package/src/opencode/constants.ts +0 -7
  56. package/src/opencode/index.ts +0 -20
  57. package/src/opencode/parser.ts +0 -45
  58. package/src/opencode/session-name.ts +0 -13
  59. package/src/opencode/session.ts +0 -146
  60. package/src/opencode/sqlite.ts +0 -447
  61. package/src/opencode/stats.ts +0 -26
  62. package/src/opencode/tokens.ts +0 -116
  63. package/src/opencode/types.ts +0 -33
  64. package/src/preview/project.ts +0 -362
  65. package/src/projects/session-links.ts +0 -52
  66. package/src/search/fff.ts +0 -224
  67. package/src/search/index.ts +0 -198
  68. package/src/settings.ts +0 -465
  69. package/src/styles/omarchy.ts +0 -295
  70. package/src/styles/opencode-themes-a.ts +0 -1442
  71. package/src/styles/opencode-themes-b.ts +0 -1212
  72. package/src/styles/opencode-tui-colors.ts +0 -1784
  73. package/src/styles/terminal-palette.ts +0 -156
  74. package/src/styles/theme-follow.ts +0 -94
  75. package/src/styles/theme.tsx +0 -311
  76. package/src/tmux/actions.ts +0 -145
  77. package/src/tmux/details.ts +0 -104
  78. package/src/tmux/helpers.ts +0 -35
  79. package/src/tmux/index.ts +0 -10
  80. package/src/tmux/list.ts +0 -31
  81. package/src/tmux/project-discovery.ts +0 -116
  82. package/src/tmux/project-loader.ts +0 -92
  83. package/src/tmux/project-zoxide.ts +0 -128
  84. package/src/tmux/projects.ts +0 -38
  85. package/src/tmux/workflows.ts +0 -26
  86. package/src/types/index.ts +0 -221
  87. package/src/ui/AgentSessionGroup.tsx +0 -93
  88. package/src/ui/CommandsModal.tsx +0 -246
  89. package/src/ui/ErrorScreen.tsx +0 -102
  90. package/src/ui/HighlightedText.tsx +0 -60
  91. package/src/ui/ItemList.tsx +0 -119
  92. package/src/ui/Modal.tsx +0 -48
  93. package/src/ui/OpencodeStatsPanel.tsx +0 -233
  94. package/src/ui/RenameModal.tsx +0 -42
  95. package/src/ui/SearchInput.tsx +0 -43
  96. package/src/ui/SessionDetailsPanel.tsx +0 -273
  97. package/src/ui/SessionList.tsx +0 -119
  98. package/src/ui/SettingEditorModal.tsx +0 -55
  99. package/src/ui/SettingOptionsModal.tsx +0 -95
  100. package/src/ui/SettingsModal.tsx +0 -102
  101. package/src/ui/Toast.tsx +0 -34
  102. package/src/ui/VersionBadge.tsx +0 -45
  103. package/src/ui/item-icon.ts +0 -110
  104. package/src/ui/list-window.ts +0 -35
  105. package/src/ui/session-meta.ts +0 -10
  106. package/src/ui/text-columns.ts +0 -17
  107. package/src/ui/use-textarea-focus.ts +0 -29
  108. package/src/update/events.ts +0 -28
  109. package/src/update/index.ts +0 -91
  110. package/src/update/installation.ts +0 -161
  111. package/src/update/version.ts +0 -33
  112. package/src/util/ansi.ts +0 -3
  113. package/src/util/browser.ts +0 -37
  114. package/src/util/clipboard.ts +0 -22
  115. package/src/util/errors.ts +0 -170
  116. package/src/util/github.ts +0 -100
  117. package/src/util/glob.ts +0 -51
  118. package/src/util/path-display.ts +0 -98
  119. package/src/util/perf.ts +0 -23
  120. package/src/util/shell.ts +0 -3
  121. package/src/util/shutdown.ts +0 -111
  122. package/src/util/terminal.ts +0 -28
  123. package/src/util/time.ts +0 -48
  124. package/tsconfig.json +0 -25
@@ -1,295 +0,0 @@
1
- import { existsSync, readFileSync } from 'node:fs'
2
- import { join } from 'path'
3
- import type { ThemeColors } from '../types'
4
-
5
- export const OMARCHY_STATE_DIR = ['.local', 'state', 'omarchy', 'current'] as const
6
-
7
- export type OmarchyMode = 'light' | 'dark'
8
-
9
- export interface OmarchyPalette {
10
- mode: OmarchyMode
11
- background: string
12
- foreground: string
13
- accent?: string
14
- selection?: string
15
- muted?: string
16
- dark_background?: string
17
- darker_background?: string
18
- lighter_background?: string
19
- dark_foreground?: string
20
- light_foreground?: string
21
- bright_foreground?: string
22
- red?: string
23
- yellow?: string
24
- orange?: string
25
- green?: string
26
- cyan?: string
27
- blue?: string
28
- magenta?: string
29
- brown?: string
30
- bright_red?: string
31
- bright_yellow?: string
32
- bright_green?: string
33
- bright_cyan?: string
34
- bright_blue?: string
35
- bright_magenta?: string
36
- }
37
-
38
- const COLOR_KEYS = [
39
- 'background',
40
- 'foreground',
41
- 'accent',
42
- 'selection',
43
- 'muted',
44
- 'dark_background',
45
- 'darker_background',
46
- 'lighter_background',
47
- 'dark_foreground',
48
- 'light_foreground',
49
- 'bright_foreground',
50
- 'red',
51
- 'yellow',
52
- 'orange',
53
- 'green',
54
- 'cyan',
55
- 'blue',
56
- 'magenta',
57
- 'brown',
58
- 'bright_red',
59
- 'bright_yellow',
60
- 'bright_green',
61
- 'bright_cyan',
62
- 'bright_blue',
63
- 'bright_magenta',
64
- ] as const
65
-
66
- type OmarchyColorKey = (typeof COLOR_KEYS)[number]
67
-
68
- const COLOR_KEY_SET = new Set<string>(COLOR_KEYS)
69
-
70
- function isOmarchyColorKey(key: string): key is OmarchyColorKey {
71
- return COLOR_KEY_SET.has(key)
72
- }
73
-
74
- function clamp(value: number): number {
75
- return Math.max(0, Math.min(255, Math.round(value)))
76
- }
77
-
78
- function normalizeHex(color: string): string {
79
- const normalized = color.startsWith('#') ? color.slice(1) : color
80
-
81
- if (normalized.length === 3 || normalized.length === 4) {
82
- return `#${normalized
83
- .split('')
84
- .map(char => `${char}${char}`)
85
- .join('')}`
86
- }
87
-
88
- return color.startsWith('#') ? color : `#${color}`
89
- }
90
-
91
- function hexToRgb(hex: string): { r: number; g: number; b: number } {
92
- const normalized = normalizeHex(hex).slice(1)
93
- const channel = (offset: number) => parseInt(normalized.slice(offset, offset + 2), 16)
94
-
95
- return {
96
- r: channel(0),
97
- g: channel(2),
98
- b: channel(4),
99
- }
100
- }
101
-
102
- function rgbToHex(r: number, g: number, b: number): string {
103
- return `#${[r, g, b].map(channel => clamp(channel).toString(16).padStart(2, '0')).join('')}`
104
- }
105
-
106
- function luminance(color: string): number {
107
- const { r, g, b } = hexToRgb(color)
108
- return 0.299 * r + 0.587 * g + 0.114 * b
109
- }
110
-
111
- function readableText(background: string): string {
112
- return luminance(background) > 150 ? '#171717' : '#f5f5f5'
113
- }
114
-
115
- function mix(colorA: string, colorB: string, ratio: number): string {
116
- const from = hexToRgb(colorA)
117
- const to = hexToRgb(colorB)
118
-
119
- return rgbToHex(
120
- from.r + (to.r - from.r) * ratio,
121
- from.g + (to.g - from.g) * ratio,
122
- from.b + (to.b - from.b) * ratio
123
- )
124
- }
125
-
126
- function parseHexColor(value: string): string | null {
127
- const unquoted = stripQuotes(value)
128
- const hex = unquoted.startsWith('#') ? unquoted.slice(1) : unquoted
129
-
130
- if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{4}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(hex)) {
131
- return null
132
- }
133
-
134
- return normalizeHex(`#${hex}`)
135
- }
136
-
137
- function stripQuotes(value: string): string {
138
- if (
139
- (value.startsWith('"') && value.endsWith('"') && value.length >= 2) ||
140
- (value.startsWith("'") && value.endsWith("'") && value.length >= 2)
141
- ) {
142
- return value.slice(1, -1)
143
- }
144
-
145
- return value
146
- }
147
-
148
- function parseMode(value: string): OmarchyMode | null {
149
- const normalized = stripQuotes(value).toLowerCase()
150
- return normalized === 'light' || normalized === 'dark' ? normalized : null
151
- }
152
-
153
- export function getOmarchyThemeNamePath(homeDir: string): string {
154
- return join(homeDir, ...OMARCHY_STATE_DIR, 'theme.name')
155
- }
156
-
157
- export function getOmarchyColorsPath(homeDir: string): string {
158
- return join(homeDir, ...OMARCHY_STATE_DIR, 'theme', 'colors.toml')
159
- }
160
-
161
- export function isOmarchyPresent(homeDir: string): boolean {
162
- return existsSync(getOmarchyColorsPath(homeDir))
163
- }
164
-
165
- export function parseOmarchyColorsToml(text: string): OmarchyPalette | null {
166
- const colors: Partial<Record<OmarchyColorKey, string>> = {}
167
- let mode: OmarchyMode | null = null
168
- let themeType: OmarchyMode | null = null
169
-
170
- for (const rawLine of text.split(/\r?\n/)) {
171
- const line = rawLine.trim()
172
- if (!line || line.startsWith('#')) {
173
- continue
174
- }
175
-
176
- const separator = line.indexOf('=')
177
- if (separator === -1) {
178
- continue
179
- }
180
-
181
- const key = line.slice(0, separator).trim().toLowerCase()
182
- const value = line.slice(separator + 1).trim()
183
-
184
- if (key === 'mode') {
185
- mode = parseMode(value) ?? mode
186
- continue
187
- }
188
-
189
- if (key === 'theme_type') {
190
- themeType = parseMode(value) ?? themeType
191
- continue
192
- }
193
-
194
- if (!isOmarchyColorKey(key)) {
195
- continue
196
- }
197
-
198
- const color = parseHexColor(value)
199
- if (!color) {
200
- if (key === 'background' || key === 'foreground') {
201
- return null
202
- }
203
- continue
204
- }
205
-
206
- colors[key] = color
207
- }
208
-
209
- const background = colors.background
210
- const foreground = colors.foreground
211
- if (!background || !foreground) {
212
- return null
213
- }
214
-
215
- const resolvedMode = mode ?? themeType ?? (luminance(background) > 150 ? 'light' : 'dark')
216
-
217
- return {
218
- mode: resolvedMode,
219
- background,
220
- foreground,
221
- accent: colors.accent,
222
- selection: colors.selection,
223
- muted: colors.muted,
224
- dark_background: colors.dark_background,
225
- darker_background: colors.darker_background,
226
- lighter_background: colors.lighter_background,
227
- dark_foreground: colors.dark_foreground,
228
- light_foreground: colors.light_foreground,
229
- bright_foreground: colors.bright_foreground,
230
- red: colors.red,
231
- yellow: colors.yellow,
232
- orange: colors.orange,
233
- green: colors.green,
234
- cyan: colors.cyan,
235
- blue: colors.blue,
236
- magenta: colors.magenta,
237
- brown: colors.brown,
238
- bright_red: colors.bright_red,
239
- bright_yellow: colors.bright_yellow,
240
- bright_green: colors.bright_green,
241
- bright_cyan: colors.bright_cyan,
242
- bright_blue: colors.bright_blue,
243
- bright_magenta: colors.bright_magenta,
244
- }
245
- }
246
-
247
- export function readOmarchyPalette(homeDir: string): OmarchyPalette | null {
248
- try {
249
- const colorsPath = getOmarchyColorsPath(homeDir)
250
- if (!existsSync(colorsPath)) {
251
- return null
252
- }
253
-
254
- return parseOmarchyColorsToml(readFileSync(colorsPath, 'utf8'))
255
- } catch {
256
- return null
257
- }
258
- }
259
-
260
- export function omarchyPaletteToThemeColors(palette: OmarchyPalette): ThemeColors {
261
- const background = palette.background
262
- const text = palette.foreground
263
- const muted = palette.muted ?? palette.dark_foreground ?? mix(text, background, 0.5)
264
- const chrome = palette.cyan ?? palette.blue ?? palette.accent ?? text
265
- const accent = palette.accent ?? palette.orange ?? chrome
266
- const danger = palette.red ?? palette.bright_red ?? text
267
- const selection = chrome
268
-
269
- return {
270
- background,
271
- surface: background,
272
- surfaceAlt: palette.lighter_background ?? mix(background, text, 0.08),
273
- surfaceModal: palette.dark_background ?? mix(background, text, 0.04),
274
- overlay: '#000000',
275
- border: muted,
276
- borderMuted: palette.dark_foreground ?? muted,
277
- text,
278
- textMuted: muted,
279
- textSubtle: muted,
280
- primary: chrome,
281
- secondary: palette.magenta ?? accent,
282
- accent,
283
- active: palette.green ?? palette.bright_green ?? text,
284
- inactive: muted,
285
- key: palette.yellow ?? palette.bright_yellow ?? palette.orange ?? text,
286
- action: accent,
287
- separator: muted,
288
- program: palette.green ?? palette.bright_green ?? text,
289
- fileTree: chrome,
290
- danger,
291
- dangerSurface: mix(background, danger, 0.2),
292
- selection,
293
- selectionText: readableText(selection),
294
- }
295
- }