mux-sesh 1.6.3 → 1.7.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 (82) hide show
  1. package/README.md +90 -59
  2. package/package.json +7 -5
  3. package/src/app/commands.ts +120 -0
  4. package/src/app/controller.ts +397 -0
  5. package/src/app/controls.ts +121 -0
  6. package/src/app/core-state.ts +71 -0
  7. package/src/app/data.ts +90 -0
  8. package/src/app/derived.ts +77 -0
  9. package/src/app/effects.ts +392 -0
  10. package/src/app/handlers.ts +325 -0
  11. package/src/app/keyboard.ts +161 -0
  12. package/src/app/modal-keyboard.ts +118 -0
  13. package/src/app/modal-state.ts +50 -0
  14. package/src/app/modals-layer.tsx +159 -0
  15. package/src/app/modals.ts +108 -0
  16. package/src/app/notifications.ts +21 -0
  17. package/src/app/opencode.ts +49 -0
  18. package/src/app/operations.ts +31 -0
  19. package/src/app/runtime.ts +76 -0
  20. package/src/app/screen.tsx +217 -0
  21. package/src/app/state.ts +166 -0
  22. package/src/app/textarea.ts +16 -0
  23. package/src/app/view.ts +89 -0
  24. package/src/app.tsx +7 -1101
  25. package/src/config/index.ts +36 -42
  26. package/src/config/listed-sessions.ts +2 -5
  27. package/src/config/paths.ts +13 -0
  28. package/src/config/session-rules.ts +10 -11
  29. package/src/config/store.ts +26 -0
  30. package/src/handlers/action-helpers.ts +50 -0
  31. package/src/handlers/actions.ts +34 -65
  32. package/src/handlers/keyboard/index.ts +5 -0
  33. package/src/handlers/keyboard/new-session.ts +57 -0
  34. package/src/handlers/keyboard/normal.ts +201 -0
  35. package/src/handlers/keyboard/opencode.ts +104 -0
  36. package/src/handlers/keyboard/search.ts +113 -0
  37. package/src/handlers/keyboard/shared.ts +116 -0
  38. package/src/items/order.ts +21 -2
  39. package/src/opencode/sqlite.ts +21 -6
  40. package/src/preview/project.ts +41 -15
  41. package/src/search/index.ts +4 -1
  42. package/src/settings.ts +294 -297
  43. package/src/styles/opencode-themes-a.ts +1442 -1
  44. package/src/styles/opencode-themes-b.ts +1212 -1
  45. package/src/styles/opencode-tui-colors.ts +1784 -1
  46. package/src/styles/theme.tsx +2 -1
  47. package/src/tmux/actions.ts +103 -0
  48. package/src/tmux/details.ts +123 -0
  49. package/src/tmux/helpers.ts +35 -0
  50. package/src/tmux/index.ts +10 -286
  51. package/src/tmux/list.ts +31 -0
  52. package/src/tmux/project-discovery.ts +113 -0
  53. package/src/tmux/project-loader.ts +74 -0
  54. package/src/tmux/project-zoxide.ts +128 -0
  55. package/src/tmux/projects.ts +23 -261
  56. package/src/types/index.ts +0 -1
  57. package/src/ui/CommandsModal.tsx +87 -22
  58. package/src/ui/HighlightedText.tsx +1 -5
  59. package/src/ui/ItemList.tsx +26 -11
  60. package/src/ui/Modal.tsx +8 -1
  61. package/src/ui/OpencodeSessionGroup.tsx +20 -9
  62. package/src/ui/OpencodeStatsPanel.tsx +48 -15
  63. package/src/ui/RenameModal.tsx +17 -17
  64. package/src/ui/SearchInput.tsx +1 -20
  65. package/src/ui/SessionDetailsPanel.tsx +43 -15
  66. package/src/ui/SessionList.tsx +25 -4
  67. package/src/ui/SettingEditorModal.tsx +15 -9
  68. package/src/ui/SettingOptionsModal.tsx +30 -12
  69. package/src/ui/SettingsModal.tsx +20 -14
  70. package/src/ui/VersionBadge.tsx +3 -1
  71. package/src/ui/item-icon.ts +5 -1
  72. package/src/ui/list-window.ts +5 -1
  73. package/src/ui/text-columns.ts +17 -0
  74. package/src/ui/use-textarea-focus.ts +26 -0
  75. package/src/update/index.ts +10 -2
  76. package/src/update/installation.ts +6 -2
  77. package/src/util/ansi.ts +3 -0
  78. package/src/util/glob.ts +5 -1
  79. package/src/util/path-display.ts +98 -0
  80. package/src/components/KeybindHelp.tsx +0 -289
  81. package/src/handlers/keyboard.ts +0 -654
  82. package/src/ui/SessionStats.tsx +0 -32
@@ -1,289 +0,0 @@
1
- import { useTheme } from '../styles/theme'
2
- import { AppMode, KeybindMode, type Item } from '../types'
3
-
4
- interface Props {
5
- appMode: AppMode
6
- keybindMode?: KeybindMode
7
- selectedItem?: Item
8
- }
9
-
10
- export default function KeybindHelp({ appMode, keybindMode = 'vim', selectedItem }: Props) {
11
- const theme = useTheme()
12
- const isStandard = keybindMode === 'standard'
13
- const showEditTarget = selectedItem?.itemKind === 'configured' && appMode === AppMode.Normal
14
-
15
- if (appMode === AppMode.Search || appMode === AppMode.NewSession || appMode === AppMode.Rename) {
16
- if (isStandard) {
17
- return (
18
- <>
19
- <text>
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>
38
- </text>
39
- <text>
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>
43
- </text>
44
- <text>
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>
48
- </text>
49
- <text>
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>
53
- </text>
54
- <text>
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>
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
- )}
66
- <text>
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>
70
- </text>
71
- <text>
72
- <span style={{ fg: theme.key }}>Ctrl+Q </span>
73
- <span style={{ fg: theme.separator }}>│ </span>
74
- <span style={{ fg: theme.action }}>quit</span>
75
- </text>
76
- </>
77
- )
78
- }
79
-
80
- return (
81
- <text>
82
- <span style={{ fg: theme.key }}>Enter</span>
83
- <span style={{ fg: theme.separator }}> │ </span>
84
- <span style={{ fg: theme.action }}>select</span>
85
- {' '}
86
- <span style={{ fg: theme.key }}>↑/↓</span>
87
- <span style={{ fg: theme.separator }}> │ </span>
88
- <span style={{ fg: theme.action }}>navigate</span>
89
- {' '}
90
- <span style={{ fg: theme.key }}>Esc</span>
91
- <span style={{ fg: theme.separator }}> │ </span>
92
- <span style={{ fg: theme.action }}>cancel</span>
93
- </text>
94
- )
95
- }
96
-
97
- if (appMode === AppMode.OpencodeManage) {
98
- if (isStandard) {
99
- return (
100
- <>
101
- <text>
102
- <span style={{ fg: theme.key }}>↑/↓ </span>
103
- <span style={{ fg: theme.separator }}>│ </span>
104
- <span style={{ fg: theme.action }}>navigate</span>
105
- </text>
106
- <text>
107
- <span style={{ fg: theme.key }}>Ctrl+D </span>
108
- <span style={{ fg: theme.separator }}>│ </span>
109
- <span style={{ fg: theme.action }}>kill</span>
110
- </text>
111
- <text>
112
- <span style={{ fg: theme.key }}>Ctrl+R </span>
113
- <span style={{ fg: theme.separator }}>│ </span>
114
- <span style={{ fg: theme.action }}>rename</span>
115
- </text>
116
- <text>
117
- <span style={{ fg: theme.key }}>Ctrl+O </span>
118
- <span style={{ fg: theme.separator }}>│ </span>
119
- <span style={{ fg: theme.action }}>back</span>
120
- </text>
121
- </>
122
- )
123
- }
124
-
125
- return (
126
- <>
127
- <text>
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>
136
- </text>
137
- <text>
138
- <span style={{ fg: theme.key }}>r </span>
139
- <span style={{ fg: theme.separator }}>│ </span>
140
- <span style={{ fg: theme.action }}>rename</span>
141
- </text>
142
- <text>
143
- <span style={{ fg: theme.key }}>o/Esc </span>
144
- <span style={{ fg: theme.separator }}>│ </span>
145
- <span style={{ fg: theme.action }}>back</span>
146
- </text>
147
- <text>
148
- <span style={{ fg: theme.key }}>, </span>
149
- <span style={{ fg: theme.separator }}>│ </span>
150
- <span style={{ fg: theme.action }}>settings</span>
151
- </text>
152
- </>
153
- )
154
- }
155
-
156
- if (isStandard) {
157
- return (
158
- <>
159
- <text>
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>
168
- </text>
169
- <text>
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>
173
- </text>
174
- <text>
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>
178
- </text>
179
- <text>
180
- <span style={{ fg: theme.key }}>Ctrl+I </span>
181
- <span style={{ fg: theme.separator }}>│ </span>
182
- <span style={{ fg: theme.action }}>search</span>
183
- </text>
184
- <text>
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>
188
- </text>
189
- <text>
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>
193
- </text>
194
- <text>
195
- <span style={{ fg: theme.key }}>Ctrl+L </span>
196
- <span style={{ fg: theme.separator }}>│ </span>
197
- <span style={{ fg: theme.action }}>last</span>
198
- </text>
199
- <text>
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>
213
- </text>
214
- </>
215
- )
216
- }
217
-
218
- return (
219
- <>
220
- <text>
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>
229
- </text>
230
- <text>
231
- <span style={{ fg: theme.key }}>d </span>
232
- <span style={{ fg: theme.separator }}>│ </span>
233
- <span style={{ fg: theme.action }}>kill</span>
234
- </text>
235
- <text>
236
- <span style={{ fg: theme.key }}>r </span>
237
- <span style={{ fg: theme.separator }}>│ </span>
238
- <span style={{ fg: theme.action }}>rename</span>
239
- </text>
240
- <text>
241
- <span style={{ fg: theme.key }}>n </span>
242
- <span style={{ fg: theme.separator }}>│ </span>
243
- <span style={{ fg: theme.action }}>new</span>
244
- </text>
245
- <text>
246
- <span style={{ fg: theme.key }}>i </span>
247
- <span style={{ fg: theme.separator }}>│ </span>
248
- <span style={{ fg: theme.action }}>search</span>
249
- </text>
250
- <text>
251
- <span style={{ fg: theme.key }}>o </span>
252
- <span style={{ fg: theme.separator }}>│ </span>
253
- <span style={{ fg: theme.action }}>opencode</span>
254
- </text>
255
- <text>
256
- <span style={{ fg: theme.key }}>, </span>
257
- <span style={{ fg: theme.separator }}>│ </span>
258
- <span style={{ fg: theme.action }}>settings</span>
259
- </text>
260
- <text>
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>
281
- </text>
282
- <text>
283
- <span style={{ fg: theme.key }}>q </span>
284
- <span style={{ fg: theme.separator }}>│ </span>
285
- <span style={{ fg: theme.action }}>quit</span>
286
- </text>
287
- </>
288
- )
289
- }