mux-sesh 1.4.1 → 1.6.0

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 (45) hide show
  1. package/README.md +123 -7
  2. package/package.json +3 -3
  3. package/src/app.tsx +746 -173
  4. package/src/components/KeybindHelp.tsx +178 -111
  5. package/src/config/index.ts +413 -20
  6. package/src/config/listed-sessions.ts +36 -0
  7. package/src/config/session-rules.ts +101 -0
  8. package/src/handlers/actions.ts +93 -6
  9. package/src/handlers/keyboard.ts +299 -79
  10. package/src/items/order.ts +50 -0
  11. package/src/opencode/session.ts +1 -17
  12. package/src/opencode/stats.ts +1 -1
  13. package/src/preview/project.ts +235 -0
  14. package/src/projects/session-links.ts +31 -0
  15. package/src/search/index.ts +83 -47
  16. package/src/settings.ts +425 -0
  17. package/src/styles/opencode-themes-a.ts +1 -0
  18. package/src/styles/opencode-themes-b.ts +1 -0
  19. package/src/styles/theme.tsx +441 -0
  20. package/src/tmux/index.ts +58 -14
  21. package/src/tmux/projects.ts +151 -20
  22. package/src/tmux/workflows.ts +22 -0
  23. package/src/types/index.ts +114 -0
  24. package/src/ui/CommandsModal.tsx +145 -0
  25. package/src/ui/HighlightedText.tsx +6 -3
  26. package/src/ui/ItemList.tsx +47 -41
  27. package/src/ui/Modal.tsx +41 -0
  28. package/src/ui/OpencodeSessionGroup.tsx +50 -46
  29. package/src/ui/OpencodeStatsPanel.tsx +34 -39
  30. package/src/ui/RenameModal.tsx +42 -0
  31. package/src/ui/SearchInput.tsx +3 -1
  32. package/src/ui/SessionDetailsPanel.tsx +168 -72
  33. package/src/ui/SessionList.tsx +59 -34
  34. package/src/ui/SessionStats.tsx +5 -3
  35. package/src/ui/SettingEditorModal.tsx +49 -0
  36. package/src/ui/SettingOptionsModal.tsx +77 -0
  37. package/src/ui/SettingsModal.tsx +96 -0
  38. package/src/ui/Toast.tsx +8 -9
  39. package/src/ui/item-icon.ts +78 -0
  40. package/src/ui/list-window.ts +22 -0
  41. package/src/update/installation.ts +4 -15
  42. package/src/update/version.ts +2 -1
  43. package/src/util/glob.ts +47 -0
  44. package/src/util/terminal.ts +6 -20
  45. package/src/styles/theme.ts +0 -50
@@ -1,70 +1,95 @@
1
- import { colors } from '../styles/theme'
2
- import { AppMode, KeybindMode } from '../types'
1
+ import { useTheme } from '../styles/theme'
2
+ import { AppMode, KeybindMode, type Item } from '../types'
3
3
 
4
4
  interface Props {
5
5
  appMode: AppMode
6
6
  keybindMode?: KeybindMode
7
+ selectedItem?: Item
7
8
  }
8
9
 
9
- export default function KeybindHelp({ appMode, keybindMode = 'vim' }: Props) {
10
+ export default function KeybindHelp({ appMode, keybindMode = 'vim', selectedItem }: Props) {
11
+ const theme = useTheme()
10
12
  const isStandard = keybindMode === 'standard'
13
+ const showEditTarget = selectedItem?.itemKind === 'configured' && appMode === AppMode.Normal
14
+
11
15
  if (appMode === AppMode.Search || appMode === AppMode.NewSession || appMode === AppMode.Rename) {
12
16
  if (isStandard) {
13
- // Standard mode: show Ctrl+X prefix keybinds in vertical layout matching vim mode
14
17
  return (
15
18
  <>
16
19
  <text>
17
- <span style={{ fg: colors.key }}>↑/↓ </span>
18
- <span style={{ fg: colors.separator }}>│ </span>
19
- <span style={{ fg: colors.action }}>navigate</span>
20
+ <span style={{ fg: theme.key }}>↑/↓ </span>
21
+ <span style={{ fg: theme.separator }}>│ </span>
22
+ <span style={{ fg: theme.action }}>navigate</span>
23
+ </text>
24
+ <text>
25
+ <span style={{ fg: theme.key }}>Ctrl+X d </span>
26
+ <span style={{ fg: theme.separator }}>│ </span>
27
+ <span style={{ fg: theme.action }}>kill</span>
28
+ </text>
29
+ <text>
30
+ <span style={{ fg: theme.key }}>Ctrl+X r </span>
31
+ <span style={{ fg: theme.separator }}>│ </span>
32
+ <span style={{ fg: theme.action }}>rename</span>
33
+ </text>
34
+ <text>
35
+ <span style={{ fg: theme.key }}>Ctrl+X n </span>
36
+ <span style={{ fg: theme.separator }}>│ </span>
37
+ <span style={{ fg: theme.action }}>new</span>
20
38
  </text>
21
39
  <text>
22
- <span style={{ fg: colors.key }}>Ctrl+X d </span>
23
- <span style={{ fg: colors.separator }}>│ </span>
24
- <span style={{ fg: colors.action }}>kill</span>
40
+ <span style={{ fg: theme.key }}>Ctrl+X o </span>
41
+ <span style={{ fg: theme.separator }}>│ </span>
42
+ <span style={{ fg: theme.action }}>opencode</span>
25
43
  </text>
26
44
  <text>
27
- <span style={{ fg: colors.key }}>Ctrl+X r </span>
28
- <span style={{ fg: colors.separator }}>│ </span>
29
- <span style={{ fg: colors.action }}>rename</span>
45
+ <span style={{ fg: theme.key }}>Ctrl+X s </span>
46
+ <span style={{ fg: theme.separator }}>│ </span>
47
+ <span style={{ fg: theme.action }}>settings</span>
30
48
  </text>
31
49
  <text>
32
- <span style={{ fg: colors.key }}>Ctrl+X n </span>
33
- <span style={{ fg: colors.separator }}>│ </span>
34
- <span style={{ fg: colors.action }}>new</span>
50
+ <span style={{ fg: theme.key }}>Ctrl+X l </span>
51
+ <span style={{ fg: theme.separator }}>│ </span>
52
+ <span style={{ fg: theme.action }}>last</span>
35
53
  </text>
36
54
  <text>
37
- <span style={{ fg: colors.key }}>Ctrl+X o </span>
38
- <span style={{ fg: colors.separator }}>│ </span>
39
- <span style={{ fg: colors.action }}>opencode</span>
55
+ <span style={{ fg: theme.key }}>Ctrl+X g </span>
56
+ <span style={{ fg: theme.separator }}>│ </span>
57
+ <span style={{ fg: theme.action }}>root</span>
40
58
  </text>
59
+ {showEditTarget && (
60
+ <text>
61
+ <span style={{ fg: theme.key }}>Ctrl+E </span>
62
+ <span style={{ fg: theme.separator }}>│ </span>
63
+ <span style={{ fg: theme.action }}>edit</span>
64
+ </text>
65
+ )}
41
66
  <text>
42
- <span style={{ fg: colors.key }}>Ctrl+X R </span>
43
- <span style={{ fg: colors.separator }}>│ </span>
44
- <span style={{ fg: colors.action }}>refresh</span>
67
+ <span style={{ fg: theme.key }}>Ctrl+X R </span>
68
+ <span style={{ fg: theme.separator }}>│ </span>
69
+ <span style={{ fg: theme.action }}>refresh</span>
45
70
  </text>
46
71
  <text>
47
- <span style={{ fg: colors.key }}>Ctrl+Q </span>
48
- <span style={{ fg: colors.separator }}>│ </span>
49
- <span style={{ fg: colors.action }}>quit</span>
72
+ <span style={{ fg: theme.key }}>Ctrl+Q </span>
73
+ <span style={{ fg: theme.separator }}>│ </span>
74
+ <span style={{ fg: theme.action }}>quit</span>
50
75
  </text>
51
76
  </>
52
77
  )
53
78
  }
54
- // Vim mode: simple keybinds
79
+
55
80
  return (
56
81
  <text>
57
- <span style={{ fg: colors.key }}>Enter</span>
58
- <span style={{ fg: colors.separator }}> │ </span>
59
- <span style={{ fg: colors.action }}>select</span>
82
+ <span style={{ fg: theme.key }}>Enter</span>
83
+ <span style={{ fg: theme.separator }}> │ </span>
84
+ <span style={{ fg: theme.action }}>select</span>
60
85
  {' '}
61
- <span style={{ fg: colors.key }}>↑/↓</span>
62
- <span style={{ fg: colors.separator }}> │ </span>
63
- <span style={{ fg: colors.action }}>navigate</span>
86
+ <span style={{ fg: theme.key }}>↑/↓</span>
87
+ <span style={{ fg: theme.separator }}> │ </span>
88
+ <span style={{ fg: theme.action }}>navigate</span>
64
89
  {' '}
65
- <span style={{ fg: colors.key }}>Esc</span>
66
- <span style={{ fg: colors.separator }}> │ </span>
67
- <span style={{ fg: colors.action }}>cancel</span>
90
+ <span style={{ fg: theme.key }}>Esc</span>
91
+ <span style={{ fg: theme.separator }}> │ </span>
92
+ <span style={{ fg: theme.action }}>cancel</span>
68
93
  </text>
69
94
  )
70
95
  }
@@ -74,97 +99,117 @@ export default function KeybindHelp({ appMode, keybindMode = 'vim' }: Props) {
74
99
  return (
75
100
  <>
76
101
  <text>
77
- <span style={{ fg: colors.key }}>↑/↓ </span>
78
- <span style={{ fg: colors.separator }}>│ </span>
79
- <span style={{ fg: colors.action }}>navigate</span>
102
+ <span style={{ fg: theme.key }}>↑/↓ </span>
103
+ <span style={{ fg: theme.separator }}>│ </span>
104
+ <span style={{ fg: theme.action }}>navigate</span>
80
105
  </text>
81
106
  <text>
82
- <span style={{ fg: colors.key }}>Ctrl+D </span>
83
- <span style={{ fg: colors.separator }}>│ </span>
84
- <span style={{ fg: colors.action }}>kill</span>
107
+ <span style={{ fg: theme.key }}>Ctrl+D </span>
108
+ <span style={{ fg: theme.separator }}>│ </span>
109
+ <span style={{ fg: theme.action }}>kill</span>
85
110
  </text>
86
111
  <text>
87
- <span style={{ fg: colors.key }}>Ctrl+R </span>
88
- <span style={{ fg: colors.separator }}>│ </span>
89
- <span style={{ fg: colors.action }}>rename</span>
112
+ <span style={{ fg: theme.key }}>Ctrl+R </span>
113
+ <span style={{ fg: theme.separator }}>│ </span>
114
+ <span style={{ fg: theme.action }}>rename</span>
90
115
  </text>
91
116
  <text>
92
- <span style={{ fg: colors.key }}>Ctrl+O </span>
93
- <span style={{ fg: colors.separator }}>│ </span>
94
- <span style={{ fg: colors.action }}>back</span>
117
+ <span style={{ fg: theme.key }}>Ctrl+O </span>
118
+ <span style={{ fg: theme.separator }}>│ </span>
119
+ <span style={{ fg: theme.action }}>back</span>
95
120
  </text>
96
121
  </>
97
122
  )
98
123
  }
124
+
99
125
  return (
100
126
  <>
101
127
  <text>
102
- <span style={{ fg: colors.key }}>j/k </span>
103
- <span style={{ fg: colors.separator }}>│ </span>
104
- <span style={{ fg: colors.action }}>navigate</span>
128
+ <span style={{ fg: theme.key }}>j/k </span>
129
+ <span style={{ fg: theme.separator }}>│ </span>
130
+ <span style={{ fg: theme.action }}>navigate</span>
131
+ </text>
132
+ <text>
133
+ <span style={{ fg: theme.key }}>d </span>
134
+ <span style={{ fg: theme.separator }}>│ </span>
135
+ <span style={{ fg: theme.action }}>kill</span>
105
136
  </text>
106
137
  <text>
107
- <span style={{ fg: colors.key }}>d </span>
108
- <span style={{ fg: colors.separator }}>│ </span>
109
- <span style={{ fg: colors.action }}>kill</span>
138
+ <span style={{ fg: theme.key }}>r </span>
139
+ <span style={{ fg: theme.separator }}>│ </span>
140
+ <span style={{ fg: theme.action }}>rename</span>
110
141
  </text>
111
142
  <text>
112
- <span style={{ fg: colors.key }}>r </span>
113
- <span style={{ fg: colors.separator }}>│ </span>
114
- <span style={{ fg: colors.action }}>rename</span>
143
+ <span style={{ fg: theme.key }}>o/Esc </span>
144
+ <span style={{ fg: theme.separator }}>│ </span>
145
+ <span style={{ fg: theme.action }}>back</span>
115
146
  </text>
116
147
  <text>
117
- <span style={{ fg: colors.key }}>o/Esc </span>
118
- <span style={{ fg: colors.separator }}>│ </span>
119
- <span style={{ fg: colors.action }}>back</span>
148
+ <span style={{ fg: theme.key }}>, </span>
149
+ <span style={{ fg: theme.separator }}>│ </span>
150
+ <span style={{ fg: theme.action }}>settings</span>
120
151
  </text>
121
152
  </>
122
153
  )
123
154
  }
124
155
 
125
- // Single column layout - all keys in left column, all actions in right column
126
156
  if (isStandard) {
127
157
  return (
128
158
  <>
129
159
  <text>
130
- <span style={{ fg: colors.key }}>↑/↓ </span>
131
- <span style={{ fg: colors.separator }}>│ </span>
132
- <span style={{ fg: colors.action }}>navigate</span>
160
+ <span style={{ fg: theme.key }}>↑/↓ </span>
161
+ <span style={{ fg: theme.separator }}>│ </span>
162
+ <span style={{ fg: theme.action }}>navigate</span>
163
+ </text>
164
+ <text>
165
+ <span style={{ fg: theme.key }}>Ctrl+X d </span>
166
+ <span style={{ fg: theme.separator }}>│ </span>
167
+ <span style={{ fg: theme.action }}>kill</span>
133
168
  </text>
134
169
  <text>
135
- <span style={{ fg: colors.key }}>Ctrl+X d </span>
136
- <span style={{ fg: colors.separator }}>│ </span>
137
- <span style={{ fg: colors.action }}>kill</span>
170
+ <span style={{ fg: theme.key }}>Ctrl+X r </span>
171
+ <span style={{ fg: theme.separator }}>│ </span>
172
+ <span style={{ fg: theme.action }}>rename</span>
138
173
  </text>
139
174
  <text>
140
- <span style={{ fg: colors.key }}>Ctrl+X r </span>
141
- <span style={{ fg: colors.separator }}>│ </span>
142
- <span style={{ fg: colors.action }}>rename</span>
175
+ <span style={{ fg: theme.key }}>Ctrl+X n </span>
176
+ <span style={{ fg: theme.separator }}>│ </span>
177
+ <span style={{ fg: theme.action }}>new</span>
143
178
  </text>
144
179
  <text>
145
- <span style={{ fg: colors.key }}>Ctrl+X n </span>
146
- <span style={{ fg: colors.separator }}>│ </span>
147
- <span style={{ fg: colors.action }}>new</span>
180
+ <span style={{ fg: theme.key }}>Ctrl+I </span>
181
+ <span style={{ fg: theme.separator }}>│ </span>
182
+ <span style={{ fg: theme.action }}>search</span>
148
183
  </text>
149
184
  <text>
150
- <span style={{ fg: colors.key }}>Ctrl+I </span>
151
- <span style={{ fg: colors.separator }}>│ </span>
152
- <span style={{ fg: colors.action }}>search</span>
185
+ <span style={{ fg: theme.key }}>Ctrl+X o </span>
186
+ <span style={{ fg: theme.separator }}>│ </span>
187
+ <span style={{ fg: theme.action }}>opencode</span>
153
188
  </text>
154
189
  <text>
155
- <span style={{ fg: colors.key }}>Ctrl+X o </span>
156
- <span style={{ fg: colors.separator }}>│ </span>
157
- <span style={{ fg: colors.action }}>opencode</span>
190
+ <span style={{ fg: theme.key }}>Ctrl+X s </span>
191
+ <span style={{ fg: theme.separator }}>│ </span>
192
+ <span style={{ fg: theme.action }}>settings</span>
158
193
  </text>
159
194
  <text>
160
- <span style={{ fg: colors.key }}>Ctrl+X R </span>
161
- <span style={{ fg: colors.separator }}>│ </span>
162
- <span style={{ fg: colors.action }}>refresh</span>
195
+ <span style={{ fg: theme.key }}>Ctrl+L </span>
196
+ <span style={{ fg: theme.separator }}>│ </span>
197
+ <span style={{ fg: theme.action }}>last</span>
163
198
  </text>
164
199
  <text>
165
- <span style={{ fg: colors.key }}>Ctrl+Q </span>
166
- <span style={{ fg: colors.separator }}>│ </span>
167
- <span style={{ fg: colors.action }}>quit</span>
200
+ <span style={{ fg: theme.key }}>Ctrl+G </span>
201
+ <span style={{ fg: theme.separator }}>│ </span>
202
+ <span style={{ fg: theme.action }}>root</span>
203
+ </text>
204
+ <text>
205
+ <span style={{ fg: theme.key }}>Ctrl+X R </span>
206
+ <span style={{ fg: theme.separator }}>│ </span>
207
+ <span style={{ fg: theme.action }}>refresh</span>
208
+ </text>
209
+ <text>
210
+ <span style={{ fg: theme.key }}>Ctrl+Q </span>
211
+ <span style={{ fg: theme.separator }}>│ </span>
212
+ <span style={{ fg: theme.action }}>quit</span>
168
213
  </text>
169
214
  </>
170
215
  )
@@ -173,49 +218,71 @@ export default function KeybindHelp({ appMode, keybindMode = 'vim' }: Props) {
173
218
  return (
174
219
  <>
175
220
  <text>
176
- <span style={{ fg: colors.key }}>j/k </span>
177
- <span style={{ fg: colors.separator }}>│ </span>
178
- <span style={{ fg: colors.action }}>navigate</span>
221
+ <span style={{ fg: theme.key }}>j/k </span>
222
+ <span style={{ fg: theme.separator }}>│ </span>
223
+ <span style={{ fg: theme.action }}>navigate</span>
224
+ </text>
225
+ <text>
226
+ <span style={{ fg: theme.key }}>1-9 </span>
227
+ <span style={{ fg: theme.separator }}>│ </span>
228
+ <span style={{ fg: theme.action }}>switch</span>
179
229
  </text>
180
230
  <text>
181
- <span style={{ fg: colors.key }}>1-9 </span>
182
- <span style={{ fg: colors.separator }}>│ </span>
183
- <span style={{ fg: colors.action }}>switch</span>
231
+ <span style={{ fg: theme.key }}>d </span>
232
+ <span style={{ fg: theme.separator }}>│ </span>
233
+ <span style={{ fg: theme.action }}>kill</span>
184
234
  </text>
185
235
  <text>
186
- <span style={{ fg: colors.key }}>d </span>
187
- <span style={{ fg: colors.separator }}>│ </span>
188
- <span style={{ fg: colors.action }}>kill</span>
236
+ <span style={{ fg: theme.key }}>r </span>
237
+ <span style={{ fg: theme.separator }}>│ </span>
238
+ <span style={{ fg: theme.action }}>rename</span>
189
239
  </text>
190
240
  <text>
191
- <span style={{ fg: colors.key }}>r </span>
192
- <span style={{ fg: colors.separator }}>│ </span>
193
- <span style={{ fg: colors.action }}>rename</span>
241
+ <span style={{ fg: theme.key }}>n </span>
242
+ <span style={{ fg: theme.separator }}>│ </span>
243
+ <span style={{ fg: theme.action }}>new</span>
194
244
  </text>
195
245
  <text>
196
- <span style={{ fg: colors.key }}>n </span>
197
- <span style={{ fg: colors.separator }}>│ </span>
198
- <span style={{ fg: colors.action }}>new</span>
246
+ <span style={{ fg: theme.key }}>i </span>
247
+ <span style={{ fg: theme.separator }}>│ </span>
248
+ <span style={{ fg: theme.action }}>search</span>
199
249
  </text>
200
250
  <text>
201
- <span style={{ fg: colors.key }}>i </span>
202
- <span style={{ fg: colors.separator }}>│ </span>
203
- <span style={{ fg: colors.action }}>search</span>
251
+ <span style={{ fg: theme.key }}>o </span>
252
+ <span style={{ fg: theme.separator }}>│ </span>
253
+ <span style={{ fg: theme.action }}>opencode</span>
204
254
  </text>
205
255
  <text>
206
- <span style={{ fg: colors.key }}>o </span>
207
- <span style={{ fg: colors.separator }}>│ </span>
208
- <span style={{ fg: colors.action }}>opencode</span>
256
+ <span style={{ fg: theme.key }}>, </span>
257
+ <span style={{ fg: theme.separator }}>│ </span>
258
+ <span style={{ fg: theme.action }}>settings</span>
209
259
  </text>
210
260
  <text>
211
- <span style={{ fg: colors.key }}>R </span>
212
- <span style={{ fg: colors.separator }}>│ </span>
213
- <span style={{ fg: colors.action }}>refresh</span>
261
+ <span style={{ fg: theme.key }}>l </span>
262
+ <span style={{ fg: theme.separator }}>│ </span>
263
+ <span style={{ fg: theme.action }}>last</span>
264
+ </text>
265
+ <text>
266
+ <span style={{ fg: theme.key }}>g </span>
267
+ <span style={{ fg: theme.separator }}>│ </span>
268
+ <span style={{ fg: theme.action }}>root</span>
269
+ </text>
270
+ {showEditTarget && (
271
+ <text>
272
+ <span style={{ fg: theme.key }}>e </span>
273
+ <span style={{ fg: theme.separator }}>│ </span>
274
+ <span style={{ fg: theme.action }}>edit</span>
275
+ </text>
276
+ )}
277
+ <text>
278
+ <span style={{ fg: theme.key }}>R </span>
279
+ <span style={{ fg: theme.separator }}>│ </span>
280
+ <span style={{ fg: theme.action }}>refresh</span>
214
281
  </text>
215
282
  <text>
216
- <span style={{ fg: colors.key }}>q </span>
217
- <span style={{ fg: colors.separator }}>│ </span>
218
- <span style={{ fg: colors.action }}>quit</span>
283
+ <span style={{ fg: theme.key }}>q </span>
284
+ <span style={{ fg: theme.separator }}>│ </span>
285
+ <span style={{ fg: theme.action }}>quit</span>
219
286
  </text>
220
287
  </>
221
288
  )