Commit 5cc0ba8
authored
🤖 refactor: unify editor APIs and fix plan file SSH support (#1043)
## Summary
Consolidates the editor-opening APIs into a single unified interface and
fixes plan file handling for SSH workspaces.
## Changes
### Editor API Consolidation
- Merged `openWorkspaceInEditor` + `openFileInEditor` → single
`openInEditor(workspaceId, targetPath, editorConfig)`
- Removed old non-runtime-aware `openInEditor` and `canOpenInEditor`
APIs (~140 lines)
- Hook now takes explicit `targetPath` parameter (no implicit workspace
root fallback)
### Plan File SSH Support
- Plan files now use workspace runtime instead of always using local
filesystem
- Removed `localRuntime` special-casing from file tools (~50 lines
across 3 files)
- Simplified `planStorage.ts` to just return
`~/.mux/plans/{workspaceId}.md`
### Files Changed
- **EditorService**: Single `openInEditor()` method
- **API Schema**: Single `openInEditor` endpoint with required
`targetPath`
- **Router**: Removed old editor discovery/fallback code
- **useOpenInEditor**: Simplified to `(workspaceId, targetPath,
runtimeConfig?)`
- **File tools**: Removed localRuntime parameter and special-casing
- **Callers**: WorkspaceHeader, ProposePlanToolCall, chatCommands
updated
## Testing
- All 1607 unit tests pass
- TypeCheck passes
- Static check passes
---
_Generated with `mux`_1 parent a033b83 commit 5cc0ba8
File tree
24 files changed
+358
-562
lines changed- src
- browser
- components
- Settings/sections
- tools
- hooks
- utils
- common
- orpc/schemas
- utils
- tools
- ui
- node
- orpc
- runtime
- services
- tools
- tests/ipc
24 files changed
+358
-562
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | | - | |
| 30 | + | |
27 | 31 | | |
28 | | - | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
53 | | - | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
108 | 118 | | |
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
112 | 122 | | |
113 | 123 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
190 | | - | |
| 191 | + | |
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
194 | | - | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| |||
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
215 | | - | |
216 | | - | |
| 216 | + | |
| 217 | + | |
217 | 218 | | |
218 | 219 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
223 | 226 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | 227 | | |
247 | 228 | | |
248 | 229 | | |
| |||
262 | 243 | | |
263 | 244 | | |
264 | 245 | | |
265 | | - | |
266 | | - | |
| 246 | + | |
| 247 | + | |
267 | 248 | | |
268 | 249 | | |
269 | 250 | | |
270 | | - | |
| 251 | + | |
271 | 252 | | |
272 | 253 | | |
273 | 254 | | |
| |||
357 | 338 | | |
358 | 339 | | |
359 | 340 | | |
360 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
361 | 347 | | |
362 | 348 | | |
363 | 349 | | |
364 | 350 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
371 | 358 | | |
372 | | - | |
| 359 | + | |
373 | 360 | | |
374 | | - | |
375 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
376 | 365 | | |
377 | 366 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
| |||
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
47 | | - | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
51 | 60 | | |
52 | 61 | | |
53 | 62 | | |
| |||
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
61 | | - | |
| 70 | + | |
62 | 71 | | |
| 72 | + | |
63 | 73 | | |
64 | 74 | | |
65 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
259 | | - | |
| 257 | + | |
260 | 258 | | |
261 | 259 | | |
262 | 260 | | |
| |||
271 | 269 | | |
272 | 270 | | |
273 | 271 | | |
274 | | - | |
275 | | - | |
276 | | - | |
| 272 | + | |
277 | 273 | | |
278 | 274 | | |
279 | 275 | | |
| |||
309 | 305 | | |
310 | 306 | | |
311 | 307 | | |
312 | | - | |
| 308 | + | |
313 | 309 | | |
314 | 310 | | |
315 | 311 | | |
| |||
320 | 316 | | |
321 | 317 | | |
322 | 318 | | |
323 | | - | |
324 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
325 | 323 | | |
326 | 324 | | |
327 | 325 | | |
| |||
0 commit comments