opencode-navigator 0.14.0 → 0.15.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.
- package/README.md +12 -4
- package/dist/tui.js +493 -600
- package/package.json +12 -10
package/dist/tui.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import {insert as _$insert50} from "@opentui/solid"
|
|
2
|
+
import {setProp as _$setProp53} from "@opentui/solid"
|
|
3
|
+
import {createElement as _$createElement61} from "@opentui/solid"
|
|
3
4
|
import {createComponent as _$createComponent61} from "@opentui/solid"
|
|
4
|
-
|
|
5
5
|
import {createSignal as createSignal2} from "solid-js"
|
|
6
|
-
|
|
7
6
|
var SIDEBAR_SECTIONS=["todo","subagents","skills","quick_actions","lsp","mcp"]
|
|
8
7
|
var QUICK_ACTION_IDS=["session.rename","session.timeline","session.copy","session.export","session.compact","session.list","session.new","session.fork","messages.copy","session.first","session.last","session.messages_last_user","session.message.next","session.message.previous","permission.mode"
|
|
9
8
|
]
|
|
@@ -21,7 +20,7 @@ return [...order,...QUICK_ACTION_IDS.filter((id)=>!order.includes(id))]
|
|
|
21
20
|
function parseQuickActionVisibility(value) {if (!value||typeof value!=="object"||Array.isArray(value))
|
|
22
21
|
return{}
|
|
23
22
|
const input=value
|
|
24
|
-
return Object.fromEntries(QUICK_ACTION_IDS.flatMap((id)=>typeof input[id]==="boolean"
|
|
23
|
+
return Object.fromEntries(QUICK_ACTION_IDS.flatMap((id)=>typeof input[id]==="boolean"?[[id,input[id]]]:[]))
|
|
25
24
|
}
|
|
26
25
|
function parseSectionOrder(value) {if (!Array.isArray(value))
|
|
27
26
|
return
|
|
@@ -40,7 +39,7 @@ return order
|
|
|
40
39
|
function parseSectionPreferences(value) {if (!value||typeof value!=="object"||Array.isArray(value))
|
|
41
40
|
return{}
|
|
42
41
|
const input=value
|
|
43
|
-
return Object.fromEntries(SIDEBAR_SECTIONS.flatMap((name)=>typeof input[name]==="boolean"
|
|
42
|
+
return Object.fromEntries(SIDEBAR_SECTIONS.flatMap((name)=>typeof input[name]==="boolean"?[[name,input[name]]]:[]))
|
|
44
43
|
}
|
|
45
44
|
function parseSectionLayout(value) {if (!value||typeof value!=="object"||Array.isArray(value))
|
|
46
45
|
return
|
|
@@ -56,43 +55,39 @@ function parseSectionItemLimits(value) {if (!value||typeof value!=="object"||Arr
|
|
|
56
55
|
return{}
|
|
57
56
|
const input=value
|
|
58
57
|
return Object.fromEntries(SIDEBAR_SECTIONS.flatMap((section)=>{const limit=input[section]
|
|
59
|
-
return typeof limit==="number"&&Number.isSafeInteger(limit)&&limit
|
|
58
|
+
return typeof limit==="number"&&Number.isSafeInteger(limit)&&limit>=0?[[section,limit]]:[]
|
|
60
59
|
}))
|
|
61
60
|
}
|
|
62
61
|
function resolveSectionVisibility(defaults,value) {if (!value||typeof value!=="object"||Array.isArray(value))
|
|
63
62
|
return defaults
|
|
64
63
|
const input=value
|
|
65
|
-
return Object.fromEntries(Object.entries(defaults).map(([name,visible])=>[name,typeof input[name]==="boolean"
|
|
64
|
+
return Object.fromEntries(Object.entries(defaults).map(([name,visible])=>[name,typeof input[name]==="boolean"?input[name]:visible]))
|
|
66
65
|
}
|
|
67
66
|
function parseSectionVisibility(value) {return resolveSectionVisibility({todo:true,subagents:true,skills:true,quick_actions:true,lsp:true,mcp:true
|
|
68
67
|
},value)
|
|
69
68
|
}
|
|
70
|
-
|
|
71
69
|
var PLUGIN_ID="opencode-navigator"
|
|
72
70
|
var LEGACY_PLUGIN_ID="opencode-pretty-sidebar"
|
|
73
71
|
var TOGGLE_COMMAND=`${PLUGIN_ID}.toggle`
|
|
74
72
|
var FOCUS_COMMAND=`${PLUGIN_ID}.focus`
|
|
75
73
|
var SEARCH_COMMAND=`${PLUGIN_ID}.search`
|
|
76
74
|
var DEFAULT_SEARCH_KEY="ctrl+shift+k";
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return{toggleKey:typeof options?.toggle_key==="string"&&options.toggle_key.trim() ? options.toggle_key.trim():"ctrl+shift+b",focusKey:typeof options?.focus_key==="string"&&options.focus_key.trim() ? options.focus_key.trim():"ctrl+shift+f",searchKey:typeof options?.search_key==="string"&&options.search_key.trim() ? options.search_key.trim():DEFAULT_SEARCH_KEY,persistMcp:options?.persist_mcp!==false,cornerFont:options?.corner_font!==false,sections:parseSectionVisibility(options?.sections),sectionOrder:parseSectionOrder(options?.section_order)??[...SIDEBAR_SECTIONS],lspIconStyle:iconStyle==="text" ? "text":"nerd",rowDensity:options?.row_density==="comfortable" ? "comfortable":"compact",sectionItemLimits:parseSectionItemLimits(options?.section_item_limits),quickActionOrder:parseQuickActionOrder(options?.quick_action_order)??[...QUICK_ACTION_IDS],quickActionVisibility:parseQuickActionVisibility(options?.quick_action_visibility)
|
|
75
|
+
function pluginConfig(options) {const iconStyle=options?.icon_style==="nerd"||options?.icon_style==="text"?options.icon_style:options?.lsp_icon_style
|
|
76
|
+
return{toggleKey:typeof options?.toggle_key==="string"&&options.toggle_key.trim()?options.toggle_key.trim():"ctrl+shift+b",focusKey:typeof options?.focus_key==="string"&&options.focus_key.trim()?options.focus_key.trim():"ctrl+shift+f",searchKey:typeof options?.search_key==="string"&&options.search_key.trim()?options.search_key.trim():DEFAULT_SEARCH_KEY,persistMcp:options?.persist_mcp!==false,cornerFont:options?.corner_font!==false,sections:parseSectionVisibility(options?.sections),sectionOrder:parseSectionOrder(options?.section_order)??[...SIDEBAR_SECTIONS],lspIconStyle:iconStyle==="text"?"text":"nerd",rowDensity:options?.row_density==="comfortable"?"comfortable":"compact",sectionItemLimits:parseSectionItemLimits(options?.section_item_limits),quickActionOrder:parseQuickActionOrder(options?.quick_action_order)??[...QUICK_ACTION_IDS],quickActionVisibility:parseQuickActionVisibility(options?.quick_action_visibility)
|
|
80
77
|
}
|
|
81
78
|
}
|
|
82
|
-
|
|
83
79
|
function currentLocation(api) {const route=api.route.current
|
|
84
|
-
const params="params" in route
|
|
85
|
-
const sessionID=typeof params?.sessionID==="string"
|
|
86
|
-
const session=sessionID
|
|
80
|
+
const params="params" in route?route.params:undefined
|
|
81
|
+
const sessionID=typeof params?.sessionID==="string"?params.sessionID:undefined
|
|
82
|
+
const session=sessionID?api.state.session.get(sessionID):undefined
|
|
87
83
|
const directory=session?.directory??api.state.path.directory
|
|
88
84
|
const workspace=session?.workspaceID
|
|
89
85
|
return{key:JSON.stringify([directory,workspace??null]),routing:{directory,...workspace&&{workspace}}
|
|
90
86
|
}
|
|
91
87
|
}
|
|
92
|
-
|
|
93
88
|
function mcpToggleAction(status) {if (status==="pending")
|
|
94
89
|
return
|
|
95
|
-
return status==="connected"
|
|
90
|
+
return status==="connected"?"disconnect":"connect"
|
|
96
91
|
}
|
|
97
92
|
function layoutPresetPreview(current,preset) {const parsed=parseSectionLayout(preset)
|
|
98
93
|
if(!parsed)
|
|
@@ -106,7 +101,7 @@ return{next,rows}
|
|
|
106
101
|
function mcpPresetPreview(items,states) {const byName=new Map(items.map((item)=>[item.name,item]))
|
|
107
102
|
const names=[...new Set([...Object.keys(states),...byName.keys()])].sort((a,b)=>a.localeCompare(b))
|
|
108
103
|
const rows=names.map((name)=>{const item=byName.get(name)
|
|
109
|
-
const desired=Object.hasOwn(states,name)
|
|
104
|
+
const desired=Object.hasOwn(states,name)?states[name]:undefined
|
|
110
105
|
const action=item&&mcpToggleAction(item.status)
|
|
111
106
|
let change="unchanged"
|
|
112
107
|
if(desired&&!item)
|
|
@@ -117,10 +112,9 @@ else if (desired==="enabled"&&action==="connect"||desired==="disabled"&&action==
|
|
|
117
112
|
}
|
|
118
113
|
return{name,status:item?.status,desired,change}
|
|
119
114
|
})
|
|
120
|
-
const changes=rows.flatMap((row)=>row.change==="connect"||row.change==="disconnect"
|
|
115
|
+
const changes=rows.flatMap((row)=>row.change==="connect"||row.change==="disconnect"?[{name:row.name,action:row.change}]:[])
|
|
121
116
|
return{rows,changes}
|
|
122
117
|
}
|
|
123
|
-
|
|
124
118
|
import {createSignal} from "solid-js"
|
|
125
119
|
var idle={status:"idle"}
|
|
126
120
|
function isAbortError(cause) {return typeof DOMException!=="undefined"&&cause instanceof DOMException&&cause.name==="AbortError"||cause instanceof Error&&cause.name==="AbortError"||typeof cause==="object"&&cause!==null&&"name" in cause&&cause.name==="AbortError"
|
|
@@ -130,12 +124,12 @@ return false
|
|
|
130
124
|
if(typeof cause!=="object"||cause===null)
|
|
131
125
|
return true
|
|
132
126
|
const value=cause
|
|
133
|
-
const status=typeof value.status==="number"
|
|
127
|
+
const status=typeof value.status==="number"?value.status:value.response?.status
|
|
134
128
|
if(typeof status!=="number")
|
|
135
129
|
return true
|
|
136
|
-
return status===408||status===425||status===429||status
|
|
130
|
+
return status===408||status===425||status===429||status>=500
|
|
137
131
|
}
|
|
138
|
-
function requestError(cause,operation,target) {return {operation,target,message:cause instanceof Error
|
|
132
|
+
function requestError(cause,operation,target) {return {operation,target,message:cause instanceof Error?cause.message:`Failed to ${operation}`,retryable:isRetryableError(cause)
|
|
139
133
|
}
|
|
140
134
|
}
|
|
141
135
|
function createRequestState(lifecycleSignal) {const [states,setStates]=createSignal({})
|
|
@@ -149,7 +143,7 @@ return
|
|
|
149
143
|
request.controller.abort()
|
|
150
144
|
active.delete(target)
|
|
151
145
|
const current=state(target)
|
|
152
|
-
setStates((values)=>({...values,[target]:current.lastSuccessfulAt
|
|
146
|
+
setStates((values)=>({...values,[target]:current.lastSuccessfulAt?{status:"ready",lastSuccessfulAt:current.lastSuccessfulAt}:idle
|
|
153
147
|
}))
|
|
154
148
|
}
|
|
155
149
|
function abortAll() {for (const target of active.keys())
|
|
@@ -166,7 +160,7 @@ if(lifecycleSignal?.aborted)
|
|
|
166
160
|
controller.abort(lifecycleSignal.reason)
|
|
167
161
|
const current=state(target)
|
|
168
162
|
active.set(target,{id,controller})
|
|
169
|
-
setStates((values)=>({...values,[target]:{status:hasData
|
|
163
|
+
setStates((values)=>({...values,[target]:{status:hasData?"refreshing":"loading",lastSuccessfulAt:current.lastSuccessfulAt
|
|
170
164
|
}
|
|
171
165
|
}))
|
|
172
166
|
function isCurrent() {return active.get(target)?.id===id
|
|
@@ -180,7 +174,7 @@ setStates((values)=>({...values,[target]:{status:"ready",lastSuccessfulAt:Date.n
|
|
|
180
174
|
}))
|
|
181
175
|
},fail(cause) {if (!isCurrent())
|
|
182
176
|
return
|
|
183
|
-
if(controller.signal.aborted||isAbortError(cause)) {setStates((values)=>({...values,[target]:current.lastSuccessfulAt
|
|
177
|
+
if(controller.signal.aborted||isAbortError(cause)) {setStates((values)=>({...values,[target]:current.lastSuccessfulAt?{status:"ready",lastSuccessfulAt:current.lastSuccessfulAt}:idle
|
|
184
178
|
}))
|
|
185
179
|
return
|
|
186
180
|
}
|
|
@@ -202,18 +196,16 @@ reject(signal.reason??new DOMException("Aborted","AbortError"))
|
|
|
202
196
|
}
|
|
203
197
|
async function retryBackgroundRefresh(refresh,options={}) {const delays=options.delays??[250,1000]
|
|
204
198
|
for(let attempt=0;; attempt++) {try {return await refresh()
|
|
205
|
-
} catch (error) {if (!isRetryableError(error)||attempt
|
|
199
|
+
} catch (error) {if (!isRetryableError(error)||attempt>=delays.length)
|
|
206
200
|
throw error
|
|
207
201
|
await (options.wait??wait)(delays[attempt],options.signal)
|
|
208
202
|
}
|
|
209
203
|
}
|
|
210
204
|
}
|
|
211
|
-
|
|
212
205
|
function mcpToggleAction2(status) {if (status==="pending")
|
|
213
206
|
return
|
|
214
|
-
return status==="connected"
|
|
207
|
+
return status==="connected"?"disconnect":"connect"
|
|
215
208
|
}
|
|
216
|
-
|
|
217
209
|
function matchingMcpPreset(items,presets) {if (items.length===0)
|
|
218
210
|
return
|
|
219
211
|
return Object.keys(presets).sort((left,right)=>left.localeCompare(right)).find((name)=>{const states=presets[name]
|
|
@@ -223,7 +215,7 @@ return Object.keys(states).length===items.length&&items.every((item)=>item.statu
|
|
|
223
215
|
function statusError(status) {if (!status||typeof status!=="object"||!("error" in status))
|
|
224
216
|
return
|
|
225
217
|
const error=status.error
|
|
226
|
-
return typeof error==="string"
|
|
218
|
+
return typeof error==="string"?error:undefined
|
|
227
219
|
}
|
|
228
220
|
function createMcpController(api,persist,preferences) {const [snapshots,setSnapshots]=createSignal2({})
|
|
229
221
|
const [mutationCounts,setMutationCounts]=createSignal2({})
|
|
@@ -268,7 +260,7 @@ return{key:location.key,scope:preferencesScope({directory:location.routing.direc
|
|
|
268
260
|
}
|
|
269
261
|
function serverKey(current,name) {return JSON.stringify([current.key,name])
|
|
270
262
|
}
|
|
271
|
-
function mutating(current=target()) {return (mutationCounts()[current.key]??0)
|
|
263
|
+
function mutating(current=target()) {return (mutationCounts()[current.key]??0)>0
|
|
272
264
|
}
|
|
273
265
|
function resetSelectedPreset(current) {selectedPresetStates.delete(current.key)
|
|
274
266
|
setSelectedPresets((values)=>{const next={...values}
|
|
@@ -290,7 +282,7 @@ return
|
|
|
290
282
|
const isChanged=items.some((item)=>{const desired=states[item.name]
|
|
291
283
|
if(!desired)
|
|
292
284
|
return false
|
|
293
|
-
return (item.status==="connected"
|
|
285
|
+
return (item.status==="connected"?"enabled":"disabled")!==desired
|
|
294
286
|
})
|
|
295
287
|
if(isChanged)
|
|
296
288
|
resetSelectedPreset(current)
|
|
@@ -300,7 +292,7 @@ if(!state||state.status!=="error"||!state.failed.includes(name))
|
|
|
300
292
|
return values
|
|
301
293
|
const failed=state.failed.filter((candidate)=>candidate!==name)
|
|
302
294
|
bulkRetries.set(current.key,(bulkRetries.get(current.key)??[]).filter((candidate)=>candidate.name!==name))
|
|
303
|
-
return{...values,[current.key]:{...state,status:failed.length
|
|
295
|
+
return{...values,[current.key]:{...state,status:failed.length>0?"error":"ready",failed}
|
|
304
296
|
}
|
|
305
297
|
})
|
|
306
298
|
}
|
|
@@ -336,7 +328,7 @@ const requestState=serverRequests.start(key,operation,false)
|
|
|
336
328
|
if(!requestState)
|
|
337
329
|
return mutations.get(key)
|
|
338
330
|
changeMutationCount(current,1)
|
|
339
|
-
const request=(action==="disconnect"
|
|
331
|
+
const request=(action==="disconnect"?api.client.mcp.disconnect({name,...current.routing},{throwOnError:true,signal:requestState.signal}):api.client.mcp.connect({name,...current.routing},{throwOnError:true,signal:requestState.signal})).then(()=>{requestState.succeed()
|
|
340
332
|
mutationRetries.delete(key)
|
|
341
333
|
clearBulkFailure(current,name)
|
|
342
334
|
}).catch((error)=>{requestState.fail(error)
|
|
@@ -355,7 +347,7 @@ await refresh(current,true)
|
|
|
355
347
|
}
|
|
356
348
|
function save(current,name,disabled) {if (!persist())
|
|
357
349
|
return
|
|
358
|
-
preferences.setDesiredMcpState(current.scope,name,disabled
|
|
350
|
+
preferences.setDesiredMcpState(current.scope,name,disabled?"disabled":"enabled")
|
|
359
351
|
}
|
|
360
352
|
async function toggle(name) {const current=target()
|
|
361
353
|
const item=list(current).find((candidate)=>candidate.name===name)
|
|
@@ -385,8 +377,8 @@ if(desired==="disabled"&&action==="disconnect") {await changeServer(current,item
|
|
|
385
377
|
if(desired==="enabled"&&action==="connect") {await changeServer(current,item.name,"connect","restore MCP preference",false)
|
|
386
378
|
}
|
|
387
379
|
}))
|
|
388
|
-
const failed=api.lifecycle?.signal.aborted
|
|
389
|
-
if(failed.length
|
|
380
|
+
const failed=api.lifecycle?.signal.aborted?[]:results.flatMap((result,index)=>result.status==="rejected"&&!isAbortError(result.reason)?[items[index].name]:[])
|
|
381
|
+
if(failed.length>0) {api.ui.toast({variant:"warning",title:"MCP preferences",message:`Could not restore: ${failed.join(", ")}`,duration:4000
|
|
390
382
|
})
|
|
391
383
|
}
|
|
392
384
|
if(generation===activation&&target().key===current.key)
|
|
@@ -412,7 +404,7 @@ const failed=[]
|
|
|
412
404
|
const retry=[]
|
|
413
405
|
await Promise.all(changes.map(async ({name,action})=>{if (operation.action!=="preset")
|
|
414
406
|
save(current,name,action==="disconnect")
|
|
415
|
-
try {const description=operation.action==="preset"
|
|
407
|
+
try {const description=operation.action==="preset"?`apply ${operation.preset} MCP preset`:`${action} all MCP servers`
|
|
416
408
|
await changeServer(current,name,action,description,false)
|
|
417
409
|
} catch (error) {if (!isAbortError(error)) {failed.push(name)
|
|
418
410
|
retry.push({name,action})
|
|
@@ -432,10 +424,10 @@ bulkRetries.set(current.key,retry)
|
|
|
432
424
|
if(activeTarget===current.key)
|
|
433
425
|
await refresh(current,true).catch(()=>{})
|
|
434
426
|
failed.sort((left,right)=>left.localeCompare(right))
|
|
435
|
-
setBulkStates((values)=>({...values,[current.key]:{...operation,status:failed.length
|
|
427
|
+
setBulkStates((values)=>({...values,[current.key]:{...operation,status:failed.length>0?"error":"ready",completed:changes.length,total:changes.length,failed
|
|
436
428
|
}
|
|
437
429
|
}))
|
|
438
|
-
if(failed.length
|
|
430
|
+
if(failed.length>0&&activeTarget===current.key) {const action=operation.action==="preset"?`apply ${operation.preset}`:operation.action
|
|
439
431
|
api.ui.toast({variant:"warning",title:"MCP servers",message:`Could not ${action}: ${failed.join(", ")}`,duration:4000
|
|
440
432
|
})
|
|
441
433
|
}
|
|
@@ -458,7 +450,7 @@ refreshing.clear()
|
|
|
458
450
|
},serverState(name,current=target()) {return serverRequests.state(serverKey(current,name))
|
|
459
451
|
},retryServer(name,current=target()) {return mutationRetries.get(serverKey(current,name))?.()
|
|
460
452
|
},mutating,bulkState,selectedPreset(current=target()) {return selectedPresets()[current.key]
|
|
461
|
-
},capturePreset(current=target()) {return Object.fromEntries(list(current).map((item)=>[item.name,item.status==="connected"
|
|
453
|
+
},capturePreset(current=target()) {return Object.fromEntries(list(current).map((item)=>[item.name,item.status==="connected"?"enabled":"disabled"]))
|
|
462
454
|
},applyPreset(name,states,current=target()) {if (mutating(current))
|
|
463
455
|
return
|
|
464
456
|
const {changes}=mcpPresetPreview(list(current),states)
|
|
@@ -496,37 +488,32 @@ return changeMany({action:state.action,...state.preset&&{preset:state.preset}},c
|
|
|
496
488
|
}
|
|
497
489
|
}
|
|
498
490
|
}
|
|
499
|
-
|
|
500
491
|
var BUCKET_RANK={Favorites:0,Ungrouped:2}
|
|
501
|
-
function buildMcpGroupedView(items,favorites,assignments) {return items.map((item)=>({...item,assignedGroup:assignments[item.name],bucket:favorites.has(item.name)
|
|
492
|
+
function buildMcpGroupedView(items,favorites,assignments) {return items.map((item)=>({...item,assignedGroup:assignments[item.name],bucket:favorites.has(item.name)?"Favorites":assignments[item.name]??"Ungrouped"
|
|
502
493
|
})).sort((left,right)=>{const leftRank=BUCKET_RANK[left.bucket]??1
|
|
503
494
|
const rightRank=BUCKET_RANK[right.bucket]??1
|
|
504
495
|
return leftRank - rightRank||left.bucket.localeCompare(right.bucket)||left.name.localeCompare(right.name)
|
|
505
496
|
})
|
|
506
497
|
}
|
|
507
|
-
|
|
508
498
|
import {createComponent as _$createComponent9} from "@opentui/solid"
|
|
509
|
-
|
|
510
499
|
import {mergeProps as _$mergeProps} from "@opentui/solid"
|
|
511
500
|
import {createComponent as _$createComponent2} from "@opentui/solid"
|
|
512
501
|
import {createEffect,onCleanup} from "solid-js"
|
|
513
|
-
|
|
514
502
|
import {createComponent as _$createComponent} from "@opentui/solid"
|
|
515
503
|
import {createContext,useContext} from "solid-js"
|
|
516
|
-
|
|
517
504
|
var ICONS={todo:["\uEAB3","[T]"],subagents:["\uEA7E","[A]"],skills:["\uEAA4","[S]"],actions:["\uEB9E","[Q]"],lsp:["\uEAC4","{}"],mcp:["\uEB2D","[M]"],sections:["\uEBEB","[]"],scope:["\uEB01","@"],presets:["\uEBD2","#"],settings:["\uEAF8","[=]"],reset:["\uEB37","R"],save:["\uEB4B","S"],add:["\uEA60","+"],edit:["\uEA73","[R]"],history:["\uEA82","[T]"],copy:["\uEBCC","[C]"],export:["\uEBAC","[E]"],compact:["\uEAF5","[-]"],checked:["\uEBB3","[x]"],unchecked:["\uEBB5","[ ]"],selected:["\uEAB6",">"],expanded:["\uEAB4","v"],collapsed:["\uEAB6",">"],radioOn:["\uEA71","(*)"],radioOff:["\uEABC","( )"],done:["\uEAB2","v"],busy:["\uEA71","*"],idle:["\uEABC","-"],close:["\uEA76","x"],error:["\uEA87","!"],retry:["\uEA77","~"],pending:["\uDB86\uDD78","..."],connected:["\uDB81\uDC3E","(*)"],disconnected:["\uDB81\uDC3D","( )"],favorite:["\uEB59","*"],favoriteEmpty:["\uEA6A","+"],bookmark:["\uDB80\uDCC0","*"],bookmarkEmpty:["\uDB80\uDCC3","+"],mcpFavorite:["\uDB80\uDCC0","*"],mcpFavoriteEmpty:["\uDB80\uDCC3","+"],recent:["\uEA82","~"],info:["\uEA74","i"],search:["\uEA6D","/"],up:["\uEAA1","^"],down:["\uEA9A","v"],left:["\uEA9B","<"],right:["\uEA9C",">"],keyEnter:["\uEBEA","enter"],keyTab:["\uDB80\uDF12","tab"],keyEscape:["\uDB84\uDEB7","esc"],keySpace:["\uDB84\uDC50","space"],delete:["\uEA81","del"],priorityMedium:["\uEA71","-"],help:["\uEB32","?"],selectionLeft:["\uE0B6"," "],selectionRight:["\uE0B4"," "],selectionTopLeft:["\uDBFC\uDC04"," "],selectionTopRight:["\uDBFC\uDC05"," "],selectionBottomLeft:["\uDBFC\uDC06"," "],selectionBottomRight:["\uDBFC\uDC07"," "]
|
|
518
505
|
}
|
|
519
|
-
function uiIcon(name,style="nerd") {return ICONS[name][style==="text"
|
|
506
|
+
function uiIcon(name,style="nerd") {return ICONS[name][style==="text"?1:0]
|
|
520
507
|
}
|
|
521
508
|
var KEY_ICONS={up:"up",down:"down",left:"left",right:"right",enter:"keyEnter",tab:"keyTab",esc:"keyEscape",space:"keySpace","?":"help"
|
|
522
509
|
}
|
|
523
510
|
function keyHint(keys,style="nerd") {if (style==="text")
|
|
524
511
|
return keys
|
|
525
512
|
return keys.split(/([+/])/).map((key)=>{const icon=KEY_ICONS[key]
|
|
526
|
-
return icon
|
|
513
|
+
return icon?uiIcon(icon,style):key
|
|
527
514
|
}).join("")
|
|
528
515
|
}
|
|
529
|
-
function sectionIcon(section,style="nerd") {return uiIcon(section==="quick_actions"
|
|
516
|
+
function sectionIcon(section,style="nerd") {return uiIcon(section==="quick_actions"?"actions":section,style)
|
|
530
517
|
}
|
|
531
518
|
var SETTINGS_ICONS={sections:"sections",scope:"scope",presets:"presets",behavior:"settings",defaults:"reset"
|
|
532
519
|
}
|
|
@@ -536,7 +523,6 @@ var ACTION_ICONS=["edit","history","copy","export","compact","sections","add","a
|
|
|
536
523
|
]
|
|
537
524
|
function quickActionIcon(command,style="nerd") {return uiIcon(ACTION_ICONS[QUICK_ACTION_IDS.indexOf(command)]??"actions",style)
|
|
538
525
|
}
|
|
539
|
-
|
|
540
526
|
function createIcons(style,multilineCorners=()=>true) {return {style,multilineCorners,icon:(name)=>uiIcon(name,style()),key:(keys)=>keyHint(keys,style()),section:(section)=>sectionIcon(section,style()),tab:(tab)=>settingsTabIcon(tab,style()),action:(command)=>quickActionIcon(command,style())
|
|
541
527
|
}
|
|
542
528
|
}
|
|
@@ -549,7 +535,6 @@ function IconProvider(props) {return _$createComponent(IconContext.Provider,{get
|
|
|
549
535
|
}
|
|
550
536
|
function useIcons() {return useContext(IconContext)
|
|
551
537
|
}
|
|
552
|
-
|
|
553
538
|
var LSP_ICONS={zls:{nerd:"\uE6A9",text:"Zg"},"yaml-ls":{nerd:"\uE6A8",text:"Yml"},vue:{nerd:"\uDB82\uDC44",text:"Vue"},typescript:{nerd:"\uDB81\uDEE6",text:"TS"},tinymist:{nerd:"\uF37F",text:"Typ"},texlab:{nerd:"\uE69B",text:"TeX"},terraform:{nerd:"\uDB84\uDC62",text:"Tf"},svelte:{nerd:"\uE697",text:"Sv"},"sourcekit-lsp":{nerd:"\uDB81\uDEE5",text:"Sw"},rust:{nerd:"\uDB85\uDE17",text:"Rs"},"ruby-lsp":{nerd:"\uDB83\uDD2D",text:"Rb"},razor:{nerd:"\uE7C6",text:"Rz"},pyright:{nerd:"\uDB80\uDF20",text:"Py"},prisma:{nerd:"\uE684",text:"Pr"},"php intelephense":{nerd:"\uDB80\uDF1F",text:"PHP"},oxlint:{nerd:"\uEBB1",text:"Ox"},"ocaml-lsp":{nerd:"\uE67A",text:"Ml"},nixd:{nerd:"\uDB84\uDD05",text:"Nix"},"lua-ls":{nerd:"\uDB82\uDCB1",text:"Lua"},"kotlin-ls":{nerd:"\uDB84\uDE19",text:"Kt"},julials:{nerd:"\uE624",text:"Jl"},jdtls:{nerd:"\uDB82\uDF37",text:"Jv"},"haskell-language-server":{nerd:"\uDB83\uDC92",text:"Hs"},gopls:{nerd:"\uDB81\uDFD3",text:"Go"},gleam:{nerd:"\uE914",text:"Gl"},fsharp:{nerd:"\uE7A7",text:"F#"},"elixir-ls":{nerd:"\uE62D",text:"Ex"},eslint:{nerd:"\uE7D2",text:"ES"},dockerfile:{nerd:"\uDB82\uDC68",text:"Dk"},deno:{nerd:"\uE7C0",text:"Dn"},dart:{nerd:"\uE798",text:"Dt"},"clojure-lsp":{nerd:"\uE768",text:"Clj"},clangd:{nerd:"\uDB81\uDE72",text:"C++"},csharp:{nerd:"\uDB80\uDF1B",text:"C#"},biome:{nerd:"\uE8FB",text:"Bm"},bash:{nerd:"\uE691",text:"Sh"},astro:{nerd:"\uE6B3",text:"Ast"},json:{nerd:"\uDB81\uDE26",text:"{}"},tailwind:{nerd:"\uE8BA",text:"TW"},css:{nerd:"\uDB80\uDF1C",text:"CSS"},html:{nerd:"\uDB80\uDF1D",text:"HTM"}
|
|
554
539
|
}
|
|
555
540
|
function lspIconName(id) {const name=id.toLowerCase()
|
|
@@ -616,12 +601,10 @@ return "prisma"
|
|
|
616
601
|
return
|
|
617
602
|
}
|
|
618
603
|
function lspIcon(id,style="nerd") {const name=lspIconName(id)
|
|
619
|
-
return name
|
|
604
|
+
return name?LSP_ICONS[name][style]:id
|
|
620
605
|
}
|
|
621
|
-
|
|
622
606
|
import {createContext as createContext2} from "solid-js"
|
|
623
607
|
var DialogContext=createContext2();
|
|
624
|
-
|
|
625
608
|
function createDialogStack(api,style=()=>"nerd",valid=()=>true,corners=()=>true) {let frames=[]
|
|
626
609
|
let isReplacing=false
|
|
627
610
|
function close() {if (frames.length===0)
|
|
@@ -665,18 +648,18 @@ show()
|
|
|
665
648
|
return close()
|
|
666
649
|
const frame={render,size,state:new Map
|
|
667
650
|
}
|
|
668
|
-
if(frames.length
|
|
651
|
+
if(frames.length>0)
|
|
669
652
|
frames[frames.length - 1]=frame
|
|
670
653
|
else
|
|
671
654
|
frames.push(frame)
|
|
672
655
|
show()
|
|
673
|
-
},back() {if (!valid()||frames.length
|
|
656
|
+
},back() {if (!valid()||frames.length<=1)
|
|
674
657
|
return close()
|
|
675
658
|
frames.pop()
|
|
676
659
|
show()
|
|
677
660
|
},prompt(props) {function showPrompt(value=props.value,retry=false) {const render=()=>_$createComponent2(api.ui.DialogPrompt,_$mergeProps(props,{value,get onCancel() {return navigation.back
|
|
678
661
|
},onConfirm:(input)=>{try {props.onConfirm?.(input)
|
|
679
|
-
} catch (error) {api.ui.toast({variant:"error",title:props.title,message:error instanceof Error
|
|
662
|
+
} catch (error) {api.ui.toast({variant:"error",title:props.title,message:error instanceof Error?error.message:"Invalid value",duration:4000
|
|
680
663
|
})
|
|
681
664
|
showPrompt(input,true)
|
|
682
665
|
}
|
|
@@ -709,7 +692,6 @@ return _$createComponent2(DialogContext.Provider,{get value() {return props.scop
|
|
|
709
692
|
}
|
|
710
693
|
})
|
|
711
694
|
}
|
|
712
|
-
|
|
713
695
|
import {createSignal as createSignal3,useContext as useContext2} from "solid-js"
|
|
714
696
|
function useDialogs(api) {const scope=useContext2(DialogContext)
|
|
715
697
|
const icons=useIcons()
|
|
@@ -741,7 +723,6 @@ setPosition(body.scrollTop)
|
|
|
741
723
|
}
|
|
742
724
|
}
|
|
743
725
|
}
|
|
744
|
-
|
|
745
726
|
import {createComponent as _$createComponent3} from "@opentui/solid"
|
|
746
727
|
import {setProp as _$setProp} from "@opentui/solid"
|
|
747
728
|
import {effect as _$effect} from "@opentui/solid"
|
|
@@ -750,7 +731,6 @@ import {insertNode as _$insertNode} from "@opentui/solid"
|
|
|
750
731
|
import {insert as _$insert} from "@opentui/solid"
|
|
751
732
|
import {createElement as _$createElement2} from "@opentui/solid"
|
|
752
733
|
import {memo as _$memo2} from "@opentui/solid"
|
|
753
|
-
|
|
754
734
|
import {use as _$use} from "@opentui/solid"
|
|
755
735
|
import {spread as _$spread} from "@opentui/solid"
|
|
756
736
|
import {mergeProps as _$mergeProps2} from "@opentui/solid"
|
|
@@ -768,15 +748,15 @@ node?.requestRender()
|
|
|
768
748
|
})
|
|
769
749
|
function before(buffer,delta) {props.renderBefore?.call(this,buffer,delta)
|
|
770
750
|
corners=[]
|
|
771
|
-
if(this.buffered||this.width
|
|
751
|
+
if(this.buffered||this.width<3||this.height<1||this.backgroundColor.a===0||this.height>1&&!icons.multilineCorners())
|
|
772
752
|
return
|
|
773
753
|
const left=this.screenX
|
|
774
754
|
const right=left + this.width - 1
|
|
775
755
|
const top=this.screenY
|
|
776
756
|
const bottom=top + this.height - 1
|
|
777
|
-
const positions=this.height===1
|
|
757
|
+
const positions=this.height===1?[[left,top,"selectionLeft"],[right,top,"selectionRight"]]:[[left,top,"selectionTopLeft"],[right,top,"selectionTopRight"],[left,bottom,"selectionBottomLeft"],[right,bottom,"selectionBottomRight"]]
|
|
778
758
|
const background=buffer.buffers.bg
|
|
779
|
-
for(const [x,y,icon] of positions) {if (x
|
|
759
|
+
for(const [x,y,icon] of positions) {if (x<0||y<0||x>=buffer.width||y>=buffer.height)
|
|
780
760
|
continue
|
|
781
761
|
const offset=(y * buffer.width + x) * 4
|
|
782
762
|
const backdrop=new RGBA(background.slice(offset,offset + 4))
|
|
@@ -785,8 +765,8 @@ corners.push({x,y,icon,backdrop
|
|
|
785
765
|
})
|
|
786
766
|
}
|
|
787
767
|
}
|
|
788
|
-
function after(buffer,delta) {for (const corner of corners) {const multiline=this.height
|
|
789
|
-
buffer.setCell(corner.x,corner.y,icons.icon(corner.icon),multiline
|
|
768
|
+
function after(buffer,delta) {for (const corner of corners) {const multiline=this.height>1
|
|
769
|
+
buffer.setCell(corner.x,corner.y,icons.icon(corner.icon),multiline?corner.backdrop:this.backgroundColor,multiline?this.backgroundColor:corner.backdrop)
|
|
790
770
|
}
|
|
791
771
|
props.renderAfter?.call(this,buffer,delta)
|
|
792
772
|
}
|
|
@@ -796,21 +776,20 @@ untrack(()=>{if (typeof local.ref==="function")
|
|
|
796
776
|
local.ref(value)
|
|
797
777
|
})
|
|
798
778
|
},_el$)
|
|
799
|
-
_$spread(_el$,_$mergeProps2(boxProps,{get paddingLeft() {return props.paddingLeft??props.padding??(local.iconOnly&&icons.style()==="text"
|
|
800
|
-
},get paddingRight() {return props.paddingRight??props.padding??(local.iconOnly&&icons.style()==="text"
|
|
801
|
-
},get renderBefore() {return _$memo(()=>icons.style()==="nerd")()
|
|
802
|
-
},get renderAfter() {return _$memo(()=>icons.style()==="nerd")()
|
|
779
|
+
_$spread(_el$,_$mergeProps2(boxProps,{get paddingLeft() {return props.paddingLeft??props.padding??(local.iconOnly&&icons.style()==="text"?0:1)
|
|
780
|
+
},get paddingRight() {return props.paddingRight??props.padding??(local.iconOnly&&icons.style()==="text"?0:1)
|
|
781
|
+
},get renderBefore() {return _$memo(()=>icons.style()==="nerd")()?before:props.renderBefore
|
|
782
|
+
},get renderAfter() {return _$memo(()=>icons.style()==="nerd")()?after:props.renderAfter
|
|
803
783
|
}
|
|
804
784
|
}),false)
|
|
805
785
|
return _el$
|
|
806
786
|
})()
|
|
807
787
|
}
|
|
808
|
-
|
|
809
788
|
function DialogAction(props) {const icons=useIcons()
|
|
810
789
|
const selected=()=>props.selected&&!props.disabled
|
|
811
790
|
const theme=()=>props.api.theme.current
|
|
812
791
|
return _$createComponent3(SelectionBox,{get id() {return props.id
|
|
813
|
-
},get backgroundColor() {return _$memo2(()=>!!selected())()
|
|
792
|
+
},get backgroundColor() {return _$memo2(()=>!!selected())()?theme().primary:undefined
|
|
814
793
|
},onMouseOver:()=>props.onSelect(),onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
815
794
|
if(!props.disabled)
|
|
816
795
|
props.onActivate()
|
|
@@ -818,12 +797,11 @@ props.onActivate()
|
|
|
818
797
|
_$insertNode(_el$,_el$2)
|
|
819
798
|
_$insert(_el$,()=>icons.icon(props.icon),_el$2)
|
|
820
799
|
_$insert(_el$,()=>props.label,null)
|
|
821
|
-
_$effect((_$p)=>_$setProp(_el$,"fg",selected()
|
|
800
|
+
_$effect((_$p)=>_$setProp(_el$,"fg",selected()?theme().selectedListItemText:theme().textMuted,_$p))
|
|
822
801
|
return _el$
|
|
823
802
|
}
|
|
824
803
|
})
|
|
825
804
|
}
|
|
826
|
-
|
|
827
805
|
import {effect as _$effect2} from "@opentui/solid"
|
|
828
806
|
import {createTextNode as _$createTextNode2} from "@opentui/solid"
|
|
829
807
|
import {insertNode as _$insertNode2} from "@opentui/solid"
|
|
@@ -860,7 +838,6 @@ return _p$
|
|
|
860
838
|
return _el$
|
|
861
839
|
})()
|
|
862
840
|
}
|
|
863
|
-
|
|
864
841
|
import {effect as _$effect3} from "@opentui/solid"
|
|
865
842
|
import {insert as _$insert3} from "@opentui/solid"
|
|
866
843
|
import {setProp as _$setProp3} from "@opentui/solid"
|
|
@@ -874,7 +851,7 @@ _$setProp3(_el$,"paddingTop",1)
|
|
|
874
851
|
_$setProp3(_el$,"paddingBottom",1)
|
|
875
852
|
_$setProp3(_el$,"gap",1)
|
|
876
853
|
_$insert3(_el$,()=>props.children)
|
|
877
|
-
_$effect3((_p$)=>{var _v$=props.id,_v$2=props.lift
|
|
854
|
+
_$effect3((_p$)=>{var _v$=props.id,_v$2=props.lift?-Math.min(6,Math.max(3,Math.floor(dimensions().height / 10))):undefined,_v$3=props.api.theme.current.backgroundPanel
|
|
878
855
|
_v$!==_p$.e&&(_p$.e=_$setProp3(_el$,"id",_v$,_p$.e))
|
|
879
856
|
_v$2!==_p$.t&&(_p$.t=_$setProp3(_el$,"marginTop",_v$2,_p$.t))
|
|
880
857
|
_v$3!==_p$.a&&(_p$.a=_$setProp3(_el$,"backgroundColor",_v$3,_p$.a))
|
|
@@ -884,9 +861,7 @@ return _p$
|
|
|
884
861
|
return _el$
|
|
885
862
|
})()
|
|
886
863
|
}
|
|
887
|
-
|
|
888
864
|
import {createComponent as _$createComponent5} from "@opentui/solid"
|
|
889
|
-
|
|
890
865
|
import {createComponent as _$createComponent4} from "@opentui/solid"
|
|
891
866
|
import {effect as _$effect4} from "@opentui/solid"
|
|
892
867
|
import {insert as _$insert4} from "@opentui/solid"
|
|
@@ -899,7 +874,7 @@ function mouseOut(event) {props.onMouseOut?.()
|
|
|
899
874
|
event.stopPropagation()
|
|
900
875
|
}
|
|
901
876
|
return _$createComponent4(SelectionBox,{iconOnly:true,width:3,height:1,flexShrink:0,alignSelf:"flex-start",alignItems:"center",justifyContent:"center",ref(r$) {var _ref$=props.ref
|
|
902
|
-
typeof _ref$==="function"
|
|
877
|
+
typeof _ref$==="function"?_ref$(r$):props.ref=r$
|
|
903
878
|
},get id() {return props.id
|
|
904
879
|
},get backgroundColor() {return props.backgroundColor
|
|
905
880
|
},onMouseOver:mouseOver,onMouseOut:mouseOut,onMouseDown:(event)=>{event.stopPropagation()
|
|
@@ -916,12 +891,11 @@ return _el$
|
|
|
916
891
|
}
|
|
917
892
|
})
|
|
918
893
|
}
|
|
919
|
-
|
|
920
894
|
function BookmarkControl(props) {const icons=useIcons()
|
|
921
895
|
return _$createComponent5(IconControl,{ref(r$) {var _ref$=props.ref
|
|
922
|
-
typeof _ref$==="function"
|
|
896
|
+
typeof _ref$==="function"?_ref$(r$):props.ref=r$
|
|
923
897
|
},get id() {return props.id
|
|
924
|
-
},get icon() {return icons.icon(props.bookmarked
|
|
898
|
+
},get icon() {return icons.icon(props.bookmarked?"bookmark":"bookmarkEmpty")
|
|
925
899
|
},get backgroundColor() {return props.backgroundColor
|
|
926
900
|
},get foregroundColor() {return props.foregroundColor
|
|
927
901
|
},get onMouseOver() {return props.onMouseOver
|
|
@@ -931,7 +905,6 @@ typeof _ref$==="function" ? _ref$(r$):props.ref=r$
|
|
|
931
905
|
}
|
|
932
906
|
})
|
|
933
907
|
}
|
|
934
|
-
|
|
935
908
|
import {createComponent as _$createComponent6} from "@opentui/solid"
|
|
936
909
|
import {mergeProps as _$mergeProps3} from "@opentui/solid"
|
|
937
910
|
import {memo as _$memo3} from "@opentui/solid"
|
|
@@ -954,7 +927,6 @@ return _el$
|
|
|
954
927
|
}
|
|
955
928
|
}))
|
|
956
929
|
}
|
|
957
|
-
|
|
958
930
|
import {memo as _$memo4} from "@opentui/solid"
|
|
959
931
|
import {createComponent as _$createComponent7} from "@opentui/solid"
|
|
960
932
|
import {use as _$use2} from "@opentui/solid"
|
|
@@ -973,7 +945,7 @@ const [active,setActive]=useDialogState("selection",0)
|
|
|
973
945
|
const theme=()=>props.api.theme.current
|
|
974
946
|
let body
|
|
975
947
|
const prefix=`${PLUGIN_ID}.mcp-preset-menu`
|
|
976
|
-
createEffect3(()=>{if (active()
|
|
948
|
+
createEffect3(()=>{if (active()>=props.options.length)
|
|
977
949
|
setActive(Math.max(0,props.options.length - 1))
|
|
978
950
|
})
|
|
979
951
|
function move(offset) {if (props.options.length===0)
|
|
@@ -1020,17 +992,17 @@ _$setProp6(_el$5,"scrollX",false)
|
|
|
1020
992
|
_$setProp6(_el$6,"gap",1)
|
|
1021
993
|
_$insert6(_el$6,_$createComponent7(For,{get each() {return props.options
|
|
1022
994
|
},children:(option,index)=>_$createComponent7(SelectionBox,{get id() {return `${prefix}.${index()}`
|
|
1023
|
-
},paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo4(()=>active()===index())()
|
|
995
|
+
},paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo4(()=>active()===index())()?theme().backgroundElement:undefined
|
|
1024
996
|
},onMouseOver:()=>setActive(index()),onMouseUp:(event)=>{event.stopPropagation()
|
|
1025
997
|
setActive(index())
|
|
1026
998
|
props.onSelect(option)
|
|
1027
999
|
},get children() {return [(()=>{var _el$1=_$createElement7("text")
|
|
1028
1000
|
_$setProp6(_el$1,"wrapMode","word")
|
|
1029
1001
|
_$insert6(_el$1,(()=>{var _c$=_$memo4(()=>!!option.icon)
|
|
1030
|
-
return ()=>_c$()
|
|
1002
|
+
return ()=>_c$()?`${icons.icon(option.icon)} `:""
|
|
1031
1003
|
})(),null)
|
|
1032
1004
|
_$insert6(_el$1,()=>option.title,null)
|
|
1033
|
-
_$effect6((_p$)=>{var _v$8=active()===index()
|
|
1005
|
+
_$effect6((_p$)=>{var _v$8=active()===index()?TextAttributes2.BOLD:undefined,_v$9=theme().text
|
|
1034
1006
|
_v$8!==_p$.e&&(_p$.e=_$setProp6(_el$1,"attributes",_v$8,_p$.e))
|
|
1035
1007
|
_v$9!==_p$.t&&(_p$.t=_$setProp6(_el$1,"fg",_v$9,_p$.t))
|
|
1036
1008
|
return _p$
|
|
@@ -1067,7 +1039,6 @@ return _el$7
|
|
|
1067
1039
|
}
|
|
1068
1040
|
})
|
|
1069
1041
|
}
|
|
1070
|
-
|
|
1071
1042
|
import {mergeProps as _$mergeProps4} from "@opentui/solid"
|
|
1072
1043
|
import {insertNode as _$insertNode4} from "@opentui/solid"
|
|
1073
1044
|
import {createComponent as _$createComponent8} from "@opentui/solid"
|
|
@@ -1082,7 +1053,7 @@ function Tab(props) {const [local,boxProps]=splitProps3(props,["api","selected",
|
|
|
1082
1053
|
const theme=()=>local.api.theme.current
|
|
1083
1054
|
return _$createComponent8(SelectionBox,_$mergeProps4(boxProps,{height:1,minWidth:0,get paddingLeft() {return props.paddingLeft??1
|
|
1084
1055
|
},get paddingRight() {return props.paddingRight??1
|
|
1085
|
-
},get backgroundColor() {return _$memo5(()=>!!local.focused)()
|
|
1056
|
+
},get backgroundColor() {return _$memo5(()=>!!local.focused)()?theme().primary:_$memo5(()=>!!local.selected)()?theme().backgroundElement:props.backgroundColor
|
|
1086
1057
|
},get children() {var _el$=_$createElement8("box"),_el$2=_$createElement8("text")
|
|
1087
1058
|
_$insertNode4(_el$,_el$2)
|
|
1088
1059
|
_$setProp7(_el$,"flexDirection","row")
|
|
@@ -1098,7 +1069,7 @@ _$setProp7(_el$3,"flexShrink",0)
|
|
|
1098
1069
|
_$setProp7(_el$3,"wrapMode","none")
|
|
1099
1070
|
_$setProp7(_el$3,"height",1)
|
|
1100
1071
|
_$insert7(_el$3,()=>local.count)
|
|
1101
|
-
_$effect7((_p$)=>{var _v$=local.focused
|
|
1072
|
+
_$effect7((_p$)=>{var _v$=local.focused?theme().selectedListItemText:theme().textMuted,_v$2=TextAttributes3.DIM
|
|
1102
1073
|
_v$!==_p$.e&&(_p$.e=_$setProp7(_el$3,"fg",_v$,_p$.e))
|
|
1103
1074
|
_v$2!==_p$.t&&(_p$.t=_$setProp7(_el$3,"attributes",_v$2,_p$.t))
|
|
1104
1075
|
return _p$
|
|
@@ -1107,7 +1078,7 @@ return _p$
|
|
|
1107
1078
|
return _el$3
|
|
1108
1079
|
}
|
|
1109
1080
|
}),null)
|
|
1110
|
-
_$effect7((_p$)=>{var _v$3=local.focused
|
|
1081
|
+
_$effect7((_p$)=>{var _v$3=local.focused?theme().selectedListItemText:local.selected?theme().accent:local.foregroundColor??theme().textMuted,_v$4=local.selected?TextAttributes3.BOLD:undefined
|
|
1111
1082
|
_v$3!==_p$.e&&(_p$.e=_$setProp7(_el$2,"fg",_v$3,_p$.e))
|
|
1112
1083
|
_v$4!==_p$.t&&(_p$.t=_$setProp7(_el$2,"attributes",_v$4,_p$.t))
|
|
1113
1084
|
return _p$
|
|
@@ -1117,7 +1088,6 @@ return _el$
|
|
|
1117
1088
|
}
|
|
1118
1089
|
}))
|
|
1119
1090
|
}
|
|
1120
|
-
|
|
1121
1091
|
function McpErrorDialog(props) {return _$createComponent9(PresetMenu,{get api() {return props.api
|
|
1122
1092
|
},get title() {return `MCP error \xB7 ${props.name}`
|
|
1123
1093
|
},height:12,get options() {return [{title:`Status \xB7 ${props.status}`,value:"error",description:props.error,icon:"error"
|
|
@@ -1125,9 +1095,7 @@ function McpErrorDialog(props) {return _$createComponent9(PresetMenu,{get api()
|
|
|
1125
1095
|
},onSelect:()=>{}
|
|
1126
1096
|
})
|
|
1127
1097
|
}
|
|
1128
|
-
|
|
1129
1098
|
import {createSignal as createSignal4} from "solid-js"
|
|
1130
|
-
|
|
1131
1099
|
var PORTABLE_SETTINGS_FORMAT="opencode-navigator/settings"
|
|
1132
1100
|
function object(value,path) {if (!value||typeof value!=="object"||Array.isArray(value))
|
|
1133
1101
|
throw new Error(`${path} must be an object`)
|
|
@@ -1150,8 +1118,8 @@ return [[name,visible]]
|
|
|
1150
1118
|
}
|
|
1151
1119
|
function parseLayout(value,unsupported) {const input=object(value,"/layout")
|
|
1152
1120
|
unknownKeys(input,["sections","expanded","order"],"/layout",unsupported)
|
|
1153
|
-
const sections=input.sections===undefined
|
|
1154
|
-
const expanded=input.expanded===undefined
|
|
1121
|
+
const sections=input.sections===undefined?{}:parseVisibility(input.sections,"/layout/sections",unsupported)
|
|
1122
|
+
const expanded=input.expanded===undefined?{}:parseVisibility(input.expanded,"/layout/expanded",unsupported)
|
|
1155
1123
|
let order
|
|
1156
1124
|
if(input.order!==undefined) {if (!Array.isArray(input.order))
|
|
1157
1125
|
throw new Error("/layout/order must be an array")
|
|
@@ -1207,7 +1175,6 @@ function serializePortableSettings(layout,mcp) {return `${JSON.stringify({
|
|
|
1207
1175
|
}, undefined, 2)}
|
|
1208
1176
|
`
|
|
1209
1177
|
}
|
|
1210
|
-
|
|
1211
1178
|
function record(value) {if (!value||typeof value!=="object"||Array.isArray(value))
|
|
1212
1179
|
return
|
|
1213
1180
|
return value
|
|
@@ -1216,9 +1183,9 @@ function parsePluginSettings(value) {const input=record(value)
|
|
|
1216
1183
|
if(!input)
|
|
1217
1184
|
return{}
|
|
1218
1185
|
return{...typeof input.toggleKey==="string"&&input.toggleKey.trim()&&{toggleKey:input.toggleKey.trim()},...typeof input.focusKey==="string"&&input.focusKey.trim()&&{focusKey:input.focusKey.trim()},...typeof input.searchKey==="string"&&input.searchKey.trim()&&{searchKey:input.searchKey.trim()},...typeof input.persistMcp==="boolean"&&{persistMcp:input.persistMcp},...typeof input.cornerFont==="boolean"&&{cornerFont:input.cornerFont},...(input.lspIconStyle==="nerd"||input.lspIconStyle==="text")&&{lspIconStyle:input.lspIconStyle},...(input.rowDensity==="compact"||input.rowDensity==="comfortable")&&{rowDensity:input.rowDensity
|
|
1219
|
-
},...Object.keys(parseSectionItemLimits(input.sectionItemLimits)).length
|
|
1186
|
+
},...Object.keys(parseSectionItemLimits(input.sectionItemLimits)).length>0&&{sectionItemLimits:parseSectionItemLimits(input.sectionItemLimits)
|
|
1220
1187
|
},...parseQuickActionOrder(input.quickActionOrder)&&{quickActionOrder:parseQuickActionOrder(input.quickActionOrder)
|
|
1221
|
-
},...Object.keys(parseQuickActionVisibility(input.quickActionVisibility)).length
|
|
1188
|
+
},...Object.keys(parseQuickActionVisibility(input.quickActionVisibility)).length>0&&{quickActionVisibility:parseQuickActionVisibility(input.quickActionVisibility)
|
|
1222
1189
|
}
|
|
1223
1190
|
}
|
|
1224
1191
|
}
|
|
@@ -1229,7 +1196,7 @@ const presets={}
|
|
|
1229
1196
|
const entries=Object.entries(input).sort(([left],[right])=>left.localeCompare(right))
|
|
1230
1197
|
for(const [candidate,preset] of entries) {const name=candidate.trim().slice(0,64)
|
|
1231
1198
|
const layout=parseSectionLayout(preset)
|
|
1232
|
-
if(name&&layout&&Object.keys(presets).length
|
|
1199
|
+
if(name&&layout&&Object.keys(presets).length<50)
|
|
1233
1200
|
presets[name]=layout
|
|
1234
1201
|
}
|
|
1235
1202
|
return presets
|
|
@@ -1248,7 +1215,7 @@ const entries=Object.entries(input).sort(([left],[right])=>left.localeCompare(ri
|
|
|
1248
1215
|
for(const [candidate,preset] of entries) {const name=candidate.trim().slice(0,64)
|
|
1249
1216
|
const states=parseDesiredMcpStates(preset)
|
|
1250
1217
|
const key=name.toLocaleLowerCase()
|
|
1251
|
-
if(name&&!names.has(key)&&Object.keys(states).length
|
|
1218
|
+
if(name&&!names.has(key)&&Object.keys(states).length>0&&Object.keys(presets).length<50) {names.add(key)
|
|
1252
1219
|
presets[name]=states
|
|
1253
1220
|
}
|
|
1254
1221
|
}
|
|
@@ -1256,11 +1223,11 @@ return presets
|
|
|
1256
1223
|
}
|
|
1257
1224
|
function parseStringList(value) {if (!Array.isArray(value))
|
|
1258
1225
|
return
|
|
1259
|
-
return [...new Set(value.filter((item)=>typeof item==="string"&&item.length
|
|
1226
|
+
return [...new Set(value.filter((item)=>typeof item==="string"&&item.length>0))].sort()
|
|
1260
1227
|
}
|
|
1261
1228
|
function parseRecentItems(value,accepts) {if (!Array.isArray(value))
|
|
1262
1229
|
return []
|
|
1263
|
-
return [...new Set(value.filter((item)=>typeof item==="string"&&item.length
|
|
1230
|
+
return [...new Set(value.filter((item)=>typeof item==="string"&&item.length>0&&accepts(item)))
|
|
1264
1231
|
].slice(0,10)
|
|
1265
1232
|
}
|
|
1266
1233
|
function parseRecentSkills(value) {return parseRecentItems(value,(item)=>Boolean(item))
|
|
@@ -1275,13 +1242,13 @@ return QUICK_ACTION_IDS.filter((id)=>selected.has(id))
|
|
|
1275
1242
|
function parseMcpServerGroups(value) {const input=record(value)
|
|
1276
1243
|
if(!input)
|
|
1277
1244
|
return{}
|
|
1278
|
-
return Object.fromEntries(Object.entries(input).flatMap(([server,rawGroup])=>{const group=typeof rawGroup==="string"
|
|
1279
|
-
return server.trim()&&group
|
|
1245
|
+
return Object.fromEntries(Object.entries(input).flatMap(([server,rawGroup])=>{const group=typeof rawGroup==="string"?rawGroup.trim().slice(0,64):""
|
|
1246
|
+
return server.trim()&&group?[[server,group]]:[]
|
|
1280
1247
|
}))
|
|
1281
1248
|
}
|
|
1282
1249
|
function parseWorkspaceProfiles(value) {return Object.fromEntries(Object.entries(record(value)??{}).flatMap(([layout,rawMcp])=>{const layoutName=layout.trim().slice(0,64)
|
|
1283
|
-
const mcpName=typeof rawMcp==="string"
|
|
1284
|
-
return layoutName&&mcpName
|
|
1250
|
+
const mcpName=typeof rawMcp==="string"?rawMcp.trim().slice(0,64):""
|
|
1251
|
+
return layoutName&&mcpName?[[layoutName,mcpName]]:[]
|
|
1285
1252
|
}).slice(0,50))
|
|
1286
1253
|
}
|
|
1287
1254
|
function emptyPreferencesDocument() {return {global:{},worktrees:{},user:{}
|
|
@@ -1303,7 +1270,7 @@ const candidateInput=record(candidate)
|
|
|
1303
1270
|
const scopedBehavior=parsePluginSettings(candidateInput?.behavior)
|
|
1304
1271
|
const scopedLayout=parseSectionLayout(candidateInput?.layout)
|
|
1305
1272
|
const mcp=parseDesiredMcpStates(candidateInput?.mcp)
|
|
1306
|
-
if(Object.keys(scopedBehavior).length
|
|
1273
|
+
if(Object.keys(scopedBehavior).length>0||scopedLayout||Object.keys(mcp).length>0) {worktrees[scope]={...Object.keys(scopedBehavior).length>0&&{behavior:scopedBehavior},...scopedLayout&&{layout:scopedLayout},...Object.keys(mcp).length>0&&{mcp}
|
|
1307
1274
|
}
|
|
1308
1275
|
}
|
|
1309
1276
|
}
|
|
@@ -1318,9 +1285,9 @@ const recentSkills=parseRecentSkills(userInput?.recentSkills)
|
|
|
1318
1285
|
const recentQuickActions=parseRecentQuickActions(userInput?.recentQuickActions)
|
|
1319
1286
|
const mcpServerGroups=parseMcpServerGroups(userInput?.mcpServerGroups)
|
|
1320
1287
|
const workspaceProfiles=parseWorkspaceProfiles(userInput?.workspaceProfiles)
|
|
1321
|
-
return{global:{...Object.keys(behavior).length
|
|
1288
|
+
return{global:{...Object.keys(behavior).length>0&&{behavior},...layout&&{layout},...Object.keys(globalMcp).length>0&&{mcp:globalMcp}
|
|
1322
1289
|
},worktrees,user:{...skippedSkillConfirmations&&{skippedSkillConfirmations},...typeof userInput?.onboardingCompleted==="boolean"&&{onboardingCompleted:userInput.onboardingCompleted
|
|
1323
|
-
},...Object.keys(layoutPresets).length
|
|
1290
|
+
},...Object.keys(layoutPresets).length>0&&{layoutPresets},...Object.keys(mcpPresets).length>0&&{mcpPresets},...favoriteSkills&&{favoriteSkills},...favoriteMcpServers?.length&&{favoriteMcpServers},...favoriteQuickActions.length>0&&{favoriteQuickActions},...recentSkills.length>0&&{recentSkills},...recentQuickActions.length>0&&{recentQuickActions},...Object.keys(mcpServerGroups).length>0&&{mcpServerGroups},...Object.keys(workspaceProfiles).length>0&&{workspaceProfiles}
|
|
1324
1291
|
}
|
|
1325
1292
|
}
|
|
1326
1293
|
}
|
|
@@ -1350,7 +1317,6 @@ Object.assign(desiredMcpStates,layer.desiredMcpStates)
|
|
|
1350
1317
|
}
|
|
1351
1318
|
return{behavior,layout:{sections,expanded,order},desiredMcpStates}
|
|
1352
1319
|
}
|
|
1353
|
-
|
|
1354
1320
|
import {randomUUID} from "crypto"
|
|
1355
1321
|
import {link,mkdir,readFile,readdir,rename,rm,unlink,writeFile} from "fs/promises"
|
|
1356
1322
|
import {join} from "path"
|
|
@@ -1361,9 +1327,9 @@ function delay(milliseconds) {return new Promise((resolve)=>setTimeout(resolve,m
|
|
|
1361
1327
|
}
|
|
1362
1328
|
function parseSkillConfirmations(value) {if (!Array.isArray(value))
|
|
1363
1329
|
return []
|
|
1364
|
-
return [...new Set(value.filter((item)=>typeof item==="string"&&item.length
|
|
1330
|
+
return [...new Set(value.filter((item)=>typeof item==="string"&&item.length>0))].sort()
|
|
1365
1331
|
}
|
|
1366
|
-
function targetPreferences(document,target) {return target.kind==="global"
|
|
1332
|
+
function targetPreferences(document,target) {return target.kind==="global"?document.global:document.worktrees[target.key]??{}
|
|
1367
1333
|
}
|
|
1368
1334
|
function isEmptyScope(value) {return !value.behavior&&!value.layout&&!value.mcp
|
|
1369
1335
|
}
|
|
@@ -1375,7 +1341,7 @@ else
|
|
|
1375
1341
|
delete profiles[layout]
|
|
1376
1342
|
}
|
|
1377
1343
|
}
|
|
1378
|
-
function applyPreferencesUpdate(current,update) {const target=update.target??(update.mcp?.scope
|
|
1344
|
+
function applyPreferencesUpdate(current,update) {const target=update.target??(update.mcp?.scope?targetForLegacyScope(update.mcp.scope):{kind:"global"})
|
|
1379
1345
|
const existing=targetPreferences(current,target)
|
|
1380
1346
|
if(update.expectedScope&&update.expectedScope!==JSON.stringify({layout:existing.layout,mcp:existing.mcp})) {throw new Error("Settings changed after this preview; reopen the import preview")
|
|
1381
1347
|
}
|
|
@@ -1383,18 +1349,18 @@ const behavior={...!update.clearBehavior&&existing.behavior,...parsePluginSettin
|
|
|
1383
1349
|
}
|
|
1384
1350
|
const sectionItemLimits={...!update.clearBehavior&&existing.behavior?.sectionItemLimits,...parsePluginSettings(update.behavior).sectionItemLimits
|
|
1385
1351
|
}
|
|
1386
|
-
if(Object.keys(sectionItemLimits).length
|
|
1352
|
+
if(Object.keys(sectionItemLimits).length>0)
|
|
1387
1353
|
behavior.sectionItemLimits=sectionItemLimits
|
|
1388
1354
|
const quickActionVisibility={...!update.clearBehavior&&existing.behavior?.quickActionVisibility,...parsePluginSettings(update.behavior).quickActionVisibility
|
|
1389
1355
|
}
|
|
1390
|
-
if(Object.keys(quickActionVisibility).length
|
|
1356
|
+
if(Object.keys(quickActionVisibility).length>0)
|
|
1391
1357
|
behavior.quickActionVisibility=quickActionVisibility
|
|
1392
1358
|
const mcpUpdate={...update.mcp?.states,...update.mcp?.name&&update.mcp.state&&{[update.mcp.name]:update.mcp.state}
|
|
1393
1359
|
}
|
|
1394
1360
|
const mcp=parseDesiredMcpStates({...!update.clearMcp&&existing.mcp,...mcpUpdate
|
|
1395
1361
|
})
|
|
1396
|
-
const scope={...Object.keys(behavior).length
|
|
1397
|
-
},...Object.keys(mcp).length
|
|
1362
|
+
const scope={...Object.keys(behavior).length>0&&{behavior},...(update.layout||!update.clearLayout&&existing.layout)&&{layout:parseSectionLayout(update.layout??existing.layout)
|
|
1363
|
+
},...Object.keys(mcp).length>0&&{mcp}
|
|
1398
1364
|
}
|
|
1399
1365
|
const worktrees={...current.worktrees}
|
|
1400
1366
|
if(target.kind==="worktree") {if (isEmptyScope(scope))
|
|
@@ -1402,7 +1368,7 @@ delete worktrees[target.key]
|
|
|
1402
1368
|
else
|
|
1403
1369
|
worktrees[target.key]=scope
|
|
1404
1370
|
}
|
|
1405
|
-
const skippedSkillConfirmations=new Set(update.user?.skippedSkillConfirmations
|
|
1371
|
+
const skippedSkillConfirmations=new Set(update.user?.skippedSkillConfirmations?parseSkillConfirmations(update.user.skippedSkillConfirmations):current.user.skippedSkillConfirmations)
|
|
1406
1372
|
const skillConfirmation=update.user?.skillConfirmation
|
|
1407
1373
|
if(update.user?.clearSkillConfirmations)
|
|
1408
1374
|
skippedSkillConfirmations.clear()
|
|
@@ -1427,12 +1393,12 @@ const mcpPresets={...update.user?.mcpPresets??current.user.mcpPresets}
|
|
|
1427
1393
|
const mcpPresetUpdate=update.user?.mcpPreset
|
|
1428
1394
|
if(mcpPresetUpdate) {const requested=mcpPresetUpdate.name.trim().slice(0,64)
|
|
1429
1395
|
const existingName=Object.keys(mcpPresets).find((name)=>name.toLocaleLowerCase()===requested.toLocaleLowerCase())
|
|
1430
|
-
if(mcpPresetUpdate.operation==="save"&&requested&&!existingName&&Object.keys(mcpPresets).length
|
|
1431
|
-
if(Object.keys(states).length
|
|
1396
|
+
if(mcpPresetUpdate.operation==="save"&&requested&&!existingName&&Object.keys(mcpPresets).length<50) {const states=parseDesiredMcpStates(mcpPresetUpdate.states)
|
|
1397
|
+
if(Object.keys(states).length>0)
|
|
1432
1398
|
mcpPresets[requested]=states
|
|
1433
1399
|
}
|
|
1434
1400
|
if(mcpPresetUpdate.operation==="update"&&existingName) {const states=parseDesiredMcpStates(mcpPresetUpdate.states)
|
|
1435
|
-
if(Object.keys(states).length
|
|
1401
|
+
if(Object.keys(states).length>0)
|
|
1436
1402
|
mcpPresets[existingName]=states
|
|
1437
1403
|
}
|
|
1438
1404
|
if(mcpPresetUpdate.operation==="rename"&&requested) {const previous=Object.keys(mcpPresets).find((name)=>name.toLocaleLowerCase()===mcpPresetUpdate.previousName.toLocaleLowerCase())
|
|
@@ -1451,7 +1417,7 @@ if(presetUpdate?.previousName&&workspaceProfiles[presetUpdate.previousName]) {wo
|
|
|
1451
1417
|
delete workspaceProfiles[presetUpdate.previousName]
|
|
1452
1418
|
} else if (presetUpdate&&!presetUpdate.layout)
|
|
1453
1419
|
delete workspaceProfiles[presetUpdate.name]
|
|
1454
|
-
const renamedMcp=mcpPresetUpdate?.operation==="rename"
|
|
1420
|
+
const renamedMcp=mcpPresetUpdate?.operation==="rename"?Object.keys(parsedMcpPresets).find((name)=>name.toLocaleLowerCase()===mcpPresetUpdate.name.trim().toLocaleLowerCase()):undefined
|
|
1455
1421
|
if(mcpPresetUpdate?.operation==="rename"&&renamedMcp) {retargetProfileMcp(workspaceProfiles,mcpPresetUpdate.previousName,renamedMcp)
|
|
1456
1422
|
} else if (mcpPresetUpdate?.operation==="delete"&&Object.keys(parsedMcpPresets).every((name)=>name.toLocaleLowerCase()!==mcpPresetUpdate.name.toLocaleLowerCase())) {retargetProfileMcp(workspaceProfiles,mcpPresetUpdate.name)
|
|
1457
1423
|
}
|
|
@@ -1476,9 +1442,9 @@ favoriteQuickActions.add(quickActionFavorite.id)
|
|
|
1476
1442
|
else
|
|
1477
1443
|
favoriteQuickActions.delete(quickActionFavorite.id)
|
|
1478
1444
|
}
|
|
1479
|
-
const recentSkills=parseRecentSkills([...update.user?.recentSkill
|
|
1445
|
+
const recentSkills=parseRecentSkills([...update.user?.recentSkill?[update.user.recentSkill]:[],...current.user.recentSkills??[]
|
|
1480
1446
|
])
|
|
1481
|
-
const recentQuickActions=parseRecentQuickActions([...update.user?.recentQuickAction
|
|
1447
|
+
const recentQuickActions=parseRecentQuickActions([...update.user?.recentQuickAction?[update.user.recentQuickAction]:[],...current.user.recentQuickActions??[]
|
|
1482
1448
|
])
|
|
1483
1449
|
const mcpServerGroups={...current.user.mcpServerGroups}
|
|
1484
1450
|
const groupUpdate=update.user?.mcpServerGroup
|
|
@@ -1488,7 +1454,7 @@ mcpServerGroups[groupUpdate.name]=canonical??group
|
|
|
1488
1454
|
} else
|
|
1489
1455
|
delete mcpServerGroups[groupUpdate.name]
|
|
1490
1456
|
}
|
|
1491
|
-
const favoriteSkills=update.user?.favoriteSkills
|
|
1457
|
+
const favoriteSkills=update.user?.favoriteSkills?parseSkillConfirmations(update.user.favoriteSkills):[...current.user.favoriteSkills??[]]
|
|
1492
1458
|
const favoriteSkill=update.user?.favoriteSkill
|
|
1493
1459
|
if(favoriteSkill?.location) {const index=favoriteSkills.indexOf(favoriteSkill.location)
|
|
1494
1460
|
if(favoriteSkill.favorite&&index===-1)
|
|
@@ -1497,15 +1463,15 @@ if(!favoriteSkill.favorite&&index!==-1)
|
|
|
1497
1463
|
favoriteSkills.splice(index,1)
|
|
1498
1464
|
favoriteSkills.sort()
|
|
1499
1465
|
}
|
|
1500
|
-
const onboardingCompleted=typeof update.user?.onboardingCompleted==="boolean"
|
|
1501
|
-
return{global:target.kind==="global"
|
|
1502
|
-
},...typeof onboardingCompleted==="boolean"&&{onboardingCompleted},...Object.keys(parsedLayoutPresets).length
|
|
1503
|
-
},...favoriteSkills.length
|
|
1504
|
-
},...recentSkills.length
|
|
1466
|
+
const onboardingCompleted=typeof update.user?.onboardingCompleted==="boolean"?update.user.onboardingCompleted:current.user.onboardingCompleted
|
|
1467
|
+
return{global:target.kind==="global"?scope:current.global,worktrees,user:{...skippedSkillConfirmations.size>0&&{skippedSkillConfirmations:[...skippedSkillConfirmations].sort()
|
|
1468
|
+
},...typeof onboardingCompleted==="boolean"&&{onboardingCompleted},...Object.keys(parsedLayoutPresets).length>0&&{layoutPresets:parsedLayoutPresets},...Object.keys(parsedMcpPresets).length>0&&{mcpPresets:parsedMcpPresets},...Object.keys(workspaceProfiles).length>0&&{workspaceProfiles:parseWorkspaceProfiles(workspaceProfiles)
|
|
1469
|
+
},...favoriteSkills.length>0&&{favoriteSkills},...favoriteMcpServers.size>0&&{favoriteMcpServers:[...favoriteMcpServers].sort()},...favoriteQuickActions.size>0&&{favoriteQuickActions:parseFavoriteQuickActions([...favoriteQuickActions])
|
|
1470
|
+
},...recentSkills.length>0&&{recentSkills},...recentQuickActions.length>0&&{recentQuickActions},...Object.keys(mcpServerGroups).length>0&&{mcpServerGroups:parseMcpServerGroups(mcpServerGroups)}
|
|
1505
1471
|
}
|
|
1506
1472
|
}
|
|
1507
1473
|
}
|
|
1508
|
-
function targetForLegacyScope(scope) {return scope==="global"
|
|
1474
|
+
function targetForLegacyScope(scope) {return scope==="global"?{kind:"global"}:{kind:"worktree",key:scope}
|
|
1509
1475
|
}
|
|
1510
1476
|
function createPreferencesStore(stateDirectory) {const directory=join(stateDirectory,LEGACY_PLUGIN_ID)
|
|
1511
1477
|
const file=join(directory,"preferences.json")
|
|
@@ -1557,7 +1523,7 @@ async function reapStaleLock(owner) {const token=Buffer.from(owner.token).toStri
|
|
|
1557
1523
|
const prefix=`preferences.lock.recover.${token}.`
|
|
1558
1524
|
const recovery=join(directory,`${prefix}${Date.now().toString().padStart(13, "0")}.${process.pid}.${randomUUID()}`)
|
|
1559
1525
|
const markers=await liveRecoveryMarkers(prefix)
|
|
1560
|
-
if(markers.length
|
|
1526
|
+
if(markers.length>0)
|
|
1561
1527
|
return false
|
|
1562
1528
|
const candidate=`${recovery}.candidate`
|
|
1563
1529
|
await writeFile(candidate,JSON.stringify({token:owner.token,pid:process.pid}),{flag:"wx",mode:384})
|
|
@@ -1613,7 +1579,7 @@ const deadline=Date.now() + LOCK_TIMEOUT_MS
|
|
|
1613
1579
|
while(true) {const release=await tryAcquireLock()
|
|
1614
1580
|
if(release)
|
|
1615
1581
|
return release
|
|
1616
|
-
if(Date.now()
|
|
1582
|
+
if(Date.now()>=deadline)
|
|
1617
1583
|
throw new Error(`Timed out waiting for preferences lock: ${lock}`)
|
|
1618
1584
|
await delay(10)
|
|
1619
1585
|
}
|
|
@@ -1656,14 +1622,13 @@ await write(applyPreferencesUpdate(current,update))
|
|
|
1656
1622
|
}
|
|
1657
1623
|
}
|
|
1658
1624
|
}
|
|
1659
|
-
|
|
1660
1625
|
function swap(items,first,second) {const value=items[first]
|
|
1661
1626
|
items[first]=items[second]
|
|
1662
1627
|
items[second]=value
|
|
1663
1628
|
}
|
|
1664
|
-
function targetKey(target) {return target.kind==="global"
|
|
1629
|
+
function targetKey(target) {return target.kind==="global"?"global":`worktree:${target.key}`
|
|
1665
1630
|
}
|
|
1666
|
-
function targetForScope(scope) {return scope==="global"
|
|
1631
|
+
function targetForScope(scope) {return scope==="global"?{kind:"global"}:{kind:"worktree",key:scope}
|
|
1667
1632
|
}
|
|
1668
1633
|
function values(scope) {if (!scope)
|
|
1669
1634
|
return
|
|
@@ -1706,22 +1671,22 @@ function skillKey(skill) {return skill.location
|
|
|
1706
1671
|
function showPersistenceWarning(cause) {if (isPersistenceWarningShown)
|
|
1707
1672
|
return
|
|
1708
1673
|
isPersistenceWarningShown=true
|
|
1709
|
-
api.ui.toast({variant:"warning",title:"Navigator settings",message:cause instanceof Error
|
|
1674
|
+
api.ui.toast({variant:"warning",title:"Navigator settings",message:cause instanceof Error?cause.message:"Navigator settings could not be saved",duration:4000
|
|
1710
1675
|
})
|
|
1711
1676
|
}
|
|
1712
1677
|
function persist(request) {request.catch(showPersistenceWarning)
|
|
1713
1678
|
}
|
|
1714
|
-
function validKey(value) {try {return api.keymap?.parseKeySequence
|
|
1679
|
+
function validKey(value) {try {return api.keymap?.parseKeySequence?api.keymap.parseKeySequence(value).length>0:Boolean(value.trim())
|
|
1715
1680
|
} catch {return false
|
|
1716
1681
|
}
|
|
1717
1682
|
}
|
|
1718
|
-
function resolveTarget(target,session=true) {const worktree=target.kind==="worktree"
|
|
1719
|
-
const globalSession=session
|
|
1683
|
+
function resolveTarget(target,session=true) {const worktree=target.kind==="worktree"?document.worktrees[target.key]:undefined
|
|
1684
|
+
const globalSession=session?sessionLayouts.get("global"):undefined
|
|
1720
1685
|
const global=values(document.global)
|
|
1721
1686
|
const result=resolvePreferences({builtIns,pluginOptions:configured,global:{...global,...globalSession&&{layout:mergeSessionLayout(document.global.layout,globalSession)}
|
|
1722
|
-
},worktree:values(worktree),session:session&&target.kind==="worktree"
|
|
1687
|
+
},worktree:values(worktree),session:session&&target.kind==="worktree"?{layout:sessionLayouts.get(targetKey(target))}:undefined
|
|
1723
1688
|
})
|
|
1724
|
-
return{...result,behavior:{...result.behavior,toggleKey:validKey(result.behavior.toggleKey)
|
|
1689
|
+
return{...result,behavior:{...result.behavior,toggleKey:validKey(result.behavior.toggleKey)?result.behavior.toggleKey:defaults.toggleKey,focusKey:validKey(result.behavior.focusKey)?result.behavior.focusKey:defaults.focusKey,searchKey:validKey(result.behavior.searchKey)?result.behavior.searchKey:defaults.searchKey
|
|
1725
1690
|
}
|
|
1726
1691
|
}
|
|
1727
1692
|
}
|
|
@@ -1729,7 +1694,7 @@ function refreshResolved() {setResolved(resolveTarget(activeTarget()))
|
|
|
1729
1694
|
setRevision((value)=>value + 1)
|
|
1730
1695
|
}
|
|
1731
1696
|
function selectedTarget() {const active=activeTarget()
|
|
1732
|
-
return preferenceScope()==="worktree"&&active.kind==="worktree"
|
|
1697
|
+
return preferenceScope()==="worktree"&&active.kind==="worktree"?active:{kind:"global"}
|
|
1733
1698
|
}
|
|
1734
1699
|
function selectedResolved() {revision()
|
|
1735
1700
|
return resolveTarget(selectedTarget(),false)
|
|
@@ -1740,7 +1705,7 @@ return resolveTarget(selectedTarget())
|
|
|
1740
1705
|
function workspaceProfiles() {revision()
|
|
1741
1706
|
return{...configured.workspaceProfiles,...document.user.workspaceProfiles}
|
|
1742
1707
|
}
|
|
1743
|
-
function scopeSnapshot(target=selectedTarget()) {const scope=target.kind==="global"
|
|
1708
|
+
function scopeSnapshot(target=selectedTarget()) {const scope=target.kind==="global"?document.global:document.worktrees[target.key]
|
|
1744
1709
|
return JSON.stringify({layout:scope?.layout,mcp:scope?.mcp})
|
|
1745
1710
|
}
|
|
1746
1711
|
function update(change) {document=applyPreferencesUpdate(document,change)
|
|
@@ -1785,7 +1750,7 @@ if(!validKey(next))
|
|
|
1785
1750
|
throw new Error("Enter a valid OpenCode keybinding")
|
|
1786
1751
|
update({target:selectedTarget(),behavior:{[name]:next}})
|
|
1787
1752
|
}
|
|
1788
|
-
function setTargetSessionLayout(target,layout,replace=false) {const current=replace
|
|
1753
|
+
function setTargetSessionLayout(target,layout,replace=false) {const current=replace?undefined:sessionLayouts.get(targetKey(target))
|
|
1789
1754
|
const order=layout.order??current?.order
|
|
1790
1755
|
sessionLayouts.set(targetKey(target),{sections:{...current?.sections,...layout.sections},expanded:{...current?.expanded,...layout.expanded},...order&&{order:[...order]}
|
|
1791
1756
|
})
|
|
@@ -1798,7 +1763,7 @@ function setSelectedSessionLayout(layout,replace=false) {setTargetSessionLayout(
|
|
|
1798
1763
|
function normalizePresetName(value) {const name=value.trim()
|
|
1799
1764
|
if(!name)
|
|
1800
1765
|
throw new Error("Enter a preset name")
|
|
1801
|
-
if(name.length
|
|
1766
|
+
if(name.length>64)
|
|
1802
1767
|
throw new Error("Preset names can contain at most 64 characters")
|
|
1803
1768
|
return name
|
|
1804
1769
|
}
|
|
@@ -1817,7 +1782,7 @@ return
|
|
|
1817
1782
|
mcpPresetReconciliation=store.flush().then(()=>store.load()).then((latest)=>{if (generation!==mcpPresetRevision)
|
|
1818
1783
|
return
|
|
1819
1784
|
const actual=latest.user.mcpPresets??{}
|
|
1820
|
-
document={...document,user:{...document.user,mcpPresets:Object.keys(actual).length
|
|
1785
|
+
document={...document,user:{...document.user,mcpPresets:Object.keys(actual).length>0?actual:undefined}
|
|
1821
1786
|
}
|
|
1822
1787
|
setMcpPresets({...configured.mcpPresets,...actual})
|
|
1823
1788
|
const name=Object.keys(actual).find((candidate)=>candidate.toLocaleLowerCase()===mcpPreset.name.toLocaleLowerCase())
|
|
@@ -1879,11 +1844,11 @@ update({target:selectedTarget(),behavior:{quickActionVisibility:{[id]:selectedRe
|
|
|
1879
1844
|
const order=[...selectedResolved().behavior.quickActionOrder]
|
|
1880
1845
|
const index=order.indexOf(id)
|
|
1881
1846
|
const destination=index + direction
|
|
1882
|
-
if(index===-1||destination
|
|
1847
|
+
if(index===-1||destination<0||destination>=order.length)
|
|
1883
1848
|
return
|
|
1884
1849
|
swap(order,index,destination)
|
|
1885
1850
|
update({target:selectedTarget(),behavior:{quickActionOrder:order}})
|
|
1886
|
-
},sectionItemLimit:(section)=>resolved().behavior.sectionItemLimits[section]??0,selectedSectionItemLimit:(section)=>selectedResolved().behavior.sectionItemLimits[section]??0,setSectionItemLimit(section,value) {if (!Number.isSafeInteger(value)||value
|
|
1851
|
+
},sectionItemLimit:(section)=>resolved().behavior.sectionItemLimits[section]??0,selectedSectionItemLimit:(section)=>selectedResolved().behavior.sectionItemLimits[section]??0,setSectionItemLimit(section,value) {if (!Number.isSafeInteger(value)||value<0)
|
|
1887
1852
|
throw new Error("Enter a non-negative whole number (0 for All)")
|
|
1888
1853
|
load()
|
|
1889
1854
|
update({target:selectedTarget(),behavior:{sectionItemLimits:{[section]:value}}})
|
|
@@ -1892,10 +1857,10 @@ update({target:selectedTarget(),behavior:{sectionItemLimits:{[section]:value}}})
|
|
|
1892
1857
|
const parsed=parsePortableSettings(source)
|
|
1893
1858
|
const target=selectedTarget()
|
|
1894
1859
|
const current=selectedResolved()
|
|
1895
|
-
const scope=target.kind==="global"
|
|
1860
|
+
const scope=target.kind==="global"?document.global:document.worktrees[target.key]??{}
|
|
1896
1861
|
const imported={...scope,...parsed.settings.layout&&{layout:parsed.settings.layout},...parsed.settings.mcp&&{mcp:parsed.settings.mcp}
|
|
1897
1862
|
}
|
|
1898
|
-
const next=resolvePreferences({builtIns,pluginOptions:configured,global:values(target.kind==="global"
|
|
1863
|
+
const next=resolvePreferences({builtIns,pluginOptions:configured,global:values(target.kind==="global"?imported:document.global),worktree:target.kind==="worktree"?values(imported):undefined
|
|
1899
1864
|
})
|
|
1900
1865
|
const layoutChanged=Boolean(parsed.settings.layout&&JSON.stringify(next.layout)!==JSON.stringify(selectedLayoutResolved().layout))
|
|
1901
1866
|
const mcpChanged=Boolean(parsed.settings.mcp&&JSON.stringify(next.desiredMcpStates)!==JSON.stringify(current.desiredMcpStates))
|
|
@@ -1934,7 +1899,7 @@ update({user:{recentSkill:skill.location}})
|
|
|
1934
1899
|
setRecentQuickActions(parseRecentQuickActions([id,...recentQuickActions()]))
|
|
1935
1900
|
update({user:{recentQuickAction:id}})
|
|
1936
1901
|
},ready,preferenceScope,selectedScopeKey:()=>targetKey(selectedTarget()),canUseWorktreeScope:()=>activeTarget().kind==="worktree",preferenceScopeLabel:()=>{const target=activeTarget()
|
|
1937
|
-
return preferenceScope()==="worktree"&&target.kind==="worktree"
|
|
1902
|
+
return preferenceScope()==="worktree"&&target.kind==="worktree"?target.key:"Global"
|
|
1938
1903
|
},skippedSkillCount:()=>skippedSkills().size,trustedSkillLocations:()=>[...skippedSkills()].sort(),load,setActiveScope(scope) {const next=targetForScope(scope)
|
|
1939
1904
|
if(targetKey(next)===targetKey(activeTarget()))
|
|
1940
1905
|
return
|
|
@@ -1942,7 +1907,7 @@ setActiveTarget(next)
|
|
|
1942
1907
|
if(next.kind==="global"&&preferenceScope()==="worktree")
|
|
1943
1908
|
setPreferenceScope("global")
|
|
1944
1909
|
refreshResolved()
|
|
1945
|
-
},setPreferenceScope(scope) {setPreferenceScope(scope==="worktree"&&activeTarget().kind==="global"
|
|
1910
|
+
},setPreferenceScope(scope) {setPreferenceScope(scope==="worktree"&&activeTarget().kind==="global"?"global":scope)
|
|
1946
1911
|
setRevision((value)=>value + 1)
|
|
1947
1912
|
},async flush() {await hydration
|
|
1948
1913
|
await store.flush()
|
|
@@ -1957,7 +1922,7 @@ setSessionLayout({expanded:{[name]:!resolved().layout.expanded[name]}
|
|
|
1957
1922
|
const order=[...resolved().layout.order]
|
|
1958
1923
|
const index=order.indexOf(name)
|
|
1959
1924
|
const destination=index + direction
|
|
1960
|
-
if(index===-1||destination
|
|
1925
|
+
if(index===-1||destination<0||destination>=order.length)
|
|
1961
1926
|
return
|
|
1962
1927
|
swap(order,index,destination)
|
|
1963
1928
|
setSessionLayout({order})
|
|
@@ -1969,7 +1934,7 @@ const layout=resolveTarget(selectedTarget()).layout
|
|
|
1969
1934
|
const order=[...layout.order]
|
|
1970
1935
|
const index=order.indexOf(name)
|
|
1971
1936
|
const destination=index + direction
|
|
1972
|
-
if(index===-1||destination
|
|
1937
|
+
if(index===-1||destination<0||destination>=order.length)
|
|
1973
1938
|
return
|
|
1974
1939
|
swap(order,index,destination)
|
|
1975
1940
|
setSelectedSessionLayout({order})
|
|
@@ -1980,7 +1945,7 @@ setSelectedSessionLayout(layoutPresetPreview(selectedLayoutResolved().layout,pre
|
|
|
1980
1945
|
const name=normalizePresetName(value)
|
|
1981
1946
|
if(Object.keys(layoutPresets()).some((candidate)=>candidate.toLocaleLowerCase()===name.toLocaleLowerCase())) {throw new Error("A preset with this name already exists")
|
|
1982
1947
|
}
|
|
1983
|
-
if(Object.keys(layoutPresets()).length
|
|
1948
|
+
if(Object.keys(layoutPresets()).length>=50)
|
|
1984
1949
|
throw new Error("You can save at most 50 layout presets")
|
|
1985
1950
|
const layout=currentLayoutPreset()
|
|
1986
1951
|
persistLayoutPresets({...layoutPresets(),[name]:layout},{name,layout})
|
|
@@ -2013,7 +1978,7 @@ throw new Error("There are no MCP servers to save")
|
|
|
2013
1978
|
const name=normalizePresetName(value)
|
|
2014
1979
|
if(Object.keys(mcpPresets()).some((candidate)=>candidate.toLocaleLowerCase()===name.toLocaleLowerCase())) {throw new Error("A preset with this name already exists")
|
|
2015
1980
|
}
|
|
2016
|
-
if(Object.keys(mcpPresets()).length
|
|
1981
|
+
if(Object.keys(mcpPresets()).length>=50)
|
|
2017
1982
|
throw new Error("You can save at most 50 MCP presets")
|
|
2018
1983
|
const preset={...states}
|
|
2019
1984
|
persistMcpPresets({...mcpPresets(),[name]:preset},{operation:"save",name,states:preset})
|
|
@@ -2063,10 +2028,10 @@ update({target:selectedTarget(),behavior:{persistMcp:!selectedResolved().behavio
|
|
|
2063
2028
|
},toggleCornerFont() {load()
|
|
2064
2029
|
update({target:selectedTarget(),behavior:{cornerFont:!selectedResolved().behavior.cornerFont}})
|
|
2065
2030
|
},toggleLspIconStyle() {load()
|
|
2066
|
-
update({target:selectedTarget(),behavior:{lspIconStyle:selectedResolved().behavior.lspIconStyle==="nerd"
|
|
2031
|
+
update({target:selectedTarget(),behavior:{lspIconStyle:selectedResolved().behavior.lspIconStyle==="nerd"?"text":"nerd"}
|
|
2067
2032
|
})
|
|
2068
2033
|
},toggleRowDensity() {load()
|
|
2069
|
-
update({target:selectedTarget(),behavior:{rowDensity:selectedResolved().behavior.rowDensity==="compact"
|
|
2034
|
+
update({target:selectedTarget(),behavior:{rowDensity:selectedResolved().behavior.rowDensity==="compact"?"comfortable":"compact"}
|
|
2070
2035
|
})
|
|
2071
2036
|
},resetPluginSettings() {load()
|
|
2072
2037
|
update({target:selectedTarget(),clearBehavior:true})
|
|
@@ -2106,12 +2071,11 @@ update({target:targetForScope(scope),mcp:{states}})
|
|
|
2106
2071
|
}
|
|
2107
2072
|
}
|
|
2108
2073
|
}
|
|
2109
|
-
|
|
2110
2074
|
function record2(value) {if (!value||typeof value!=="object"||Array.isArray(value))
|
|
2111
2075
|
return
|
|
2112
2076
|
return value
|
|
2113
2077
|
}
|
|
2114
|
-
function present(value) {return value&&Object.keys(value).length
|
|
2078
|
+
function present(value) {return value&&Object.keys(value).length>0
|
|
2115
2079
|
}
|
|
2116
2080
|
function parseConfiguredDefaults(value) {const input=record2(value)
|
|
2117
2081
|
if(!input)
|
|
@@ -2129,7 +2093,7 @@ return{...present(behavior)&&{behavior},...layout&&{layout},...present(desiredMc
|
|
|
2129
2093
|
function mergeRecords(left,right) {const result={...left}
|
|
2130
2094
|
for(const [key,value] of Object.entries(right)) {const previous=record2(result[key])
|
|
2131
2095
|
const next=record2(value)
|
|
2132
|
-
result[key]=previous&&next
|
|
2096
|
+
result[key]=previous&&next?mergeRecords(previous,next):value
|
|
2133
2097
|
}
|
|
2134
2098
|
return result
|
|
2135
2099
|
}
|
|
@@ -2144,7 +2108,6 @@ return{behavior,layout:{sections,expanded:{},...sectionOrder&&{order:sectionOrde
|
|
|
2144
2108
|
}
|
|
2145
2109
|
function configuredDefaultsFromPluginOptions(options) {return mergeConfiguredDefaults(legacyDefaults(pluginConfig(options)),parseConfiguredDefaults(options??{}))
|
|
2146
2110
|
}
|
|
2147
|
-
|
|
2148
2111
|
import {createSignal as createSignal5} from "solid-js"
|
|
2149
2112
|
function createSkillController(api) {const [skills,setSkills]=createSignal5({})
|
|
2150
2113
|
const refreshing=new Map
|
|
@@ -2215,7 +2178,6 @@ throw error_
|
|
|
2215
2178
|
}
|
|
2216
2179
|
}
|
|
2217
2180
|
}
|
|
2218
|
-
|
|
2219
2181
|
import {effect as _$effect10} from "@opentui/solid"
|
|
2220
2182
|
import {createComponent as _$createComponent11} from "@opentui/solid"
|
|
2221
2183
|
import {memo as _$memo8} from "@opentui/solid"
|
|
@@ -2226,7 +2188,6 @@ import {setProp as _$setProp10} from "@opentui/solid"
|
|
|
2226
2188
|
import {createElement as _$createElement11} from "@opentui/solid"
|
|
2227
2189
|
import {TextAttributes as TextAttributes6} from "@opentui/core"
|
|
2228
2190
|
import {createSignal as createSignal6,onCleanup as onCleanup3} from "solid-js"
|
|
2229
|
-
|
|
2230
2191
|
import {createComponent as _$createComponent10} from "@opentui/solid"
|
|
2231
2192
|
import {effect as _$effect8} from "@opentui/solid"
|
|
2232
2193
|
import {memo as _$memo6} from "@opentui/solid"
|
|
@@ -2250,34 +2211,34 @@ _$insertNode5(_el$4,_el$6)
|
|
|
2250
2211
|
_$insertNode5(_el$4,_el$8)
|
|
2251
2212
|
_$setProp8(_el$4,"flexDirection","row")
|
|
2252
2213
|
_$setProp8(_el$4,"gap",1)
|
|
2253
|
-
_$insert8(_el$5,()=>icons.icon(props.skip
|
|
2214
|
+
_$insert8(_el$5,()=>icons.icon(props.skip?"checked":"unchecked"))
|
|
2254
2215
|
_$insertNode5(_el$6,_$createTextNode4(`Don't show again for this skill`))
|
|
2255
2216
|
_$insertNode5(_el$8,_el$9)
|
|
2256
2217
|
_$insertNode5(_el$8,_el$0)
|
|
2257
2218
|
_$insert8(_el$8,()=>icons.key("space"),_el$0)
|
|
2258
2219
|
_$setProp8(_el$1,"flexDirection","row")
|
|
2259
2220
|
_$setProp8(_el$1,"justifyContent","flex-end")
|
|
2260
|
-
_$insert8(_el$1,_$createComponent10(SelectionBox,{paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo6(()=>props.active==="cancel")()
|
|
2221
|
+
_$insert8(_el$1,_$createComponent10(SelectionBox,{paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo6(()=>props.active==="cancel")()?theme().primary:undefined
|
|
2261
2222
|
},onMouseOver:()=>props.onActive("cancel"),onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
2262
2223
|
props.onCancel()
|
|
2263
2224
|
},get children() {var _el$10=_$createElement9("text"),_el$11=_$createTextNode4(` Cancel`)
|
|
2264
2225
|
_$insertNode5(_el$10,_el$11)
|
|
2265
2226
|
_$insert8(_el$10,()=>icons.icon("close"),_el$11)
|
|
2266
|
-
_$effect8((_$p)=>_$setProp8(_el$10,"fg",props.active==="cancel"
|
|
2227
|
+
_$effect8((_$p)=>_$setProp8(_el$10,"fg",props.active==="cancel"?theme().selectedListItemText:theme().textMuted,_$p))
|
|
2267
2228
|
return _el$10
|
|
2268
2229
|
}
|
|
2269
2230
|
}),null)
|
|
2270
|
-
_$insert8(_el$1,_$createComponent10(SelectionBox,{paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo6(()=>props.active==="accept")()
|
|
2231
|
+
_$insert8(_el$1,_$createComponent10(SelectionBox,{paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo6(()=>props.active==="accept")()?theme().primary:undefined
|
|
2271
2232
|
},onMouseOver:()=>props.onActive("accept"),onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
2272
2233
|
props.onAccept()
|
|
2273
2234
|
},get children() {var _el$12=_$createElement9("text"),_el$13=_$createTextNode4(` Accept`)
|
|
2274
2235
|
_$insertNode5(_el$12,_el$13)
|
|
2275
2236
|
_$insert8(_el$12,()=>icons.icon("done"),_el$13)
|
|
2276
|
-
_$effect8((_$p)=>_$setProp8(_el$12,"fg",props.active==="accept"
|
|
2237
|
+
_$effect8((_$p)=>_$setProp8(_el$12,"fg",props.active==="accept"?theme().selectedListItemText:theme().textMuted,_$p))
|
|
2277
2238
|
return _el$12
|
|
2278
2239
|
}
|
|
2279
2240
|
}),null)
|
|
2280
|
-
_$effect8((_p$)=>{var _v$=theme().borderSubtle,_v$2=theme().accent,_v$3=TextAttributes4.BOLD,_v$4=props.onToggleSkip,_v$5=props.skip
|
|
2241
|
+
_$effect8((_p$)=>{var _v$=theme().borderSubtle,_v$2=theme().accent,_v$3=TextAttributes4.BOLD,_v$4=props.onToggleSkip,_v$5=props.skip?theme().accent:theme().textMuted,_v$6=theme().text,_v$7=theme().textMuted
|
|
2281
2242
|
_v$!==_p$.e&&(_p$.e=_$setProp8(_el$,"borderColor",_v$,_p$.e))
|
|
2282
2243
|
_v$2!==_p$.t&&(_p$.t=_$setProp8(_el$2,"fg",_v$2,_p$.t))
|
|
2283
2244
|
_v$3!==_p$.a&&(_p$.a=_$setProp8(_el$2,"attributes",_v$3,_p$.a))
|
|
@@ -2291,7 +2252,6 @@ return _p$
|
|
|
2291
2252
|
return _el$
|
|
2292
2253
|
})()
|
|
2293
2254
|
}
|
|
2294
|
-
|
|
2295
2255
|
import {effect as _$effect9} from "@opentui/solid"
|
|
2296
2256
|
import {memo as _$memo7} from "@opentui/solid"
|
|
2297
2257
|
import {createTextNode as _$createTextNode5} from "@opentui/solid"
|
|
@@ -2308,7 +2268,7 @@ const theme=()=>props.api.theme.current
|
|
|
2308
2268
|
return (()=>{var _el$=_$createElement10("scrollbox"),_el$2=_$createElement10("box"),_el$3=_$createElement10("box"),_el$4=_$createElement10("text"),_el$5=_$createTextNode5(` Description`),_el$6=_$createElement10("text"),_el$7=_$createElement10("box"),_el$8=_$createElement10("text"),_el$9=_$createTextNode5(` Source`),_el$0=_$createElement10("text")
|
|
2309
2269
|
_$insertNode6(_el$,_el$2)
|
|
2310
2270
|
var _ref$=props.ref
|
|
2311
|
-
typeof _ref$==="function"
|
|
2271
|
+
typeof _ref$==="function"?_$use3(_ref$,_el$):props.ref=_el$
|
|
2312
2272
|
_$setProp9(_el$,"contentOptions",{minHeight:0
|
|
2313
2273
|
})
|
|
2314
2274
|
_$setProp9(_el$,"scrollX",false)
|
|
@@ -2342,7 +2302,6 @@ return _p$
|
|
|
2342
2302
|
return _el$
|
|
2343
2303
|
})()
|
|
2344
2304
|
}
|
|
2345
|
-
|
|
2346
2305
|
function SkillDialog(props) {const icons=useIcons()
|
|
2347
2306
|
const dialogs=useDialogs(props.api)
|
|
2348
2307
|
const [skipConfirmation,setSkipConfirmation]=createSignal6(false)
|
|
@@ -2355,7 +2314,7 @@ props.onAccept(isSkip)
|
|
|
2355
2314
|
}
|
|
2356
2315
|
function cancel() {dialogs.back()
|
|
2357
2316
|
}
|
|
2358
|
-
function move(offset) {const actions=props.favoriteDisabled
|
|
2317
|
+
function move(offset) {const actions=props.favoriteDisabled?["accept","cancel"]:["accept","cancel","favorite"]
|
|
2359
2318
|
const index=actions.indexOf(active())
|
|
2360
2319
|
setActive(actions[(index + offset + actions.length) % actions.length])
|
|
2361
2320
|
}
|
|
@@ -2367,7 +2326,7 @@ else if (!props.favoriteDisabled)
|
|
|
2367
2326
|
props.onToggleFavorite()
|
|
2368
2327
|
}
|
|
2369
2328
|
function confirmationAction() {const action=active()
|
|
2370
|
-
return action==="favorite"
|
|
2329
|
+
return action==="favorite"?undefined:action
|
|
2371
2330
|
}
|
|
2372
2331
|
const unregister=props.api.keymap.registerLayer({mode:"modal",priority:1000,commands:[{name:`${PLUGIN_ID}.skill-dialog.scroll-up`,run:()=>body?.scrollBy(-1)
|
|
2373
2332
|
},{name:`${PLUGIN_ID}.skill-dialog.scroll-down`,run:()=>body?.scrollBy(1)
|
|
@@ -2401,8 +2360,8 @@ _$setProp10(_el$4,"flexDirection","row")
|
|
|
2401
2360
|
_$setProp10(_el$4,"gap",1)
|
|
2402
2361
|
_$setProp10(_el$4,"alignItems","center")
|
|
2403
2362
|
_$insert10(_el$4,_$createComponent11(BookmarkControl,{get bookmarked() {return props.favorite
|
|
2404
|
-
},get backgroundColor() {return _$memo8(()=>active()==="favorite")()
|
|
2405
|
-
},get foregroundColor() {return _$memo8(()=>!!props.favoriteDisabled)()
|
|
2363
|
+
},get backgroundColor() {return _$memo8(()=>active()==="favorite")()?theme().primary:undefined
|
|
2364
|
+
},get foregroundColor() {return _$memo8(()=>!!props.favoriteDisabled)()?theme().textMuted:_$memo8(()=>active()==="favorite")()?theme().selectedListItemText:theme().warning
|
|
2406
2365
|
},onMouseOver:()=>{if (!props.favoriteDisabled)
|
|
2407
2366
|
setActive("favorite")
|
|
2408
2367
|
},onMouseUp:()=>{if (!props.favoriteDisabled)
|
|
@@ -2433,9 +2392,7 @@ return _el$
|
|
|
2433
2392
|
}
|
|
2434
2393
|
})
|
|
2435
2394
|
}
|
|
2436
|
-
|
|
2437
2395
|
import {batch,createSignal as createSignal8} from "solid-js"
|
|
2438
|
-
|
|
2439
2396
|
import {createSignal as createSignal7} from "solid-js"
|
|
2440
2397
|
function createSubagentHistory({now=Date.now}={}) {const targets=new Map
|
|
2441
2398
|
const [revision,setRevision]=createSignal7(0)
|
|
@@ -2466,18 +2423,18 @@ changed()
|
|
|
2466
2423
|
return
|
|
2467
2424
|
const value=state(key)
|
|
2468
2425
|
const run=value.active.get(sessionID)??value.recent.find((item)=>item.sessionID===sessionID)
|
|
2469
|
-
if(!run||at
|
|
2426
|
+
if(!run||at<run.startedAt&&!run.startedBeforeObservation)
|
|
2470
2427
|
return
|
|
2471
2428
|
const isCancelled=error?.name==="MessageAbortedError"
|
|
2472
|
-
const data=error&&"data" in error
|
|
2473
|
-
const fallbackMessage=isCancelled
|
|
2474
|
-
const message=data&&"message" in data&&typeof data.message==="string"
|
|
2475
|
-
const next={...run,startedAt:Math.min(run.startedAt,at),outcome:isCancelled
|
|
2429
|
+
const data=error&&"data" in error?error.data:undefined
|
|
2430
|
+
const fallbackMessage=isCancelled?"Session aborted":"Session error"
|
|
2431
|
+
const message=data&&"message" in data&&typeof data.message==="string"?data.message:fallbackMessage
|
|
2432
|
+
const next={...run,startedAt:Math.min(run.startedAt,at),outcome:isCancelled?"cancelled":"error",errorMessage:message
|
|
2476
2433
|
}
|
|
2477
2434
|
if(value.active.has(sessionID))
|
|
2478
2435
|
value.active.set(sessionID,next)
|
|
2479
2436
|
else
|
|
2480
|
-
value.recent=value.recent.map((item)=>item.sessionID===sessionID
|
|
2437
|
+
value.recent=value.recent.map((item)=>item.sessionID===sessionID?next:item)
|
|
2481
2438
|
changed()
|
|
2482
2439
|
},remove(key,sessionID) {const value=targets.get(key)
|
|
2483
2440
|
if(!value)
|
|
@@ -2493,7 +2450,6 @@ return targets.get(key)?.recent??[]
|
|
|
2493
2450
|
}
|
|
2494
2451
|
}
|
|
2495
2452
|
}
|
|
2496
|
-
|
|
2497
2453
|
var POLL_INTERVAL_MS=5000
|
|
2498
2454
|
function activeStatus(status) {return status?.type==="busy"||status?.type==="retry"
|
|
2499
2455
|
}
|
|
@@ -2516,14 +2472,14 @@ const workspace=parent?.workspaceID
|
|
|
2516
2472
|
return{key:JSON.stringify([parentID,directory,workspace??null]),parentID,routing:{directory,...workspace&&{workspace}}
|
|
2517
2473
|
}
|
|
2518
2474
|
}
|
|
2519
|
-
function applySession(items,parentID,mutation) {const next=items.filter((item)=>item.id!==(mutation.type==="upsert"
|
|
2475
|
+
function applySession(items,parentID,mutation) {const next=items.filter((item)=>item.id!==(mutation.type==="upsert"?mutation.info.id:mutation.sessionID))
|
|
2520
2476
|
if(mutation.type==="upsert"&&mutation.info.parentID===parentID)
|
|
2521
2477
|
next.push(mutation.info)
|
|
2522
2478
|
return next.sort((a,b)=>a.time.created - b.time.created||a.id.localeCompare(b.id))
|
|
2523
2479
|
}
|
|
2524
2480
|
function applyStatus(current,mutation) {return {...current,[mutation.sessionID]:mutation.status}
|
|
2525
2481
|
}
|
|
2526
|
-
function recordSession(mutation) {const sessionID=mutation.type==="upsert"
|
|
2482
|
+
function recordSession(mutation) {const sessionID=mutation.type==="upsert"?mutation.info.id:mutation.sessionID
|
|
2527
2483
|
for(const key of targets.keys()) {remoteFailures.delete(JSON.stringify([key,sessionID]))
|
|
2528
2484
|
remoteRetryAt.delete(JSON.stringify([key,sessionID]))
|
|
2529
2485
|
if(mutation.type==="remove")
|
|
@@ -2574,7 +2530,7 @@ nextChildren=applySession(nextChildren,current.parentID,mutation)
|
|
|
2574
2530
|
let nextStatuses={...statusResult.data}
|
|
2575
2531
|
const missing={}
|
|
2576
2532
|
const remoteStatuses=await Promise.all(nextChildren.map((session)=>{const key=JSON.stringify([current.key,session.id])
|
|
2577
|
-
return (remoteRetryAt.get(key)??0)
|
|
2533
|
+
return (remoteRetryAt.get(key)??0)<=now()?fetchDevTeamStatus(session,requestState.signal):{sessionID:session.id,failed:true,cooldown:true,status:undefined}
|
|
2578
2534
|
}))
|
|
2579
2535
|
if(!requestState.isCurrent())
|
|
2580
2536
|
return
|
|
@@ -2584,7 +2540,7 @@ const key=JSON.stringify([current.key,result.sessionID])
|
|
|
2584
2540
|
if(result.failed) {missing[result.sessionID]=true
|
|
2585
2541
|
if(!("cooldown" in result)) {const failures=(remoteFailures.get(key)??0) + 1
|
|
2586
2542
|
remoteFailures.set(key,failures)
|
|
2587
|
-
if(failures
|
|
2543
|
+
if(failures>=3)
|
|
2588
2544
|
remoteRetryAt.set(key,now() + 30000)
|
|
2589
2545
|
}
|
|
2590
2546
|
const previous=statuses()[current.key]?.[result.sessionID]
|
|
@@ -2603,7 +2559,7 @@ nextChildren=applySession(nextChildren,current.parentID,mutation)
|
|
|
2603
2559
|
for(const mutation of journal.statuses)
|
|
2604
2560
|
nextStatuses=applyStatus(nextStatuses,mutation)
|
|
2605
2561
|
if(requestState.isCurrent()) {batch(()=>{for (const session of nextChildren) {const mutations=journal.statuses.filter((mutation)=>mutation.sessionID===session.id)
|
|
2606
|
-
if(mutations.length
|
|
2562
|
+
if(mutations.length>0) {for (const mutation of mutations) {if (!mutation.observed.has(current.key))
|
|
2607
2563
|
history.observeStatus(current.key,session.id,mutation.status,mutation.at)
|
|
2608
2564
|
}
|
|
2609
2565
|
} else if (!missing[session.id]) {const status=nextStatuses[session.id]??{type:"idle"}
|
|
@@ -2634,19 +2590,19 @@ function refresh(parentID,force=false) {return refreshTarget(target(parentID),fo
|
|
|
2634
2590
|
}
|
|
2635
2591
|
function list(parentID) {const current=target(parentID)
|
|
2636
2592
|
const currentStatuses=statuses()[current.key]??{}
|
|
2637
|
-
return (children()[current.key]??[]).map((session)=>({session,status:currentStatuses[session.id]??(unavailable()[current.key]?.[session.id]
|
|
2593
|
+
return (children()[current.key]??[]).map((session)=>({session,status:currentStatuses[session.id]??(unavailable()[current.key]?.[session.id]?undefined:api.state.session.status(session.id))
|
|
2638
2594
|
})).filter((item)=>activeStatus(item.status)).map((item)=>({...item,run:history.active(current.key,item.session.id),unavailable:unavailable()[current.key]?.[item.session.id]
|
|
2639
2595
|
}))
|
|
2640
2596
|
}
|
|
2641
2597
|
function recent(parentID) {const current=target(parentID)
|
|
2642
2598
|
const sessions=new Map((children()[current.key]??[]).map((session)=>[session.id,session]))
|
|
2643
2599
|
return history.recent(current.key).flatMap((run)=>{const session=sessions.get(run.sessionID)
|
|
2644
|
-
return session
|
|
2600
|
+
return session?[{session,status:{type:"idle"},run,unavailable:false}]:[]
|
|
2645
2601
|
})
|
|
2646
2602
|
}
|
|
2647
2603
|
const unsubscribe=[api.event.on("session.created",(event)=>recordSession({type:"upsert",info:event.properties.info})),api.event.on("session.updated",(event)=>recordSession({type:"upsert",info:event.properties.info})),api.event.on("session.deleted",(event)=>{recordSession({type:"remove",sessionID:event.properties.sessionID})
|
|
2648
2604
|
recordStatus({sessionID:event.properties.sessionID,status:{type:"idle"}})
|
|
2649
|
-
}),api.event.on("session.status",(event)=>recordStatus(event.properties)),api.event.on("session.error",(event)=>recordError(event.properties)),api.event.on("session.idle",(event)=>recordStatus({sessionID:event.properties.sessionID,status:{type:"idle"}})),api.event.on("server.connected",()=>{const current=activeTarget
|
|
2605
|
+
}),api.event.on("session.status",(event)=>recordStatus(event.properties)),api.event.on("session.error",(event)=>recordError(event.properties)),api.event.on("session.idle",(event)=>recordStatus({sessionID:event.properties.sessionID,status:{type:"idle"}})),api.event.on("server.connected",()=>{const current=activeTarget?targets.get(activeTarget):undefined
|
|
2650
2606
|
if(current)
|
|
2651
2607
|
retryBackgroundRefresh(()=>refreshTarget(current),{signal:api.lifecycle.signal}).catch(()=>{})
|
|
2652
2608
|
})
|
|
@@ -2686,8 +2642,8 @@ refreshing.clear()
|
|
|
2686
2642
|
}
|
|
2687
2643
|
}
|
|
2688
2644
|
async function fetchDevTeamStatus(session,signal) {const metadata=session.metadata
|
|
2689
|
-
const devTeam=metadata&&typeof metadata.devTeam==="object"
|
|
2690
|
-
const serverUrl=devTeam&&"serverUrl" in devTeam
|
|
2645
|
+
const devTeam=metadata&&typeof metadata.devTeam==="object"?metadata.devTeam:undefined
|
|
2646
|
+
const serverUrl=devTeam&&"serverUrl" in devTeam?devTeam.serverUrl:undefined
|
|
2691
2647
|
if(typeof serverUrl!=="string")
|
|
2692
2648
|
return
|
|
2693
2649
|
try {const url=new URL("/session/status",serverUrl)
|
|
@@ -2712,7 +2668,6 @@ return
|
|
|
2712
2668
|
return{sessionID:session.id,failed:true}
|
|
2713
2669
|
}
|
|
2714
2670
|
}
|
|
2715
|
-
|
|
2716
2671
|
import {createEffect as createEffect4,createSignal as createSignal9,onCleanup as onCleanup4} from "solid-js"
|
|
2717
2672
|
function filterSubagentView(rows,mode,query) {const needle=query.trim().toLocaleLowerCase()
|
|
2718
2673
|
return rows.filter((row)=>{if (mode==="active"&&row.group!=="Active")
|
|
@@ -2729,16 +2684,16 @@ function countSubagentView(rows,query) {return {all:filterSubagentView(rows,"all
|
|
|
2729
2684
|
}
|
|
2730
2685
|
function buildSubagentView(active,recent) {const priority=(item)=>{if (item.run?.errorMessage||item.unavailable)
|
|
2731
2686
|
return 0
|
|
2732
|
-
return item.status.type==="retry"
|
|
2687
|
+
return item.status.type==="retry"?1:2
|
|
2733
2688
|
}
|
|
2734
2689
|
return [...[...active].sort((a,b)=>priority(a) - priority(b)).map((item)=>({...item,group:"Active"})),...[...recent].sort((a,b)=>(b.run?.finishedAt??0) - (a.run?.finishedAt??0)||a.session.id.localeCompare(b.session.id)).map((item)=>({...item,group:"Recent"}))
|
|
2735
2690
|
]
|
|
2736
2691
|
}
|
|
2737
2692
|
function formatSubagentDuration(startedAt,now) {const seconds=Math.max(0,Math.floor((now - startedAt) / 1000))
|
|
2738
2693
|
let value=`${seconds}s`
|
|
2739
|
-
if(seconds
|
|
2694
|
+
if(seconds>=3600)
|
|
2740
2695
|
value=`${Math.floor(seconds / 3600)}h ${String(Math.floor(seconds / 60) % 60).padStart(2, "0")}m`
|
|
2741
|
-
else if (seconds
|
|
2696
|
+
else if (seconds>=60)
|
|
2742
2697
|
value=`${Math.floor(seconds / 60)}m ${String(seconds % 60).padStart(2, "0")}s`
|
|
2743
2698
|
return value
|
|
2744
2699
|
}
|
|
@@ -2751,7 +2706,6 @@ onCleanup4(()=>clearInterval(timer))
|
|
|
2751
2706
|
})
|
|
2752
2707
|
return now
|
|
2753
2708
|
}
|
|
2754
|
-
|
|
2755
2709
|
import {createSignal as createSignal10} from "solid-js"
|
|
2756
2710
|
function createTodoController(api) {const [sessions,setSessions]=createSignal10({})
|
|
2757
2711
|
const refreshing=new Map
|
|
@@ -2812,19 +2766,17 @@ refreshing.clear()
|
|
|
2812
2766
|
}
|
|
2813
2767
|
}
|
|
2814
2768
|
}
|
|
2815
|
-
|
|
2816
2769
|
function buildTodoView(todos,mode) {const active=[...todos.filter((item)=>item.status==="in_progress"),...todos.filter((item)=>item.status==="pending")
|
|
2817
2770
|
]
|
|
2818
2771
|
const completed=todos.filter((item)=>item.status==="completed")
|
|
2819
2772
|
const cancelled=todos.filter((item)=>item.status==="cancelled")
|
|
2820
2773
|
const other=todos.filter((item)=>!["in_progress","pending","completed","cancelled"].includes(item.status))
|
|
2821
|
-
const groups=[{title:"Active",items:mode==="finished"
|
|
2774
|
+
const groups=[{title:"Active",items:mode==="finished"?[]:active},{title:"Completed",items:mode==="active"?[]:completed},{title:"Cancelled",items:mode==="active"?[]:cancelled},{title:"Other",items:mode==="all"?other:[]}
|
|
2822
2775
|
].filter((group)=>group.items.length)
|
|
2823
2776
|
return{groups,rows:groups.flatMap((group)=>group.items.map((item)=>({item,group:group.title}))),counts:{all:todos.length,active:active.length,finished:completed.length + cancelled.length,completed:completed.length
|
|
2824
2777
|
}
|
|
2825
2778
|
}
|
|
2826
2779
|
}
|
|
2827
|
-
|
|
2828
2780
|
import {createComponent as _$createComponent12} from "@opentui/solid"
|
|
2829
2781
|
import {setProp as _$setProp11} from "@opentui/solid"
|
|
2830
2782
|
import {effect as _$effect11} from "@opentui/solid"
|
|
@@ -2862,7 +2814,6 @@ return _el$3
|
|
|
2862
2814
|
function openKeyboardHelp(api,iconStyle=()=>"nerd",multilineCorners=()=>true) {createDialogStack(api,iconStyle,()=>true,multilineCorners).open(()=>_$createComponent12(KeyboardHelpDialog,{api
|
|
2863
2815
|
}))
|
|
2864
2816
|
}
|
|
2865
|
-
|
|
2866
2817
|
import {createSignal as createSignal11,onCleanup as onCleanup5} from "solid-js"
|
|
2867
2818
|
var QUICK_ACTION_METADATA=[["\uEA73","Rename"],["\uEA82","Timeline"],["\uEBCC","Copy transcript"],["\uEBAC","Export"],["\uEAF5","Compact"],["\uEBEB","Switch session"],["\uEA60","New session"],["\uEB9E","Fork session"],["\uEBCC","Copy last response"],["\uEAA1","First message"],["\uEA9A","Last message"],["\uEA82","Last user message"],["\uEA9A","Next message"],["\uEAA1","Previous message"],["\uEBB3","Auto-approve permissions"]
|
|
2868
2819
|
]
|
|
@@ -2873,7 +2824,7 @@ function quickActionRequiresSession(command) {return command!=="session.list"&&c
|
|
|
2873
2824
|
function quickActionLabel(api,action) {if (action.command!=="permission.mode")
|
|
2874
2825
|
return action.label
|
|
2875
2826
|
const command=api.keymap.getCommands?.({visibility:"registered"}).find((candidate)=>candidate.name===action.command)
|
|
2876
|
-
return typeof command?.title==="string"
|
|
2827
|
+
return typeof command?.title==="string"?command.title:action.label
|
|
2877
2828
|
}
|
|
2878
2829
|
function createQuickActionRevision(api) {const [revision,setRevision]=createSignal11(0)
|
|
2879
2830
|
const unsubscribe=api.keymap.on?.("state",()=>setRevision((value)=>value + 1))
|
|
@@ -2897,12 +2848,11 @@ if(enabled===false||typeof enabled==="function"&&!enabled())
|
|
|
2897
2848
|
return "Unavailable in the current session"
|
|
2898
2849
|
return
|
|
2899
2850
|
}
|
|
2900
|
-
|
|
2901
2851
|
var SEARCH_GROUPS=["Skills","Subagents","MCP","Actions"]
|
|
2902
2852
|
var SEARCH_SECTIONS={Skills:"skills",Subagents:"subagents",MCP:"mcp",Actions:"quick_actions"
|
|
2903
2853
|
}
|
|
2904
2854
|
function searchContext(api) {const route=api.route.current
|
|
2905
|
-
const sessionID=route.name==="session"&&"params" in route&&typeof route.params?.sessionID==="string"
|
|
2855
|
+
const sessionID=route.name==="session"&&"params" in route&&typeof route.params?.sessionID==="string"?route.params.sessionID:undefined
|
|
2906
2856
|
const location=currentLocation(api)
|
|
2907
2857
|
return{sessionID,location,key:JSON.stringify([route.name,sessionID??null,location.key])}
|
|
2908
2858
|
}
|
|
@@ -2911,10 +2861,10 @@ const skills=[...input.skills].sort((a,b)=>Number(input.favoriteSkills.has(b.loc
|
|
|
2911
2861
|
const mcp=[...input.mcp].sort((a,b)=>Number(input.favoriteMcp.has(b.name)) - Number(input.favoriteMcp.has(a.name))||a.name.localeCompare(b.name))
|
|
2912
2862
|
const results=[...skills.map((skill)=>({id:`skill:${skill.location || skill.name}`,group:"Skills",title:skill.name,description:skill.description?.trim()||skill.location,keywords:skill.location,skill
|
|
2913
2863
|
})),...input.subagents.map((item)=>({id:`subagent:${item.session.id}`,group:"Subagents",title:item.session.title,description:[item.run?.outcome??item.status.type,item.run?.errorMessage].filter(Boolean).join(" \xB7 "),keywords:item.session.id,sessionID:item.session.id
|
|
2914
|
-
})),...mcp.map((item)=>({id:`mcp:${item.name}`,group:"MCP",title:item.name,description:[input.mcpGroups?.[item.name],mcpToggleAction2(item.status)==="disconnect"
|
|
2915
|
-
].filter(Boolean).join(" \xB7 "),keywords:input.mcpGroups?.[item.name],disabled:input.mcpBusy||!mcpToggleAction2(item.status)
|
|
2864
|
+
})),...mcp.map((item)=>({id:`mcp:${item.name}`,group:"MCP",title:item.name,description:[input.mcpGroups?.[item.name],mcpToggleAction2(item.status)==="disconnect"?"Disconnect":"Connect",item.status,item.error
|
|
2865
|
+
].filter(Boolean).join(" \xB7 "),keywords:input.mcpGroups?.[item.name],disabled:input.mcpBusy||!mcpToggleAction2(item.status)?"MCP operation in progress":undefined,server:item.name
|
|
2916
2866
|
})),...orderQuickActionIds(input.actionOrder,input.favoriteQuickActions??new Set).flatMap((id)=>{const action=QUICK_ACTIONS.find((item)=>item.command===id)
|
|
2917
|
-
return action
|
|
2867
|
+
return action?[{id:`action:${id}`,group:"Actions",title:input.actionLabel?.(action)??action.label,description:id,command:id,disabled:input.actionDisabledReason?.(action)??(quickActionRequiresSession(action.command)&&!input.hasSession?"Requires an open session":undefined)
|
|
2918
2868
|
}
|
|
2919
2869
|
]:[]
|
|
2920
2870
|
})
|
|
@@ -2943,19 +2893,17 @@ function searchResults(candidates,query) {const terms=query.trim().toLocaleLower
|
|
|
2943
2893
|
const scored=candidates.flatMap((item,index)=>{let score=0
|
|
2944
2894
|
for(const term of terms) {const title=fuzzyScore(term,item.title)
|
|
2945
2895
|
const detail=fuzzyScore(term,`${item.description} ${item.keywords ?? ""}`)
|
|
2946
|
-
if(title
|
|
2896
|
+
if(title<0&&detail<0)
|
|
2947
2897
|
return []
|
|
2948
|
-
score += Math.max(title
|
|
2898
|
+
score += Math.max(title>=0?title:-Infinity,detail>=0?detail - 250:-Infinity)
|
|
2949
2899
|
}
|
|
2950
2900
|
return [{item,score,index}]
|
|
2951
2901
|
})
|
|
2952
2902
|
scored.sort((a,b)=>SEARCH_GROUPS.indexOf(a.item.group) - SEARCH_GROUPS.indexOf(b.item.group)||b.score - a.score||a.index - b.index)
|
|
2953
2903
|
return scored.map(({item})=>item)
|
|
2954
2904
|
}
|
|
2955
|
-
|
|
2956
2905
|
import {createElement as _$createElement17} from "@opentui/solid"
|
|
2957
2906
|
import {createEffect as createEffect6,onCleanup as onCleanup7} from "solid-js"
|
|
2958
|
-
|
|
2959
2907
|
import {mergeProps as _$mergeProps5} from "@opentui/solid"
|
|
2960
2908
|
import {effect as _$effect15} from "@opentui/solid"
|
|
2961
2909
|
import {createTextNode as _$createTextNode10} from "@opentui/solid"
|
|
@@ -2964,7 +2912,6 @@ import {insert as _$insert15} from "@opentui/solid"
|
|
|
2964
2912
|
import {setProp as _$setProp15} from "@opentui/solid"
|
|
2965
2913
|
import {createElement as _$createElement16} from "@opentui/solid"
|
|
2966
2914
|
import {createComponent as _$createComponent17} from "@opentui/solid"
|
|
2967
|
-
|
|
2968
2915
|
import {createComponent as _$createComponent13} from "@opentui/solid"
|
|
2969
2916
|
import {memo as _$memo9} from "@opentui/solid"
|
|
2970
2917
|
import {RGBA as RGBA2,parseColor} from "@opentui/core"
|
|
@@ -2987,7 +2934,7 @@ const icons=useIcons()
|
|
|
2987
2934
|
const commandRevision=createQuickActionRevision(props.api)
|
|
2988
2935
|
const dialogs=useDialogs(props.api)
|
|
2989
2936
|
const resultColors=createMemo(()=>{const background=parseColor(theme().backgroundPanel)
|
|
2990
|
-
const contrast=background.r * 0.299 + background.g * 0.587 + background.b * 0.114
|
|
2937
|
+
const contrast=background.r * 0.299 + background.g * 0.587 + background.b * 0.114>0.5?0:1
|
|
2991
2938
|
return{title:mixColor(parseColor(theme().text),RGBA2.fromValues(contrast,contrast,contrast),0.45),description:mixColor(parseColor(theme().textMuted),background,0.4)
|
|
2992
2939
|
}
|
|
2993
2940
|
})
|
|
@@ -2999,7 +2946,7 @@ let isDisposed=false
|
|
|
2999
2946
|
let refreshGeneration=0
|
|
3000
2947
|
const sameContext=()=>searchContext(props.api).key===context.key
|
|
3001
2948
|
const candidates=createMemo(()=>{commandRevision()
|
|
3002
|
-
return buildSearchCandidates({skills:props.skills.list(skillTarget),subagents:context.sessionID
|
|
2949
|
+
return buildSearchCandidates({skills:props.skills.list(skillTarget),subagents:context.sessionID?buildSubagentView(props.subagents.list(context.sessionID),props.subagents.recent(context.sessionID)):[],mcp:props.mcp.list(mcpTarget),actionOrder:props.preferences.quickActionOrder?.()??QUICK_ACTION_IDS,favoriteQuickActions:props.preferences.favoriteQuickActions?.()??new Set,favoriteSkills:props.preferences.favoriteSkills(),recentSkills:props.preferences.recentSkills(),favoriteMcp:props.preferences.favoriteMcpServers(),mcpGroups:props.preferences.mcpServerGroups?.()??{},hasSession:Boolean(context.sessionID),mcpBusy:props.mcp.mutating(mcpTarget)||props.mcp.bulkState(mcpTarget).status==="running",actionDisabledReason:(action)=>quickActionDisabledReason(props.api,action),actionLabel:(action)=>quickActionLabel(props.api,action)
|
|
3003
2950
|
})
|
|
3004
2951
|
})
|
|
3005
2952
|
const matches=createMemo(()=>searchResults(candidates(),query()))
|
|
@@ -3010,13 +2957,13 @@ const byID=createMemo(()=>new Map(results().map((item)=>[item.id,item])))
|
|
|
3010
2957
|
const active=createMemo(()=>results().find((item)=>item.id===selectedID())??results()[0])
|
|
3011
2958
|
const sources=createMemo(()=>[{group:"Skills",state:props.skills.state(skillTarget)
|
|
3012
2959
|
},{group:"MCP",state:props.mcp.state(mcpTarget)
|
|
3013
|
-
},...context.sessionID
|
|
2960
|
+
},...context.sessionID?[{group:"Subagents",state:props.subagents.state(context.sessionID)
|
|
3014
2961
|
}]:[]])
|
|
3015
2962
|
const loading=createMemo(()=>refreshing()&&sources().some(({group,state
|
|
3016
2963
|
})=>group===activeTab()&&state.status==="loading"))
|
|
3017
2964
|
const allErrors=createMemo((previous)=>sources().flatMap((source)=>{if (source.state.error)
|
|
3018
2965
|
return [source]
|
|
3019
|
-
return source.state.status==="refreshing"
|
|
2966
|
+
return source.state.status==="refreshing"?previous.filter((item)=>item.group===source.group):[]
|
|
3020
2967
|
}),[])
|
|
3021
2968
|
const errors=createMemo(()=>allErrors().filter((source)=>source.group===activeTab()))
|
|
3022
2969
|
async function refresh(force=false) {const generation=++refreshGeneration
|
|
@@ -3024,7 +2971,7 @@ setRefreshing(true)
|
|
|
3024
2971
|
try {await props.preferences.load()
|
|
3025
2972
|
if(isDisposed||!sameContext())
|
|
3026
2973
|
return
|
|
3027
|
-
await Promise.allSettled([props.skills.refresh(skillTarget,force),props.mcp.refresh(mcpTarget,force),...context.sessionID
|
|
2974
|
+
await Promise.allSettled([props.skills.refresh(skillTarget,force),props.mcp.refresh(mcpTarget,force),...context.sessionID?[props.subagents.refresh(context.sessionID,force)]:[]])
|
|
3028
2975
|
} finally {if (!isDisposed&&generation===refreshGeneration)
|
|
3029
2976
|
setRefreshing(false)
|
|
3030
2977
|
}
|
|
@@ -3054,7 +3001,7 @@ function moveTab(offset) {selectTab(SEARCH_GROUPS[(SEARCH_GROUPS.indexOf(activeT
|
|
|
3054
3001
|
}
|
|
3055
3002
|
function report(cause) {if (isAbortError(cause))
|
|
3056
3003
|
return
|
|
3057
|
-
props.api.ui.toast({title:"Search Everything",variant:"error",message:cause instanceof Error
|
|
3004
|
+
props.api.ui.toast({title:"Search Everything",variant:"error",message:cause instanceof Error?cause.message:"Action failed",duration:4000
|
|
3058
3005
|
})
|
|
3059
3006
|
}
|
|
3060
3007
|
async function insertSkill(skill) {if (!sameContext())
|
|
@@ -3073,7 +3020,7 @@ setScrollTop(body.scrollTop)
|
|
|
3073
3020
|
if(item.group==="Skills"&&props.preferences.shouldConfirmSkill(item.skill)) {dialogs.open(()=>_$createComponent13(SkillDialog,{get api() {return props.api
|
|
3074
3021
|
},get skill() {return item.skill
|
|
3075
3022
|
},get favorite() {return props.preferences.isFavoriteSkill?.(item.skill)??false
|
|
3076
|
-
},get favoriteDisabled() {return _$memo9(()=>!!props.preferences.ready)()
|
|
3023
|
+
},get favoriteDisabled() {return _$memo9(()=>!!props.preferences.ready)()?!props.preferences.ready():false
|
|
3077
3024
|
},onToggleFavorite:()=>props.preferences.toggleFavoriteSkill?.(item.skill),onAccept:(skip)=>{if (!sameContext())
|
|
3078
3025
|
return
|
|
3079
3026
|
if(skip)
|
|
@@ -3093,7 +3040,7 @@ break
|
|
|
3093
3040
|
case "Subagents":{props.subagents.open(item.sessionID)
|
|
3094
3041
|
break
|
|
3095
3042
|
}
|
|
3096
|
-
case "Actions":{const target=props.returnTarget?.parent&&!props.returnTarget.isDestroyed
|
|
3043
|
+
case "Actions":{const target=props.returnTarget?.parent&&!props.returnTarget.isDestroyed?props.returnTarget:null
|
|
3097
3044
|
target?.focus()
|
|
3098
3045
|
const result=props.api.keymap.dispatchCommand(item.command,{target,focused:target
|
|
3099
3046
|
})
|
|
@@ -3148,7 +3095,6 @@ setScrollTop(body.scrollTop)
|
|
|
3148
3095
|
},resultHeight:()=>Math.min(Math.max(3,Math.min(16,Math.floor(dimensions().height * 0.5) - 9)),Math.max(1,results().length * 3 + errors().length * 2)),theme
|
|
3149
3096
|
}
|
|
3150
3097
|
}
|
|
3151
|
-
|
|
3152
3098
|
import {memo as _$memo10} from "@opentui/solid"
|
|
3153
3099
|
import {createComponent as _$createComponent14} from "@opentui/solid"
|
|
3154
3100
|
import {use as _$use4} from "@opentui/solid"
|
|
@@ -3183,7 +3129,7 @@ return _el$
|
|
|
3183
3129
|
})(),_$createComponent14(SelectionBox,{get backgroundColor() {return model.theme().backgroundElement
|
|
3184
3130
|
},height:1,get children() {var _el$5=_$createElement13("input")
|
|
3185
3131
|
var _ref$=model.setInput
|
|
3186
|
-
typeof _ref$==="function"
|
|
3132
|
+
typeof _ref$==="function"?_$use4(_ref$,_el$5):model.setInput=_el$5
|
|
3187
3133
|
_$setProp12(_el$5,"placeholder","Search skills, subagents, MCP, actions...")
|
|
3188
3134
|
_$setProp12(_el$5,"focused",true)
|
|
3189
3135
|
_$setProp12(_el$5,"backgroundColor","transparent")
|
|
@@ -3218,7 +3164,6 @@ model.selectTab(tab)
|
|
|
3218
3164
|
return _el$6
|
|
3219
3165
|
})()]
|
|
3220
3166
|
}
|
|
3221
|
-
|
|
3222
3167
|
import {memo as _$memo12} from "@opentui/solid"
|
|
3223
3168
|
import {createTextNode as _$createTextNode9} from "@opentui/solid"
|
|
3224
3169
|
import {insertNode as _$insertNode11} from "@opentui/solid"
|
|
@@ -3229,7 +3174,6 @@ import {setProp as _$setProp14} from "@opentui/solid"
|
|
|
3229
3174
|
import {use as _$use5} from "@opentui/solid"
|
|
3230
3175
|
import {createElement as _$createElement15} from "@opentui/solid"
|
|
3231
3176
|
import {For as For3,Show as Show2} from "solid-js"
|
|
3232
|
-
|
|
3233
3177
|
import {createComponent as _$createComponent15} from "@opentui/solid"
|
|
3234
3178
|
import {effect as _$effect13} from "@opentui/solid"
|
|
3235
3179
|
import {insertNode as _$insertNode10} from "@opentui/solid"
|
|
@@ -3242,10 +3186,10 @@ function SearchResultRow(props) {const initial=props.model.byID().get(props.id)
|
|
|
3242
3186
|
const item=()=>props.model.byID().get(props.id)??initial
|
|
3243
3187
|
const selected=()=>props.model.active()?.id===props.id
|
|
3244
3188
|
const actionIcon=()=>{const result=item()
|
|
3245
|
-
return result.group==="Actions"
|
|
3189
|
+
return result.group==="Actions"?`${props.model.icons.action(result.command)} `:""
|
|
3246
3190
|
}
|
|
3247
3191
|
return _$createComponent15(SelectionBox,{get id() {return `${props.model.prefix}.${props.id}`
|
|
3248
|
-
},height:2,marginBottom:1,paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo11(()=>!!selected())()
|
|
3192
|
+
},height:2,marginBottom:1,paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo11(()=>!!selected())()?props.model.theme().backgroundElement:undefined
|
|
3249
3193
|
},onMouseOver:()=>props.model.setSelectedID(props.id),onMouseDown:(event)=>{event.preventDefault()
|
|
3250
3194
|
event.stopPropagation()
|
|
3251
3195
|
},onMouseUp:(event)=>{event.stopPropagation()
|
|
@@ -3258,7 +3202,7 @@ _$setProp13(_el$2,"wrapMode","none")
|
|
|
3258
3202
|
_$setProp13(_el$2,"truncate",true)
|
|
3259
3203
|
_$setProp13(_el$2,"height",1)
|
|
3260
3204
|
_$insert13(_el$2,(()=>{var _c$=_$memo11(()=>!!selected())
|
|
3261
|
-
return ()=>_c$()
|
|
3205
|
+
return ()=>_c$()?`${props.model.icons.icon("selected")} `:" "
|
|
3262
3206
|
})(),null)
|
|
3263
3207
|
_$insert13(_el$2,actionIcon,null)
|
|
3264
3208
|
_$insert13(_el$2,()=>item().title,null)
|
|
@@ -3268,7 +3212,7 @@ _$setProp13(_el$4,"wrapMode","none")
|
|
|
3268
3212
|
_$setProp13(_el$4,"truncate",true)
|
|
3269
3213
|
_$setProp13(_el$4,"height",1)
|
|
3270
3214
|
_$insert13(_el$4,()=>(item().disabled??item().description).replaceAll(/\s+/g," "))
|
|
3271
|
-
_$effect13((_p$)=>{var _v$=item().disabled
|
|
3215
|
+
_$effect13((_p$)=>{var _v$=item().disabled?props.model.theme().textMuted:selected()?props.model.theme().accent:props.model.resultColors().title,_v$2=TextAttributes9.BOLD,_v$3=item().group==="Actions"&&props.model.icons.style()==="text"?6:4,_v$4=props.model.resultColors().description,_v$5=TextAttributes9.DIM
|
|
3272
3216
|
_v$!==_p$.e&&(_p$.e=_$setProp13(_el$2,"fg",_v$,_p$.e))
|
|
3273
3217
|
_v$2!==_p$.t&&(_p$.t=_$setProp13(_el$2,"attributes",_v$2,_p$.t))
|
|
3274
3218
|
_v$3!==_p$.a&&(_p$.a=_$setProp13(_el$3,"paddingLeft",_v$3,_p$.a))
|
|
@@ -3281,11 +3225,10 @@ return _el$
|
|
|
3281
3225
|
}
|
|
3282
3226
|
})
|
|
3283
3227
|
}
|
|
3284
|
-
|
|
3285
3228
|
function SearchResults(props) {const model=props.model
|
|
3286
3229
|
return (()=>{var _el$=_$createElement15("scrollbox")
|
|
3287
3230
|
var _ref$=model.setBody
|
|
3288
|
-
typeof _ref$==="function"
|
|
3231
|
+
typeof _ref$==="function"?_$use5(_ref$,_el$):model.setBody=_el$
|
|
3289
3232
|
_$setProp14(_el$,"contentOptions",{minHeight:0
|
|
3290
3233
|
})
|
|
3291
3234
|
_$setProp14(_el$,"scrollX",false)
|
|
@@ -3310,8 +3253,8 @@ return _el$2
|
|
|
3310
3253
|
_$insert14(_el$,_$createComponent16(Show2,{get when() {return model.results().length
|
|
3311
3254
|
},get fallback() {return (()=>{var _el$8=_$createElement15("text"),_el$9=_$createTextNode9(` `)
|
|
3312
3255
|
_$insertNode11(_el$8,_el$9)
|
|
3313
|
-
_$insert14(_el$8,()=>model.icons.icon(model.loading()
|
|
3314
|
-
_$insert14(_el$8,()=>model.loading()
|
|
3256
|
+
_$insert14(_el$8,()=>model.icons.icon(model.loading()?"pending":"search"),_el$9)
|
|
3257
|
+
_$insert14(_el$8,()=>model.loading()?"Loading sources\u2026":"No matching results",null)
|
|
3315
3258
|
_$effect14((_$p)=>_$setProp14(_el$8,"fg",model.theme().textMuted,_$p))
|
|
3316
3259
|
return _el$8
|
|
3317
3260
|
})()
|
|
@@ -3334,7 +3277,6 @@ return _p$
|
|
|
3334
3277
|
return _el$
|
|
3335
3278
|
})()
|
|
3336
3279
|
}
|
|
3337
|
-
|
|
3338
3280
|
function SearchEverythingDialog(props) {const model=createSearchDialogController(props)
|
|
3339
3281
|
return _$createComponent17(DialogSurface,{get api() {return props.api
|
|
3340
3282
|
},get id() {return model.prefix
|
|
@@ -3361,14 +3303,13 @@ function openSearchEverything(services,returnTarget=services.api.renderer.curren
|
|
|
3361
3303
|
createDialogStack(services.api,services.preferences.lspIconStyle,()=>searchContext(services.api).key===context,services.preferences.cornerFont).open(()=>_$createComponent17(SearchEverythingDialog,_$mergeProps5(services,{returnTarget
|
|
3362
3304
|
})),"large")
|
|
3363
3305
|
}
|
|
3364
|
-
|
|
3365
3306
|
function SearchBinding(props) {const timers=new Set
|
|
3366
3307
|
let isDisposed=false
|
|
3367
3308
|
const unregister=props.api.keymap.registerLayer({mode:"base",commands:[{name:SEARCH_COMMAND,title:"Search Everything",category:"Navigator",namespace:"palette",enabled:()=>["home","session"].includes(props.api.route.current.name),run:()=>{const context=searchContext(props.api).key
|
|
3368
3309
|
const timer=setTimeout(()=>{timers.delete(timer)
|
|
3369
3310
|
if(isDisposed||props.api.lifecycle?.signal.aborted||searchContext(props.api).key!==context||props.api.ui.dialog.open)
|
|
3370
3311
|
return
|
|
3371
|
-
const target=props.interaction.ownsFocus()
|
|
3312
|
+
const target=props.interaction.ownsFocus()?props.interaction.savedReturnTarget():props.api.renderer.currentFocusedRenderable
|
|
3372
3313
|
openSearchEverything(props,target??null)
|
|
3373
3314
|
},50)
|
|
3374
3315
|
timers.add(timer)
|
|
@@ -3390,15 +3331,14 @@ clearTimeout(timer)
|
|
|
3390
3331
|
})
|
|
3391
3332
|
return _$createElement17("box")
|
|
3392
3333
|
}
|
|
3393
|
-
|
|
3394
3334
|
import {createMemo as createMemo2} from "solid-js"
|
|
3395
3335
|
function createLayoutPresetPreview(preferences,name) {const scope=preferences.selectedScopeKey()
|
|
3396
3336
|
const valid=()=>preferences.selectedScopeKey()===scope
|
|
3397
3337
|
const preset=createMemo2(()=>preferences.layoutPresets()[name])
|
|
3398
3338
|
const preview=createMemo2(()=>{const value=preset()
|
|
3399
|
-
return value
|
|
3339
|
+
return value?preferences.previewLayoutPreset(value):undefined
|
|
3400
3340
|
})
|
|
3401
|
-
return{valid,preview,scope:preferences.preferenceScopeLabel,blocked:()=>preset()
|
|
3341
|
+
return{valid,preview,scope:preferences.preferenceScopeLabel,blocked:()=>preset()?"":"Preset no longer exists.",apply() {const value=preset()
|
|
3402
3342
|
if(!valid()||!value)
|
|
3403
3343
|
return false
|
|
3404
3344
|
preferences.applyLayoutPreset(value)
|
|
@@ -3419,16 +3359,15 @@ if(controller.mutating(target))
|
|
|
3419
3359
|
return "Wait for the current MCP operation to finish."
|
|
3420
3360
|
if(state().error)
|
|
3421
3361
|
return `Could not refresh MCP: ${state().error.message}. Retry to update the preview.`
|
|
3422
|
-
return state().status==="ready"
|
|
3362
|
+
return state().status==="ready"?"":"Refreshing MCP states\u2026"
|
|
3423
3363
|
})
|
|
3424
3364
|
return{valid,preview,blocked,scope:target.scope,refresh() {if (valid()&&!controller.mutating(target))
|
|
3425
3365
|
controller.refresh(target,true).catch(()=>{})
|
|
3426
3366
|
},apply() {const value=preset()
|
|
3427
|
-
return value&&valid()&&!blocked()
|
|
3367
|
+
return value&&valid()&&!blocked()?controller.applyPreset(name,value,target):undefined
|
|
3428
3368
|
}
|
|
3429
3369
|
}
|
|
3430
3370
|
}
|
|
3431
|
-
|
|
3432
3371
|
import {createComponent as _$createComponent20} from "@opentui/solid"
|
|
3433
3372
|
import {effect as _$effect18} from "@opentui/solid"
|
|
3434
3373
|
import {createTextNode as _$createTextNode13} from "@opentui/solid"
|
|
@@ -3438,19 +3377,17 @@ import {setProp as _$setProp18} from "@opentui/solid"
|
|
|
3438
3377
|
import {createElement as _$createElement20} from "@opentui/solid"
|
|
3439
3378
|
import {TextAttributes as TextAttributes12} from "@opentui/core"
|
|
3440
3379
|
import {Show as Show3,createSignal as createSignal13,onCleanup as onCleanup8} from "solid-js"
|
|
3441
|
-
|
|
3442
3380
|
var defaults={todo:true,lsp:true}
|
|
3443
3381
|
var capabilities=new WeakMap
|
|
3444
3382
|
function setHostCapabilities(api,value) {capabilities.set(api,value)
|
|
3445
3383
|
}
|
|
3446
3384
|
function hostCapabilities(api) {return capabilities.get(api)??defaults
|
|
3447
3385
|
}
|
|
3448
|
-
function hostCapabilityUnavailable(api,section) {return section==="todo"||section==="lsp"
|
|
3386
|
+
function hostCapabilityUnavailable(api,section) {return section==="todo"||section==="lsp"?hostCapabilities(api).unavailable?.[section]:undefined
|
|
3449
3387
|
}
|
|
3450
3388
|
function supportsSidebarSection(api,section) {const current=hostCapabilities(api)
|
|
3451
|
-
return section!=="todo"&§ion!=="lsp"
|
|
3389
|
+
return section!=="todo"&§ion!=="lsp"?true:current[section]
|
|
3452
3390
|
}
|
|
3453
|
-
|
|
3454
3391
|
var ONBOARDING_STEPS=[{title:"A control center that stays compact",summary:"Navigator brings session state, search, and controls into OpenCode's existing sidebar.",icon:"help",features:[{icon:"sections",title:"Progressive disclosure",description:"Expand only the context you need right now."},{icon:"scope",title:"Current context",description:"Follow the active session, workspace, and worktree."},{icon:"actions",title:"Mouse and keyboard",description:"Use the same controls with either input method."}
|
|
3455
3392
|
]
|
|
3456
3393
|
},{title:"Stay oriented while agents work",summary:"Keep current work visible without turning the sidebar into another dashboard.",icon:"todo",features:[{icon:"todo",title:"Todo filters",description:"Separate active, finished, and cancelled work."},{icon:"subagents",title:"Live subagents",description:"See running, retrying, recent, and failed child sessions."
|
|
@@ -3475,7 +3412,6 @@ var ONBOARDING_STEPS=[{title:"A control center that stays compact",summary:"Navi
|
|
|
3475
3412
|
]
|
|
3476
3413
|
}
|
|
3477
3414
|
];
|
|
3478
|
-
|
|
3479
3415
|
import {effect as _$effect16} from "@opentui/solid"
|
|
3480
3416
|
import {memo as _$memo13} from "@opentui/solid"
|
|
3481
3417
|
import {createComponent as _$createComponent18} from "@opentui/solid"
|
|
@@ -3534,7 +3470,7 @@ _$insertNode13(_el$6,_el$9)
|
|
|
3534
3470
|
_$setProp16(_el$6,"wrapMode","word")
|
|
3535
3471
|
_$insert16(_el$6,()=>props.preferences.toggleKey(),_el$8)
|
|
3536
3472
|
_$insert16(_el$6,()=>props.preferences.focusKey(),_el$9)
|
|
3537
|
-
_$insert16(_el$6,()=>icons.style()==="text"
|
|
3473
|
+
_$insert16(_el$6,()=>icons.style()==="text"?"Text fallback":"Nerd Font",null)
|
|
3538
3474
|
_$setProp16(_el$1,"flexDirection","row")
|
|
3539
3475
|
_$setProp16(_el$1,"justifyContent","space-between")
|
|
3540
3476
|
_$insert16(_el$1,_$createComponent18(SelectionBox,{paddingLeft:1,paddingRight:1,onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
@@ -3551,7 +3487,7 @@ _$insert16(_el$1,_$createComponent18(SelectionBox,{paddingLeft:1,paddingRight:1,
|
|
|
3551
3487
|
props.onAdvance()
|
|
3552
3488
|
},get children() {var _el$12=_$createElement18("text"),_el$13=_$createTextNode11(` `)
|
|
3553
3489
|
_$insertNode13(_el$12,_el$13)
|
|
3554
|
-
_$insert16(_el$12,()=>props.final
|
|
3490
|
+
_$insert16(_el$12,()=>props.final?"Configure sidebar":"Next",_el$13)
|
|
3555
3491
|
_$insert16(_el$12,()=>icons.icon("right"),null)
|
|
3556
3492
|
_$effect16((_$p)=>_$setProp16(_el$12,"fg",theme().selectedListItemText,_$p))
|
|
3557
3493
|
return _el$12
|
|
@@ -3569,7 +3505,6 @@ return _p$
|
|
|
3569
3505
|
return _el$
|
|
3570
3506
|
})()
|
|
3571
3507
|
}
|
|
3572
|
-
|
|
3573
3508
|
import {memo as _$memo14} from "@opentui/solid"
|
|
3574
3509
|
import {effect as _$effect17} from "@opentui/solid"
|
|
3575
3510
|
import {createComponent as _$createComponent19} from "@opentui/solid"
|
|
@@ -3593,19 +3528,19 @@ _$insertNode14(_el$2,_el$3)
|
|
|
3593
3528
|
_$insert17(_el$2,()=>icons.icon("sections"),_el$3)
|
|
3594
3529
|
_$insertNode14(_el$4,_$createTextNode12(`Select what appears now. You can change visibility, order, limits, scope, and presets later with the gear button.`))
|
|
3595
3530
|
_$setProp17(_el$4,"wrapMode","word")
|
|
3596
|
-
_$insert17(_el$,_$createComponent19(For5,{each:sections,children:(section,index)=>_$createComponent19(SelectionBox,{flexDirection:"row",gap:1,paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo14(()=>props.active===index())()
|
|
3531
|
+
_$insert17(_el$,_$createComponent19(For5,{each:sections,children:(section,index)=>_$createComponent19(SelectionBox,{flexDirection:"row",gap:1,paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo14(()=>props.active===index())()?theme().backgroundElement:undefined
|
|
3597
3532
|
},onMouseOver:()=>props.onActive(index()),onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
3598
3533
|
props.preferences.toggleSection(section.name)
|
|
3599
3534
|
},get children() {return [(()=>{var _el$1=_$createElement19("text")
|
|
3600
3535
|
_$setProp17(_el$1,"flexShrink",0)
|
|
3601
|
-
_$insert17(_el$1,()=>icons.icon(props.preferences.sections()[section.name]
|
|
3602
|
-
_$effect17((_$p)=>_$setProp17(_el$1,"fg",props.preferences.sections()[section.name]
|
|
3536
|
+
_$insert17(_el$1,()=>icons.icon(props.preferences.sections()[section.name]?"checked":"unchecked"))
|
|
3537
|
+
_$effect17((_$p)=>_$setProp17(_el$1,"fg",props.preferences.sections()[section.name]?theme().accent:theme().textMuted,_$p))
|
|
3603
3538
|
return _el$1
|
|
3604
3539
|
})(),(()=>{var _el$10=_$createElement19("text"),_el$11=_$createTextNode12(` `)
|
|
3605
3540
|
_$insertNode14(_el$10,_el$11)
|
|
3606
3541
|
_$insert17(_el$10,()=>icons.section(section.name),_el$11)
|
|
3607
3542
|
_$insert17(_el$10,()=>section.label,null)
|
|
3608
|
-
_$effect17((_$p)=>_$setProp17(_el$10,"fg",props.active===index()
|
|
3543
|
+
_$effect17((_$p)=>_$setProp17(_el$10,"fg",props.active===index()?theme().text:theme().textMuted,_$p))
|
|
3609
3544
|
return _el$10
|
|
3610
3545
|
})()]
|
|
3611
3546
|
}
|
|
@@ -3622,13 +3557,13 @@ _$effect17((_$p)=>_$setProp17(_el$7,"fg",theme().textMuted,_$p))
|
|
|
3622
3557
|
return _el$7
|
|
3623
3558
|
}
|
|
3624
3559
|
}),null)
|
|
3625
|
-
_$insert17(_el$6,_$createComponent19(SelectionBox,{paddingLeft:2,paddingRight:2,get backgroundColor() {return _$memo14(()=>props.active===finishIndex)()
|
|
3560
|
+
_$insert17(_el$6,_$createComponent19(SelectionBox,{paddingLeft:2,paddingRight:2,get backgroundColor() {return _$memo14(()=>props.active===finishIndex)()?theme().primary:undefined
|
|
3626
3561
|
},onMouseOver:()=>props.onActive(finishIndex),onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
3627
3562
|
props.onFinish()
|
|
3628
3563
|
},get children() {var _el$9=_$createElement19("text"),_el$0=_$createTextNode12(` Finish`)
|
|
3629
3564
|
_$insertNode14(_el$9,_el$0)
|
|
3630
3565
|
_$insert17(_el$9,()=>icons.icon("done"),_el$0)
|
|
3631
|
-
_$effect17((_$p)=>_$setProp17(_el$9,"fg",props.active===finishIndex
|
|
3566
|
+
_$effect17((_$p)=>_$setProp17(_el$9,"fg",props.active===finishIndex?theme().selectedListItemText:theme().textMuted,_$p))
|
|
3632
3567
|
return _el$9
|
|
3633
3568
|
}
|
|
3634
3569
|
}),null)
|
|
@@ -3642,7 +3577,6 @@ return _p$
|
|
|
3642
3577
|
return _el$
|
|
3643
3578
|
})()
|
|
3644
3579
|
}
|
|
3645
|
-
|
|
3646
3580
|
function FirstRunWizard(props) {const icons=useIcons()
|
|
3647
3581
|
const dialogs=useDialogs(props.api)
|
|
3648
3582
|
const [active,setActive]=createSignal13(0)
|
|
@@ -3741,17 +3675,14 @@ return false
|
|
|
3741
3675
|
openFirstRunWizard(api,preferences)
|
|
3742
3676
|
return true
|
|
3743
3677
|
}
|
|
3744
|
-
|
|
3745
3678
|
import {mergeProps as _$mergeProps7} from "@opentui/solid"
|
|
3746
3679
|
import {createComponent as _$createComponent26} from "@opentui/solid"
|
|
3747
3680
|
import {memo as _$memo18} from "@opentui/solid"
|
|
3748
3681
|
import {For as For8,createMemo as createMemo4,onMount as onMount3} from "solid-js"
|
|
3749
|
-
|
|
3750
3682
|
import {mergeProps as _$mergeProps6} from "@opentui/solid"
|
|
3751
3683
|
import {createComponent as _$createComponent25} from "@opentui/solid"
|
|
3752
3684
|
import {memo as _$memo17} from "@opentui/solid"
|
|
3753
3685
|
import {For as For7,createMemo as createMemo3,onMount as onMount2} from "solid-js"
|
|
3754
|
-
|
|
3755
3686
|
import {memo as _$memo15} from "@opentui/solid"
|
|
3756
3687
|
import {use as _$use6} from "@opentui/solid"
|
|
3757
3688
|
import {effect as _$effect21} from "@opentui/solid"
|
|
@@ -3763,7 +3694,6 @@ import {createElement as _$createElement23} from "@opentui/solid"
|
|
|
3763
3694
|
import {createComponent as _$createComponent23} from "@opentui/solid"
|
|
3764
3695
|
import {useTerminalDimensions as useTerminalDimensions4} from "@opentui/solid"
|
|
3765
3696
|
import {Show as Show5,createEffect as createEffect7,createSignal as createSignal14,onCleanup as onCleanup9} from "solid-js"
|
|
3766
|
-
|
|
3767
3697
|
import {createComponent as _$createComponent21} from "@opentui/solid"
|
|
3768
3698
|
import {effect as _$effect19} from "@opentui/solid"
|
|
3769
3699
|
import {createTextNode as _$createTextNode14} from "@opentui/solid"
|
|
@@ -3808,7 +3738,6 @@ _$insert19(_el$6,_$createComponent21(DialogAction,{get api() {return props.api
|
|
|
3808
3738
|
return _el$
|
|
3809
3739
|
})()
|
|
3810
3740
|
}
|
|
3811
|
-
|
|
3812
3741
|
import {effect as _$effect20} from "@opentui/solid"
|
|
3813
3742
|
import {createTextNode as _$createTextNode15} from "@opentui/solid"
|
|
3814
3743
|
import {insertNode as _$insertNode17} from "@opentui/solid"
|
|
@@ -3819,7 +3748,7 @@ import {createElement as _$createElement22} from "@opentui/solid"
|
|
|
3819
3748
|
import {For as For6} from "solid-js"
|
|
3820
3749
|
function PresetPreviewSummary(props) {const icons=useIcons()
|
|
3821
3750
|
const theme=()=>props.api.theme.current
|
|
3822
|
-
const color=(tone)=>tone==="accent"
|
|
3751
|
+
const color=(tone)=>tone==="accent"?theme().accent:tone==="warning"?theme().warning:theme().textMuted
|
|
3823
3752
|
return (()=>{var _el$=_$createElement22("box")
|
|
3824
3753
|
_$setProp20(_el$,"flexDirection","row")
|
|
3825
3754
|
_$setProp20(_el$,"flexWrap","wrap")
|
|
@@ -3840,7 +3769,6 @@ return _el$2
|
|
|
3840
3769
|
return _el$
|
|
3841
3770
|
})()
|
|
3842
3771
|
}
|
|
3843
|
-
|
|
3844
3772
|
function PresetPreviewFrame(props) {const icons=useIcons()
|
|
3845
3773
|
const dialogs=useDialogs(props.api)
|
|
3846
3774
|
const theme=()=>props.api.theme.current
|
|
@@ -3858,13 +3786,13 @@ return
|
|
|
3858
3786
|
if(props.blocked)
|
|
3859
3787
|
return
|
|
3860
3788
|
try {props.onApply()
|
|
3861
|
-
} catch (error) {props.api.ui.toast({variant:"error",title:props.title,message:error instanceof Error
|
|
3789
|
+
} catch (error) {props.api.ui.toast({variant:"error",title:props.title,message:error instanceof Error?error.message:"Could not apply preset",duration:4000
|
|
3862
3790
|
})
|
|
3863
3791
|
}
|
|
3864
3792
|
}
|
|
3865
3793
|
const unregister=props.api.keymap.registerLayer({mode:"modal",priority:1000,commands:[{name:`${prefix}.up`,run:()=>body?.scrollBy(-1)
|
|
3866
3794
|
},{name:`${prefix}.down`,run:()=>body?.scrollBy(1)
|
|
3867
|
-
},{name:`${prefix}.move`,run:()=>{setActive((value)=>value==="apply"
|
|
3795
|
+
},{name:`${prefix}.move`,run:()=>{setActive((value)=>value==="apply"?"cancel":"apply")
|
|
3868
3796
|
}
|
|
3869
3797
|
},{name:`${prefix}.submit`,run:()=>activate(active())
|
|
3870
3798
|
},{name:`${prefix}.refresh`,run:()=>props.onRefresh?.()
|
|
@@ -3934,12 +3862,12 @@ _$insertNode18(_el$7,_el$9)
|
|
|
3934
3862
|
_$setProp21(_el$7,"flexDirection","row")
|
|
3935
3863
|
_$setProp21(_el$7,"gap",1)
|
|
3936
3864
|
_$setProp21(_el$8,"flexShrink",0)
|
|
3937
|
-
_$insert21(_el$8,()=>icons.icon(props.blocked
|
|
3865
|
+
_$insert21(_el$8,()=>icons.icon(props.blocked?"error":"info"))
|
|
3938
3866
|
_$setProp21(_el$9,"flexGrow",1)
|
|
3939
3867
|
_$setProp21(_el$9,"wrapMode","word")
|
|
3940
3868
|
_$setProp21(_el$9,"height",2)
|
|
3941
3869
|
_$insert21(_el$9,()=>props.blocked||props.notice)
|
|
3942
|
-
_$effect21((_p$)=>{var _v$6=props.blocked
|
|
3870
|
+
_$effect21((_p$)=>{var _v$6=props.blocked?theme().warning:theme().accent,_v$7=props.blocked?theme().warning:theme().textMuted
|
|
3943
3871
|
_v$6!==_p$.e&&(_p$.e=_$setProp21(_el$8,"fg",_v$6,_p$.e))
|
|
3944
3872
|
_v$7!==_p$.t&&(_p$.t=_$setProp21(_el$9,"fg",_v$7,_p$.t))
|
|
3945
3873
|
return _p$
|
|
@@ -3965,7 +3893,6 @@ return _el$0
|
|
|
3965
3893
|
}
|
|
3966
3894
|
})
|
|
3967
3895
|
}
|
|
3968
|
-
|
|
3969
3896
|
import {createComponent as _$createComponent24} from "@opentui/solid"
|
|
3970
3897
|
import {effect as _$effect22} from "@opentui/solid"
|
|
3971
3898
|
import {createTextNode as _$createTextNode17} from "@opentui/solid"
|
|
@@ -3978,8 +3905,8 @@ import {TextAttributes as TextAttributes13} from "@opentui/core"
|
|
|
3978
3905
|
function PresetPreviewRow(props) {const icons=useIcons()
|
|
3979
3906
|
const theme=()=>props.api.theme.current
|
|
3980
3907
|
const emphasized=()=>props.status!=="unchanged"
|
|
3981
|
-
const statusColor=()=>props.status==="changed"
|
|
3982
|
-
return _$createComponent24(SelectionBox,{get backgroundColor() {return _$memo16(()=>!!emphasized())()
|
|
3908
|
+
const statusColor=()=>props.status==="changed"?theme().accent:props.status==="skipped"?theme().warning:theme().textMuted
|
|
3909
|
+
return _$createComponent24(SelectionBox,{get backgroundColor() {return _$memo16(()=>!!emphasized())()?theme().backgroundElement:theme().backgroundPanel
|
|
3983
3910
|
},paddingLeft:1,paddingRight:1,get children() {return [(()=>{var _el$=_$createElement24("box"),_el$2=_$createElement24("text"),_el$3=_$createElement24("text"),_el$4=_$createElement24("text"),_el$5=_$createTextNode17(` `)
|
|
3984
3911
|
_$insertNode19(_el$,_el$2)
|
|
3985
3912
|
_$insertNode19(_el$,_el$3)
|
|
@@ -3997,7 +3924,7 @@ _$insertNode19(_el$4,_el$5)
|
|
|
3997
3924
|
_$setProp22(_el$4,"flexShrink",0)
|
|
3998
3925
|
_$insert22(_el$4,()=>icons.icon(props.statusIcon),_el$5)
|
|
3999
3926
|
_$insert22(_el$4,()=>props.statusLabel,null)
|
|
4000
|
-
_$effect22((_p$)=>{var _v$=statusColor(),_v$2=emphasized()
|
|
3927
|
+
_$effect22((_p$)=>{var _v$=statusColor(),_v$2=emphasized()?theme().text:theme().textMuted,_v$3=emphasized()?TextAttributes13.BOLD:undefined,_v$4=statusColor(),_v$5=emphasized()?TextAttributes13.BOLD:undefined
|
|
4001
3928
|
_v$!==_p$.e&&(_p$.e=_$setProp22(_el$2,"fg",_v$,_p$.e))
|
|
4002
3929
|
_v$2!==_p$.t&&(_p$.t=_$setProp22(_el$3,"fg",_v$2,_p$.t))
|
|
4003
3930
|
_v$3!==_p$.a&&(_p$.a=_$setProp22(_el$3,"attributes",_v$3,_p$.a))
|
|
@@ -4020,7 +3947,6 @@ return _el$6
|
|
|
4020
3947
|
}
|
|
4021
3948
|
})
|
|
4022
3949
|
}
|
|
4023
|
-
|
|
4024
3950
|
function McpPresetPreview(props) {const dialogs=useDialogs(props.api)
|
|
4025
3951
|
const icons=useIcons()
|
|
4026
3952
|
const model=createMcpPresetPreview(props.controller,props.preferences,props.name)
|
|
@@ -4039,7 +3965,7 @@ return _$createComponent25(PresetPreviewFrame,{get api() {return props.api
|
|
|
4039
3965
|
},get valid() {return model.valid
|
|
4040
3966
|
},get blocked() {return model.blocked()
|
|
4041
3967
|
},get onRefresh() {return model.refresh
|
|
4042
|
-
},get notice() {return props.controller.persist()
|
|
3968
|
+
},get notice() {return props.controller.persist()?"Desired states will be remembered for this scope, including unavailable servers.":"MCP state persistence is off; desired states will not be saved."
|
|
4043
3969
|
},onApply:()=>{const request=model.apply()
|
|
4044
3970
|
if(!request)
|
|
4045
3971
|
return
|
|
@@ -4053,22 +3979,21 @@ reportMcpApplyError(props.api,request)
|
|
|
4053
3979
|
}
|
|
4054
3980
|
})
|
|
4055
3981
|
}
|
|
4056
|
-
function reportMcpApplyError(api,request) {request.catch((error)=>api.ui.toast({variant:"error",title:"Preset apply",message:error instanceof Error
|
|
3982
|
+
function reportMcpApplyError(api,request) {request.catch((error)=>api.ui.toast({variant:"error",title:"Preset apply",message:error instanceof Error?error.message:"MCP preset failed",duration:4000
|
|
4057
3983
|
}))
|
|
4058
3984
|
}
|
|
4059
3985
|
function mcpPreviewRows(model,icons) {return model.preview().rows.map((row)=>{const unchanged=`${row.status ?? "not available"} \xB7 unchanged`
|
|
4060
|
-
const description=row.desired
|
|
3986
|
+
const description=row.desired?{missing:`Not available in this workspace \xB7 target ${row.desired} \xB7 skipped`,unavailable:`${row.status} \xB7 target ${row.desired} \xB7 skipped`,connect:`${row.status} -> enabled \xB7 connect`,disconnect:`${row.status} -> disabled \xB7 disconnect`,unchanged
|
|
4061
3987
|
}[row.change]:`${unchanged} (not in preset)`
|
|
4062
|
-
return{icon:icons.icon("mcp"),title:row.name,description,changed:row.change==="connect"||row.change==="disconnect",skipped:row.change==="missing"||row.change==="unavailable",status:row.change==="connect"||row.change==="disconnect"
|
|
3988
|
+
return{icon:icons.icon("mcp"),title:row.name,description,changed:row.change==="connect"||row.change==="disconnect",skipped:row.change==="missing"||row.change==="unavailable",status:row.change==="connect"||row.change==="disconnect"?"changed":row.change==="missing"||row.change==="unavailable"?"skipped":"unchanged",statusIcon:row.change==="connect"?"connected":row.change==="disconnect"?"disconnected":row.change==="missing"||row.change==="unavailable"?"pending":"done",statusLabel:row.change==="connect"?"CONNECT":row.change==="disconnect"?"DISCONNECT":row.change==="missing"||row.change==="unavailable"?"SKIPPED":"UNCHANGED"
|
|
4063
3989
|
}
|
|
4064
3990
|
}).sort((a,b)=>Number(b.changed) - Number(a.changed)||Number(b.skipped) - Number(a.skipped))
|
|
4065
3991
|
}
|
|
4066
|
-
|
|
4067
3992
|
function LayoutPresetPreview(props) {const dialogs=useDialogs(props.api)
|
|
4068
3993
|
const icons=useIcons()
|
|
4069
3994
|
const model=createLayoutPresetPreview(props.preferences,props.name)
|
|
4070
3995
|
const linked=props.preferences.workspaceProfiles?.()[props.name]
|
|
4071
|
-
const mcpModel=props.controller&&linked
|
|
3996
|
+
const mcpModel=props.controller&&linked?createMcpPresetPreview(props.controller,props.preferences,linked):undefined
|
|
4072
3997
|
const rows=createMemo4(()=>model.preview()?.rows.map((row)=>{const changes=[]
|
|
4073
3998
|
if(row.visibility[0]!==row.visibility[1])
|
|
4074
3999
|
changes.push(`${row.visibility[0] ? "visible" : "hidden"} -> ${row.visibility[1] ? "visible" : "hidden"}`)
|
|
@@ -4076,22 +4001,22 @@ if(row.expansion[0]!==row.expansion[1])
|
|
|
4076
4001
|
changes.push(`${row.expansion[0] ? "expanded" : "collapsed"} -> ${row.expansion[1] ? "expanded" : "collapsed"}`)
|
|
4077
4002
|
if(row.position[0]!==row.position[1])
|
|
4078
4003
|
changes.push(`position ${row.position[0]} -> ${row.position[1]}`)
|
|
4079
|
-
return{icon:icons.section(row.section),title:`${row.position[1]}. ${SECTION_DEFINITIONS.find((section) => section.name === row.section).label}`,description:changes.join(" \xB7 ")||"No changes",changed:changes.length
|
|
4004
|
+
return{icon:icons.section(row.section),title:`${row.position[1]}. ${SECTION_DEFINITIONS.find((section) => section.name === row.section).label}`,description:changes.join(" \xB7 ")||"No changes",changed:changes.length>0,status:changes.length>0?"changed":"unchanged",statusIcon:changes.length>0?"edit":"done",statusLabel:changes.length>0?"CHANGED":"UNCHANGED"
|
|
4080
4005
|
}
|
|
4081
4006
|
}).sort((a,b)=>Number(b.changed) - Number(a.changed))??[])
|
|
4082
|
-
const mcpRows=createMemo4(()=>mcpModel
|
|
4007
|
+
const mcpRows=createMemo4(()=>mcpModel?mcpPreviewRows(mcpModel,icons):[])
|
|
4083
4008
|
const changed=()=>rows().filter((row)=>row.changed).length
|
|
4084
4009
|
onMount3(()=>mcpModel?.refresh())
|
|
4085
4010
|
return _$createComponent26(PresetPreviewFrame,{get api() {return props.api
|
|
4086
4011
|
},get title() {return `${mcpModel ? "Workspace profile" : "Layout preview"}: ${props.name}`
|
|
4087
|
-
},get scope() {return mcpModel
|
|
4012
|
+
},get scope() {return mcpModel?`${model.scope()} \xB7 MCP ${mcpModel.scope}`:model.scope()
|
|
4088
4013
|
},get stats() {return [{icon:"edit",label:`${changed()} layout changed`,tone:"accent"
|
|
4089
4014
|
},{icon:"done",label:`${rows().length - changed()} layout unchanged`,tone:"muted"
|
|
4090
4015
|
}]
|
|
4091
4016
|
},get rowCount() {return rows().length + mcpRows().length
|
|
4092
4017
|
},valid:()=>model.valid()&&(!mcpModel||mcpModel.valid()),get blocked() {return model.blocked()||mcpModel?.blocked()
|
|
4093
4018
|
},get onRefresh() {return mcpModel?.refresh
|
|
4094
|
-
},notice:mcpModel
|
|
4019
|
+
},notice:mcpModel?"Applies both presets; layout stays session-only.":"Applies layout changes. Save current layout as default to persist them.",onApply:()=>{const request=mcpModel?.apply()
|
|
4095
4020
|
if(mcpModel&&!request)
|
|
4096
4021
|
return
|
|
4097
4022
|
if(!model.apply())
|
|
@@ -4101,7 +4026,7 @@ dialogs.close()
|
|
|
4101
4026
|
else {dialogs.back()
|
|
4102
4027
|
dialogs.back()
|
|
4103
4028
|
}
|
|
4104
|
-
props.api.ui.toast({variant:"success",title:mcpModel
|
|
4029
|
+
props.api.ui.toast({variant:"success",title:mcpModel?"Workspace profile":"Layout presets",message:`${props.name} applied to ${model.scope()}`,duration:3000
|
|
4105
4030
|
})
|
|
4106
4031
|
if(request)
|
|
4107
4032
|
reportMcpApplyError(props.api,request)
|
|
@@ -4117,16 +4042,14 @@ reportMcpApplyError(props.api,request)
|
|
|
4117
4042
|
}
|
|
4118
4043
|
})
|
|
4119
4044
|
}
|
|
4120
|
-
|
|
4121
4045
|
import {createComponent as _$createComponent28} from "@opentui/solid"
|
|
4122
|
-
|
|
4123
4046
|
import {createComponent as _$createComponent27} from "@opentui/solid"
|
|
4124
4047
|
function McpGroupAssignmentDialog(props) {const dialogs=useDialogs(props.api)
|
|
4125
4048
|
const options=()=>{const assigned=props.preferences.mcpServerGroups?.()[props.server]
|
|
4126
4049
|
const groups=[...new Set(Object.values(props.preferences.mcpServerGroups?.()??{}))].sort((a,b)=>a.localeCompare(b))
|
|
4127
|
-
return [...groups.map((group)=>({title:group,value:`:${group}`,description:group===assigned
|
|
4050
|
+
return [...groups.map((group)=>({title:group,value:`:${group}`,description:group===assigned?"Current":"Existing group"
|
|
4128
4051
|
})),{title:"Create new group",value:"+",description:"Type a name"
|
|
4129
|
-
},{title:"Ungrouped",value:":",description:assigned
|
|
4052
|
+
},{title:"Ungrouped",value:":",description:assigned?"Remove assignment":"No group"
|
|
4130
4053
|
}]
|
|
4131
4054
|
}
|
|
4132
4055
|
return _$createComponent27(PresetMenu,{get api() {return props.api
|
|
@@ -4146,7 +4069,6 @@ dialogs.back()
|
|
|
4146
4069
|
}
|
|
4147
4070
|
})
|
|
4148
4071
|
}
|
|
4149
|
-
|
|
4150
4072
|
function McpGroupsDialog(props) {const dialogs=useDialogs(props.api)
|
|
4151
4073
|
const options=()=>{const live=new Set(props.mcp.list(props.mcp.target()).map((item)=>item.name))
|
|
4152
4074
|
return [...new Set([...live,...Object.keys(props.preferences.mcpServerGroups?.()??{})])].sort((a,b)=>a.localeCompare(b)).map((name)=>({title:name,value:name,description:[props.preferences.mcpServerGroups?.()[name]??"Ungrouped",!live.has(name)&&"not in workspace"].filter(Boolean).join(" \xB7 ")
|
|
@@ -4161,7 +4083,6 @@ return _$createComponent28(PresetMenu,{get api() {return props.api
|
|
|
4161
4083
|
}))
|
|
4162
4084
|
})
|
|
4163
4085
|
}
|
|
4164
|
-
|
|
4165
4086
|
import {createComponent as _$createComponent29} from "@opentui/solid"
|
|
4166
4087
|
import {setProp as _$setProp23} from "@opentui/solid"
|
|
4167
4088
|
import {effect as _$effect23} from "@opentui/solid"
|
|
@@ -4175,14 +4096,14 @@ return current.key===target.key&¤t.scope===target.scope
|
|
|
4175
4096
|
function notify(message) {api.ui.toast({variant:"success",title:"MCP presets",message,duration:3000
|
|
4176
4097
|
})
|
|
4177
4098
|
}
|
|
4178
|
-
function prompt(value="",renameFrom) {dialogs.prompt({title:renameFrom
|
|
4099
|
+
function prompt(value="",renameFrom) {dialogs.prompt({title:renameFrom?"Rename MCP preset":"Save MCP preset",description:()=>(()=>{var _el$=_$createElement25("text")
|
|
4179
4100
|
_$insertNode20(_el$,_$createTextNode18(`Save the current enabled and disabled servers.`))
|
|
4180
4101
|
_$effect23((_$p)=>_$setProp23(_el$,"fg",api.theme.current.textMuted,_$p))
|
|
4181
4102
|
return _el$
|
|
4182
|
-
})(),placeholder:"Preset name",value,onConfirm(input) {const name=renameFrom
|
|
4103
|
+
})(),placeholder:"Preset name",value,onConfirm(input) {const name=renameFrom?preferences.renameMcpPreset(renameFrom,input):preferences.saveMcpPreset(input,controller.capturePreset())
|
|
4183
4104
|
if(renameFrom)
|
|
4184
4105
|
controller.renameSelectedPreset(renameFrom)
|
|
4185
|
-
notify(renameFrom
|
|
4106
|
+
notify(renameFrom?`Renamed to ${name}`:`Saved ${name}`)
|
|
4186
4107
|
dialogs.back()
|
|
4187
4108
|
if(renameFrom)
|
|
4188
4109
|
dialogs.back()
|
|
@@ -4203,7 +4124,7 @@ throw new Error("MCP preset no longer exists")
|
|
|
4203
4124
|
controller.updateSelectedPreset(name)
|
|
4204
4125
|
notify(`Updated ${name}`)
|
|
4205
4126
|
dialogs.back()
|
|
4206
|
-
} catch (error) {api.ui.toast({variant:"error",title:"MCP presets",message:error instanceof Error
|
|
4127
|
+
} catch (error) {api.ui.toast({variant:"error",title:"MCP presets",message:error instanceof Error?error.message:"Could not update the preset",duration:4000
|
|
4207
4128
|
})
|
|
4208
4129
|
dialogs.back()
|
|
4209
4130
|
}
|
|
@@ -4225,10 +4146,9 @@ dialogs.back()
|
|
|
4225
4146
|
dialogs.open(()=>_$createComponent29(PresetMenu,{api,title:"MCP presets",get options() {return [{title:"Save current",value:"save",description:"Create a preset from the current server states",icon:"save"
|
|
4226
4147
|
},...Object.entries(preferences.mcpPresets()).map(([name,states])=>({title:name,value:`preset:${name}`,icon:"presets",description:`${Object.values(states).filter((state) => state === "enabled").length}/${Object.keys(states).length} enabled`
|
|
4227
4148
|
}))]
|
|
4228
|
-
},onSelect:(option)=>option.value==="save"
|
|
4149
|
+
},onSelect:(option)=>option.value==="save"?prompt():actions(option.value.slice("preset:".length))
|
|
4229
4150
|
}))
|
|
4230
4151
|
}
|
|
4231
|
-
|
|
4232
4152
|
import {memo as _$memo19} from "@opentui/solid"
|
|
4233
4153
|
import {createComponent as _$createComponent30} from "@opentui/solid"
|
|
4234
4154
|
import {use as _$use7} from "@opentui/solid"
|
|
@@ -4318,7 +4238,7 @@ _$setProp24(_el$0,"scrollX",false)
|
|
|
4318
4238
|
_$setProp24(_el$1,"gap",1)
|
|
4319
4239
|
_$insert23(_el$1,_$createComponent30(For9,{get each() {return actions()
|
|
4320
4240
|
},children:(action,index)=>_$createComponent30(SelectionBox,{get id() {return `${prefix}.${action.command}`
|
|
4321
|
-
},flexDirection:"row",gap:1,paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo19(()=>selected()===action.command)()
|
|
4241
|
+
},flexDirection:"row",gap:1,paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo19(()=>selected()===action.command)()?theme().backgroundElement:undefined
|
|
4322
4242
|
},onMouseOver:()=>setSelected(action.command),onMouseDown:()=>{setSelected(action.command)
|
|
4323
4243
|
props.preferences.toggleQuickAction(action.command)
|
|
4324
4244
|
},get children() {return [(()=>{var _el$16=_$createElement26("text"),_el$17=_$createTextNode19(` `),_el$18=_$createTextNode19(`. `),_el$19=_$createTextNode19(` `)
|
|
@@ -4326,7 +4246,7 @@ _$insertNode21(_el$16,_el$17)
|
|
|
4326
4246
|
_$insertNode21(_el$16,_el$18)
|
|
4327
4247
|
_$insertNode21(_el$16,_el$19)
|
|
4328
4248
|
_$setProp24(_el$16,"flexGrow",1)
|
|
4329
|
-
_$insert23(_el$16,()=>icons.icon(props.preferences.selectedQuickActionVisible(action.command)
|
|
4249
|
+
_$insert23(_el$16,()=>icons.icon(props.preferences.selectedQuickActionVisible(action.command)?"checked":"unchecked"),_el$17)
|
|
4330
4250
|
_$insert23(_el$16,()=>index() + 1,_el$18)
|
|
4331
4251
|
_$insert23(_el$16,()=>icons.action(action.command),_el$19)
|
|
4332
4252
|
_$insert23(_el$16,()=>action.label,null)
|
|
@@ -4376,7 +4296,6 @@ return _el$10
|
|
|
4376
4296
|
}
|
|
4377
4297
|
})
|
|
4378
4298
|
}
|
|
4379
|
-
|
|
4380
4299
|
import {memo as _$memo21} from "@opentui/solid"
|
|
4381
4300
|
import {use as _$use8} from "@opentui/solid"
|
|
4382
4301
|
import {createComponent as _$createComponent35} from "@opentui/solid"
|
|
@@ -4388,25 +4307,23 @@ import {setProp as _$setProp28} from "@opentui/solid"
|
|
|
4388
4307
|
import {createElement as _$createElement30} from "@opentui/solid"
|
|
4389
4308
|
import {TextAttributes as TextAttributes16} from "@opentui/core"
|
|
4390
4309
|
import {For as For10} from "solid-js"
|
|
4391
|
-
|
|
4392
4310
|
import {useTerminalDimensions as useTerminalDimensions6} from "@opentui/solid"
|
|
4393
4311
|
import {createEffect as createEffect9,createMemo as createMemo8,onCleanup as onCleanup11,onMount as onMount4} from "solid-js"
|
|
4394
|
-
|
|
4395
4312
|
import {createComponent as _$createComponent31} from "@opentui/solid"
|
|
4396
4313
|
import {setProp as _$setProp25} from "@opentui/solid"
|
|
4397
4314
|
import {effect as _$effect25} from "@opentui/solid"
|
|
4398
4315
|
import {createTextNode as _$createTextNode20} from "@opentui/solid"
|
|
4399
4316
|
import {insertNode as _$insertNode22} from "@opentui/solid"
|
|
4400
4317
|
import {createElement as _$createElement27} from "@opentui/solid"
|
|
4401
|
-
function createLayoutPresetActions(input) {function prompt(value="",renameFrom) {input.dialogs.prompt({title:renameFrom
|
|
4318
|
+
function createLayoutPresetActions(input) {function prompt(value="",renameFrom) {input.dialogs.prompt({title:renameFrom?"Rename layout preset":"Save layout preset",description:()=>(()=>{var _el$=_$createElement27("text")
|
|
4402
4319
|
_$insertNode22(_el$,_$createTextNode20(`Save the current visible, expanded, and ordered sections.`))
|
|
4403
4320
|
_$effect25((_$p)=>_$setProp25(_el$,"fg",input.api.theme.current.textMuted,_$p))
|
|
4404
4321
|
return _el$
|
|
4405
|
-
})(),placeholder:"Preset name",value,onConfirm(nameInput) {const name=renameFrom
|
|
4322
|
+
})(),placeholder:"Preset name",value,onConfirm(nameInput) {const name=renameFrom?input.preferences.renameLayoutPreset(renameFrom,nameInput):input.preferences.saveLayoutPreset(nameInput)
|
|
4406
4323
|
input.dialogs.back()
|
|
4407
4324
|
if(renameFrom)
|
|
4408
4325
|
input.dialogs.back()
|
|
4409
|
-
input.api.ui.toast({variant:"success",title:"Layout presets",message:renameFrom
|
|
4326
|
+
input.api.ui.toast({variant:"success",title:"Layout presets",message:renameFrom?`Renamed to ${name}`:`Saved ${name}`,duration:3000
|
|
4410
4327
|
})
|
|
4411
4328
|
}
|
|
4412
4329
|
})
|
|
@@ -4418,10 +4335,10 @@ input.dialogs.back()
|
|
|
4418
4335
|
}
|
|
4419
4336
|
})
|
|
4420
4337
|
input.dialogs.open(()=>_$createComponent31(PresetMenu,{get api() {return input.api
|
|
4421
|
-
},title:name,get options() {return [{title:"Preview & apply",value:"apply",icon:"info",description:linked
|
|
4338
|
+
},title:name,get options() {return [{title:"Preview & apply",value:"apply",icon:"info",description:linked?`profile \xB7 ${linked}`:"review layout changes"
|
|
4422
4339
|
},{title:"Update from current",value:"update",icon:"save",description:"replace saved layout"
|
|
4423
4340
|
},{title:"Rename\u2026",value:"rename",description:"change preset name",icon:"edit"
|
|
4424
|
-
},...input.mcp
|
|
4341
|
+
},...input.mcp?[{title:linked?"Change MCP link\u2026":"Link MCP preset\u2026",value:"link",icon:"mcp",description:linked?`${linked} \xB7 empty unlinks`:"pair layout and MCP"
|
|
4425
4342
|
}]:[],{title:"Delete",value:"delete",description:"remove preset",icon:"delete"
|
|
4426
4343
|
}]
|
|
4427
4344
|
},onSelect:(option)=>{switch (option.value) {case "apply":{input.dialogs.open(()=>_$createComponent31(LayoutPresetPreview,{get api() {return input.api
|
|
@@ -4453,25 +4370,24 @@ input.dialogs.back()
|
|
|
4453
4370
|
return{open,prompt
|
|
4454
4371
|
}
|
|
4455
4372
|
}
|
|
4456
|
-
|
|
4457
4373
|
import {createMemo as createMemo6} from "solid-js"
|
|
4458
4374
|
function createSettingsGroups(api,preferences,icons) {const supportedSections=()=>SIDEBAR_SECTIONS.filter((name)=>supportsSidebarSection(api,name))
|
|
4459
4375
|
const groups=createMemo6(()=>[{id:"scope",tab:"Scope",title:"Preference scope",options:[{title:`${icons.icon(preferences.preferenceScope() === "global" ? "radioOn" : "radioOff")} Global`,value:"scope:global",description:"applies to every worktree"
|
|
4460
|
-
},{title:`${icons.icon(preferences.preferenceScope() === "worktree" ? "radioOn" : "radioOff")} Current worktree`,value:"scope:worktree",description:preferences.canUseWorktreeScope()
|
|
4376
|
+
},{title:`${icons.icon(preferences.preferenceScope() === "worktree" ? "radioOn" : "radioOff")} Current worktree`,value:"scope:worktree",description:preferences.canUseWorktreeScope()?preferences.preferenceScopeLabel():"unavailable outside a worktree"
|
|
4461
4377
|
}
|
|
4462
4378
|
]
|
|
4463
|
-
},{id:"presets",tab:"Presets",title:"Layout presets",options:[...Object.keys(preferences.layoutPresets()).sort((left,right)=>left.localeCompare(right)).map((name)=>({title:`${icons.icon("presets")} ${name}`,value:`preset:custom:${encodeURIComponent(name)}`,description:preferences.workspaceProfiles?.()[name]
|
|
4379
|
+
},{id:"presets",tab:"Presets",title:"Layout presets",options:[...Object.keys(preferences.layoutPresets()).sort((left,right)=>left.localeCompare(right)).map((name)=>({title:`${icons.icon("presets")} ${name}`,value:`preset:custom:${encodeURIComponent(name)}`,description:preferences.workspaceProfiles?.()[name]?`profile \xB7 ${preferences.workspaceProfiles()[name]}`:"enter to apply or edit"
|
|
4464
4380
|
})),{title:`${icons.icon("add")} Save as\u2026`,value:"save_preset",description:"create a preset from the current layout"
|
|
4465
4381
|
}
|
|
4466
4382
|
]
|
|
4467
4383
|
},{id:"sections",tab:"Sections",title:"Sections & order",options:preferences.selectedSectionOrder().filter((name)=>supportsSidebarSection(api,name)).map((name,index)=>{const section=SECTION_DEFINITIONS.find((candidate)=>candidate.name===name)
|
|
4468
|
-
return{title:`${icons.icon(preferences.selectedSections()[section.name] ? "checked" : "unchecked")} ${index + 1}. ${icons.section(section.name)} ${section.label}`,value:section.name,description:preferences.selectedSections()[section.name]
|
|
4384
|
+
return{title:`${icons.icon(preferences.selectedSections()[section.name] ? "checked" : "unchecked")} ${index + 1}. ${icons.section(section.name)} ${section.label}`,value:section.name,description:preferences.selectedSections()[section.name]?"visible":"hidden"
|
|
4469
4385
|
}
|
|
4470
4386
|
})
|
|
4471
|
-
},{id:"behavior",tab:"Behavior",title:"Behavior",options:[{title:`${icons.icon(preferences.selectedPersistMcp() ? "checked" : "unchecked")} Remember MCP states`,value:"persist_mcp",description:preferences.selectedPersistMcp()
|
|
4472
|
-
},{title:`${icons.icon("settings")} Icon style`,value:"lsp_icon_style",description:preferences.selectedLspIconStyle()==="nerd"
|
|
4473
|
-
},{title:`${icons.icon(preferences.selectedCornerFont() ? "checked" : "unchecked")} Multiline corner font`,value:"corner_font",description:preferences.selectedCornerFont()
|
|
4474
|
-
},{title:`${icons.icon("sections")} Row density`,value:"row_density",description:preferences.selectedRowDensity()==="compact"
|
|
4387
|
+
},{id:"behavior",tab:"Behavior",title:"Behavior",options:[{title:`${icons.icon(preferences.selectedPersistMcp() ? "checked" : "unchecked")} Remember MCP states`,value:"persist_mcp",description:preferences.selectedPersistMcp()?"on":"off"
|
|
4388
|
+
},{title:`${icons.icon("settings")} Icon style`,value:"lsp_icon_style",description:preferences.selectedLspIconStyle()==="nerd"?"Nerd Font":"Text fallback"
|
|
4389
|
+
},{title:`${icons.icon(preferences.selectedCornerFont() ? "checked" : "unchecked")} Multiline corner font`,value:"corner_font",description:preferences.selectedCornerFont()?"Installed":"Not installed \xB7 rectangular highlights"
|
|
4390
|
+
},{title:`${icons.icon("sections")} Row density`,value:"row_density",description:preferences.selectedRowDensity()==="compact"?"Compact":"Comfortable"
|
|
4475
4391
|
},{title:`${icons.icon("sections")} Sidebar shortcut`,value:"toggle_key",description:preferences.selectedToggleKey()
|
|
4476
4392
|
},{title:`${icons.icon("selected")} Focus shortcut`,value:"focus_key",description:preferences.selectedFocusKey()
|
|
4477
4393
|
},{title:`${icons.icon("search")} Search Everything shortcut`,value:"search_key",description:preferences.selectedSearchKey?.()??DEFAULT_SEARCH_KEY
|
|
@@ -4492,7 +4408,6 @@ return{title:`${icons.icon(preferences.selectedSections()[section.name] ? "check
|
|
|
4492
4408
|
const orderedGroups=createMemo6(()=>["sections","scope","presets","behavior","defaults"].map((id)=>groups().find((group)=>group.id===id)))
|
|
4493
4409
|
return orderedGroups
|
|
4494
4410
|
}
|
|
4495
|
-
|
|
4496
4411
|
function registerSettingsKeymap(input) {return input.api.keymap.registerLayer({mode:"modal",priority:1000,commands:[{name:`${PLUGIN_ID}.settings.previous`,run:()=>input.move(-1)},{name:`${PLUGIN_ID}.settings.next`,run:()=>input.move(1)},{name:`${PLUGIN_ID}.settings.select`,run:()=>input.select()},{name:`${PLUGIN_ID}.settings.mcp-groups`,run:()=>{if (input.activeGroup()==="sections"&&input.options()[input.active()]?.value==="mcp")
|
|
4497
4412
|
input.openMcpGroups()
|
|
4498
4413
|
}
|
|
@@ -4508,14 +4423,12 @@ input.openLimitPrompt(section)
|
|
|
4508
4423
|
]
|
|
4509
4424
|
})
|
|
4510
4425
|
}
|
|
4511
|
-
|
|
4512
4426
|
import {createComponent as _$createComponent33} from "@opentui/solid"
|
|
4513
4427
|
import {setProp as _$setProp26} from "@opentui/solid"
|
|
4514
4428
|
import {effect as _$effect26} from "@opentui/solid"
|
|
4515
4429
|
import {createTextNode as _$createTextNode21} from "@opentui/solid"
|
|
4516
4430
|
import {insertNode as _$insertNode23} from "@opentui/solid"
|
|
4517
4431
|
import {createElement as _$createElement28} from "@opentui/solid"
|
|
4518
|
-
|
|
4519
4432
|
import {createComponent as _$createComponent32} from "@opentui/solid"
|
|
4520
4433
|
import {createMemo as createMemo7} from "solid-js"
|
|
4521
4434
|
var RESET_ALL="__reset_all__"
|
|
@@ -4536,7 +4449,6 @@ props.preferences.revokeSkillConfirmation(option.value)
|
|
|
4536
4449
|
}
|
|
4537
4450
|
})
|
|
4538
4451
|
}
|
|
4539
|
-
|
|
4540
4452
|
function createSettingsSelection(input) {function openLimitPrompt(section) {const index=input.options().findIndex((option)=>option.value===section)
|
|
4541
4453
|
if(index!==-1)
|
|
4542
4454
|
input.setActive(index)
|
|
@@ -4567,11 +4479,11 @@ input.dialogs.back()
|
|
|
4567
4479
|
})
|
|
4568
4480
|
}
|
|
4569
4481
|
function saveLayout() {input.preferences.saveLayoutAsDefault().then(()=>input.api.ui.toast({variant:"success",title:"Navigator settings",message:"Current layout saved as default",duration:3000
|
|
4570
|
-
})).catch((error)=>input.api.ui.toast({variant:"error",title:"Navigator settings",message:error instanceof Error
|
|
4482
|
+
})).catch((error)=>input.api.ui.toast({variant:"error",title:"Navigator settings",message:error instanceof Error?error.message:"Failed to save the default layout",duration:5000
|
|
4571
4483
|
}))
|
|
4572
4484
|
}
|
|
4573
4485
|
function exportSettings() {const copied=input.api.renderer.copyToClipboardOSC52(input.preferences.exportPortableSettings())
|
|
4574
|
-
input.api.ui.toast({variant:copied
|
|
4486
|
+
input.api.ui.toast({variant:copied?"success":"warning",title:"Portable settings",message:copied?"Layout and MCP settings copied as JSON":"Terminal clipboard is unavailable",duration:4000
|
|
4575
4487
|
})
|
|
4576
4488
|
}
|
|
4577
4489
|
function importSettings() {input.dialogs.prompt({title:"Import portable settings",description:()=>(()=>{var _el$5=_$createElement28("text")
|
|
@@ -4579,10 +4491,10 @@ _$insertNode23(_el$5,_$createTextNode21(`Paste versioned Navigator JSON.`))
|
|
|
4579
4491
|
_$effect26((_$p)=>_$setProp26(_el$5,"fg",input.api.theme.current.textMuted,_$p))
|
|
4580
4492
|
return _el$5
|
|
4581
4493
|
})(),onConfirm(source) {const preview=input.preferences.previewPortableSettings(source)
|
|
4582
|
-
const options=[...preview.settings.layout
|
|
4583
|
-
}]:[],...preview.settings.mcp
|
|
4494
|
+
const options=[...preview.settings.layout?[{title:`Layout \xB7 ${preview.layoutChanged ? "CHANGED" : "UNCHANGED"}`,value:"status",description:`${Object.keys(preview.settings.layout.sections).length} visibility \xB7 ${Object.keys(preview.settings.layout.expanded).length} expansion values`,icon:preview.layoutChanged?"edit":"done"
|
|
4495
|
+
}]:[],...preview.settings.mcp?[{title:`MCP \xB7 ${preview.mcpChanged ? "CHANGED" : "UNCHANGED"}`,value:"status",description:`${Object.keys(preview.settings.mcp).length} remembered server states`,icon:preview.mcpChanged?"edit":"done"
|
|
4584
4496
|
}]:[],...preview.unsupported.map((path)=>({title:"Unsupported field \xB7 SKIPPED",value:"status",description:path,icon:"error"
|
|
4585
|
-
})),...preview.layoutChanged||preview.mcpChanged
|
|
4497
|
+
})),...preview.layoutChanged||preview.mcpChanged?[{title:"Apply imported settings",value:"apply",description:preview.target,icon:"done"
|
|
4586
4498
|
}]:[],{title:"Cancel",value:"cancel",description:"return without changes",icon:"close"
|
|
4587
4499
|
}]
|
|
4588
4500
|
let applying=false
|
|
@@ -4592,7 +4504,7 @@ input.api.ui.toast({variant:"success",title:"Portable settings",message:"Layout
|
|
|
4592
4504
|
})
|
|
4593
4505
|
input.dialogs.back()
|
|
4594
4506
|
} catch (error) {applying=false
|
|
4595
|
-
input.api.ui.toast({variant:"error",title:"Portable settings",message:error instanceof Error
|
|
4507
|
+
input.api.ui.toast({variant:"error",title:"Portable settings",message:error instanceof Error?error.message:"Could not import settings",duration:5000
|
|
4596
4508
|
})
|
|
4597
4509
|
}
|
|
4598
4510
|
}
|
|
@@ -4614,7 +4526,7 @@ const index=input.options().findIndex((option)=>option.value===value)
|
|
|
4614
4526
|
if(index!==-1)
|
|
4615
4527
|
input.setActive(index)
|
|
4616
4528
|
if(value==="scope:global"||value==="scope:worktree")
|
|
4617
|
-
input.preferences.setPreferenceScope(value==="scope:global"
|
|
4529
|
+
input.preferences.setPreferenceScope(value==="scope:global"?"global":"worktree")
|
|
4618
4530
|
else if (value.startsWith("preset:custom:"))
|
|
4619
4531
|
input.openPreset(decodeURIComponent(value.slice("preset:custom:".length)))
|
|
4620
4532
|
else
|
|
@@ -4694,7 +4606,6 @@ input.dialogs.open(()=>_$createComponent33(McpGroupsDialog,{get api() {return in
|
|
|
4694
4606
|
return{openLimitPrompt,openMcpGroups,openQuickActions,select
|
|
4695
4607
|
}
|
|
4696
4608
|
}
|
|
4697
|
-
|
|
4698
4609
|
function createSettingsDialogController(props) {let body
|
|
4699
4610
|
const theme=()=>props.api.theme.current
|
|
4700
4611
|
const icons=useIcons()
|
|
@@ -4709,7 +4620,7 @@ const options=createMemo8(()=>orderedGroups().find((group)=>group.id===activeGro
|
|
|
4709
4620
|
const optionId=(value)=>`${PLUGIN_ID}.settings.${value}`
|
|
4710
4621
|
const initialActive=options().findIndex((option)=>option.value===props.activeValue)
|
|
4711
4622
|
const [active,setActive]=useDialogState("selection",Math.max(0,initialActive))
|
|
4712
|
-
createEffect9(()=>{if (active()
|
|
4623
|
+
createEffect9(()=>{if (active()>=options().length)
|
|
4713
4624
|
setActive(Math.max(0,options().length - 1))
|
|
4714
4625
|
})
|
|
4715
4626
|
const contentHeight=createMemo8(()=>Math.min(bodyHeight(),Math.max(1,options().length * 2 - 1)))
|
|
@@ -4766,7 +4677,6 @@ scroll.ref(node)
|
|
|
4766
4677
|
},restoreScroll:scroll.restore,saveScroll:scroll.save,theme
|
|
4767
4678
|
}
|
|
4768
4679
|
}
|
|
4769
|
-
|
|
4770
4680
|
import {createComponent as _$createComponent34} from "@opentui/solid"
|
|
4771
4681
|
import {createTextNode as _$createTextNode22} from "@opentui/solid"
|
|
4772
4682
|
import {insertNode as _$insertNode24} from "@opentui/solid"
|
|
@@ -4782,13 +4692,13 @@ const index=()=>model.options().findIndex((candidate)=>candidate.value===props.o
|
|
|
4782
4692
|
const selected=()=>model.active()===index()
|
|
4783
4693
|
const section=()=>props.option.value
|
|
4784
4694
|
return _$createComponent34(SelectionBox,{get id() {return model.optionId(props.option.value)
|
|
4785
|
-
},flexDirection:"row",gap:2,paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo20(()=>!!selected())()
|
|
4695
|
+
},flexDirection:"row",gap:2,paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo20(()=>!!selected())()?model.theme().backgroundElement:undefined
|
|
4786
4696
|
},onMouseOver:()=>model.setActive(index()),onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
4787
4697
|
model.select(props.option.value)
|
|
4788
4698
|
},get children() {return [(()=>{var _el$=_$createElement29("text")
|
|
4789
4699
|
_$setProp27(_el$,"flexShrink",0)
|
|
4790
4700
|
_$insert24(_el$,()=>props.option.title)
|
|
4791
|
-
_$effect27((_p$)=>{var _v$=selected()
|
|
4701
|
+
_$effect27((_p$)=>{var _v$=selected()?TextAttributes15.BOLD:undefined,_v$2=model.theme().text
|
|
4792
4702
|
_v$!==_p$.e&&(_p$.e=_$setProp27(_el$,"attributes",_v$,_p$.e))
|
|
4793
4703
|
_v$2!==_p$.t&&(_p$.t=_$setProp27(_el$,"fg",_v$2,_p$.t))
|
|
4794
4704
|
return _p$
|
|
@@ -4860,7 +4770,6 @@ return _el$3
|
|
|
4860
4770
|
}
|
|
4861
4771
|
})
|
|
4862
4772
|
}
|
|
4863
|
-
|
|
4864
4773
|
function SettingsDialog(props) {const model=createSettingsDialogController(props)
|
|
4865
4774
|
return _$createComponent35(DialogSurface,{get api() {return props.api
|
|
4866
4775
|
},get children() {return [(()=>{var _el$=_$createElement30("box"),_el$2=_$createElement30("text"),_el$3=_$createTextNode23(` Navigator settings`),_el$4=_$createElement30("text")
|
|
@@ -4903,7 +4812,7 @@ return _el$7
|
|
|
4903
4812
|
})(),(()=>{var _el$8=_$createElement30("scrollbox"),_el$9=_$createElement30("box")
|
|
4904
4813
|
_$insertNode25(_el$8,_el$9)
|
|
4905
4814
|
var _ref$=model.setBody
|
|
4906
|
-
typeof _ref$==="function"
|
|
4815
|
+
typeof _ref$==="function"?_$use8(_ref$,_el$8):model.setBody=_el$8
|
|
4907
4816
|
_$setProp28(_el$8,"scrollX",false)
|
|
4908
4817
|
_$setProp28(_el$8,"verticalScrollbarOptions",{visible:true
|
|
4909
4818
|
})
|
|
@@ -4934,7 +4843,6 @@ return _el$0
|
|
|
4934
4843
|
function openSettings(api,preferences,activeValue,mcp) {createDialogStack(api,preferences.lspIconStyle,()=>true,preferences.cornerFont).open(()=>_$createComponent35(SettingsDialog,{api,preferences,mcp,activeValue
|
|
4935
4844
|
}),"xlarge")
|
|
4936
4845
|
}
|
|
4937
|
-
|
|
4938
4846
|
import {createElement as _$createElement31} from "@opentui/solid"
|
|
4939
4847
|
import {onCleanup as onCleanup12} from "solid-js"
|
|
4940
4848
|
function SettingsBinding(props) {const unregister=props.api.keymap.registerLayer({mode:"base",commands:[{name:`${PLUGIN_ID}.settings`,title:"Navigator settings",category:"Navigator",namespace:"palette",enabled:()=>["home","session"].includes(props.api.route.current.name),run:()=>openSettings(props.api,props.preferences,undefined,props.mcp)
|
|
@@ -4945,40 +4853,30 @@ function SettingsBinding(props) {const unregister=props.api.keymap.registerLayer
|
|
|
4945
4853
|
onCleanup12(unregister)
|
|
4946
4854
|
return _$createElement31("box")
|
|
4947
4855
|
}
|
|
4948
|
-
|
|
4949
|
-
import {insert as _$insert26} from "@opentui/solid"
|
|
4950
4856
|
import {createComponent as _$createComponent36} from "@opentui/solid"
|
|
4951
4857
|
import {memo as _$memo22} from "@opentui/solid"
|
|
4952
|
-
import {setProp as _$setProp29} from "@opentui/solid"
|
|
4953
|
-
import {createElement as _$createElement32} from "@opentui/solid"
|
|
4954
4858
|
import {createSignal as createSignal15} from "solid-js"
|
|
4955
4859
|
function SettingsFooterButton(props) {const icons=useIcons()
|
|
4956
4860
|
const [hovered,setHovered]=createSignal15(false)
|
|
4957
4861
|
const theme=()=>props.api.theme.current
|
|
4958
|
-
return (()
|
|
4959
|
-
_$
|
|
4960
|
-
_$
|
|
4961
|
-
_$insert26(_el$,_$createComponent36(IconControl,{id:`${PLUGIN_ID}.settings.footer`,get icon() {return icons.icon("settings")
|
|
4962
|
-
},get foregroundColor() {return _$memo22(()=>!!hovered())() ? theme().text:theme().textMuted
|
|
4963
|
-
},get backgroundColor() {return _$memo22(()=>!!hovered())() ? theme().backgroundElement:theme().backgroundPanel
|
|
4862
|
+
return _$createComponent36(IconControl,{id:`${PLUGIN_ID}.settings.footer`,get icon() {return icons.icon("settings")
|
|
4863
|
+
},get foregroundColor() {return _$memo22(()=>!!hovered())()?theme().text:theme().textMuted
|
|
4864
|
+
},get backgroundColor() {return _$memo22(()=>!!hovered())()?theme().backgroundElement:theme().backgroundPanel
|
|
4964
4865
|
},onMouseOver:()=>setHovered(true),onMouseOut:()=>setHovered(false),onMouseUp:()=>openSettings(props.api,props.preferences,undefined,props.mcp)
|
|
4965
|
-
})
|
|
4966
|
-
return _el$
|
|
4967
|
-
})()
|
|
4866
|
+
})
|
|
4968
4867
|
}
|
|
4969
|
-
|
|
4970
4868
|
import {createSignal as createSignal16} from "solid-js"
|
|
4971
4869
|
var NAVIGATOR_PACKAGE_URL="https://registry.npmjs.org/opencode-navigator/latest"
|
|
4972
4870
|
var REQUEST_TIMEOUT_MS=5000
|
|
4973
4871
|
function versionParts(value) {const match=/^v?(\d+)\.(\d+)\.(\d+)(?:-([^+]+))?/.exec(value)
|
|
4974
|
-
return match
|
|
4872
|
+
return match?{numbers:match.slice(1,4).map(Number),prerelease:match[4]||undefined}:undefined
|
|
4975
4873
|
}
|
|
4976
4874
|
function isNewerVersion(latest,current) {const next=versionParts(latest)
|
|
4977
4875
|
const installed=versionParts(current)
|
|
4978
4876
|
if(!next||!installed)
|
|
4979
4877
|
return false
|
|
4980
|
-
for(let index=0;index
|
|
4981
|
-
return next.numbers[index]
|
|
4878
|
+
for(let index=0;index<3; index++) {if (next.numbers[index]!==installed.numbers[index])
|
|
4879
|
+
return next.numbers[index]>installed.numbers[index]
|
|
4982
4880
|
}
|
|
4983
4881
|
return installed.prerelease!==undefined&&next.prerelease===undefined
|
|
4984
4882
|
}
|
|
@@ -5001,16 +4899,27 @@ setNavigatorUpdate(isNewerVersion(metadata.version,navigatorVersion))
|
|
|
5001
4899
|
}).catch(()=>{}).finally(()=>clearTimeout(timeout))
|
|
5002
4900
|
return{openCodeUpdate,navigatorUpdate}
|
|
5003
4901
|
}
|
|
5004
|
-
|
|
4902
|
+
import {setProp as _$setProp29} from "@opentui/solid"
|
|
5005
4903
|
import {effect as _$effect29} from "@opentui/solid"
|
|
4904
|
+
import {insert as _$insert26} from "@opentui/solid"
|
|
4905
|
+
import {createElement as _$createElement32} from "@opentui/solid"
|
|
4906
|
+
function NavigatorVersion(props) {const icons=useIcons()
|
|
4907
|
+
const label=()=>`Navigator ${props.navigatorVersion}${props.status.navigatorUpdate() ? icons.icon("up") : ""}`
|
|
4908
|
+
return (()=>{var _el$=_$createElement32("text")
|
|
4909
|
+
_$insert26(_el$,label)
|
|
4910
|
+
_$effect29((_$p)=>_$setProp29(_el$,"fg",props.api.theme.current.textMuted,_$p))
|
|
4911
|
+
return _el$
|
|
4912
|
+
})()
|
|
4913
|
+
}
|
|
4914
|
+
import {effect as _$effect30} from "@opentui/solid"
|
|
5006
4915
|
import {insertNode as _$insertNode26} from "@opentui/solid"
|
|
5007
4916
|
import {insert as _$insert27} from "@opentui/solid"
|
|
5008
4917
|
import {setProp as _$setProp30} from "@opentui/solid"
|
|
5009
4918
|
import {createElement as _$createElement33} from "@opentui/solid"
|
|
5010
4919
|
function footerPath(api,sessionID) {const directory=api.state.session.get(sessionID)?.directory||api.state.path.directory
|
|
5011
4920
|
const home=process.env.HOME
|
|
5012
|
-
const compact=home&&directory.startsWith(`${home}/`)
|
|
5013
|
-
const branch=directory===api.state.path.directory
|
|
4921
|
+
const compact=home&&directory.startsWith(`${home}/`)?`~${directory.slice(home.length)}`:directory
|
|
4922
|
+
const branch=directory===api.state.path.directory?api.state.vcs?.branch:undefined
|
|
5014
4923
|
return `${compact}${branch ? `:${branch}` : ""}`
|
|
5015
4924
|
}
|
|
5016
4925
|
function VersionFooter(props) {const theme=()=>props.api.theme.current
|
|
@@ -5023,7 +4932,7 @@ _$insertNode26(_el$,_el$3)
|
|
|
5023
4932
|
_$setProp30(_el$,"gap",1)
|
|
5024
4933
|
_$insert27(_el$2,path)
|
|
5025
4934
|
_$insert27(_el$3,versions)
|
|
5026
|
-
_$
|
|
4935
|
+
_$effect30((_p$)=>{var _v$=theme().text,_v$2=theme().textMuted
|
|
5027
4936
|
_v$!==_p$.e&&(_p$.e=_$setProp30(_el$2,"fg",_v$,_p$.e))
|
|
5028
4937
|
_v$2!==_p$.t&&(_p$.t=_$setProp30(_el$3,"fg",_v$2,_p$.t))
|
|
5029
4938
|
return _p$
|
|
@@ -5032,14 +4941,12 @@ return _p$
|
|
|
5032
4941
|
return _el$
|
|
5033
4942
|
})()
|
|
5034
4943
|
}
|
|
5035
|
-
|
|
5036
4944
|
function matchesFilter(query,...values) {const needle=query.trim().toLocaleLowerCase()
|
|
5037
4945
|
return !needle||values.some((value)=>value?.toLocaleLowerCase().includes(needle))
|
|
5038
4946
|
}
|
|
5039
|
-
|
|
5040
4947
|
import {ScrollBoxRenderable} from "@opentui/core"
|
|
5041
4948
|
import {createSignal as createSignal17} from "solid-js"
|
|
5042
|
-
function position(descriptor) {return typeof descriptor.position==="function"
|
|
4949
|
+
function position(descriptor) {return typeof descriptor.position==="function"?descriptor.position():descriptor.position
|
|
5043
4950
|
}
|
|
5044
4951
|
var SECTION_COMMANDS=[{section:"todo",title:"Focus Todo"},{section:"subagents",title:"Focus Subagents"},{section:"skills",title:"Focus Skills"},{section:"quick_actions",title:"Focus Quick Actions"},{section:"lsp",title:"Focus LSP"},{section:"mcp",title:"Focus MCP"}
|
|
5045
4952
|
]
|
|
@@ -5148,7 +5055,7 @@ function move(offset) {const items=available()
|
|
|
5148
5055
|
if(items.length===0)
|
|
5149
5056
|
return
|
|
5150
5057
|
const current=items.find((descriptor)=>descriptor.id===selectedId())
|
|
5151
|
-
if(!current) {select(items[offset
|
|
5058
|
+
if(!current) {select(items[offset>0?0:items.length - 1].id)
|
|
5152
5059
|
return
|
|
5153
5060
|
}
|
|
5154
5061
|
const rows=items.filter((descriptor,index)=>{if (index===0)
|
|
@@ -5175,7 +5082,7 @@ function moveHorizontal(offset) {const items=available()
|
|
|
5175
5082
|
if(items.length===0)
|
|
5176
5083
|
return
|
|
5177
5084
|
const current=items.find((descriptor)=>descriptor.id===selectedId())
|
|
5178
|
-
if(!current) {select(items[offset
|
|
5085
|
+
if(!current) {select(items[offset>0?0:items.length - 1].id)
|
|
5179
5086
|
return
|
|
5180
5087
|
}
|
|
5181
5088
|
const currentPosition=position(current)
|
|
@@ -5246,7 +5153,7 @@ focus()
|
|
|
5246
5153
|
},50)
|
|
5247
5154
|
focusTimers.add(timer)
|
|
5248
5155
|
}
|
|
5249
|
-
function dispatchFromReturnTarget(command) {const target=savedReturnTarget?.parent&&isEffectivelyVisible(savedReturnTarget)
|
|
5156
|
+
function dispatchFromReturnTarget(command) {const target=savedReturnTarget?.parent&&isEffectivelyVisible(savedReturnTarget)?savedReturnTarget:null
|
|
5250
5157
|
return api.keymap.dispatchCommand(command,{focused:target,target})
|
|
5251
5158
|
}
|
|
5252
5159
|
function register(descriptor) {descriptors.set(descriptor.id,descriptor)
|
|
@@ -5314,15 +5221,13 @@ setFocusWithin(false)
|
|
|
5314
5221
|
}
|
|
5315
5222
|
}
|
|
5316
5223
|
}
|
|
5317
|
-
|
|
5318
5224
|
import {createComponent as _$createComponent37} from "@opentui/solid"
|
|
5319
5225
|
import {memo as _$memo23} from "@opentui/solid"
|
|
5320
|
-
import {effect as _$
|
|
5226
|
+
import {effect as _$effect31} from "@opentui/solid"
|
|
5321
5227
|
import {insert as _$insert28} from "@opentui/solid"
|
|
5322
5228
|
import {setProp as _$setProp31} from "@opentui/solid"
|
|
5323
5229
|
import {createElement as _$createElement34} from "@opentui/solid"
|
|
5324
5230
|
import {Show as Show7,createSignal as createSignal19} from "solid-js"
|
|
5325
|
-
|
|
5326
5231
|
import {createSignal as createSignal18,onCleanup as onCleanup13} from "solid-js"
|
|
5327
5232
|
function sidebarInteractiveColors(theme,state,normalColor=theme.text,mode="row") {const highlighted=!state.disabled&&(state.focused||mode==="control"&&state.hovered)
|
|
5328
5233
|
let backgroundColor=theme.backgroundPanel
|
|
@@ -5358,16 +5263,15 @@ return true
|
|
|
5358
5263
|
}
|
|
5359
5264
|
}
|
|
5360
5265
|
}
|
|
5361
|
-
|
|
5362
5266
|
function LspBadge(props) {const icons=useIcons()
|
|
5363
5267
|
const isKnown=lspIconName(props.id)!==undefined
|
|
5364
5268
|
const [showName,setShowName]=createSignal19(false)
|
|
5365
|
-
const statusColor=()=>props.status==="connected"
|
|
5269
|
+
const statusColor=()=>props.status==="connected"?props.api.theme.current.success:props.api.theme.current.error
|
|
5366
5270
|
if(!isKnown) {return (()=>{var _el$=_$createElement34("text")
|
|
5367
5271
|
_$setProp31(_el$,"flexShrink",1)
|
|
5368
5272
|
_$setProp31(_el$,"wrapMode","none")
|
|
5369
5273
|
_$insert28(_el$,()=>props.id)
|
|
5370
|
-
_$
|
|
5274
|
+
_$effect31((_$p)=>_$setProp31(_el$,"fg",statusColor(),_$p))
|
|
5371
5275
|
return _el$
|
|
5372
5276
|
})()
|
|
5373
5277
|
}
|
|
@@ -5384,34 +5288,32 @@ item.activate(event)
|
|
|
5384
5288
|
},get children() {return [(()=>{var _el$2=_$createElement34("text")
|
|
5385
5289
|
_$setProp31(_el$2,"flexShrink",0)
|
|
5386
5290
|
_$insert28(_el$2,()=>lspIcon(props.id,props.iconStyle??icons.style()))
|
|
5387
|
-
_$
|
|
5291
|
+
_$effect31((_$p)=>_$setProp31(_el$2,"fg",item.foregroundColor(),_$p))
|
|
5388
5292
|
return _el$2
|
|
5389
5293
|
})(),_$createComponent37(Show7,{get when() {return showName()
|
|
5390
5294
|
},get children() {var _el$3=_$createElement34("text")
|
|
5391
5295
|
_$setProp31(_el$3,"flexShrink",0)
|
|
5392
5296
|
_$setProp31(_el$3,"wrapMode","none")
|
|
5393
5297
|
_$insert28(_el$3,()=>props.id)
|
|
5394
|
-
_$
|
|
5298
|
+
_$effect31((_$p)=>_$setProp31(_el$3,"fg",item.focused()?item.foregroundColor():props.api.theme.current.textMuted,_$p))
|
|
5395
5299
|
return _el$3
|
|
5396
5300
|
}
|
|
5397
5301
|
})]
|
|
5398
5302
|
}
|
|
5399
5303
|
})
|
|
5400
5304
|
}
|
|
5401
|
-
|
|
5402
|
-
import {effect as _$effect33} from "@opentui/solid"
|
|
5305
|
+
import {effect as _$effect34} from "@opentui/solid"
|
|
5403
5306
|
import {memo as _$memo26} from "@opentui/solid"
|
|
5404
5307
|
import {insert as _$insert31} from "@opentui/solid"
|
|
5405
5308
|
import {createComponent as _$createComponent40} from "@opentui/solid"
|
|
5406
5309
|
import {setProp as _$setProp34} from "@opentui/solid"
|
|
5407
5310
|
import {createElement as _$createElement37} from "@opentui/solid"
|
|
5408
5311
|
import {For as For11,Show as Show10,createMemo as createMemo10} from "solid-js"
|
|
5409
|
-
|
|
5410
5312
|
import {createComputed,createMemo as createMemo9,createSignal as createSignal20,untrack as untrack2} from "solid-js"
|
|
5411
5313
|
function createListVisibility(options) {const [expanded,setExpanded]=createSignal20(false)
|
|
5412
5314
|
let previousKey
|
|
5413
5315
|
let previousLimit
|
|
5414
|
-
const canToggle=createMemo9(()=>options.limit()
|
|
5316
|
+
const canToggle=createMemo9(()=>options.limit()>0&&options.items().length>options.limit())
|
|
5415
5317
|
createComputed(()=>{const key=options.resetKey()
|
|
5416
5318
|
const limit=options.limit()
|
|
5417
5319
|
const isToggle=canToggle()
|
|
@@ -5420,14 +5322,13 @@ untrack2(()=>setExpanded(false))
|
|
|
5420
5322
|
previousKey=key
|
|
5421
5323
|
previousLimit=limit
|
|
5422
5324
|
})
|
|
5423
|
-
const visible=createMemo9(()=>!canToggle()||expanded()
|
|
5325
|
+
const visible=createMemo9(()=>!canToggle()||expanded()?options.items():options.items().slice(0,options.limit()))
|
|
5424
5326
|
return{visible,expanded,canToggle,hiddenCount:()=>options.items().length - visible().length,showAll:()=>setExpanded(canToggle()),showLess:()=>setExpanded(false)
|
|
5425
5327
|
}
|
|
5426
5328
|
}
|
|
5427
|
-
|
|
5428
5329
|
import {createComponent as _$createComponent38} from "@opentui/solid"
|
|
5429
5330
|
import {setProp as _$setProp32} from "@opentui/solid"
|
|
5430
|
-
import {effect as _$
|
|
5331
|
+
import {effect as _$effect32} from "@opentui/solid"
|
|
5431
5332
|
import {createTextNode as _$createTextNode24} from "@opentui/solid"
|
|
5432
5333
|
import {insertNode as _$insertNode27} from "@opentui/solid"
|
|
5433
5334
|
import {insert as _$insert29} from "@opentui/solid"
|
|
@@ -5451,7 +5352,7 @@ queueMicrotask(()=>props.interaction?.select(id))
|
|
|
5451
5352
|
})
|
|
5452
5353
|
return _$createComponent38(Show8,{get when() {return props.visibility.canToggle()
|
|
5453
5354
|
},get children() {return _$createComponent38(SelectionBox,{ref(r$) {var _ref$=item.ref
|
|
5454
|
-
typeof _ref$==="function"
|
|
5355
|
+
typeof _ref$==="function"?_ref$(r$):item.ref=r$
|
|
5455
5356
|
},id,paddingLeft:1,paddingRight:1,get backgroundColor() {return item.backgroundColor()
|
|
5456
5357
|
},get onMouseOver() {return item.onMouseOver
|
|
5457
5358
|
},get onMouseOut() {return item.onMouseOut
|
|
@@ -5459,20 +5360,19 @@ typeof _ref$==="function" ? _ref$(r$):item.ref=r$
|
|
|
5459
5360
|
item.activate(event)
|
|
5460
5361
|
},get children() {var _el$=_$createElement35("text"),_el$2=_$createTextNode24(` `)
|
|
5461
5362
|
_$insertNode27(_el$,_el$2)
|
|
5462
|
-
_$insert29(_el$,()=>icons.icon(props.visibility.expanded()
|
|
5363
|
+
_$insert29(_el$,()=>icons.icon(props.visibility.expanded()?"up":"down"),_el$2)
|
|
5463
5364
|
_$insert29(_el$,(()=>{var _c$=_$memo24(()=>!!props.visibility.expanded())
|
|
5464
|
-
return ()=>_c$()
|
|
5365
|
+
return ()=>_c$()?"Show less":`Show all (${props.visibility.hiddenCount()} more)`
|
|
5465
5366
|
})(),null)
|
|
5466
|
-
_$
|
|
5367
|
+
_$effect32((_$p)=>_$setProp32(_el$,"fg",item.foregroundColor(),_$p))
|
|
5467
5368
|
return _el$
|
|
5468
5369
|
}
|
|
5469
5370
|
})
|
|
5470
5371
|
}
|
|
5471
5372
|
})
|
|
5472
5373
|
}
|
|
5473
|
-
|
|
5474
5374
|
import {createComponent as _$createComponent39} from "@opentui/solid"
|
|
5475
|
-
import {effect as _$
|
|
5375
|
+
import {effect as _$effect33} from "@opentui/solid"
|
|
5476
5376
|
import {createTextNode as _$createTextNode25} from "@opentui/solid"
|
|
5477
5377
|
import {insertNode as _$insertNode28} from "@opentui/solid"
|
|
5478
5378
|
import {memo as _$memo25} from "@opentui/solid"
|
|
@@ -5482,15 +5382,15 @@ import {createElement as _$createElement36} from "@opentui/solid"
|
|
|
5482
5382
|
import {Show as Show9,createEffect as createEffect10,createSignal as createSignal21} from "solid-js"
|
|
5483
5383
|
var graphemes=new Intl.Segmenter(undefined,{granularity:"grapheme"
|
|
5484
5384
|
})
|
|
5485
|
-
function truncateEnd(value,maxWidth) {if (Bun.stringWidth(value)
|
|
5385
|
+
function truncateEnd(value,maxWidth) {if (Bun.stringWidth(value)<=maxWidth)
|
|
5486
5386
|
return value
|
|
5487
|
-
if(maxWidth
|
|
5387
|
+
if(maxWidth<=0)
|
|
5488
5388
|
return ""
|
|
5489
|
-
const ellipsis=maxWidth
|
|
5389
|
+
const ellipsis=maxWidth>=3?"...":".".repeat(maxWidth)
|
|
5490
5390
|
const contentWidth=maxWidth - Bun.stringWidth(ellipsis)
|
|
5491
5391
|
let result=""
|
|
5492
5392
|
for(const {segment
|
|
5493
|
-
} of graphemes.segment(value)) {if (Bun.stringWidth(result + segment)
|
|
5393
|
+
} of graphemes.segment(value)) {if (Bun.stringWidth(result + segment)>contentWidth)
|
|
5494
5394
|
break
|
|
5495
5395
|
result += segment
|
|
5496
5396
|
}
|
|
@@ -5498,12 +5398,12 @@ return result + ellipsis
|
|
|
5498
5398
|
}
|
|
5499
5399
|
function Section(props) {const icons=useIcons()
|
|
5500
5400
|
const [actionWidth,setActionWidth]=createSignal21()
|
|
5501
|
-
const icon=()=>props.section
|
|
5401
|
+
const icon=()=>props.section?icons.section(props.section):props.icon
|
|
5502
5402
|
const theme=()=>props.api.theme.current
|
|
5503
5403
|
const item=useSidebarItem(props.api,props.interaction,{id:props.sectionId??`section.${props.title}`,position:()=>({section:props.navigationSection??0,row:0,column:0
|
|
5504
5404
|
}),activate:props.onToggle
|
|
5505
5405
|
})
|
|
5506
|
-
const action=props.headerAction
|
|
5406
|
+
const action=props.headerAction?useSidebarItem(props.api,props.interaction,{id:props.headerAction.id,position:()=>({section:props.navigationSection??0,row:0,column:1
|
|
5507
5407
|
}),disabled:props.headerAction.disabled,activate:props.headerAction.onActivate
|
|
5508
5408
|
},()=>theme().accent,"control"):undefined
|
|
5509
5409
|
createEffect10(()=>{props.headerAction?.label()
|
|
@@ -5511,7 +5411,7 @@ setActionWidth(undefined)
|
|
|
5511
5411
|
})
|
|
5512
5412
|
const actionLabel=()=>{const label=props.headerAction?.label()??""
|
|
5513
5413
|
const width=actionWidth()
|
|
5514
|
-
return width===undefined
|
|
5414
|
+
return width===undefined?label:truncateEnd(label,width - 2)
|
|
5515
5415
|
}
|
|
5516
5416
|
return (()=>{var _el$=_$createElement36("box")
|
|
5517
5417
|
_$setProp33(_el$,"gap",1)
|
|
@@ -5526,13 +5426,13 @@ _$insertNode28(_el$2,_el$5)
|
|
|
5526
5426
|
_$insertNode28(_el$2,_el$6)
|
|
5527
5427
|
_$setProp33(_el$2,"flexShrink",0)
|
|
5528
5428
|
_$setProp33(_el$2,"wrapMode","none")
|
|
5529
|
-
_$insert30(_el$3,()=>icons.icon(props.open
|
|
5429
|
+
_$insert30(_el$3,()=>icons.icon(props.open?"expanded":"collapsed"))
|
|
5530
5430
|
_$insert30(_el$5,(()=>{var _c$=_$memo25(()=>!!icon())
|
|
5531
|
-
return ()=>_c$()
|
|
5431
|
+
return ()=>_c$()?`${icon()} `:""
|
|
5532
5432
|
})())
|
|
5533
5433
|
_$insert30(_el$6,()=>props.title)
|
|
5534
|
-
_$
|
|
5535
|
-
},_v$3={fg:item.focused()
|
|
5434
|
+
_$effect33((_p$)=>{var _v$=item.foregroundColor(),_v$2={fg:item.focused()?item.foregroundColor():theme().accent
|
|
5435
|
+
},_v$3={fg:item.focused()?item.foregroundColor():theme().accent
|
|
5536
5436
|
}
|
|
5537
5437
|
_v$!==_p$.e&&(_p$.e=_$setProp33(_el$2,"fg",_v$,_p$.e))
|
|
5538
5438
|
_v$2!==_p$.t&&(_p$.t=_$setProp33(_el$3,"style",_v$2,_p$.t))
|
|
@@ -5559,7 +5459,7 @@ control().activate(event)
|
|
|
5559
5459
|
_$setProp33(_el$9,"wrapMode","none")
|
|
5560
5460
|
_$setProp33(_el$9,"height",1)
|
|
5561
5461
|
_$insert30(_el$9,actionLabel)
|
|
5562
|
-
_$
|
|
5462
|
+
_$effect33((_$p)=>_$setProp33(_el$9,"fg",control().foregroundColor(),_$p))
|
|
5563
5463
|
return _el$9
|
|
5564
5464
|
}
|
|
5565
5465
|
})
|
|
@@ -5568,7 +5468,7 @@ _$setProp33(_el$8,"wrapMode","none")
|
|
|
5568
5468
|
_$setProp33(_el$8,"truncate",true)
|
|
5569
5469
|
_$setProp33(_el$8,"height",1)
|
|
5570
5470
|
_$insert30(_el$8,()=>props.summary)
|
|
5571
|
-
_$
|
|
5471
|
+
_$effect33((_p$)=>{var _v$4=item.focused()?item.foregroundColor():theme().textMuted,_v$5=props.headerAction?0:1
|
|
5572
5472
|
_v$4!==_p$.e&&(_p$.e=_$setProp33(_el$8,"fg",_v$4,_p$.e))
|
|
5573
5473
|
_v$5!==_p$.t&&(_p$.t=_$setProp33(_el$8,"flexShrink",_v$5,_p$.t))
|
|
5574
5474
|
return _p$
|
|
@@ -5586,7 +5486,6 @@ return _el$
|
|
|
5586
5486
|
})()
|
|
5587
5487
|
}
|
|
5588
5488
|
var SectionWithHeaderAction=Section;
|
|
5589
|
-
|
|
5590
5489
|
function LspSection(props) {const list=createMemo10(()=>[...props.api.state.lsp()].sort((a,b)=>Number(b.status==="error") - Number(a.status==="error")||a.id.localeCompare(b.id)||a.root.localeCompare(b.root)))
|
|
5591
5490
|
const visibility=createListVisibility({items:list,limit:()=>props.preferences.sectionItemLimit?.("lsp")??0,resetKey:()=>currentLocation(props.api).key
|
|
5592
5491
|
})
|
|
@@ -5598,10 +5497,10 @@ return _$createComponent40(Section,{get api() {return props.api
|
|
|
5598
5497
|
},sectionId:`${PLUGIN_ID}.section.lsp`,get navigationSection() {return navigationSection()
|
|
5599
5498
|
},title:"LSP",section:"lsp",get summary() {return `${connected()}/${list().length}`
|
|
5600
5499
|
},get open() {return props.preferences.expanded().lsp
|
|
5601
|
-
},onToggle:()=>props.preferences.toggleSectionExpanded("lsp"),get children() {return [_$createComponent40(Show10,{get when() {return list().length
|
|
5500
|
+
},onToggle:()=>props.preferences.toggleSectionExpanded("lsp"),get children() {return [_$createComponent40(Show10,{get when() {return list().length>0
|
|
5602
5501
|
},get fallback() {return (()=>{var _el$2=_$createElement37("text")
|
|
5603
|
-
_$insert31(_el$2,()=>disabled()
|
|
5604
|
-
_$
|
|
5502
|
+
_$insert31(_el$2,()=>disabled()?"LSP is disabled":"Activates as files are read")
|
|
5503
|
+
_$effect34((_$p)=>_$setProp34(_el$2,"fg",props.api.theme.current.textMuted,_$p))
|
|
5605
5504
|
return _el$2
|
|
5606
5505
|
})()
|
|
5607
5506
|
},get children() {var _el$=_$createElement37("box")
|
|
@@ -5631,15 +5530,13 @@ return _el$
|
|
|
5631
5530
|
}
|
|
5632
5531
|
})
|
|
5633
5532
|
}
|
|
5634
|
-
|
|
5635
5533
|
import {createComponent as _$createComponent46} from "@opentui/solid"
|
|
5636
5534
|
import {createMemo as createMemo12,createSignal as createSignal23} from "solid-js"
|
|
5637
|
-
|
|
5638
5535
|
import {createMemo as createMemo11} from "solid-js"
|
|
5639
5536
|
function createMcpSectionModel(props,query) {const target=createMemo11(()=>props.controller.target())
|
|
5640
5537
|
const favorites=createMemo11(()=>props.preferences.favoriteMcpServers?.()??new Set)
|
|
5641
5538
|
const groups=createMemo11(()=>props.preferences.mcpServerGroups?.()??{})
|
|
5642
|
-
const grouped=createMemo11(()=>Object.keys(groups()).length
|
|
5539
|
+
const grouped=createMemo11(()=>Object.keys(groups()).length>0)
|
|
5643
5540
|
const list=createMemo11(()=>buildMcpGroupedView(props.controller.list(target()),favorites(),groups()))
|
|
5644
5541
|
const filtered=createMemo11(()=>list().filter((item)=>matchesFilter(query(),`${item.name} ${item.assignedGroup ?? ""}`)))
|
|
5645
5542
|
const visibility=createListVisibility({items:filtered,limit:()=>props.preferences.sectionItemLimit?.("mcp")??0,resetKey:()=>JSON.stringify([target().key,query()])
|
|
@@ -5655,13 +5552,12 @@ const disconnectable=createMemo11(()=>list().filter((item)=>mcpToggleAction2(ite
|
|
|
5655
5552
|
const errors=createMemo11(()=>list().filter((item)=>item.status==="failed"||item.status==="needs_auth"||item.status==="needs_client_registration").length)
|
|
5656
5553
|
const presetName=createMemo11(()=>{const presets=props.preferences.mcpPresets?.()??{}
|
|
5657
5554
|
const selected=props.controller.selectedPreset?.(target())
|
|
5658
|
-
return selected&&Object.hasOwn(presets,selected)
|
|
5555
|
+
return selected&&Object.hasOwn(presets,selected)?selected:matchingMcpPreset(list(),presets)
|
|
5659
5556
|
})
|
|
5660
5557
|
return{target,favorites,groups,grouped,list,filtered,visibility,active,state,bulk,bulkRunning,mutationRunning,connectable,disconnectable,errors,presetName
|
|
5661
5558
|
}
|
|
5662
5559
|
}
|
|
5663
|
-
|
|
5664
|
-
import {effect as _$effect39} from "@opentui/solid"
|
|
5560
|
+
import {effect as _$effect40} from "@opentui/solid"
|
|
5665
5561
|
import {createTextNode as _$createTextNode27} from "@opentui/solid"
|
|
5666
5562
|
import {insertNode as _$insertNode31} from "@opentui/solid"
|
|
5667
5563
|
import {insert as _$insert37} from "@opentui/solid"
|
|
@@ -5670,9 +5566,8 @@ import {memo as _$memo30} from "@opentui/solid"
|
|
|
5670
5566
|
import {setProp as _$setProp40} from "@opentui/solid"
|
|
5671
5567
|
import {createElement as _$createElement43} from "@opentui/solid"
|
|
5672
5568
|
import {For as For12,Show as Show13} from "solid-js"
|
|
5673
|
-
|
|
5674
5569
|
import {createComponent as _$createComponent41} from "@opentui/solid"
|
|
5675
|
-
import {effect as _$
|
|
5570
|
+
import {effect as _$effect35} from "@opentui/solid"
|
|
5676
5571
|
import {insert as _$insert32} from "@opentui/solid"
|
|
5677
5572
|
import {setProp as _$setProp35} from "@opentui/solid"
|
|
5678
5573
|
import {createElement as _$createElement38} from "@opentui/solid"
|
|
@@ -5687,20 +5582,18 @@ _$setProp35(_el$,"wrapMode","none")
|
|
|
5687
5582
|
_$setProp35(_el$,"truncate",true)
|
|
5688
5583
|
_$setProp35(_el$,"height",1)
|
|
5689
5584
|
_$insert32(_el$,()=>props.label)
|
|
5690
|
-
_$
|
|
5585
|
+
_$effect35((_$p)=>_$setProp35(_el$,"fg",item.foregroundColor(),_$p))
|
|
5691
5586
|
return _el$
|
|
5692
5587
|
}
|
|
5693
5588
|
})
|
|
5694
5589
|
}
|
|
5695
|
-
|
|
5696
5590
|
import {insertNode as _$insertNode30} from "@opentui/solid"
|
|
5697
|
-
import {effect as _$
|
|
5591
|
+
import {effect as _$effect37} from "@opentui/solid"
|
|
5698
5592
|
import {insert as _$insert34} from "@opentui/solid"
|
|
5699
5593
|
import {setProp as _$setProp37} from "@opentui/solid"
|
|
5700
5594
|
import {createElement as _$createElement40} from "@opentui/solid"
|
|
5701
5595
|
import {memo as _$memo28} from "@opentui/solid"
|
|
5702
5596
|
import {createComponent as _$createComponent43} from "@opentui/solid"
|
|
5703
|
-
|
|
5704
5597
|
function mcpColor(api,status) {const theme=api.theme.current
|
|
5705
5598
|
if(status==="connected")
|
|
5706
5599
|
return theme.success
|
|
@@ -5712,11 +5605,10 @@ return theme.textMuted
|
|
|
5712
5605
|
}
|
|
5713
5606
|
function mcpToggle(status,busy) {if (busy||status==="pending")
|
|
5714
5607
|
return "pending"
|
|
5715
|
-
return status==="connected"
|
|
5608
|
+
return status==="connected"?"connected":"disconnected"
|
|
5716
5609
|
}
|
|
5717
|
-
|
|
5718
5610
|
import {memo as _$memo27} from "@opentui/solid"
|
|
5719
|
-
import {effect as _$
|
|
5611
|
+
import {effect as _$effect36} from "@opentui/solid"
|
|
5720
5612
|
import {createTextNode as _$createTextNode26} from "@opentui/solid"
|
|
5721
5613
|
import {insertNode as _$insertNode29} from "@opentui/solid"
|
|
5722
5614
|
import {insert as _$insert33} from "@opentui/solid"
|
|
@@ -5740,14 +5632,14 @@ _$setProp36(_el$,"flexGrow",1)
|
|
|
5740
5632
|
_$setProp36(_el$,"wrapMode","word")
|
|
5741
5633
|
_$insert33(_el$,()=>icons.icon("error"),_el$2)
|
|
5742
5634
|
_$insert33(_el$,()=>error().message,null)
|
|
5743
|
-
_$
|
|
5635
|
+
_$effect36((_$p)=>_$setProp36(_el$,"fg",item.focused()?item.foregroundColor():props.api.theme.current.error,_$p))
|
|
5744
5636
|
return _el$
|
|
5745
5637
|
})(),_$createComponent42(Show11,{get when() {return error().retryable
|
|
5746
5638
|
},get children() {var _el$3=_$createElement39("text"),_el$4=_$createTextNode26(` Retry`)
|
|
5747
5639
|
_$insertNode29(_el$3,_el$4)
|
|
5748
5640
|
_$setProp36(_el$3,"flexShrink",0)
|
|
5749
5641
|
_$insert33(_el$3,()=>icons.icon("retry"),_el$4)
|
|
5750
|
-
_$
|
|
5642
|
+
_$effect36((_$p)=>_$setProp36(_el$3,"fg",item.focused()?item.foregroundColor():props.api.theme.current.accent,_$p))
|
|
5751
5643
|
return _el$3
|
|
5752
5644
|
}
|
|
5753
5645
|
})]
|
|
@@ -5764,7 +5656,7 @@ _$insert33(_el$5,_$createComponent42(Show11,{get when() {return _$memo27(()=>!!p
|
|
|
5764
5656
|
_$insertNode29(_el$6,_el$7)
|
|
5765
5657
|
_$insert33(_el$6,()=>icons.icon("pending"),_el$7)
|
|
5766
5658
|
_$insert33(_el$6,()=>props.loading,null)
|
|
5767
|
-
_$
|
|
5659
|
+
_$effect36((_$p)=>_$setProp36(_el$6,"fg",props.api.theme.current.textMuted,_$p))
|
|
5768
5660
|
return _el$6
|
|
5769
5661
|
}
|
|
5770
5662
|
}),null)
|
|
@@ -5777,14 +5669,13 @@ _$insert33(_el$5,_$createComponent42(Show11,{get when() {return _$memo27(()=>!!(
|
|
|
5777
5669
|
_$insertNode29(_el$8,_el$9)
|
|
5778
5670
|
_$insert33(_el$8,()=>icons.icon("info"),_el$9)
|
|
5779
5671
|
_$insert33(_el$8,()=>props.empty,null)
|
|
5780
|
-
_$
|
|
5672
|
+
_$effect36((_$p)=>_$setProp36(_el$8,"fg",props.api.theme.current.textMuted,_$p))
|
|
5781
5673
|
return _el$8
|
|
5782
5674
|
}
|
|
5783
5675
|
}),null)
|
|
5784
5676
|
return _el$5
|
|
5785
5677
|
})()
|
|
5786
5678
|
}
|
|
5787
|
-
|
|
5788
5679
|
function McpRow(props) {const icons=useIcons()
|
|
5789
5680
|
const dialogs=useDialogs(props.api)
|
|
5790
5681
|
const theme=()=>props.api.theme.current
|
|
@@ -5811,19 +5702,19 @@ dialogs.open(()=>_$createComponent43(McpErrorDialog,{get api() {return props.api
|
|
|
5811
5702
|
}),"medium")
|
|
5812
5703
|
}
|
|
5813
5704
|
},()=>theme().error,"control")
|
|
5814
|
-
const nestedBackground=(background)=>background==="transparent"
|
|
5705
|
+
const nestedBackground=(background)=>background==="transparent"?row.backgroundColor():background
|
|
5815
5706
|
return _$createComponent43(ListRow,{ref:(node)=>row.ref(node),get id() {return id()
|
|
5816
5707
|
},get backgroundColor() {return row.backgroundColor()
|
|
5817
|
-
},paddingLeft:1,paddingRight:1,get paddingTop() {return error()
|
|
5818
|
-
},get paddingBottom() {return error()
|
|
5819
|
-
},get marginTop() {return props.separator
|
|
5708
|
+
},paddingLeft:1,paddingRight:1,get paddingTop() {return error()?1:0
|
|
5709
|
+
},get paddingBottom() {return error()?1:0
|
|
5710
|
+
},get marginTop() {return props.separator?1:0
|
|
5820
5711
|
},get onMouseOver() {return row.onMouseOver
|
|
5821
5712
|
},get onMouseOut() {return row.onMouseOut
|
|
5822
5713
|
},onMouseDown:(event)=>row.activate(event),get content() {return (()=>{var _el$=_$createElement40("text")
|
|
5823
5714
|
_$setProp37(_el$,"flexGrow",1)
|
|
5824
5715
|
_$setProp37(_el$,"wrapMode","none")
|
|
5825
5716
|
_$insert34(_el$,()=>props.item.name)
|
|
5826
|
-
_$
|
|
5717
|
+
_$effect37((_$p)=>_$setProp37(_el$,"fg",row.focused()||disabled()?row.foregroundColor():props.item.status==="connected"?theme().text:theme().textMuted,_$p))
|
|
5827
5718
|
return _el$
|
|
5828
5719
|
})()
|
|
5829
5720
|
},get trailing() {return (()=>{var _el$2=_$createElement40("box"),_el$3=_$createElement40("text"),_el$4=_$createElement40("b")
|
|
@@ -5834,7 +5725,7 @@ _$setProp37(_el$2,"gap",1)
|
|
|
5834
5725
|
_$insertNode30(_el$3,_el$4)
|
|
5835
5726
|
_$insert34(_el$4,()=>icons.icon(mcpToggle(props.item.status,busy())))
|
|
5836
5727
|
_$insert34(_el$2,(()=>{var _c$=_$memo28(()=>!!props.item.error)
|
|
5837
|
-
return ()=>_c$()
|
|
5728
|
+
return ()=>_c$()?_$createComponent43(IconControl,{ref:(node)=>info.ref(node),get id() {return `${id()}.info`
|
|
5838
5729
|
},get icon() {return icons.icon("info")
|
|
5839
5730
|
},get backgroundColor() {return nestedBackground(info.backgroundColor())
|
|
5840
5731
|
},get foregroundColor() {return info.foregroundColor()
|
|
@@ -5846,12 +5737,12 @@ return ()=>_c$() ? _$createComponent43(IconControl,{ref:(node)=>info.ref(node),g
|
|
|
5846
5737
|
_$insert34(_el$2,_$createComponent43(BookmarkControl,{ref:(node)=>bookmark.ref(node),get id() {return `${id()}.favorite`
|
|
5847
5738
|
},get bookmarked() {return props.favorite
|
|
5848
5739
|
},get backgroundColor() {return nestedBackground(bookmark.backgroundColor())
|
|
5849
|
-
},get foregroundColor() {return _$memo28(()=>!!row.focused())()
|
|
5740
|
+
},get foregroundColor() {return _$memo28(()=>!!row.focused())()?row.foregroundColor():bookmark.foregroundColor()
|
|
5850
5741
|
},get onMouseOver() {return bookmark.onMouseOver
|
|
5851
5742
|
},get onMouseOut() {return bookmark.onMouseOut
|
|
5852
5743
|
},onMouseUp:(event)=>bookmark.activate(event)
|
|
5853
5744
|
}),null)
|
|
5854
|
-
_$
|
|
5745
|
+
_$effect37((_$p)=>_$setProp37(_el$3,"fg",row.focused()?row.foregroundColor():mcpColor(props.api,props.item.status),_$p))
|
|
5855
5746
|
return _el$2
|
|
5856
5747
|
})()
|
|
5857
5748
|
},get details() {return _$createComponent43(RequestErrorRow,{get api() {return props.api
|
|
@@ -5866,10 +5757,9 @@ return _el$2
|
|
|
5866
5757
|
}
|
|
5867
5758
|
})
|
|
5868
5759
|
}
|
|
5869
|
-
|
|
5870
5760
|
import {createComponent as _$createComponent44} from "@opentui/solid"
|
|
5871
5761
|
import {use as _$use9} from "@opentui/solid"
|
|
5872
|
-
import {effect as _$
|
|
5762
|
+
import {effect as _$effect38} from "@opentui/solid"
|
|
5873
5763
|
import {insert as _$insert35} from "@opentui/solid"
|
|
5874
5764
|
import {setProp as _$setProp38} from "@opentui/solid"
|
|
5875
5765
|
import {createElement as _$createElement41} from "@opentui/solid"
|
|
@@ -5890,8 +5780,8 @@ input.focus()
|
|
|
5890
5780
|
}
|
|
5891
5781
|
})
|
|
5892
5782
|
const highlighted=()=>item.focused()||inputFocused()
|
|
5893
|
-
const textColor=()=>highlighted()
|
|
5894
|
-
const mutedColor=()=>highlighted()
|
|
5783
|
+
const textColor=()=>highlighted()?theme().selectedListItemText:theme().text
|
|
5784
|
+
const mutedColor=()=>highlighted()?theme().selectedListItemText:theme().textMuted
|
|
5895
5785
|
function leaveInput(event) {event?.preventDefault()
|
|
5896
5786
|
event?.stopPropagation()
|
|
5897
5787
|
setInputFocused(false)
|
|
@@ -5902,13 +5792,13 @@ input?.blur()
|
|
|
5902
5792
|
}
|
|
5903
5793
|
onCleanup14(()=>unregisterInput?.())
|
|
5904
5794
|
return _$createComponent44(SelectionBox,{ref:(node)=>item.ref(node),get id() {return props.id
|
|
5905
|
-
},flexDirection:"row",gap:1,marginTop:1,marginBottom:1,paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo29(()=>!!highlighted())()
|
|
5795
|
+
},flexDirection:"row",gap:1,marginTop:1,marginBottom:1,paddingLeft:1,paddingRight:1,get backgroundColor() {return _$memo29(()=>!!highlighted())()?theme().primary:item.backgroundColor()
|
|
5906
5796
|
},get onMouseOver() {return item.onMouseOver
|
|
5907
5797
|
},get onMouseOut() {return item.onMouseOut
|
|
5908
5798
|
},onMouseDown:(event)=>item.activate(event),get children() {return [(()=>{var _el$=_$createElement41("text")
|
|
5909
5799
|
_$setProp38(_el$,"flexShrink",0)
|
|
5910
5800
|
_$insert35(_el$,()=>icons.icon("search"))
|
|
5911
|
-
_$
|
|
5801
|
+
_$effect38((_$p)=>_$setProp38(_el$,"fg",mutedColor(),_$p))
|
|
5912
5802
|
return _el$
|
|
5913
5803
|
})(),(()=>{var _el$2=_$createElement41("input")
|
|
5914
5804
|
_$use9((node)=>{input=node
|
|
@@ -5925,7 +5815,7 @@ _$setProp38(_el$2,"onKeyDown",(event)=>{if (event.name!=="escape")
|
|
|
5925
5815
|
return
|
|
5926
5816
|
leaveInput(event)
|
|
5927
5817
|
})
|
|
5928
|
-
_$
|
|
5818
|
+
_$effect38((_p$)=>{var {query:_v$,placeholder:_v$2}=props,_v$3=mutedColor(),_v$4=textColor(),_v$5=textColor(),_v$6=highlighted()?theme().selectedListItemText:theme().accent,_v$7=inputFocused(),_v$8=props.onInput
|
|
5929
5819
|
_v$!==_p$.e&&(_p$.e=_$setProp38(_el$2,"value",_v$,_p$.e))
|
|
5930
5820
|
_v$2!==_p$.t&&(_p$.t=_$setProp38(_el$2,"placeholder",_v$2,_p$.t))
|
|
5931
5821
|
_v$3!==_p$.a&&(_p$.a=_$setProp38(_el$2,"placeholderColor",_v$3,_p$.a))
|
|
@@ -5943,25 +5833,23 @@ return _el$2
|
|
|
5943
5833
|
_$setProp38(_el$3,"flexShrink",0)
|
|
5944
5834
|
_$setProp38(_el$3,"onMouseDown",()=>props.onInput(""))
|
|
5945
5835
|
_$insert35(_el$3,()=>icons.icon("close"))
|
|
5946
|
-
_$
|
|
5836
|
+
_$effect38((_$p)=>_$setProp38(_el$3,"fg",mutedColor(),_$p))
|
|
5947
5837
|
return _el$3
|
|
5948
5838
|
}
|
|
5949
5839
|
})]
|
|
5950
5840
|
}
|
|
5951
5841
|
})
|
|
5952
5842
|
}
|
|
5953
|
-
|
|
5954
5843
|
import {setProp as _$setProp39} from "@opentui/solid"
|
|
5955
|
-
import {effect as _$
|
|
5844
|
+
import {effect as _$effect39} from "@opentui/solid"
|
|
5956
5845
|
import {insert as _$insert36} from "@opentui/solid"
|
|
5957
5846
|
import {createElement as _$createElement42} from "@opentui/solid"
|
|
5958
5847
|
function SidebarRowList(props) {return (()=>{var _el$=_$createElement42("box")
|
|
5959
5848
|
_$insert36(_el$,()=>props.children)
|
|
5960
|
-
_$
|
|
5849
|
+
_$effect39((_$p)=>_$setProp39(_el$,"gap",props.density==="comfortable"?1:0,_$p))
|
|
5961
5850
|
return _el$
|
|
5962
5851
|
})()
|
|
5963
5852
|
}
|
|
5964
|
-
|
|
5965
5853
|
function McpSectionContent(props) {const icons=useIcons()
|
|
5966
5854
|
const model=props.model
|
|
5967
5855
|
return _$createComponent45(SectionRequestBody,{get api() {return props.api
|
|
@@ -5969,7 +5857,7 @@ return _$createComponent45(SectionRequestBody,{get api() {return props.api
|
|
|
5969
5857
|
},id:`${PLUGIN_ID}.retry.mcp`,get position() {return {section:props.navigationSection,row:1,column:0
|
|
5970
5858
|
}
|
|
5971
5859
|
},get state() {return model.state()
|
|
5972
|
-
},get hasItems() {return model.list().length
|
|
5860
|
+
},get hasItems() {return model.list().length>0
|
|
5973
5861
|
},empty:"No MCP servers",loading:"Loading MCP servers\u2026",onRetry:()=>void props.controller.retry(model.target()),get children() {var _el$=_$createElement43("box"),_el$2=_$createElement43("box")
|
|
5974
5862
|
_$insertNode31(_el$,_el$2)
|
|
5975
5863
|
_$setProp40(_el$2,"flexDirection","row")
|
|
@@ -5996,11 +5884,11 @@ _$insertNode31(_el$3,_el$4)
|
|
|
5996
5884
|
_$insertNode31(_el$3,_el$5)
|
|
5997
5885
|
_$insertNode31(_el$3,_el$6)
|
|
5998
5886
|
_$insert37(_el$3,(()=>{var _c$=_$memo30(()=>model.bulk().action==="connect")
|
|
5999
|
-
return ()=>_c$()
|
|
5887
|
+
return ()=>_c$()?"Connecting":_$memo30(()=>model.bulk().action==="disconnect")()?"Disconnecting":`Applying ${model.bulk().preset}`
|
|
6000
5888
|
})(),_el$4)
|
|
6001
5889
|
_$insert37(_el$3,()=>model.bulk().completed,_el$5)
|
|
6002
5890
|
_$insert37(_el$3,()=>model.bulk().total,_el$6)
|
|
6003
|
-
_$
|
|
5891
|
+
_$effect40((_$p)=>_$setProp40(_el$3,"fg",props.api.theme.current.textMuted,_$p))
|
|
6004
5892
|
return _el$3
|
|
6005
5893
|
}
|
|
6006
5894
|
}),null)
|
|
@@ -6022,10 +5910,10 @@ _$insert37(_el$,_$createComponent45(SectionFilter,{get api() {return props.api
|
|
|
6022
5910
|
},placeholder:"Filter MCP...",get onInput() {return props.onQuery
|
|
6023
5911
|
}
|
|
6024
5912
|
}),null)
|
|
6025
|
-
_$insert37(_el$,_$createComponent45(Show13,{get when() {return model.filtered().length
|
|
5913
|
+
_$insert37(_el$,_$createComponent45(Show13,{get when() {return model.filtered().length>0
|
|
6026
5914
|
},get fallback() {return (()=>{var _el$7=_$createElement43("text")
|
|
6027
5915
|
_$insertNode31(_el$7,_$createTextNode27(`No matching MCP servers`))
|
|
6028
|
-
_$
|
|
5916
|
+
_$effect40((_$p)=>_$setProp40(_el$7,"fg",props.api.theme.current.textMuted,_$p))
|
|
6029
5917
|
return _el$7
|
|
6030
5918
|
})()
|
|
6031
5919
|
},get children() {return [_$createComponent45(SidebarRowList,{get density() {return props.preferences.rowDensity?.()??"compact"
|
|
@@ -6036,7 +5924,7 @@ _$setProp40(_el$9,"height",1)
|
|
|
6036
5924
|
_$setProp40(_el$9,"wrapMode","none")
|
|
6037
5925
|
_$setProp40(_el$9,"truncate",true)
|
|
6038
5926
|
_$insert37(_el$9,()=>item.bucket)
|
|
6039
|
-
_$
|
|
5927
|
+
_$effect40((_p$)=>{var _v$=index()>0?1:0,_v$2=props.api.theme.current.textMuted
|
|
6040
5928
|
_v$!==_p$.e&&(_p$.e=_$setProp40(_el$9,"marginTop",_v$,_p$.e))
|
|
6041
5929
|
_v$2!==_p$.t&&(_p$.t=_$setProp40(_el$9,"fg",_v$2,_p$.t))
|
|
6042
5930
|
return _p$
|
|
@@ -6052,7 +5940,7 @@ return _el$9
|
|
|
6052
5940
|
},get disabled() {return model.bulkRunning()
|
|
6053
5941
|
},onToggle:()=>void props.controller.toggle(item.name).catch(()=>{}),onRetry:()=>void props.controller.retryServer(item.name,model.target())?.catch(()=>{}),get favorite() {return model.favorites().has(item.name)
|
|
6054
5942
|
},get favoriteDisabled() {return props.preferences.ready?.()===false
|
|
6055
|
-
},get separator() {return _$memo30(()=>!!(!model.grouped()&&index()
|
|
5943
|
+
},get separator() {return _$memo30(()=>!!(!model.grouped()&&index()>0&&model.favorites().has(model.visibility.visible()[index() - 1].name)))()&&!model.favorites().has(item.name)
|
|
6056
5944
|
},onToggleFavorite:()=>props.preferences.toggleFavoriteMcpServer?.(item.name)
|
|
6057
5945
|
})]
|
|
6058
5946
|
})
|
|
@@ -6066,12 +5954,11 @@ return _el$9
|
|
|
6066
5954
|
})]
|
|
6067
5955
|
}
|
|
6068
5956
|
}),null)
|
|
6069
|
-
_$
|
|
5957
|
+
_$effect40((_$p)=>_$setProp40(_el$2,"paddingBottom",model.bulkRunning()||model.bulk().status==="error"?1:0,_$p))
|
|
6070
5958
|
return _el$
|
|
6071
5959
|
}
|
|
6072
5960
|
})
|
|
6073
5961
|
}
|
|
6074
|
-
|
|
6075
5962
|
function McpSection(props) {const icons=useIcons()
|
|
6076
5963
|
const [query,setQuery]=createSignal23("")
|
|
6077
5964
|
const model=createMcpSectionModel(props,query)
|
|
@@ -6094,17 +5981,15 @@ return _$createComponent46(SectionWithHeaderAction,{get api() {return props.api
|
|
|
6094
5981
|
}
|
|
6095
5982
|
})
|
|
6096
5983
|
}
|
|
6097
|
-
|
|
6098
5984
|
import {createComponent as _$createComponent48} from "@opentui/solid"
|
|
6099
5985
|
import {setProp as _$setProp42} from "@opentui/solid"
|
|
6100
|
-
import {effect as _$
|
|
5986
|
+
import {effect as _$effect42} from "@opentui/solid"
|
|
6101
5987
|
import {createTextNode as _$createTextNode28} from "@opentui/solid"
|
|
6102
5988
|
import {insertNode as _$insertNode32} from "@opentui/solid"
|
|
6103
5989
|
import {createElement as _$createElement45} from "@opentui/solid"
|
|
6104
5990
|
import {memo as _$memo32} from "@opentui/solid"
|
|
6105
5991
|
import {For as For13,Show as Show15,createMemo as createMemo14} from "solid-js"
|
|
6106
|
-
|
|
6107
|
-
import {effect as _$effect40} from "@opentui/solid"
|
|
5992
|
+
import {effect as _$effect41} from "@opentui/solid"
|
|
6108
5993
|
import {insert as _$insert38} from "@opentui/solid"
|
|
6109
5994
|
import {setProp as _$setProp41} from "@opentui/solid"
|
|
6110
5995
|
import {createElement as _$createElement44} from "@opentui/solid"
|
|
@@ -6117,7 +6002,7 @@ const shortcut=createMemo13(()=>{const bindings=props.api.keymap.getCommandBindi
|
|
|
6117
6002
|
})
|
|
6118
6003
|
return props.api.keys.formatBindings(bindings.get(props.action.command))
|
|
6119
6004
|
})
|
|
6120
|
-
function run() {const result=props.interaction
|
|
6005
|
+
function run() {const result=props.interaction?props.interaction.dispatchFromReturnTarget(props.action.command):props.api.keymap.dispatchCommand(props.action.command)
|
|
6121
6006
|
if(result.ok)
|
|
6122
6007
|
return
|
|
6123
6008
|
props.api.ui.toast({variant:"warning",title:props.action.label,message:`Command is ${result.reason}`,duration:3000
|
|
@@ -6132,17 +6017,17 @@ queueMicrotask(()=>props.interaction?.select(`${id()}.favorite`))
|
|
|
6132
6017
|
}
|
|
6133
6018
|
},()=>theme().warning,"control")
|
|
6134
6019
|
const controlBackground=()=>{const background=favorite.backgroundColor()
|
|
6135
|
-
return background==="transparent"
|
|
6020
|
+
return background==="transparent"?row.backgroundColor():background
|
|
6136
6021
|
}
|
|
6137
6022
|
return _$createComponent47(ListRow,{ref:(node)=>row.ref(node),get id() {return id()
|
|
6138
|
-
},paddingLeft:1,paddingRight:1,get marginTop() {return props.separator
|
|
6023
|
+
},paddingLeft:1,paddingRight:1,get marginTop() {return props.separator?1:0
|
|
6139
6024
|
},get backgroundColor() {return row.backgroundColor()
|
|
6140
6025
|
},get onMouseOver() {return row.onMouseOver
|
|
6141
6026
|
},get onMouseOut() {return row.onMouseOut
|
|
6142
6027
|
},onMouseUp:(event)=>row.activate(event),get leading() {return (()=>{var _el$=_$createElement44("text")
|
|
6143
6028
|
_$setProp41(_el$,"flexShrink",0)
|
|
6144
6029
|
_$insert38(_el$,()=>icons.action(props.action.command))
|
|
6145
|
-
_$
|
|
6030
|
+
_$effect41((_$p)=>_$setProp41(_el$,"fg",props.disabled?theme().textMuted:row.focused()?row.foregroundColor():theme().accent,_$p))
|
|
6146
6031
|
return _el$
|
|
6147
6032
|
})()
|
|
6148
6033
|
},get content() {return (()=>{var _el$2=_$createElement44("text")
|
|
@@ -6151,9 +6036,9 @@ _$setProp41(_el$2,"wrapMode","none")
|
|
|
6151
6036
|
_$setProp41(_el$2,"truncate",true)
|
|
6152
6037
|
_$insert38(_el$2,()=>props.action.label,null)
|
|
6153
6038
|
_$insert38(_el$2,(()=>{var _c$=_$memo31(()=>!!props.disabled)
|
|
6154
|
-
return ()=>_c$()
|
|
6039
|
+
return ()=>_c$()?` \xB7 ${props.disabled}`:""
|
|
6155
6040
|
})(),null)
|
|
6156
|
-
_$
|
|
6041
|
+
_$effect41((_$p)=>_$setProp41(_el$2,"fg",row.foregroundColor(),_$p))
|
|
6157
6042
|
return _el$2
|
|
6158
6043
|
})()
|
|
6159
6044
|
},get metadata() {return _$createComponent47(Show14,{get when() {return shortcut()
|
|
@@ -6161,14 +6046,14 @@ return _el$2
|
|
|
6161
6046
|
_$setProp41(_el$3,"flexShrink",0)
|
|
6162
6047
|
_$setProp41(_el$3,"wrapMode","none")
|
|
6163
6048
|
_$insert38(_el$3,value)
|
|
6164
|
-
_$
|
|
6049
|
+
_$effect41((_$p)=>_$setProp41(_el$3,"fg",row.focused()?row.foregroundColor():theme().textMuted,_$p))
|
|
6165
6050
|
return _el$3
|
|
6166
6051
|
})()
|
|
6167
6052
|
})
|
|
6168
6053
|
},get trailing() {return _$createComponent47(BookmarkControl,{ref:(node)=>favorite.ref(node),get id() {return `${id()}.favorite`
|
|
6169
6054
|
},get bookmarked() {return props.favorite
|
|
6170
6055
|
},get backgroundColor() {return controlBackground()
|
|
6171
|
-
},get foregroundColor() {return _$memo31(()=>!!row.focused())()
|
|
6056
|
+
},get foregroundColor() {return _$memo31(()=>!!row.focused())()?row.foregroundColor():favorite.foregroundColor()
|
|
6172
6057
|
},get onMouseOver() {return favorite.onMouseOver
|
|
6173
6058
|
},get onMouseOut() {return favorite.onMouseOut
|
|
6174
6059
|
},onMouseUp:(event)=>favorite.activate(event)
|
|
@@ -6176,11 +6061,10 @@ return _el$3
|
|
|
6176
6061
|
}
|
|
6177
6062
|
})
|
|
6178
6063
|
}
|
|
6179
|
-
|
|
6180
6064
|
function QuickActionsSection(props) {const commandRevision=createQuickActionRevision(props.api)
|
|
6181
6065
|
const actions=createMemo14(()=>{commandRevision()
|
|
6182
6066
|
return orderQuickActionIds(props.preferences.quickActionOrder?.()??QUICK_ACTIONS.map((action)=>action.command),props.preferences.favoriteQuickActions?.()??new Set).flatMap((id)=>{const action=QUICK_ACTIONS.find((candidate)=>candidate.command===id)
|
|
6183
|
-
return action&&props.preferences.quickActionVisible?.(id)!==false
|
|
6067
|
+
return action&&props.preferences.quickActionVisible?.(id)!==false?[{...action,label:quickActionLabel(props.api,action),disabled:quickActionDisabledReason(props.api,action)
|
|
6184
6068
|
}]:[]
|
|
6185
6069
|
})
|
|
6186
6070
|
})
|
|
@@ -6196,7 +6080,7 @@ return _$createComponent48(Section,{get api() {return props.api
|
|
|
6196
6080
|
},get children() {return [_$createComponent48(Show15,{get when() {return actions().length===0
|
|
6197
6081
|
},get children() {var _el$=_$createElement45("text")
|
|
6198
6082
|
_$insertNode32(_el$,_$createTextNode28(`No quick actions selected`))
|
|
6199
|
-
_$
|
|
6083
|
+
_$effect42((_$p)=>_$setProp42(_el$,"fg",props.api.theme.current.textMuted,_$p))
|
|
6200
6084
|
return _el$
|
|
6201
6085
|
}
|
|
6202
6086
|
}),_$createComponent48(For13,{get each() {return visibility.visible()
|
|
@@ -6204,8 +6088,8 @@ return _el$
|
|
|
6204
6088
|
},get interaction() {return props.interaction
|
|
6205
6089
|
},action,get disabled() {return action.disabled
|
|
6206
6090
|
},get favorite() {return props.preferences.favoriteQuickActions?.().has(action.command)??false
|
|
6207
|
-
},get favoriteDisabled() {return _$memo32(()=>!!props.preferences.ready)()
|
|
6208
|
-
},get separator() {return _$memo32(()=>!!(index()
|
|
6091
|
+
},get favoriteDisabled() {return _$memo32(()=>!!props.preferences.ready)()?!props.preferences.ready():false
|
|
6092
|
+
},get separator() {return _$memo32(()=>!!(index()>0&&(props.preferences.favoriteQuickActions?.().has(visibility.visible()[index() - 1].command)??false)))()&&!(props.preferences.favoriteQuickActions?.().has(action.command)??false)
|
|
6209
6093
|
},onToggleFavorite:()=>props.preferences.toggleFavoriteQuickAction?.(action.command),get position() {return {section:navigationSection(),row:10 + index(),column:0
|
|
6210
6094
|
}
|
|
6211
6095
|
}
|
|
@@ -6221,7 +6105,6 @@ return _el$
|
|
|
6221
6105
|
}
|
|
6222
6106
|
})
|
|
6223
6107
|
}
|
|
6224
|
-
|
|
6225
6108
|
import {insert as _$insert39} from "@opentui/solid"
|
|
6226
6109
|
import {spread as _$spread2} from "@opentui/solid"
|
|
6227
6110
|
import {mergeProps as _$mergeProps8} from "@opentui/solid"
|
|
@@ -6232,13 +6115,12 @@ function SectionBoundary(props) {const dividerColor=()=>{const {backgroundPanel,
|
|
|
6232
6115
|
return RGBA3.fromValues(backgroundPanel.r + (borderSubtle.r - backgroundPanel.r) * 0.45,backgroundPanel.g + (borderSubtle.g - backgroundPanel.g) * 0.45,backgroundPanel.b + (borderSubtle.b - backgroundPanel.b) * 0.45)
|
|
6233
6116
|
}
|
|
6234
6117
|
return (()=>{var _el$=_$createElement46("box")
|
|
6235
|
-
_$spread2(_el$,_$mergeProps8(()=>props.divided
|
|
6118
|
+
_$spread2(_el$,_$mergeProps8(()=>props.divided?{border:["bottom"],borderColor:dividerColor(),paddingBottom:1
|
|
6236
6119
|
}:{}),true)
|
|
6237
6120
|
_$insert39(_el$,()=>props.children)
|
|
6238
6121
|
return _el$
|
|
6239
6122
|
})()
|
|
6240
6123
|
}
|
|
6241
|
-
|
|
6242
6124
|
import {createComponent as _$createComponent49} from "@opentui/solid"
|
|
6243
6125
|
import {memo as _$memo33} from "@opentui/solid"
|
|
6244
6126
|
function SectionTab(props) {const item=useSidebarItem(props.api,props.interaction,{id:props.id,position:()=>props.position,disabled:()=>props.disabled===true,activate:props.onActivate
|
|
@@ -6251,8 +6133,8 @@ return _$createComponent49(Tab,{get api() {return props.api
|
|
|
6251
6133
|
},ref:(node)=>item.ref(node),get id() {return props.id
|
|
6252
6134
|
},height:1,minWidth:0,paddingLeft:1,paddingRight:1,get backgroundColor() {return item.backgroundColor()
|
|
6253
6135
|
},get foregroundColor() {return item.foregroundColor()
|
|
6254
|
-
},get onMouseOver() {return _$memo33(()=>!!props.disabled)()
|
|
6255
|
-
},get onMouseOut() {return _$memo33(()=>!!props.disabled)()
|
|
6136
|
+
},get onMouseOver() {return _$memo33(()=>!!props.disabled)()?undefined:item.onMouseOver
|
|
6137
|
+
},get onMouseOut() {return _$memo33(()=>!!props.disabled)()?undefined:item.onMouseOut
|
|
6256
6138
|
},onMouseDown:(event)=>{if (!props.disabled)
|
|
6257
6139
|
item.select(event)
|
|
6258
6140
|
},onMouseUp:(event)=>{event.stopPropagation()
|
|
@@ -6262,10 +6144,8 @@ item.activate(event)
|
|
|
6262
6144
|
}
|
|
6263
6145
|
})
|
|
6264
6146
|
}
|
|
6265
|
-
|
|
6266
6147
|
import {createElement as _$createElement47} from "@opentui/solid"
|
|
6267
6148
|
import {createEffect as createEffect11,onCleanup as onCleanup15} from "solid-js"
|
|
6268
|
-
|
|
6269
6149
|
var ENTRY_COMMAND=`${PLUGIN_ID}.sidebar-shortcuts.enter`
|
|
6270
6150
|
var CANCEL_COMMAND=`${PLUGIN_ID}.sidebar-shortcuts.cancel`
|
|
6271
6151
|
var MODE=`${PLUGIN_ID}.sidebar-shortcuts`
|
|
@@ -6324,7 +6204,6 @@ unregisterCommands()
|
|
|
6324
6204
|
}
|
|
6325
6205
|
}
|
|
6326
6206
|
}
|
|
6327
|
-
|
|
6328
6207
|
function SidebarToggleBinding(props) {const shortcuts=createSidebarShortcutMode(props.api)
|
|
6329
6208
|
createEffect11(()=>shortcuts.bind(props.preferences.toggleKey()))
|
|
6330
6209
|
onCleanup15(shortcuts.dispose)
|
|
@@ -6343,18 +6222,16 @@ onCleanup15(unregister)
|
|
|
6343
6222
|
})
|
|
6344
6223
|
return _$createElement47("box")
|
|
6345
6224
|
}
|
|
6346
|
-
|
|
6347
6225
|
import {mergeProps as _$mergeProps9} from "@opentui/solid"
|
|
6348
|
-
import {effect as _$
|
|
6226
|
+
import {effect as _$effect51} from "@opentui/solid"
|
|
6349
6227
|
import {insert as _$insert48} from "@opentui/solid"
|
|
6350
6228
|
import {createComponent as _$createComponent58} from "@opentui/solid"
|
|
6351
6229
|
import {setProp as _$setProp51} from "@opentui/solid"
|
|
6352
6230
|
import {use as _$use10} from "@opentui/solid"
|
|
6353
6231
|
import {createElement as _$createElement56} from "@opentui/solid"
|
|
6354
6232
|
import {For as For18,Match,Switch,createMemo as createMemo18,onCleanup as onCleanup19} from "solid-js"
|
|
6355
|
-
|
|
6356
6233
|
import {setProp as _$setProp44} from "@opentui/solid"
|
|
6357
|
-
import {effect as _$
|
|
6234
|
+
import {effect as _$effect44} from "@opentui/solid"
|
|
6358
6235
|
import {createTextNode as _$createTextNode29} from "@opentui/solid"
|
|
6359
6236
|
import {insertNode as _$insertNode33} from "@opentui/solid"
|
|
6360
6237
|
import {insert as _$insert41} from "@opentui/solid"
|
|
@@ -6362,14 +6239,13 @@ import {createElement as _$createElement49} from "@opentui/solid"
|
|
|
6362
6239
|
import {createComponent as _$createComponent51} from "@opentui/solid"
|
|
6363
6240
|
import {memo as _$memo35} from "@opentui/solid"
|
|
6364
6241
|
import {For as For14,Show as Show16,createSignal as createSignal24} from "solid-js"
|
|
6365
|
-
|
|
6366
6242
|
import {createEffect as createEffect12,createMemo as createMemo15,onCleanup as onCleanup16,untrack as untrack4} from "solid-js"
|
|
6367
6243
|
function createSkillSectionModel(props,query) {const target=createMemo15(()=>props.controller.target())
|
|
6368
6244
|
const recent=createMemo15(()=>new Map((props.preferences.recentSkills?.()??[]).map((location,index)=>[location,index])))
|
|
6369
6245
|
const list=createMemo15(()=>{const favorites=props.preferences.favoriteSkills?.()??new Set
|
|
6370
6246
|
return [...props.controller.list(target())].sort((left,right)=>{const isLeftFavorite=favorites.has(left.location)
|
|
6371
6247
|
const isRightFavorite=favorites.has(right.location)
|
|
6372
|
-
return Number(isRightFavorite) - Number(isLeftFavorite)||(isLeftFavorite
|
|
6248
|
+
return Number(isRightFavorite) - Number(isLeftFavorite)||(isLeftFavorite?0:(recent().get(left.location)??Infinity) - (recent().get(right.location)??Infinity))||left.name.localeCompare(right.name)
|
|
6373
6249
|
}).map((item)=>({...item}))
|
|
6374
6250
|
})
|
|
6375
6251
|
const filtered=createMemo15(()=>list().filter((item)=>matchesFilter(query(),item.name,item.description)))
|
|
@@ -6386,18 +6262,17 @@ if(isInserted)
|
|
|
6386
6262
|
await props.preferences.recordSkillUse?.(item)
|
|
6387
6263
|
} catch (error) {if (isAbortError(error))
|
|
6388
6264
|
return
|
|
6389
|
-
props.api.ui.toast({variant:"error",title:"Skills",message:error instanceof Error
|
|
6265
|
+
props.api.ui.toast({variant:"error",title:"Skills",message:error instanceof Error?error.message:`Failed to insert /${item.name}`,duration:5000
|
|
6390
6266
|
})
|
|
6391
6267
|
}
|
|
6392
6268
|
}
|
|
6393
6269
|
function skillGroup(item) {if (props.preferences.isFavoriteSkill?.(item))
|
|
6394
6270
|
return "favorite"
|
|
6395
|
-
return recent().has(item.location)
|
|
6271
|
+
return recent().has(item.location)?"recent":"other"
|
|
6396
6272
|
}
|
|
6397
6273
|
return{target,recent,list,filtered,visibility,state,useSkill,skillGroup}
|
|
6398
6274
|
}
|
|
6399
|
-
|
|
6400
|
-
import {effect as _$effect42} from "@opentui/solid"
|
|
6275
|
+
import {effect as _$effect43} from "@opentui/solid"
|
|
6401
6276
|
import {insert as _$insert40} from "@opentui/solid"
|
|
6402
6277
|
import {setProp as _$setProp43} from "@opentui/solid"
|
|
6403
6278
|
import {createElement as _$createElement48} from "@opentui/solid"
|
|
@@ -6415,30 +6290,30 @@ queueMicrotask(()=>props.interaction?.select(`${id()}.favorite`))
|
|
|
6415
6290
|
}
|
|
6416
6291
|
},()=>theme().warning,"control")
|
|
6417
6292
|
const controlBackground=()=>{const background=favorite.backgroundColor()
|
|
6418
|
-
return background==="transparent"
|
|
6293
|
+
return background==="transparent"?row.backgroundColor():background
|
|
6419
6294
|
}
|
|
6420
6295
|
return _$createComponent50(ListRow,{ref:(node)=>row.ref(node),get id() {return id()
|
|
6421
|
-
},paddingLeft:1,paddingRight:1,get marginTop() {return props.separator
|
|
6296
|
+
},paddingLeft:1,paddingRight:1,get marginTop() {return props.separator?1:0
|
|
6422
6297
|
},get backgroundColor() {return row.backgroundColor()
|
|
6423
6298
|
},get onMouseOver() {return row.onMouseOver
|
|
6424
6299
|
},get onMouseOut() {return row.onMouseOut
|
|
6425
6300
|
},onMouseUp:(event)=>row.activate(event),get leading() {return (()=>{var _el$=_$createElement48("text")
|
|
6426
6301
|
_$setProp43(_el$,"flexShrink",0)
|
|
6427
|
-
_$insert40(_el$,()=>icons.icon(props.recent
|
|
6428
|
-
_$
|
|
6302
|
+
_$insert40(_el$,()=>icons.icon(props.recent?"recent":"skills"))
|
|
6303
|
+
_$effect43((_$p)=>_$setProp43(_el$,"fg",row.focused()?row.foregroundColor():theme().accent,_$p))
|
|
6429
6304
|
return _el$
|
|
6430
6305
|
})()
|
|
6431
6306
|
},get content() {return (()=>{var _el$2=_$createElement48("text")
|
|
6432
6307
|
_$setProp43(_el$2,"flexGrow",1)
|
|
6433
6308
|
_$setProp43(_el$2,"wrapMode","word")
|
|
6434
6309
|
_$insert40(_el$2,()=>props.item.name)
|
|
6435
|
-
_$
|
|
6310
|
+
_$effect43((_$p)=>_$setProp43(_el$2,"fg",row.foregroundColor(),_$p))
|
|
6436
6311
|
return _el$2
|
|
6437
6312
|
})()
|
|
6438
6313
|
},get trailing() {return _$createComponent50(BookmarkControl,{ref:(node)=>favorite.ref(node),get id() {return `${id()}.favorite`
|
|
6439
6314
|
},get bookmarked() {return props.favorite
|
|
6440
6315
|
},get backgroundColor() {return controlBackground()
|
|
6441
|
-
},get foregroundColor() {return _$memo34(()=>!!row.focused())()
|
|
6316
|
+
},get foregroundColor() {return _$memo34(()=>!!row.focused())()?row.foregroundColor():favorite.foregroundColor()
|
|
6442
6317
|
},get onMouseOver() {return favorite.onMouseOver
|
|
6443
6318
|
},get onMouseOut() {return favorite.onMouseOut
|
|
6444
6319
|
},onMouseUp:(event)=>favorite.activate(event)
|
|
@@ -6446,7 +6321,6 @@ return _el$2
|
|
|
6446
6321
|
}
|
|
6447
6322
|
})
|
|
6448
6323
|
}
|
|
6449
|
-
|
|
6450
6324
|
function SkillsSection(props) {const dialogs=useDialogs(props.api)
|
|
6451
6325
|
const [query,setQuery]=createSignal24("")
|
|
6452
6326
|
const model=createSkillSectionModel(props,query)
|
|
@@ -6475,7 +6349,7 @@ return _$createComponent51(Section,{get api() {return props.api
|
|
|
6475
6349
|
},id:`${PLUGIN_ID}.retry.skills`,get position() {return {section:navigationSection(),row:1,column:0
|
|
6476
6350
|
}
|
|
6477
6351
|
},get state() {return model.state()
|
|
6478
|
-
},get hasItems() {return model.list().length
|
|
6352
|
+
},get hasItems() {return model.list().length>0
|
|
6479
6353
|
},empty:"No skills",loading:"Loading skills\u2026",onRetry:()=>void props.controller.retry(model.target()),get children() {var _el$=_$createElement49("box")
|
|
6480
6354
|
_$insert41(_el$,_$createComponent51(SectionFilter,{get api() {return props.api
|
|
6481
6355
|
},get interaction() {return props.interaction
|
|
@@ -6484,10 +6358,10 @@ _$insert41(_el$,_$createComponent51(SectionFilter,{get api() {return props.api
|
|
|
6484
6358
|
},get query() {return query()
|
|
6485
6359
|
},placeholder:"Filter skills...",onInput:setQuery
|
|
6486
6360
|
}),null)
|
|
6487
|
-
_$insert41(_el$,_$createComponent51(Show16,{get when() {return model.filtered().length
|
|
6361
|
+
_$insert41(_el$,_$createComponent51(Show16,{get when() {return model.filtered().length>0
|
|
6488
6362
|
},get fallback() {return (()=>{var _el$2=_$createElement49("text")
|
|
6489
6363
|
_$insertNode33(_el$2,_$createTextNode29(`No matching skills`))
|
|
6490
|
-
_$
|
|
6364
|
+
_$effect44((_$p)=>_$setProp44(_el$2,"fg",props.api.theme.current.textMuted,_$p))
|
|
6491
6365
|
return _el$2
|
|
6492
6366
|
})()
|
|
6493
6367
|
},get children() {return [_$createComponent51(SidebarRowList,{get density() {return props.preferences.rowDensity?.()??"compact"
|
|
@@ -6499,7 +6373,7 @@ return _el$2
|
|
|
6499
6373
|
},onUse:()=>selectSkill(item),get recent() {return model.recent().has(item.location)
|
|
6500
6374
|
},get favorite() {return props.preferences.isFavoriteSkill?.(item)??false
|
|
6501
6375
|
},get favoriteDisabled() {return props.preferences.ready?.()===false
|
|
6502
|
-
},get separator() {return _$memo35(()=>index()
|
|
6376
|
+
},get separator() {return _$memo35(()=>index()>0)()&&model.skillGroup(model.visibility.visible()[index() - 1])!==model.skillGroup(item)
|
|
6503
6377
|
},onToggleFavorite:()=>props.preferences.toggleFavoriteSkill?.(item)
|
|
6504
6378
|
})
|
|
6505
6379
|
})
|
|
@@ -6519,9 +6393,8 @@ return _el$
|
|
|
6519
6393
|
}
|
|
6520
6394
|
})
|
|
6521
6395
|
}
|
|
6522
|
-
|
|
6523
6396
|
import {memo as _$memo37} from "@opentui/solid"
|
|
6524
|
-
import {effect as _$
|
|
6397
|
+
import {effect as _$effect47} from "@opentui/solid"
|
|
6525
6398
|
import {createTextNode as _$createTextNode31} from "@opentui/solid"
|
|
6526
6399
|
import {insertNode as _$insertNode36} from "@opentui/solid"
|
|
6527
6400
|
import {insert as _$insert44} from "@opentui/solid"
|
|
@@ -6529,7 +6402,6 @@ import {setProp as _$setProp47} from "@opentui/solid"
|
|
|
6529
6402
|
import {createElement as _$createElement52} from "@opentui/solid"
|
|
6530
6403
|
import {createComponent as _$createComponent54} from "@opentui/solid"
|
|
6531
6404
|
import {For as For16,Show as Show19} from "solid-js"
|
|
6532
|
-
|
|
6533
6405
|
import {createEffect as createEffect13,createMemo as createMemo16,createSignal as createSignal25,onCleanup as onCleanup17,untrack as untrack5} from "solid-js"
|
|
6534
6406
|
function createSubagentSectionModel(props) {const list=createMemo16(()=>props.controller.list(props.sessionID))
|
|
6535
6407
|
const recent=createMemo16(()=>props.controller.recent?.(props.sessionID)??[])
|
|
@@ -6537,7 +6409,7 @@ const rows=createMemo16(()=>buildSubagentView(list(),recent()))
|
|
|
6537
6409
|
const [query,setQuery]=createSignal25("")
|
|
6538
6410
|
const [mode,setMode]=createSignal25("all")
|
|
6539
6411
|
const counts=createMemo16(()=>countSubagentView(rows(),query()))
|
|
6540
|
-
const tabs=createMemo16(()=>["all","active","recent",...counts().errors
|
|
6412
|
+
const tabs=createMemo16(()=>["all","active","recent",...counts().errors>0?["errors"]:[]
|
|
6541
6413
|
])
|
|
6542
6414
|
const filtered=createMemo16(()=>filterSubagentView(rows(),mode(),query()))
|
|
6543
6415
|
const parentID=createMemo16(()=>props.api.state?.session?.get(props.sessionID)?.parentID)
|
|
@@ -6551,7 +6423,7 @@ setMode("all")
|
|
|
6551
6423
|
})
|
|
6552
6424
|
const visibility=createListVisibility({items:filtered,limit:()=>props.preferences.sectionItemLimit?.("subagents")??0,resetKey:()=>JSON.stringify([targetKey(),query(),mode()])
|
|
6553
6425
|
})
|
|
6554
|
-
const clockKey=createMemo16(()=>props.preferences.expanded().subagents&&visibility.visible().some((item)=>item.status.type!=="idle")
|
|
6426
|
+
const clockKey=createMemo16(()=>props.preferences.expanded().subagents&&visibility.visible().some((item)=>item.status.type!=="idle")?targetKey():undefined)
|
|
6555
6427
|
const now=createSubagentClock(clockKey)
|
|
6556
6428
|
const byId=createMemo16(()=>new Map(visibility.visible().map((item)=>[item.session.id,item])))
|
|
6557
6429
|
const ids=createMemo16(()=>visibility.visible().map((item)=>item.session.id))
|
|
@@ -6565,19 +6437,17 @@ untrack5(()=>void props.controller.refresh(sessionID).catch(()=>{}))
|
|
|
6565
6437
|
return{list,recent,rows,query,setQuery,mode,setMode,counts,tabs,filtered,parentID,visibility,now,byId,ids,state
|
|
6566
6438
|
}
|
|
6567
6439
|
}
|
|
6568
|
-
|
|
6569
6440
|
import {setProp as _$setProp46} from "@opentui/solid"
|
|
6570
|
-
import {effect as _$
|
|
6441
|
+
import {effect as _$effect46} from "@opentui/solid"
|
|
6571
6442
|
import {insertNode as _$insertNode35} from "@opentui/solid"
|
|
6572
6443
|
import {insert as _$insert43} from "@opentui/solid"
|
|
6573
6444
|
import {createElement as _$createElement51} from "@opentui/solid"
|
|
6574
6445
|
import {createComponent as _$createComponent53} from "@opentui/solid"
|
|
6575
6446
|
import {For as For15,Show as Show18} from "solid-js"
|
|
6576
|
-
|
|
6577
6447
|
import {createTextNode as _$createTextNode30} from "@opentui/solid"
|
|
6578
6448
|
import {insertNode as _$insertNode34} from "@opentui/solid"
|
|
6579
6449
|
import {memo as _$memo36} from "@opentui/solid"
|
|
6580
|
-
import {effect as _$
|
|
6450
|
+
import {effect as _$effect45} from "@opentui/solid"
|
|
6581
6451
|
import {insert as _$insert42} from "@opentui/solid"
|
|
6582
6452
|
import {setProp as _$setProp45} from "@opentui/solid"
|
|
6583
6453
|
import {createElement as _$createElement50} from "@opentui/solid"
|
|
@@ -6592,48 +6462,48 @@ const cancelled=()=>props.item.run?.outcome==="cancelled"
|
|
|
6592
6462
|
const id=()=>`${PLUGIN_ID}.subagent.${props.item.session.id}`
|
|
6593
6463
|
const row=useSidebarItem(props.api,props.interaction,{id:id(),position:()=>props.position,activate:props.onOpen
|
|
6594
6464
|
})
|
|
6595
|
-
const leadingColor=()=>row.focused()
|
|
6465
|
+
const leadingColor=()=>row.focused()?row.foregroundColor():failed()?theme().error:retrying()||props.item.unavailable?theme().warning:idle()?theme().textMuted:theme().primary
|
|
6596
6466
|
return _$createComponent52(ListRow,{ref:(node)=>row.ref(node),get id() {return id()
|
|
6597
6467
|
},paddingLeft:1,paddingRight:1,get backgroundColor() {return row.backgroundColor()
|
|
6598
6468
|
},get onMouseOver() {return row.onMouseOver
|
|
6599
6469
|
},get onMouseOut() {return row.onMouseOut
|
|
6600
6470
|
},onMouseDown:(event)=>row.activate(event),get leading() {return (()=>{var _el$=_$createElement50("text")
|
|
6601
6471
|
_$setProp45(_el$,"flexShrink",0)
|
|
6602
|
-
_$insert42(_el$,()=>icons.icon(failed()
|
|
6603
|
-
_$
|
|
6472
|
+
_$insert42(_el$,()=>icons.icon(failed()?"error":cancelled()?"close":retrying()?"retry":idle()?"idle":"busy"))
|
|
6473
|
+
_$effect45((_$p)=>_$setProp45(_el$,"fg",leadingColor(),_$p))
|
|
6604
6474
|
return _el$
|
|
6605
6475
|
})()
|
|
6606
6476
|
},get content() {return (()=>{var _el$2=_$createElement50("text")
|
|
6607
6477
|
_$setProp45(_el$2,"flexGrow",1)
|
|
6608
6478
|
_$setProp45(_el$2,"wrapMode","word")
|
|
6609
6479
|
_$insert42(_el$2,()=>props.item.session.title)
|
|
6610
|
-
_$
|
|
6480
|
+
_$effect45((_$p)=>_$setProp45(_el$2,"fg",row.foregroundColor(),_$p))
|
|
6611
6481
|
return _el$2
|
|
6612
6482
|
})()
|
|
6613
6483
|
},get metadata() {return (()=>{var _el$3=_$createElement50("text")
|
|
6614
6484
|
_$setProp45(_el$3,"flexShrink",0)
|
|
6615
6485
|
_$insert42(_el$3,(()=>{var _c$=_$memo36(()=>!!props.item.run)
|
|
6616
|
-
return ()=>_c$()
|
|
6486
|
+
return ()=>_c$()?`${props.item.run.startedBeforeObservation ? `${icons.icon("recent")} ` : ""}${formatSubagentDuration(props.item.run.startedAt, props.item.run.finishedAt ?? props.now)}`:""
|
|
6617
6487
|
})())
|
|
6618
|
-
_$
|
|
6488
|
+
_$effect45((_$p)=>_$setProp45(_el$3,"fg",row.focused()?row.foregroundColor():theme().textMuted,_$p))
|
|
6619
6489
|
return _el$3
|
|
6620
6490
|
})()
|
|
6621
6491
|
},get details() {return [_$createComponent52(Show17,{get when() {return props.item.run?.errorMessage
|
|
6622
6492
|
},get children() {var _el$4=_$createElement50("text"),_el$5=_$createTextNode30(`: `)
|
|
6623
6493
|
_$insertNode34(_el$4,_el$5)
|
|
6624
6494
|
_$setProp45(_el$4,"wrapMode","word")
|
|
6625
|
-
_$insert42(_el$4,()=>cancelled()
|
|
6495
|
+
_$insert42(_el$4,()=>cancelled()?"Cancelled":"Error",_el$5)
|
|
6626
6496
|
_$insert42(_el$4,()=>props.item.run?.errorMessage,null)
|
|
6627
|
-
_$
|
|
6497
|
+
_$effect45((_$p)=>_$setProp45(_el$4,"fg",row.focused()?row.foregroundColor():failed()?theme().error:theme().textMuted,_$p))
|
|
6628
6498
|
return _el$4
|
|
6629
6499
|
}
|
|
6630
6500
|
}),_$createComponent52(Show17,{get when() {return props.item.unavailable
|
|
6631
6501
|
},get children() {var _el$6=_$createElement50("text")
|
|
6632
6502
|
_$insertNode34(_el$6,_$createTextNode30(`Worker status unavailable`))
|
|
6633
|
-
_$
|
|
6503
|
+
_$effect45((_$p)=>_$setProp45(_el$6,"fg",theme().warning,_$p))
|
|
6634
6504
|
return _el$6
|
|
6635
6505
|
}
|
|
6636
|
-
}),_$createComponent52(Show17,{get when() {return _$memo36(()=>props.item.status.type==="retry")()
|
|
6506
|
+
}),_$createComponent52(Show17,{get when() {return _$memo36(()=>props.item.status.type==="retry")()?props.item.status:undefined
|
|
6637
6507
|
},children:(status)=>(()=>{var _el$0=_$createElement50("text"),_el$1=_$createTextNode30(`Retry #`),_el$10=_$createTextNode30(` \xB7 `),_el$11=_$createTextNode30(`s \xB7 `)
|
|
6638
6508
|
_$insertNode34(_el$0,_el$1)
|
|
6639
6509
|
_$insertNode34(_el$0,_el$10)
|
|
@@ -6642,20 +6512,19 @@ _$setProp45(_el$0,"wrapMode","word")
|
|
|
6642
6512
|
_$insert42(_el$0,()=>status().attempt,_el$10)
|
|
6643
6513
|
_$insert42(_el$0,()=>Math.max(0,Math.ceil((status().next - props.now) / 1000)),_el$11)
|
|
6644
6514
|
_$insert42(_el$0,()=>status().message,null)
|
|
6645
|
-
_$
|
|
6515
|
+
_$effect45((_$p)=>_$setProp45(_el$0,"fg",row.focused()?row.foregroundColor():theme().warning,_$p))
|
|
6646
6516
|
return _el$0
|
|
6647
6517
|
})()
|
|
6648
6518
|
}),_$createComponent52(Show17,{get when() {return _$memo36(()=>!!idle())()&&!props.item.run?.errorMessage
|
|
6649
6519
|
},get children() {var _el$8=_$createElement50("text")
|
|
6650
6520
|
_$insertNode34(_el$8,_$createTextNode30(`Finished`))
|
|
6651
|
-
_$
|
|
6521
|
+
_$effect45((_$p)=>_$setProp45(_el$8,"fg",theme().textMuted,_$p))
|
|
6652
6522
|
return _el$8
|
|
6653
6523
|
}
|
|
6654
6524
|
})]
|
|
6655
6525
|
}
|
|
6656
6526
|
})
|
|
6657
6527
|
}
|
|
6658
|
-
|
|
6659
6528
|
function SubagentList(props) {return _$createComponent53(SidebarRowList,{get density() {return props.density
|
|
6660
6529
|
},get children() {return _$createComponent53(For15,{get each() {return props.ids
|
|
6661
6530
|
},children:(id,index)=>{const initial=props.itemById(id)
|
|
@@ -6666,7 +6535,7 @@ _$insert43(_el$,_$createComponent53(Show18,{get when() {return startsGroup()
|
|
|
6666
6535
|
},get children() {var _el$2=_$createElement51("text"),_el$3=_$createElement51("b")
|
|
6667
6536
|
_$insertNode35(_el$2,_el$3)
|
|
6668
6537
|
_$insert43(_el$3,()=>item().group)
|
|
6669
|
-
_$
|
|
6538
|
+
_$effect46((_$p)=>_$setProp46(_el$2,"fg",props.api.theme.current.textMuted,_$p))
|
|
6670
6539
|
return _el$2
|
|
6671
6540
|
}
|
|
6672
6541
|
}),null)
|
|
@@ -6678,7 +6547,7 @@ _$insert43(_el$,_$createComponent53(SubagentRow,{get api() {return props.api
|
|
|
6678
6547
|
}
|
|
6679
6548
|
},onOpen:()=>props.controller.open(id)
|
|
6680
6549
|
}),null)
|
|
6681
|
-
_$
|
|
6550
|
+
_$effect46((_$p)=>_$setProp46(_el$,"marginTop",index()>0&&startsGroup()?1:0,_$p))
|
|
6682
6551
|
return _el$
|
|
6683
6552
|
})()
|
|
6684
6553
|
}
|
|
@@ -6686,7 +6555,6 @@ return _el$
|
|
|
6686
6555
|
}
|
|
6687
6556
|
})
|
|
6688
6557
|
}
|
|
6689
|
-
|
|
6690
6558
|
function SubagentSection(props) {const icons=useIcons()
|
|
6691
6559
|
const model=createSubagentSectionModel(props)
|
|
6692
6560
|
const navigationSection=()=>props.navigationSection??2
|
|
@@ -6708,7 +6576,7 @@ return _$createComponent54(Section,{get api() {return props.api
|
|
|
6708
6576
|
},id:`${PLUGIN_ID}.retry.subagents`,get position() {return {section:navigationSection(),row:2,column:0
|
|
6709
6577
|
}
|
|
6710
6578
|
},get state() {return model.state()
|
|
6711
|
-
},get hasItems() {return model.rows().length
|
|
6579
|
+
},get hasItems() {return model.rows().length>0
|
|
6712
6580
|
},empty:"No subagents",loading:"Loading subagents\u2026",onRetry:()=>void props.controller.retry(props.sessionID),get children() {var _el$=_$createElement52("box"),_el$2=_$createElement52("box")
|
|
6713
6581
|
_$insertNode36(_el$,_el$2)
|
|
6714
6582
|
_$setProp47(_el$,"gap",1)
|
|
@@ -6737,7 +6605,7 @@ _$insert44(_el$2,_$createComponent54(For16,{get each() {return model.tabs()
|
|
|
6737
6605
|
_$insert44(_el$,_$createComponent54(Show19,{get when() {return model.filtered().length===0
|
|
6738
6606
|
},get children() {var _el$3=_$createElement52("text")
|
|
6739
6607
|
_$insertNode36(_el$3,_$createTextNode31(`No matching subagents`))
|
|
6740
|
-
_$
|
|
6608
|
+
_$effect47((_$p)=>_$setProp47(_el$3,"fg",props.api.theme.current.textMuted,_$p))
|
|
6741
6609
|
return _el$3
|
|
6742
6610
|
}
|
|
6743
6611
|
}),null)
|
|
@@ -6764,8 +6632,7 @@ return _el$
|
|
|
6764
6632
|
}
|
|
6765
6633
|
})
|
|
6766
6634
|
}
|
|
6767
|
-
|
|
6768
|
-
import {effect as _$effect49} from "@opentui/solid"
|
|
6635
|
+
import {effect as _$effect50} from "@opentui/solid"
|
|
6769
6636
|
import {createTextNode as _$createTextNode33} from "@opentui/solid"
|
|
6770
6637
|
import {insertNode as _$insertNode39} from "@opentui/solid"
|
|
6771
6638
|
import {insert as _$insert47} from "@opentui/solid"
|
|
@@ -6774,18 +6641,16 @@ import {createElement as _$createElement55} from "@opentui/solid"
|
|
|
6774
6641
|
import {createComponent as _$createComponent57} from "@opentui/solid"
|
|
6775
6642
|
import {memo as _$memo40} from "@opentui/solid"
|
|
6776
6643
|
import {Show as Show22,createEffect as createEffect14,createMemo as createMemo17,createSignal as createSignal26,onCleanup as onCleanup18,untrack as untrack6} from "solid-js"
|
|
6777
|
-
|
|
6778
6644
|
import {memo as _$memo39} from "@opentui/solid"
|
|
6779
|
-
import {effect as _$
|
|
6645
|
+
import {effect as _$effect49} from "@opentui/solid"
|
|
6780
6646
|
import {insertNode as _$insertNode38} from "@opentui/solid"
|
|
6781
6647
|
import {insert as _$insert46} from "@opentui/solid"
|
|
6782
6648
|
import {createComponent as _$createComponent56} from "@opentui/solid"
|
|
6783
6649
|
import {setProp as _$setProp49} from "@opentui/solid"
|
|
6784
6650
|
import {createElement as _$createElement54} from "@opentui/solid"
|
|
6785
6651
|
import {For as For17,Show as Show21} from "solid-js"
|
|
6786
|
-
|
|
6787
6652
|
import {createComponent as _$createComponent55} from "@opentui/solid"
|
|
6788
|
-
import {effect as _$
|
|
6653
|
+
import {effect as _$effect48} from "@opentui/solid"
|
|
6789
6654
|
import {createTextNode as _$createTextNode32} from "@opentui/solid"
|
|
6790
6655
|
import {insertNode as _$insertNode37} from "@opentui/solid"
|
|
6791
6656
|
import {memo as _$memo38} from "@opentui/solid"
|
|
@@ -6819,7 +6684,7 @@ _$insertNode37(_el$,_el$3)
|
|
|
6819
6684
|
_$setProp48(_el$,"flexDirection","row")
|
|
6820
6685
|
_$setProp48(_el$,"gap",1)
|
|
6821
6686
|
_$setProp48(_el$2,"flexShrink",0)
|
|
6822
|
-
_$insert45(_el$2,()=>icons.icon(done()
|
|
6687
|
+
_$insert45(_el$2,()=>icons.icon(done()?"done":active()?"busy":cancelled()?"close":"idle"))
|
|
6823
6688
|
_$setProp48(_el$3,"flexGrow",1)
|
|
6824
6689
|
_$setProp48(_el$3,"wrapMode","word")
|
|
6825
6690
|
_$insert45(_el$3,()=>props.item.content)
|
|
@@ -6830,11 +6695,11 @@ _$setProp48(_el$4,"width",2)
|
|
|
6830
6695
|
_$setProp48(_el$4,"flexShrink",0)
|
|
6831
6696
|
_$insertNode37(_el$5,_el$6)
|
|
6832
6697
|
_$insert45(_el$5,priorityLabel,null)
|
|
6833
|
-
_$
|
|
6698
|
+
_$effect48((_$p)=>_$setProp48(_el$4,"fg",priorityColor(),_$p))
|
|
6834
6699
|
return _el$4
|
|
6835
6700
|
}
|
|
6836
6701
|
}),null)
|
|
6837
|
-
_$
|
|
6702
|
+
_$effect48((_p$)=>{var _v$=active()?theme().warning:done()?theme().success:cancelled()?theme().error:theme().textMuted,_v$2=active()?theme().primary:theme().textMuted,_v$3=done()?TextAttributes17.STRIKETHROUGH:active()?TextAttributes17.BOLD:undefined
|
|
6838
6703
|
_v$!==_p$.e&&(_p$.e=_$setProp48(_el$2,"fg",_v$,_p$.e))
|
|
6839
6704
|
_v$2!==_p$.t&&(_p$.t=_$setProp48(_el$3,"fg",_v$2,_p$.t))
|
|
6840
6705
|
_v$3!==_p$.a&&(_p$.a=_$setProp48(_el$3,"attributes",_v$3,_p$.a))
|
|
@@ -6844,7 +6709,6 @@ return _p$
|
|
|
6844
6709
|
return _el$
|
|
6845
6710
|
})()
|
|
6846
6711
|
}
|
|
6847
|
-
|
|
6848
6712
|
function TodoContents(props) {const navigationSection=()=>props.navigationSection??1
|
|
6849
6713
|
return (()=>{var _el$=_$createElement54("box"),_el$2=_$createElement54("box")
|
|
6850
6714
|
_$insertNode38(_el$,_el$2)
|
|
@@ -6861,7 +6725,7 @@ _$insert46(_el$2,_$createComponent56(For17,{each:["all","active","finished"],chi
|
|
|
6861
6725
|
},onActivate:()=>props.setMode(value)
|
|
6862
6726
|
})
|
|
6863
6727
|
}))
|
|
6864
|
-
_$insert46(_el$,_$createComponent56(Show21,{get when() {return props.view.rows.length
|
|
6728
|
+
_$insert46(_el$,_$createComponent56(Show21,{get when() {return props.view.rows.length>0
|
|
6865
6729
|
},get fallback() {return _$createComponent56(EmptyTodo,{get api() {return props.api
|
|
6866
6730
|
},get mode() {return props.mode
|
|
6867
6731
|
}
|
|
@@ -6874,7 +6738,7 @@ _$insert46(_el$3,_$createComponent56(Show21,{get when() {return startsGroup()
|
|
|
6874
6738
|
},get children() {var _el$4=_$createElement54("text"),_el$5=_$createElement54("b")
|
|
6875
6739
|
_$insertNode38(_el$4,_el$5)
|
|
6876
6740
|
_$insert46(_el$5,()=>row.group)
|
|
6877
|
-
_$
|
|
6741
|
+
_$effect49((_$p)=>_$setProp49(_el$4,"fg",props.api.theme.current.textMuted,_$p))
|
|
6878
6742
|
return _el$4
|
|
6879
6743
|
}
|
|
6880
6744
|
}),null)
|
|
@@ -6882,7 +6746,7 @@ _$insert46(_el$3,_$createComponent56(TodoRow,{get api() {return props.api
|
|
|
6882
6746
|
},get item() {return row.item
|
|
6883
6747
|
}
|
|
6884
6748
|
}),null)
|
|
6885
|
-
_$
|
|
6749
|
+
_$effect49((_$p)=>_$setProp49(_el$3,"marginTop",index()>0&&startsGroup()?1:0,_$p))
|
|
6886
6750
|
return _el$3
|
|
6887
6751
|
})()
|
|
6888
6752
|
}
|
|
@@ -6901,12 +6765,11 @@ return _el$
|
|
|
6901
6765
|
})()
|
|
6902
6766
|
}
|
|
6903
6767
|
function EmptyTodo(props) {return (()=>{var _el$6=_$createElement54("text")
|
|
6904
|
-
_$insert46(_el$6,()=>props.mode==="active"
|
|
6905
|
-
_$
|
|
6768
|
+
_$insert46(_el$6,()=>props.mode==="active"?"No active tasks":"No finished tasks")
|
|
6769
|
+
_$effect49((_$p)=>_$setProp49(_el$6,"fg",props.api.theme.current.textMuted,_$p))
|
|
6906
6770
|
return _el$6
|
|
6907
6771
|
})()
|
|
6908
6772
|
}
|
|
6909
|
-
|
|
6910
6773
|
function TodoSection(props) {const list=createMemo17(()=>props.controller.list(props.sessionID))
|
|
6911
6774
|
const icons=useIcons()
|
|
6912
6775
|
const unavailable=()=>hostCapabilityUnavailable(props.api,"todo")
|
|
@@ -6931,7 +6794,7 @@ const navigationSection=()=>props.navigationSection??1
|
|
|
6931
6794
|
return _$createComponent57(Section,{get api() {return props.api
|
|
6932
6795
|
},get interaction() {return props.interaction
|
|
6933
6796
|
},sectionId:`${PLUGIN_ID}.section.todo`,get navigationSection() {return navigationSection()
|
|
6934
|
-
},title:"TODO",section:"todo",get summary() {return _$memo40(()=>!!unavailable())()
|
|
6797
|
+
},title:"TODO",section:"todo",get summary() {return _$memo40(()=>!!unavailable())()?"\u2014":`${view().counts.completed}/${list().length}`
|
|
6935
6798
|
},get open() {return props.preferences.expanded().todo
|
|
6936
6799
|
},onToggle:()=>props.preferences.toggleSectionExpanded("todo"),get children() {return _$createComponent57(Show22,{get when() {return unavailable()
|
|
6937
6800
|
},get fallback() {return _$createComponent57(SectionRequestBody,{get api() {return props.api
|
|
@@ -6939,7 +6802,7 @@ return _$createComponent57(Section,{get api() {return props.api
|
|
|
6939
6802
|
},id:`${PLUGIN_ID}.retry.todo`,get position() {return {section:navigationSection(),row:1,column:0
|
|
6940
6803
|
}
|
|
6941
6804
|
},get state() {return state()
|
|
6942
|
-
},get hasItems() {return list().length
|
|
6805
|
+
},get hasItems() {return list().length>0
|
|
6943
6806
|
},empty:"No tasks yet",loading:"Loading tasks\u2026",onRetry:()=>void props.controller.retry(props.sessionID),get children() {return _$createComponent57(TodoContents,{get api() {return props.api
|
|
6944
6807
|
},get interaction() {return props.interaction
|
|
6945
6808
|
},get navigationSection() {return props.navigationSection
|
|
@@ -6955,14 +6818,13 @@ _$insertNode39(_el$,_el$2)
|
|
|
6955
6818
|
_$setProp50(_el$,"wrapMode","word")
|
|
6956
6819
|
_$insert47(_el$,()=>icons.icon("info"),_el$2)
|
|
6957
6820
|
_$insert47(_el$,message,null)
|
|
6958
|
-
_$
|
|
6821
|
+
_$effect50((_$p)=>_$setProp50(_el$,"fg",props.api.theme.current.textMuted,_$p))
|
|
6959
6822
|
return _el$
|
|
6960
6823
|
})()
|
|
6961
6824
|
})
|
|
6962
6825
|
}
|
|
6963
6826
|
})
|
|
6964
6827
|
}
|
|
6965
|
-
|
|
6966
6828
|
function SidebarContent(props) {const sections=props.preferences.sections
|
|
6967
6829
|
const visibleSections=createMemo18(()=>props.preferences.sectionOrder().filter((section)=>sections()[section]&&supportsSidebarSection(props.api,section)))
|
|
6968
6830
|
onCleanup19(()=>props.interaction.setContentRoot(undefined))
|
|
@@ -6979,7 +6841,7 @@ props.interaction.leave()
|
|
|
6979
6841
|
})
|
|
6980
6842
|
_$insert48(_el$,_$createComponent58(For18,{get each() {return visibleSections()
|
|
6981
6843
|
},children:(section,index)=>_$createComponent58(SectionBoundary,{get api() {return props.api
|
|
6982
|
-
},get divided() {return index()
|
|
6844
|
+
},get divided() {return index()<visibleSections().length - 1
|
|
6983
6845
|
},get children() {return _$createComponent58(Switch,{get children() {return [_$createComponent58(Match,{when:section==="todo",get children() {return _$createComponent58(TodoSection,_$mergeProps9(props,{get navigationSection() {return index() + 1
|
|
6984
6846
|
},get controller() {return props.todo
|
|
6985
6847
|
}
|
|
@@ -7014,7 +6876,7 @@ _$insert48(_el$,_$createComponent58(For18,{get each() {return visibleSections()
|
|
|
7014
6876
|
}
|
|
7015
6877
|
})
|
|
7016
6878
|
}))
|
|
7017
|
-
_$
|
|
6879
|
+
_$effect51((_p$)=>{var _v$=props.interaction.syncFocus,_v$2=props.interaction.syncFocus
|
|
7018
6880
|
_v$!==_p$.e&&(_p$.e=_$setProp51(_el$,"on:focused",_v$,_p$.e))
|
|
7019
6881
|
_v$2!==_p$.t&&(_p$.t=_$setProp51(_el$,"on:blurred",_v$2,_p$.t))
|
|
7020
6882
|
return _p$
|
|
@@ -7023,7 +6885,6 @@ return _p$
|
|
|
7023
6885
|
return _el$
|
|
7024
6886
|
})()
|
|
7025
6887
|
}
|
|
7026
|
-
|
|
7027
6888
|
import {createElement as _$createElement57} from "@opentui/solid"
|
|
7028
6889
|
import {createEffect as createEffect15,createMemo as createMemo19,onCleanup as onCleanup20,untrack as untrack7} from "solid-js"
|
|
7029
6890
|
function McpPersistence(props) {const persist=createMemo19(()=>props.controller.persist())
|
|
@@ -7031,7 +6892,7 @@ createEffect15(()=>{if (!props.api.state.ready)
|
|
|
7031
6892
|
return
|
|
7032
6893
|
persist()
|
|
7033
6894
|
const route=props.api.route.current
|
|
7034
|
-
const params="params" in route
|
|
6895
|
+
const params="params" in route?route.params:undefined
|
|
7035
6896
|
if(typeof params?.sessionID!=="string")
|
|
7036
6897
|
return
|
|
7037
6898
|
const current=props.controller.target()
|
|
@@ -7055,8 +6916,7 @@ showFirstRunWizard(props.api,props.preferences).catch(()=>{})
|
|
|
7055
6916
|
})
|
|
7056
6917
|
return _$createElement57("box")
|
|
7057
6918
|
}
|
|
7058
|
-
|
|
7059
|
-
import {effect as _$effect51} from "@opentui/solid"
|
|
6919
|
+
import {effect as _$effect52} from "@opentui/solid"
|
|
7060
6920
|
import {createComponent as _$createComponent59} from "@opentui/solid"
|
|
7061
6921
|
import {insertNode as _$insertNode40} from "@opentui/solid"
|
|
7062
6922
|
import {insert as _$insert49} from "@opentui/solid"
|
|
@@ -7067,7 +6927,7 @@ import {Show as Show23,createMemo as createMemo20,onCleanup as onCleanup21} from
|
|
|
7067
6927
|
function SidebarTitle(props) {const icons=useIcons()
|
|
7068
6928
|
const theme=()=>props.api.theme.current
|
|
7069
6929
|
const created=createMemo20(()=>{const value=props.api.state.session.get(props.sessionID)?.time?.created
|
|
7070
|
-
return value===undefined
|
|
6930
|
+
return value===undefined?undefined:`Created ${new Date(value).toLocaleDateString("en", {
|
|
7071
6931
|
dateStyle: "medium"
|
|
7072
6932
|
})}`
|
|
7073
6933
|
})
|
|
@@ -7093,7 +6953,7 @@ _$insert49(_el$5,()=>props.title)
|
|
|
7093
6953
|
_$insert49(_el$3,_$createComponent59(Show23,{get when() {return created()
|
|
7094
6954
|
},children:(value)=>(()=>{var _el$6=_$createElement58("text")
|
|
7095
6955
|
_$insert49(_el$6,value)
|
|
7096
|
-
_$
|
|
6956
|
+
_$effect52((_$p)=>_$setProp52(_el$6,"fg",theme().textMuted,_$p))
|
|
7097
6957
|
return _el$6
|
|
7098
6958
|
})()
|
|
7099
6959
|
}),null)
|
|
@@ -7104,7 +6964,7 @@ _$insert49(_el$2,_$createComponent59(IconControl,{ref:(node)=>settings.ref(node)
|
|
|
7104
6964
|
},get onMouseOut() {return settings.onMouseOut
|
|
7105
6965
|
},onMouseUp:(event)=>settings.activate(event)
|
|
7106
6966
|
}),null)
|
|
7107
|
-
_$
|
|
6967
|
+
_$effect52((_p$)=>{var _v$=theme().borderSubtle,_v$2=theme().text
|
|
7108
6968
|
_v$!==_p$.e&&(_p$.e=_$setProp52(_el$,"borderColor",_v$,_p$.e))
|
|
7109
6969
|
_v$2!==_p$.t&&(_p$.t=_$setProp52(_el$4,"fg",_v$2,_p$.t))
|
|
7110
6970
|
return _p$
|
|
@@ -7113,7 +6973,6 @@ return _p$
|
|
|
7113
6973
|
return _el$
|
|
7114
6974
|
})()
|
|
7115
6975
|
}
|
|
7116
|
-
|
|
7117
6976
|
import {readFile as readFile2} from "fs/promises"
|
|
7118
6977
|
import {dirname,join as join2} from "path"
|
|
7119
6978
|
function isMissing(error) {const value=error
|
|
@@ -7128,30 +6987,31 @@ return
|
|
|
7128
6987
|
throw new Error(`${source}: ${error instanceof Error ? error.message : "could not be read"}`,{cause:error})
|
|
7129
6988
|
}
|
|
7130
6989
|
}
|
|
7131
|
-
async function loadConfiguredDefaults(api,options,readProject) {const userPath=api.state.path.config
|
|
6990
|
+
async function loadConfiguredDefaults(api,options,readProject) {const userPath=api.state.path.config?join2(dirname(api.state.path.config),".opencode-navigator","settings.json"):undefined
|
|
7132
6991
|
const safe=async (request)=>{try {return await request
|
|
7133
|
-
} catch (error) {api.ui.toast({variant:"warning",title:"Navigator configuration",message:error instanceof Error
|
|
6992
|
+
} catch (error) {api.ui.toast({variant:"warning",title:"Navigator configuration",message:error instanceof Error?error.message:"Navigator configuration could not be loaded",duration:5000
|
|
7134
6993
|
})
|
|
7135
6994
|
return
|
|
7136
6995
|
}
|
|
7137
6996
|
}
|
|
7138
|
-
const [user,project]=await Promise.all([safe(userPath
|
|
6997
|
+
const [user,project]=await Promise.all([safe(userPath?readSource(userPath,()=>readFile2(userPath,"utf8")):undefined),safe(readProject?readSource(".opencode/navigator.json",readProject):undefined)
|
|
7139
6998
|
])
|
|
7140
6999
|
return mergeConfiguredDefaults(configuredDefaultsFromPluginOptions(options),user,project)
|
|
7141
7000
|
}
|
|
7142
|
-
|
|
7143
7001
|
import {homedir} from "os"
|
|
7144
7002
|
import {join as join3} from "path"
|
|
7145
|
-
|
|
7146
|
-
function location(input) {return input.directory ? {location:{directory:input.directory}}:{}
|
|
7003
|
+
function location(input) {return input.directory?{location:{directory:input.directory}}:{}
|
|
7147
7004
|
}
|
|
7148
7005
|
function mcpItem(server) {return {name:server.name,status:server.status.status,...server.status.error&&{error:server.status.error}
|
|
7149
7006
|
}
|
|
7150
7007
|
}
|
|
7008
|
+
function skillKey(directory,name) {return `${directory}\x00${name}`
|
|
7009
|
+
}
|
|
7151
7010
|
function createV2ClientAdapter(context) {const skillIDs=new Map
|
|
7152
7011
|
return{state:{mcp:()=>(context.data.location.mcp.server.list(context.location)??[]).map((server)=>mcpItem(server))
|
|
7153
7012
|
},client:{app:{async skills(input,options={}) {const response=await context.client.skill.list(location(input),{signal:options.signal})
|
|
7154
|
-
const
|
|
7013
|
+
const directory=input.directory??response.location.directory
|
|
7014
|
+
const data=response.data.map((skill)=>{skillIDs.set(skillKey(directory,skill.name),skill.id)
|
|
7155
7015
|
return{name:skill.name,description:skill.description,location:skill.path,content:skill.content
|
|
7156
7016
|
}
|
|
7157
7017
|
})
|
|
@@ -7159,8 +7019,10 @@ return{data}
|
|
|
7159
7019
|
}
|
|
7160
7020
|
},tui:{async appendPrompt(input,options={}) {const route=context.ui.router.current()
|
|
7161
7021
|
const name=/^\/([^\s]+)\s*$/u.exec(input.text)?.[1]
|
|
7162
|
-
const
|
|
7163
|
-
|
|
7022
|
+
const directory=input.directory??context.location?.directory??context.data.location.default().directory
|
|
7023
|
+
const session=route.type==="session"?context.data.session.get(route.sessionID):undefined
|
|
7024
|
+
const id=name?skillIDs.get(skillKey(directory,name)):undefined
|
|
7025
|
+
if(route.type!=="session"||session?.location.directory!==directory||!id)
|
|
7164
7026
|
return{data:false}
|
|
7165
7027
|
await context.client.session.skill({sessionID:route.sessionID,id},{signal:options.signal})
|
|
7166
7028
|
return{data:true}
|
|
@@ -7177,16 +7039,20 @@ return{data:undefined}
|
|
|
7177
7039
|
}
|
|
7178
7040
|
}
|
|
7179
7041
|
}
|
|
7180
|
-
|
|
7181
7042
|
var SESSION_UPDATE_EVENTS=new Set(["session.agent.selected","session.model.selected","session.moved","session.renamed","session.permissions"
|
|
7182
7043
|
])
|
|
7183
|
-
function createV2EventAdapter(context,sessions) {return {on(name,handler) {
|
|
7044
|
+
function createV2EventAdapter(context,sessions) {return {on(name,handler) {let active=true
|
|
7045
|
+
const unsubscribe=context.data.listen(({details})=>{const event=details
|
|
7184
7046
|
if(name==="server.connected"&&event.type==="server.connected") {handler({type:name,properties:{}})
|
|
7185
7047
|
return
|
|
7186
7048
|
}
|
|
7187
7049
|
if(name==="mcp.tools.changed"&&event.type.startsWith("mcp.")) {handler({type:name,properties:event.data})
|
|
7188
7050
|
return
|
|
7189
7051
|
}
|
|
7052
|
+
if(name==="installation.update-available"&&event.type==="installation.update-available") {if (typeof event.data.version==="string") {handler({type:name,properties:{version:event.data.version}})
|
|
7053
|
+
}
|
|
7054
|
+
return
|
|
7055
|
+
}
|
|
7190
7056
|
if(name==="session.deleted"&&event.type==="session.deleted") {handler({type:name,properties:{sessionID:event.data.sessionID}})
|
|
7191
7057
|
return
|
|
7192
7058
|
}
|
|
@@ -7198,7 +7064,11 @@ sessions.setStatus(sessionID,status)
|
|
|
7198
7064
|
handler({type:name,properties:{sessionID,status}})
|
|
7199
7065
|
return
|
|
7200
7066
|
}
|
|
7201
|
-
if(name==="session.idle"&&event.type==="session.idle") {
|
|
7067
|
+
if(name==="session.idle"&&event.type==="session.idle") {const sessionID=event.data.sessionID
|
|
7068
|
+
if(typeof sessionID!=="string")
|
|
7069
|
+
return
|
|
7070
|
+
sessions.setStatus(sessionID,{type:"idle"})
|
|
7071
|
+
handler({type:name,properties:{sessionID}})
|
|
7202
7072
|
return
|
|
7203
7073
|
}
|
|
7204
7074
|
if(name==="session.error"&&event.type==="session.execution.failed") {const error=event.data.error
|
|
@@ -7212,14 +7082,23 @@ const isUpdated=name==="session.updated"&&SESSION_UPDATE_EVENTS.has(event.type)
|
|
|
7212
7082
|
if(!isCreated&&!isUpdated)
|
|
7213
7083
|
return
|
|
7214
7084
|
const sessionID=event.data.sessionID
|
|
7215
|
-
const info=typeof sessionID==="string"
|
|
7216
|
-
if(info)
|
|
7217
|
-
|
|
7085
|
+
const info=typeof sessionID==="string"?context.data.session.get(sessionID):undefined
|
|
7086
|
+
if(info) {handler({type:name,properties:{info:sessions.normalize(info)}})
|
|
7087
|
+
return
|
|
7088
|
+
}
|
|
7089
|
+
if(typeof sessionID!=="string")
|
|
7090
|
+
return
|
|
7091
|
+
context.data.session.sync(sessionID).then(()=>{const synced=context.data.session.get(sessionID)
|
|
7092
|
+
if(active&&synced)
|
|
7093
|
+
handler({type:name,properties:{info:sessions.normalize(synced)}})
|
|
7094
|
+
}).catch(()=>{})
|
|
7218
7095
|
})
|
|
7096
|
+
return ()=>{active=false
|
|
7097
|
+
unsubscribe()
|
|
7098
|
+
}
|
|
7219
7099
|
}
|
|
7220
7100
|
}
|
|
7221
7101
|
}
|
|
7222
|
-
|
|
7223
7102
|
import {createElement as _$createElement59} from "@opentui/solid"
|
|
7224
7103
|
import {createSignal as createSignal27} from "solid-js"
|
|
7225
7104
|
function belongsTo2(renderable,ancestor) {if (!renderable||!ancestor)
|
|
@@ -7229,7 +7108,7 @@ return true
|
|
|
7229
7108
|
}
|
|
7230
7109
|
return false
|
|
7231
7110
|
}
|
|
7232
|
-
function enabled(value) {return typeof value==="function"
|
|
7111
|
+
function enabled(value) {return typeof value==="function"?value():value!==false
|
|
7233
7112
|
}
|
|
7234
7113
|
function createV2Keymap(context) {const [revision,setRevision]=createSignal27(0)
|
|
7235
7114
|
const layers=new Map
|
|
@@ -7238,25 +7117,35 @@ function layerActive(layer) {const mode=layer.mode??"base"
|
|
|
7238
7117
|
const target=layer.target
|
|
7239
7118
|
return (mode==="global"||context.keymap.mode.current()===mode)&&enabled(layer.enabled)&&(!target||belongsTo2(context.renderer.currentFocusedRenderable,target))
|
|
7240
7119
|
}
|
|
7241
|
-
function legacyCommand(name) {return [...layers].sort(([leftID,left],[rightID,right])=>(right.priority??0) - (left.priority??0)||rightID - leftID).flatMap(([,layer])=>layerActive(layer)
|
|
7120
|
+
function legacyCommand(name) {return [...layers].sort(([leftID,left],[rightID,right])=>(right.priority??0) - (left.priority??0)||rightID - leftID).flatMap(([,layer])=>layerActive(layer)?[layer]:[]).flatMap((layer)=>layer.commands??[]).find((command)=>command.name===name&&enabled(command.enabled))
|
|
7242
7121
|
}
|
|
7243
7122
|
function run(command,input="",event) {return command.run({keymap,event,focused:context.renderer.currentFocusedRenderable,target:context.renderer.currentFocusedRenderable,data:{},command,input,payload:undefined
|
|
7244
7123
|
})
|
|
7245
7124
|
}
|
|
7246
7125
|
async function runV2(command,input="",event) {await run(command,input,event)
|
|
7247
7126
|
}
|
|
7127
|
+
const onKeypress=(event)=>{if (event.name!==","||!event.ctrl||event.shift||event.meta||event.super||event.hyper)
|
|
7128
|
+
return
|
|
7129
|
+
const command=legacyCommand(`${PLUGIN_ID}.settings`)
|
|
7130
|
+
if(!command)
|
|
7131
|
+
return
|
|
7132
|
+
event.preventDefault()
|
|
7133
|
+
event.stopPropagation()
|
|
7134
|
+
runV2(command,"",event)
|
|
7135
|
+
}
|
|
7136
|
+
context.renderer.keyInput.on("keypress",onKeypress)
|
|
7248
7137
|
function v2Commands(id,layer) {const available=()=>layerActive(layer)
|
|
7249
|
-
const named=(layer.commands??[]).map((command)=>({id:command.name,title:command.title,description:command.desc,group:command.category,palette:command.namespace==="palette"
|
|
7138
|
+
const named=(layer.commands??[]).map((command)=>({id:command.name,title:command.title,description:command.desc,group:command.category,palette:command.namespace==="palette"?true:undefined,suggested:command.suggested,enabled:()=>available()&&enabled(command.enabled),run:(input,event)=>runV2(command,input,event)
|
|
7250
7139
|
}))
|
|
7251
|
-
const bindings=(layer.bindings??[]).
|
|
7140
|
+
const bindings=(layer.bindings??[]).flatMap((binding,index)=>typeof binding.key==="string"?[{id:`${PLUGIN_ID}.v2-binding.${id}.${index}`,bind:binding.key,enabled:available,run:()=>{context.keymap.dispatch(String(binding.cmd))
|
|
7252
7141
|
}
|
|
7253
|
-
})
|
|
7142
|
+
}]:[])
|
|
7254
7143
|
return [...named,...bindings]
|
|
7255
7144
|
}
|
|
7256
7145
|
function Bridge() {context.keymap.layer(()=>{revision()
|
|
7257
7146
|
const current=[...layers].sort(([leftID,left],[rightID,right])=>(right.priority??0) - (left.priority??0)||rightID - leftID)
|
|
7258
7147
|
const commands=current.flatMap(([id,layer])=>v2Commands(id,layer))
|
|
7259
|
-
const bindings=commands.flatMap((command)=>command.id
|
|
7148
|
+
const bindings=commands.flatMap((command)=>command.id?[command.id]:[])
|
|
7260
7149
|
return{mode:"global",priority:2000,commands,bindings
|
|
7261
7150
|
}
|
|
7262
7151
|
})
|
|
@@ -7273,7 +7162,7 @@ setRevision((value)=>value + 1)
|
|
|
7273
7162
|
if(command) {if (!enabled(command.enabled))
|
|
7274
7163
|
return{ok:false,reason:"disabled",command
|
|
7275
7164
|
}
|
|
7276
|
-
context.keymap.dispatch(name,typeof options?.payload==="string"
|
|
7165
|
+
context.keymap.dispatch(name,typeof options?.payload==="string"?options.payload:undefined)
|
|
7277
7166
|
return{ok:true,command
|
|
7278
7167
|
}
|
|
7279
7168
|
}
|
|
@@ -7291,16 +7180,16 @@ return [{...command,name,run:()=>context.keymap.dispatch(name)
|
|
|
7291
7180
|
}]
|
|
7292
7181
|
})
|
|
7293
7182
|
},getCommandBindings(input) {return new Map(input.commands.map((name)=>[name,[...context.keymap.shortcuts(name)]]))
|
|
7294
|
-
},parseKeySequence(value) {return value.trim()
|
|
7183
|
+
},parseKeySequence(value) {return value.trim()?value.trim().split(/\s+/u):[]
|
|
7184
|
+
}
|
|
7295
7185
|
}
|
|
7186
|
+
return{keymap,Bridge,dispose:()=>{context.renderer.keyInput.off("keypress",onKeypress)
|
|
7296
7187
|
}
|
|
7297
|
-
return{keymap,Bridge
|
|
7298
7188
|
}
|
|
7299
7189
|
}
|
|
7300
|
-
|
|
7301
7190
|
function createV2SessionAdapter(context) {const statuses=new Map
|
|
7302
7191
|
function normalize(info) {const directory=info.location.directory
|
|
7303
|
-
const workspaceID=context.location?.directory===directory
|
|
7192
|
+
const workspaceID=context.location?.directory===directory?context.location.workspaceID:undefined
|
|
7304
7193
|
return{id:info.id,slug:info.id,projectID:info.projectID,...workspaceID&&{workspaceID},directory,...info.parentID&&{parentID:info.parentID},cost:Number(info.cost),tokens:info.tokens,title:info.title??"Untitled session",...info.agent&&{agent:info.agent},...info.model&&{model:info.model},version:context.app.version,metadata:info.metadata,time:{created:info.time.created,updated:info.time.updated,...info.time.archived&&{archived:info.time.archived}
|
|
7305
7194
|
}
|
|
7306
7195
|
}
|
|
@@ -7308,16 +7197,16 @@ return{id:info.id,slug:info.id,projectID:info.projectID,...workspaceID&&{workspa
|
|
|
7308
7197
|
function status(sessionID) {const cached=statuses.get(sessionID)
|
|
7309
7198
|
if(cached)
|
|
7310
7199
|
return cached
|
|
7311
|
-
return context.data.session.status(sessionID)==="running"
|
|
7200
|
+
return context.data.session.status(sessionID)==="running"?{type:"busy"}:{type:"idle"}
|
|
7312
7201
|
}
|
|
7313
7202
|
return{normalize,setStatus(sessionID,value) {statuses.set(sessionID,value)
|
|
7314
7203
|
},state:{count:()=>context.data.session.list().length,get:(sessionID)=>{const value=context.data.session.get(sessionID)
|
|
7315
|
-
return value
|
|
7204
|
+
return value?normalize(value):undefined
|
|
7316
7205
|
},todo:()=>[],status
|
|
7317
7206
|
},client:{async children(input,options={}) {const response=await context.client.session.list({parentID:input.sessionID,...input.directory&&{directory:input.directory}},{signal:options.signal})
|
|
7318
7207
|
return{data:response.data.map((session)=>normalize(session))}
|
|
7319
7208
|
},async status(_input,options={}) {const active=await context.client.session.active({signal:options.signal})
|
|
7320
|
-
const data=Object.fromEntries(context.data.session.list().map((session)=>[session.id,statuses.get(session.id)??(active[session.id]
|
|
7209
|
+
const data=Object.fromEntries(context.data.session.list().map((session)=>[session.id,statuses.get(session.id)??(active[session.id]?{type:"busy"}:{type:"idle"})
|
|
7321
7210
|
]))
|
|
7322
7211
|
return{data}
|
|
7323
7212
|
},async todo() {return {data:[]}
|
|
@@ -7325,7 +7214,6 @@ return{data}
|
|
|
7325
7214
|
}
|
|
7326
7215
|
}
|
|
7327
7216
|
}
|
|
7328
|
-
|
|
7329
7217
|
import {memo as _$memo41} from "@opentui/solid"
|
|
7330
7218
|
import {createComponent as _$createComponent60} from "@opentui/solid"
|
|
7331
7219
|
function createV2Slots(context,keymap,onDispose) {return {register(plugin) {const slots=plugin.slots
|
|
@@ -7341,11 +7229,9 @@ return "opencode-navigator"
|
|
|
7341
7229
|
}
|
|
7342
7230
|
}
|
|
7343
7231
|
}
|
|
7344
|
-
|
|
7345
7232
|
function legacyTheme(theme) {return {primary:theme.hue.interactive[200],secondary:theme.categorical[0]?.[200]??theme.hue.accent[200],accent:theme.hue.accent[200],error:theme.text.feedback.error.base,warning:theme.text.feedback.warning.base,success:theme.text.feedback.success.base,info:theme.text.feedback.info.base,text:theme.text.base,textMuted:theme.text.muted,selectedListItemText:theme.text.action.primary.focused,background:theme.background.base,backgroundPanel:theme.background.raised.base,backgroundElement:theme.background.raised.high,backgroundMenu:theme.background.raised.max,border:theme.border.base,borderActive:theme.scrollbar.base,borderSubtle:theme.hue.neutral[500],diffAdded:theme.diff.text.added,diffRemoved:theme.diff.text.removed,diffContext:theme.diff.text.context,diffHunkHeader:theme.diff.text.hunkHeader,diffHighlightAdded:theme.diff.highlight.added,diffHighlightRemoved:theme.diff.highlight.removed,diffAddedBg:theme.diff.background.added,diffRemovedBg:theme.diff.background.removed,diffContextBg:theme.diff.background.context,diffLineNumber:theme.diff.lineNumber.text,diffAddedLineNumberBg:theme.diff.lineNumber.background.added,diffRemovedLineNumberBg:theme.diff.lineNumber.background.removed,markdownText:theme.markdown.text,markdownHeading:theme.markdown.heading,markdownLink:theme.markdown.link,markdownLinkText:theme.markdown.linkText,markdownCode:theme.markdown.code,markdownBlockQuote:theme.markdown.blockQuote,markdownEmph:theme.markdown.emphasis,markdownStrong:theme.markdown.strong,markdownHorizontalRule:theme.markdown.horizontalRule,markdownListItem:theme.markdown.listItem,markdownListEnumeration:theme.markdown.listEnumeration,markdownImage:theme.markdown.image,markdownImageText:theme.markdown.imageText,markdownCodeBlock:theme.markdown.codeBlock,syntaxComment:theme.syntax.comment,syntaxKeyword:theme.syntax.keyword,syntaxFunction:theme.syntax.function,syntaxVariable:theme.syntax.variable,syntaxString:theme.syntax.string,syntaxNumber:theme.syntax.number,syntaxType:theme.syntax.type,syntaxOperator:theme.syntax.operator,syntaxPunctuation:theme.syntax.punctuation,thinkingOpacity:0.6
|
|
7346
7233
|
}
|
|
7347
7234
|
}
|
|
7348
|
-
|
|
7349
7235
|
import {createElement as _$createElement60} from "@opentui/solid"
|
|
7350
7236
|
import {onCleanup as onCleanup22,onMount as onMount5} from "solid-js"
|
|
7351
7237
|
function createV2UI(context) {let dialogOpen=false
|
|
@@ -7376,8 +7262,7 @@ context.ui.dialog.clear()
|
|
|
7376
7262
|
}
|
|
7377
7263
|
}
|
|
7378
7264
|
}
|
|
7379
|
-
|
|
7380
|
-
function stateDirectory() {const base=process.env.XDG_STATE_HOME??(process.platform==="win32" ? process.env.LOCALAPPDATA:undefined)??join3(homedir(),".local","state")
|
|
7265
|
+
function stateDirectory() {const base=process.env.XDG_STATE_HOME??(process.platform==="win32"?process.env.LOCALAPPDATA:undefined)??join3(homedir(),".local","state")
|
|
7381
7266
|
return join3(base,"opencode")
|
|
7382
7267
|
}
|
|
7383
7268
|
function route(context) {const current=context.ui.router.current()
|
|
@@ -7394,6 +7279,7 @@ function createOpenCodeV2Api(context) {const controller=new AbortController
|
|
|
7394
7279
|
const disposers=[]
|
|
7395
7280
|
const currentLocation=context.location??context.data.location.default()
|
|
7396
7281
|
const keymap=createV2Keymap(context)
|
|
7282
|
+
disposers.push(keymap.dispose)
|
|
7397
7283
|
const sessions=createV2SessionAdapter(context)
|
|
7398
7284
|
const remote=createV2ClientAdapter(context)
|
|
7399
7285
|
const ui=createV2UI(context)
|
|
@@ -7425,13 +7311,12 @@ setHostCapabilities(api,{todo:true,lsp:false,unavailable:{todo:"OpenCode 2 does
|
|
|
7425
7311
|
}
|
|
7426
7312
|
})
|
|
7427
7313
|
return{api,async dispose() {controller.abort()
|
|
7428
|
-
for(let index=disposers.length - 1;index
|
|
7314
|
+
for(let index=disposers.length - 1;index>=0; index--)
|
|
7429
7315
|
await disposers[index]()
|
|
7430
7316
|
disposers.length=0
|
|
7431
7317
|
}
|
|
7432
7318
|
}
|
|
7433
7319
|
}
|
|
7434
|
-
|
|
7435
7320
|
async function setupNavigator(api,options,readProject) {const config=pluginConfig(undefined)
|
|
7436
7321
|
const configured=await loadConfiguredDefaults(api,options,readProject)
|
|
7437
7322
|
const todo=createTodoController(api)
|
|
@@ -7492,13 +7377,13 @@ if(result.error) {if (result.response.status===404)
|
|
|
7492
7377
|
return
|
|
7493
7378
|
throw result.error
|
|
7494
7379
|
}
|
|
7495
|
-
return result.data?.type==="text"
|
|
7380
|
+
return result.data?.type==="text"?result.data.content:undefined
|
|
7496
7381
|
})
|
|
7497
|
-
const versionStatus=createVersionStatus(api,"0.
|
|
7382
|
+
const versionStatus=createVersionStatus(api,"0.15.0")
|
|
7498
7383
|
api.slots.register({order:90,slots:{sidebar_footer(_context,props) {return _$createComponent61(IconProvider,{get style() {return preferences.lspIconStyle
|
|
7499
7384
|
},get multilineCorners() {return preferences.cornerFont
|
|
7500
7385
|
},get children() {return _$createComponent61(VersionFooter,{api,get sessionID() {return props.session_id
|
|
7501
|
-
},navigatorVersion:"0.
|
|
7386
|
+
},navigatorVersion:"0.15.0",status:versionStatus
|
|
7502
7387
|
})
|
|
7503
7388
|
}
|
|
7504
7389
|
})
|
|
@@ -7513,11 +7398,19 @@ return
|
|
|
7513
7398
|
return new TextDecoder().decode(await context.client.file.read({location:context.location,path:".opencode/navigator.json"
|
|
7514
7399
|
}))
|
|
7515
7400
|
})
|
|
7401
|
+
const versionStatus=createVersionStatus(adapter.api,"0.15.0")
|
|
7516
7402
|
const disposeFooter=context.ui.slot({append:"sidebar.footer",render:()=>_$createComponent61(IconProvider,{get style() {return preferences.lspIconStyle
|
|
7517
7403
|
},get multilineCorners() {return preferences.cornerFont
|
|
7518
|
-
},get children() {
|
|
7404
|
+
},get children() {var _el$=_$createElement61("box")
|
|
7405
|
+
_$setProp53(_el$,"flexDirection","row")
|
|
7406
|
+
_$setProp53(_el$,"justifyContent","space-between")
|
|
7407
|
+
_$insert50(_el$,_$createComponent61(NavigatorVersion,{get api() {return adapter.api
|
|
7408
|
+
},navigatorVersion:"0.15.0",status:versionStatus
|
|
7409
|
+
}),null)
|
|
7410
|
+
_$insert50(_el$,_$createComponent61(SettingsFooterButton,{get api() {return adapter.api
|
|
7519
7411
|
},preferences,mcp
|
|
7520
|
-
})
|
|
7412
|
+
}),null)
|
|
7413
|
+
return _el$
|
|
7521
7414
|
}
|
|
7522
7415
|
})
|
|
7523
7416
|
})
|