opencode-navigator 0.24.0 → 0.26.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/CHANGELOG.md +10 -0
- package/HOST_API.md +22 -12
- package/LINT_COVERAGE.md +199 -0
- package/README.md +41 -9
- package/dist/native-todo-setup.js +1156 -0
- package/dist/onboarding.js +379 -0
- package/dist/provider-limits.js +6 -5
- package/dist/runtime-dependencies.json +3 -3
- package/dist/sidebar-settings.js +283 -543
- package/dist/tui.js +223 -414
- package/package.json +9 -6
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import {SECTION_DEFINITIONS,PLUGIN_ID
|
|
2
|
+
} from "./chunk-bv0nm1tj.js"
|
|
3
|
+
import"./chunk-qmntexwm.js";
|
|
4
|
+
import {createComponent as _$createComponent3} from "@opentui/solid"
|
|
5
|
+
import {effect as _$effect4} from "@opentui/solid"
|
|
6
|
+
import {createTextNode as _$createTextNode3} from "@opentui/solid"
|
|
7
|
+
import {insertNode as _$insertNode3} from "@opentui/solid"
|
|
8
|
+
import {insert as _$insert4} from "@opentui/solid"
|
|
9
|
+
import {setProp as _$setProp4} from "@opentui/solid"
|
|
10
|
+
import {createElement as _$createElement4} from "@opentui/solid"
|
|
11
|
+
import {TextAttributes as TextAttributes3} from "@opentui/core"
|
|
12
|
+
import {Show,createSignal as createSignal2,onCleanup as onCleanup3} from "solid-js"
|
|
13
|
+
import {supportsSidebarSection as supportsSidebarSection2} from "./tui.js"
|
|
14
|
+
import {DialogSurface,useDialogs,useIcons as useIcons3} from "./tui.js"
|
|
15
|
+
import {hostCapabilities} from "./tui.js"
|
|
16
|
+
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."}]
|
|
17
|
+
},{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:"Track active, finished, and cancelled tasks. Edit through chat and the built-in Todo tool."
|
|
18
|
+
},{icon:"subagents",title:"Live subagents",description:"See running, retrying, recent, and failed child sessions; open them directly."
|
|
19
|
+
},{icon:"info",title:"Provider limits",description:"Follow the selected provider and account allowance. Codex linking and banked resets require confirmation."
|
|
20
|
+
}]
|
|
21
|
+
},{title:"Find anything and launch Skills safely",summary:"Search complete source lists without expanding every sidebar section.",icon:"search",features:[{icon:"search",title:"Search Everything",description:"Search Skills, Subagents, MCP, and Actions in shared tabs."
|
|
22
|
+
},{icon:"search",title:"Full source lists",description:"Search beyond sidebar visibility and item limits."},{icon:"skills",title:"Skill confirmation",description:"Review a skill and its source before inserting its command."
|
|
23
|
+
}]
|
|
24
|
+
},{title:"Run actions and check language tools",summary:"Keep frequent commands and private toolbar shortcuts nearby; show only host-supported language-server status.",icon:"actions",features:[{icon:"actions",title:"Quick Actions",description:"Choose visibility and order for rename, timeline, copy, export, compaction and other available commands."
|
|
25
|
+
},{icon:"lsp",title:"Compact LSP status",description:"Spot connected and failed language servers at a glance."
|
|
26
|
+
},{icon:"settings",title:"Private pinned toolbar",description:"Pin Actions or Skills separately from favorites: zero to three icons, optional text, observed-state icons, More or wrapping."
|
|
27
|
+
},{icon:"settings",title:"Session permissions",description:"Toggle auto-approve with the supported OpenCode 1.x command."
|
|
28
|
+
}]
|
|
29
|
+
},{title:"Control MCP without losing context",summary:"Manage individual servers or entire working sets directly from Navigator.",icon:"mcp",features:[{icon:"mcp",title:"Live server controls",description:"Connect, disconnect, filter, and favorite servers."},{icon:"actions",title:"Bulk operations",description:"Activate a group heading to connect or disconnect its full eligible bucket; retry failures in place."
|
|
30
|
+
},{icon:"presets",title:"Safe presets",description:"Preview connections and disconnections before Apply."}]
|
|
31
|
+
},{title:"Make Navigator fit each workspace",summary:"Use the same controls with mouse or keyboard and keep only the context you need.",icon:"settings",features:[{icon:"sections",title:"Flexible layout",description:"Choose section visibility, order, expansion, and item limits."
|
|
32
|
+
},{icon:"presets",title:"Scoped presets",description:"Preview layouts globally or for a worktree. Reload private preferences across running sessions."
|
|
33
|
+
},{icon:"settings",title:"About and changelog",description:"Check versions and updates, reopen notes by version, and prepare an editable Bug report for gh or your browser."
|
|
34
|
+
},{icon:"info",title:"Readable controls",description:"Use Nerd Font icons with the corner font, disable multiline masks, or choose Text fallback. Open Settings with Ctrl+,."
|
|
35
|
+
}]
|
|
36
|
+
}]
|
|
37
|
+
function onboardingSteps(api){const capabilities=hostCapabilities(api)
|
|
38
|
+
return ONBOARDING_STEPS.map((step,index)=>{if(index===1&&capabilities.nativeTodo)
|
|
39
|
+
return{...step,features:[{icon:"todo",title:"Todo filters and enablement",description:"If native Todo is off, use Enable Todo and confirm its server-config change. Edit tasks through chat and todowrite."
|
|
40
|
+
},...step.features.slice(1)]
|
|
41
|
+
}
|
|
42
|
+
if(index===3)
|
|
43
|
+
return{...step,features:step.features.map((feature)=>{if(feature.icon==="lsp"&&!capabilities.lsp)
|
|
44
|
+
return{...feature,title:"Language tools on this host",description:"OpenCode 2.x does not expose LSP status or actions. Use project lint and compiler commands instead."
|
|
45
|
+
}
|
|
46
|
+
if(feature.title==="Session permissions"&&capabilities.permissionMode===false)
|
|
47
|
+
return{...feature,description:"The Permissions action opens host Settings; choose Session \u2192 Permissions there."
|
|
48
|
+
}
|
|
49
|
+
return feature
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
return step
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
import {effect as _$effect2} from "@opentui/solid"
|
|
56
|
+
import {memo as _$memo} from "@opentui/solid"
|
|
57
|
+
import {createComponent as _$createComponent} from "@opentui/solid"
|
|
58
|
+
import {createTextNode as _$createTextNode} from "@opentui/solid"
|
|
59
|
+
import {insertNode as _$insertNode} from "@opentui/solid"
|
|
60
|
+
import {insert as _$insert2} from "@opentui/solid"
|
|
61
|
+
import {setProp as _$setProp2} from "@opentui/solid"
|
|
62
|
+
import {createElement as _$createElement2} from "@opentui/solid"
|
|
63
|
+
import {TextAttributes} from "@opentui/core"
|
|
64
|
+
import {For} from "solid-js"
|
|
65
|
+
import {SelectionBox,useIcons} from "./tui.js"
|
|
66
|
+
import {useRenderer} from "@opentui/solid"
|
|
67
|
+
import {createSignal,onCleanup} from "solid-js"
|
|
68
|
+
function useWizardHeight(api){const renderer=api.renderer??useRenderer()
|
|
69
|
+
const [height,setHeight]=createSignal(renderer.height)
|
|
70
|
+
const resize=()=>setHeight(renderer.height)
|
|
71
|
+
renderer.on("resize",resize)
|
|
72
|
+
onCleanup(()=>renderer.off("resize",resize))
|
|
73
|
+
return height
|
|
74
|
+
}
|
|
75
|
+
import {effect as _$effect} from "@opentui/solid"
|
|
76
|
+
import {insert as _$insert} from "@opentui/solid"
|
|
77
|
+
import {use as _$use} from "@opentui/solid"
|
|
78
|
+
import {setProp as _$setProp} from "@opentui/solid"
|
|
79
|
+
import {createElement as _$createElement} from "@opentui/solid"
|
|
80
|
+
import {useRenderer as useRenderer2} from "@opentui/solid"
|
|
81
|
+
import {createEffect,onCleanup as onCleanup2} from "solid-js"
|
|
82
|
+
function WizardScrollBody(props){const renderer=useRenderer2()
|
|
83
|
+
let body
|
|
84
|
+
let pending=true
|
|
85
|
+
createEffect(()=>{pending=props.active!==undefined||props.resetKey!==undefined
|
|
86
|
+
})
|
|
87
|
+
const reveal=()=>{if(!pending||!body||body.isDestroyed||body.scrollHeight===0)
|
|
88
|
+
return
|
|
89
|
+
pending=false
|
|
90
|
+
if(props.active)
|
|
91
|
+
body.scrollChildIntoView(props.active)
|
|
92
|
+
else if(props.resetKey)
|
|
93
|
+
body.scrollTo(0)
|
|
94
|
+
}
|
|
95
|
+
renderer.on("frame",reveal)
|
|
96
|
+
const unregister=props.api.keymap.registerLayer({mode:"modal",priority:1001,commands:[{name:"opencode-navigator.wizard.body.up",run:()=>body?.scrollBy(-Math.max(1,props.height-1))
|
|
97
|
+
},{name:"opencode-navigator.wizard.body.down",run:()=>body?.scrollBy(Math.max(1,props.height-1))
|
|
98
|
+
}],bindings:[{key:"pageup",cmd:"opencode-navigator.wizard.body.up"
|
|
99
|
+
},{key:"pagedown",cmd:"opencode-navigator.wizard.body.down"
|
|
100
|
+
}]
|
|
101
|
+
})
|
|
102
|
+
onCleanup2(()=>{unregister()
|
|
103
|
+
renderer.off("frame",reveal)
|
|
104
|
+
})
|
|
105
|
+
return(()=>{var _el$=_$createElement("scrollbox")
|
|
106
|
+
_$use((node)=>{body=node
|
|
107
|
+
},_el$)
|
|
108
|
+
_$setProp(_el$,"id","opencode-navigator.wizard.body")
|
|
109
|
+
_$setProp(_el$,"flexShrink",0)
|
|
110
|
+
_$setProp(_el$,"scrollX",false)
|
|
111
|
+
_$setProp(_el$,"horizontalScrollbarOptions",{visible:false
|
|
112
|
+
})
|
|
113
|
+
_$insert(_el$,()=>props.children)
|
|
114
|
+
_$effect((_$p)=>_$setProp(_el$,"height",props.height,_$p))
|
|
115
|
+
return _el$
|
|
116
|
+
})()
|
|
117
|
+
}
|
|
118
|
+
function OnboardingStep(props){const icons=useIcons()
|
|
119
|
+
const theme=()=>props.api.theme.current
|
|
120
|
+
const height=useWizardHeight(props.api)
|
|
121
|
+
return(()=>{var _el$=_$createElement2("box"),_el$1=_$createElement2("box")
|
|
122
|
+
_$insertNode(_el$,_el$1)
|
|
123
|
+
_$setProp2(_el$,"gap",1)
|
|
124
|
+
_$insert2(_el$,_$createComponent(WizardScrollBody,{get api(){return props.api
|
|
125
|
+
},get height(){return Math.min(16,Math.max(3,height()-11))
|
|
126
|
+
},get resetKey(){return props.step.title
|
|
127
|
+
},get children(){var _el$2=_$createElement2("box"),_el$3=_$createElement2("text"),_el$4=_$createTextNode(` `),_el$5=_$createElement2("text"),_el$6=_$createElement2("box"),_el$7=_$createElement2("text"),_el$8=_$createTextNode(`Navigator: `),_el$9=_$createTextNode(` \xB7 Focus: `),_el$0=_$createTextNode(` \xB7 Settings: Ctrl+, \xB7 Icons: `)
|
|
128
|
+
_$insertNode(_el$2,_el$3)
|
|
129
|
+
_$insertNode(_el$2,_el$5)
|
|
130
|
+
_$insertNode(_el$2,_el$6)
|
|
131
|
+
_$insertNode(_el$2,_el$7)
|
|
132
|
+
_$setProp2(_el$2,"gap",1)
|
|
133
|
+
_$insertNode(_el$3,_el$4)
|
|
134
|
+
_$insert2(_el$3,()=>icons.icon(props.step.icon),_el$4)
|
|
135
|
+
_$insert2(_el$3,()=>props.step.title,null)
|
|
136
|
+
_$setProp2(_el$5,"wrapMode","word")
|
|
137
|
+
_$insert2(_el$5,()=>props.step.summary)
|
|
138
|
+
_$setProp2(_el$6,"border",["top","bottom"])
|
|
139
|
+
_$setProp2(_el$6,"paddingTop",1)
|
|
140
|
+
_$setProp2(_el$6,"paddingBottom",1)
|
|
141
|
+
_$setProp2(_el$6,"gap",1)
|
|
142
|
+
_$insert2(_el$6,_$createComponent(For,{get each(){return props.step.features
|
|
143
|
+
},children:(feature)=>(()=>{var _el$14=_$createElement2("box"),_el$15=_$createElement2("text"),_el$16=_$createElement2("text"),_el$17=_$createElement2("b"),_el$18=_$createTextNode(` \xB7 `)
|
|
144
|
+
_$insertNode(_el$14,_el$15)
|
|
145
|
+
_$insertNode(_el$14,_el$16)
|
|
146
|
+
_$setProp2(_el$14,"flexDirection","row")
|
|
147
|
+
_$setProp2(_el$14,"gap",1)
|
|
148
|
+
_$setProp2(_el$15,"flexShrink",0)
|
|
149
|
+
_$insert2(_el$15,()=>icons.icon(feature.icon))
|
|
150
|
+
_$insertNode(_el$16,_el$17)
|
|
151
|
+
_$insertNode(_el$16,_el$18)
|
|
152
|
+
_$setProp2(_el$16,"flexGrow",1)
|
|
153
|
+
_$setProp2(_el$16,"minWidth",0)
|
|
154
|
+
_$setProp2(_el$16,"wrapMode","word")
|
|
155
|
+
_$insert2(_el$17,()=>feature.title)
|
|
156
|
+
_$insert2(_el$16,()=>feature.description,null)
|
|
157
|
+
_$effect2((_p$)=>{var _v$6=theme().accent,_v$7=theme().textMuted
|
|
158
|
+
_v$6!==_p$.e&&(_p$.e=_$setProp2(_el$15,"fg",_v$6,_p$.e))
|
|
159
|
+
_v$7!==_p$.t&&(_p$.t=_$setProp2(_el$16,"fg",_v$7,_p$.t))
|
|
160
|
+
return _p$
|
|
161
|
+
},{e:undefined,t:undefined
|
|
162
|
+
})
|
|
163
|
+
return _el$14
|
|
164
|
+
})()
|
|
165
|
+
}))
|
|
166
|
+
_$insertNode(_el$7,_el$8)
|
|
167
|
+
_$insertNode(_el$7,_el$9)
|
|
168
|
+
_$insertNode(_el$7,_el$0)
|
|
169
|
+
_$setProp2(_el$7,"wrapMode","word")
|
|
170
|
+
_$insert2(_el$7,()=>props.preferences.toggleKey(),_el$9)
|
|
171
|
+
_$insert2(_el$7,()=>props.preferences.focusKey(),_el$0)
|
|
172
|
+
_$insert2(_el$7,()=>icons.style()==="text"?"Text fallback":"Nerd Font",null)
|
|
173
|
+
_$effect2((_p$)=>{var _v$=theme().accent,_v$2=TextAttributes.BOLD,_v$3=theme().textMuted,_v$4=theme().borderSubtle,_v$5=theme().textMuted
|
|
174
|
+
_v$!==_p$.e&&(_p$.e=_$setProp2(_el$3,"fg",_v$,_p$.e))
|
|
175
|
+
_v$2!==_p$.t&&(_p$.t=_$setProp2(_el$3,"attributes",_v$2,_p$.t))
|
|
176
|
+
_v$3!==_p$.a&&(_p$.a=_$setProp2(_el$5,"fg",_v$3,_p$.a))
|
|
177
|
+
_v$4!==_p$.o&&(_p$.o=_$setProp2(_el$6,"borderColor",_v$4,_p$.o))
|
|
178
|
+
_v$5!==_p$.i&&(_p$.i=_$setProp2(_el$7,"fg",_v$5,_p$.i))
|
|
179
|
+
return _p$
|
|
180
|
+
},{e:undefined,t:undefined,a:undefined,o:undefined,i:undefined
|
|
181
|
+
})
|
|
182
|
+
return _el$2
|
|
183
|
+
}}),_el$1)
|
|
184
|
+
_$setProp2(_el$1,"flexDirection","row")
|
|
185
|
+
_$setProp2(_el$1,"justifyContent","space-between")
|
|
186
|
+
_$insert2(_el$1,_$createComponent(SelectionBox,{id:"opencode-navigator.wizard.back",paddingLeft:1,paddingRight:1,onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
187
|
+
props.onBack()
|
|
188
|
+
},get children(){var _el$10=_$createElement2("text"),_el$11=_$createTextNode(` Back`)
|
|
189
|
+
_$insertNode(_el$10,_el$11)
|
|
190
|
+
_$insert2(_el$10,()=>icons.icon("left"),_el$11)
|
|
191
|
+
_$effect2((_$p)=>_$setProp2(_el$10,"fg",theme().textMuted,_$p))
|
|
192
|
+
return _el$10
|
|
193
|
+
}}),null)
|
|
194
|
+
_$insert2(_el$1,_$createComponent(SelectionBox,{id:"opencode-navigator.wizard.next",paddingLeft:1,paddingRight:1,get backgroundColor(){return theme().primary
|
|
195
|
+
},onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
196
|
+
props.onAdvance()
|
|
197
|
+
},get children(){var _el$12=_$createElement2("text"),_el$13=_$createTextNode(` `)
|
|
198
|
+
_$insertNode(_el$12,_el$13)
|
|
199
|
+
_$insert2(_el$12,()=>props.final?"Configure sidebar":"Next",_el$13)
|
|
200
|
+
_$insert2(_el$12,()=>icons.icon("right"),null)
|
|
201
|
+
_$effect2((_$p)=>_$setProp2(_el$12,"fg",theme().selectedListItemText,_$p))
|
|
202
|
+
return _el$12
|
|
203
|
+
}}),null)
|
|
204
|
+
return _el$
|
|
205
|
+
})()
|
|
206
|
+
}
|
|
207
|
+
import {effect as _$effect3} from "@opentui/solid"
|
|
208
|
+
import {createComponent as _$createComponent2} from "@opentui/solid"
|
|
209
|
+
import {memo as _$memo2} from "@opentui/solid"
|
|
210
|
+
import {createTextNode as _$createTextNode2} from "@opentui/solid"
|
|
211
|
+
import {insertNode as _$insertNode2} from "@opentui/solid"
|
|
212
|
+
import {insert as _$insert3} from "@opentui/solid"
|
|
213
|
+
import {setProp as _$setProp3} from "@opentui/solid"
|
|
214
|
+
import {createElement as _$createElement3} from "@opentui/solid"
|
|
215
|
+
import {TextAttributes as TextAttributes2} from "@opentui/core"
|
|
216
|
+
import {For as For2} from "solid-js"
|
|
217
|
+
import {supportsSidebarSection} from "./tui.js"
|
|
218
|
+
import {SelectionBox as SelectionBox2,useIcons as useIcons2} from "./tui.js"
|
|
219
|
+
function SectionConfig(props){const icons=useIcons2()
|
|
220
|
+
const theme=()=>props.api.theme.current
|
|
221
|
+
const sections=SECTION_DEFINITIONS.filter((section)=>supportsSidebarSection(props.api,section.name))
|
|
222
|
+
const finishIndex=sections.length
|
|
223
|
+
const height=useWizardHeight(props.api)
|
|
224
|
+
return(()=>{var _el$=_$createElement3("box"),_el$2=_$createElement3("text"),_el$3=_$createTextNode2(` Choose your sidebar sections`),_el$4=_$createElement3("text"),_el$7=_$createElement3("box")
|
|
225
|
+
_$insertNode2(_el$,_el$2)
|
|
226
|
+
_$insertNode2(_el$,_el$4)
|
|
227
|
+
_$insertNode2(_el$,_el$7)
|
|
228
|
+
_$setProp3(_el$,"gap",1)
|
|
229
|
+
_$insertNode2(_el$2,_el$3)
|
|
230
|
+
_$setProp3(_el$2,"flexShrink",0)
|
|
231
|
+
_$insert3(_el$2,()=>icons.icon("sections"),_el$3)
|
|
232
|
+
_$insertNode2(_el$4,_$createTextNode2(`Select what appears now. You can change visibility, order, limits, scope, and presets later with the gear button.`))
|
|
233
|
+
_$setProp3(_el$4,"wrapMode","word")
|
|
234
|
+
_$setProp3(_el$4,"flexShrink",0)
|
|
235
|
+
_$insert3(_el$,_$createComponent2(WizardScrollBody,{get api(){return props.api
|
|
236
|
+
},get height(){return Math.min(sections.length*2-1,Math.max(3,height()-15))
|
|
237
|
+
},get active(){return _$memo2(()=>props.active<sections.length)()?`opencode-navigator.wizard.section.${props.active}`:undefined
|
|
238
|
+
},get children(){var _el$6=_$createElement3("box")
|
|
239
|
+
_$setProp3(_el$6,"gap",1)
|
|
240
|
+
_$insert3(_el$6,_$createComponent2(For2,{each:sections,children:(section,index)=>_$createComponent2(SelectionBox2,{get id(){return `opencode-navigator.wizard.section.${index()}`
|
|
241
|
+
},height:1,flexShrink:0,flexDirection:"row",gap:1,paddingLeft:1,paddingRight:1,get backgroundColor(){return _$memo2(()=>props.active===index())()?theme().backgroundElement:undefined
|
|
242
|
+
},onMouseOver:()=>props.onActive(index()),onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
243
|
+
props.preferences.toggleSection(section.name)
|
|
244
|
+
},get children(){return [(()=>{var _el$10=_$createElement3("text")
|
|
245
|
+
_$setProp3(_el$10,"flexShrink",0)
|
|
246
|
+
_$insert3(_el$10,()=>icons.icon(props.preferences.sections()[section.name]?"checked":"unchecked"))
|
|
247
|
+
_$effect3((_$p)=>_$setProp3(_el$10,"fg",props.preferences.sections()[section.name]?theme().accent:theme().textMuted,_$p))
|
|
248
|
+
return _el$10
|
|
249
|
+
})(),(()=>{var _el$11=_$createElement3("text"),_el$12=_$createTextNode2(` `)
|
|
250
|
+
_$insertNode2(_el$11,_el$12)
|
|
251
|
+
_$insert3(_el$11,()=>icons.section(section.name),_el$12)
|
|
252
|
+
_$insert3(_el$11,()=>section.label,null)
|
|
253
|
+
_$effect3((_$p)=>_$setProp3(_el$11,"fg",props.active===index()?theme().text:theme().textMuted,_$p))
|
|
254
|
+
return _el$11
|
|
255
|
+
})()]
|
|
256
|
+
}})
|
|
257
|
+
}))
|
|
258
|
+
return _el$6
|
|
259
|
+
}}),_el$7)
|
|
260
|
+
_$setProp3(_el$7,"flexDirection","row")
|
|
261
|
+
_$setProp3(_el$7,"justifyContent","space-between")
|
|
262
|
+
_$setProp3(_el$7,"flexShrink",0)
|
|
263
|
+
_$insert3(_el$7,_$createComponent2(SelectionBox2,{id:"opencode-navigator.wizard.back",paddingLeft:1,paddingRight:1,onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
264
|
+
props.onBack()
|
|
265
|
+
},get children(){var _el$8=_$createElement3("text"),_el$9=_$createTextNode2(` Back`)
|
|
266
|
+
_$insertNode2(_el$8,_el$9)
|
|
267
|
+
_$insert3(_el$8,()=>icons.icon("left"),_el$9)
|
|
268
|
+
_$effect3((_$p)=>_$setProp3(_el$8,"fg",theme().textMuted,_$p))
|
|
269
|
+
return _el$8
|
|
270
|
+
}}),null)
|
|
271
|
+
_$insert3(_el$7,_$createComponent2(SelectionBox2,{id:"opencode-navigator.wizard.finish",paddingLeft:2,paddingRight:2,get backgroundColor(){return _$memo2(()=>props.active===finishIndex)()?theme().primary:undefined
|
|
272
|
+
},onMouseOver:()=>props.onActive(finishIndex),onMouseDown:(event)=>event.stopPropagation(),onMouseUp:(event)=>{event.stopPropagation()
|
|
273
|
+
props.onFinish()
|
|
274
|
+
},get children(){var _el$0=_$createElement3("text"),_el$1=_$createTextNode2(` Finish`)
|
|
275
|
+
_$insertNode2(_el$0,_el$1)
|
|
276
|
+
_$insert3(_el$0,()=>icons.icon("done"),_el$1)
|
|
277
|
+
_$effect3((_$p)=>_$setProp3(_el$0,"fg",props.active===finishIndex?theme().selectedListItemText:theme().textMuted,_$p))
|
|
278
|
+
return _el$0
|
|
279
|
+
}}),null)
|
|
280
|
+
_$effect3((_p$)=>{var _v$=theme().accent,_v$2=TextAttributes2.BOLD,_v$3=theme().textMuted
|
|
281
|
+
_v$!==_p$.e&&(_p$.e=_$setProp3(_el$2,"fg",_v$,_p$.e))
|
|
282
|
+
_v$2!==_p$.t&&(_p$.t=_$setProp3(_el$2,"attributes",_v$2,_p$.t))
|
|
283
|
+
_v$3!==_p$.a&&(_p$.a=_$setProp3(_el$4,"fg",_v$3,_p$.a))
|
|
284
|
+
return _p$
|
|
285
|
+
},{e:undefined,t:undefined,a:undefined
|
|
286
|
+
})
|
|
287
|
+
return _el$
|
|
288
|
+
})()
|
|
289
|
+
}
|
|
290
|
+
function FirstRunWizard(props){const icons=useIcons3()
|
|
291
|
+
const dialogs=useDialogs(props.api)
|
|
292
|
+
const [active,setActive]=createSignal2(0)
|
|
293
|
+
const [step,setStep]=createSignal2(0)
|
|
294
|
+
const theme=()=>props.api.theme.current
|
|
295
|
+
const sections=SECTION_DEFINITIONS.filter((section)=>supportsSidebarSection2(props.api,section.name))
|
|
296
|
+
const steps=onboardingSteps(props.api)
|
|
297
|
+
const finishIndex=sections.length
|
|
298
|
+
const stepCount=steps.length + 1
|
|
299
|
+
const configuring=()=>step()===steps.length
|
|
300
|
+
function finish(){dialogs.back()
|
|
301
|
+
}
|
|
302
|
+
function move(offset){if(configuring())
|
|
303
|
+
setActive((value)=>(value + offset + finishIndex + 1)%(finishIndex + 1))
|
|
304
|
+
else
|
|
305
|
+
setStep((value)=>Math.max(0,Math.min(steps.length,value + offset)))
|
|
306
|
+
}
|
|
307
|
+
function back(){setStep((value)=>Math.max(0,value-1))
|
|
308
|
+
}
|
|
309
|
+
function advance(){if(!configuring())
|
|
310
|
+
setStep((value)=>Math.min(steps.length,value + 1))
|
|
311
|
+
}
|
|
312
|
+
function select(){if(!configuring()){advance()
|
|
313
|
+
return
|
|
314
|
+
}
|
|
315
|
+
const index=active()
|
|
316
|
+
if(index===finishIndex)
|
|
317
|
+
finish()
|
|
318
|
+
else
|
|
319
|
+
props.preferences.toggleSection(sections[index].name)
|
|
320
|
+
}
|
|
321
|
+
const unregister=props.api.keymap.registerLayer({mode:"modal",priority:1000,commands:[{name:`${PLUGIN_ID}.wizard.previous`,run(){move(-1)
|
|
322
|
+
}},{name:`${PLUGIN_ID}.wizard.next`,run(){move(1)
|
|
323
|
+
}},{name:`${PLUGIN_ID}.wizard.select`,run:select
|
|
324
|
+
},{name:`${PLUGIN_ID}.wizard.back`,run:back
|
|
325
|
+
},{name:`${PLUGIN_ID}.wizard.forward`,run:advance
|
|
326
|
+
}],bindings:[{key:"up",cmd:`${PLUGIN_ID}.wizard.previous`
|
|
327
|
+
},{key:"down",cmd:`${PLUGIN_ID}.wizard.next`
|
|
328
|
+
},{key:"tab",cmd:`${PLUGIN_ID}.wizard.next`
|
|
329
|
+
},{key:"left",cmd:`${PLUGIN_ID}.wizard.back`
|
|
330
|
+
},{key:"right",cmd:`${PLUGIN_ID}.wizard.forward`
|
|
331
|
+
},{key:"space",cmd:`${PLUGIN_ID}.wizard.select`
|
|
332
|
+
},{key:"return",cmd:`${PLUGIN_ID}.wizard.select`
|
|
333
|
+
}]
|
|
334
|
+
})
|
|
335
|
+
onCleanup3(unregister)
|
|
336
|
+
return _$createComponent3(DialogSurface,{get api(){return props.api
|
|
337
|
+
},lift:true,get children(){return [(()=>{var _el$=_$createElement4("box"),_el$2=_$createElement4("text"),_el$3=_$createTextNode3(` Navigator setup`),_el$4=_$createElement4("text"),_el$5=_$createTextNode3(`Step `),_el$6=_$createTextNode3(`/`),_el$7=_$createTextNode3(` \xB7 `)
|
|
338
|
+
_$insertNode3(_el$,_el$2)
|
|
339
|
+
_$insertNode3(_el$,_el$4)
|
|
340
|
+
_$setProp4(_el$,"id","opencode-navigator.wizard.header")
|
|
341
|
+
_$setProp4(_el$,"flexDirection","row")
|
|
342
|
+
_$setProp4(_el$,"justifyContent","space-between")
|
|
343
|
+
_$insertNode3(_el$2,_el$3)
|
|
344
|
+
_$insert4(_el$2,()=>icons.icon("help"),_el$3)
|
|
345
|
+
_$insertNode3(_el$4,_el$5)
|
|
346
|
+
_$insertNode3(_el$4,_el$6)
|
|
347
|
+
_$insertNode3(_el$4,_el$7)
|
|
348
|
+
_$setProp4(_el$4,"onMouseDown",(event)=>event.stopPropagation())
|
|
349
|
+
_$setProp4(_el$4,"onMouseUp",(event)=>{event.stopPropagation()
|
|
350
|
+
finish()
|
|
351
|
+
})
|
|
352
|
+
_$insert4(_el$4,()=>step() + 1,_el$6)
|
|
353
|
+
_$insert4(_el$4,stepCount,_el$7)
|
|
354
|
+
_$insert4(_el$4,()=>icons.key("esc"),null)
|
|
355
|
+
_$effect4((_p$)=>{var _v$=TextAttributes3.BOLD,_v$2=theme().text,_v$3=theme().textMuted
|
|
356
|
+
_v$!==_p$.e&&(_p$.e=_$setProp4(_el$2,"attributes",_v$,_p$.e))
|
|
357
|
+
_v$2!==_p$.t&&(_p$.t=_$setProp4(_el$2,"fg",_v$2,_p$.t))
|
|
358
|
+
_v$3!==_p$.a&&(_p$.a=_$setProp4(_el$4,"fg",_v$3,_p$.a))
|
|
359
|
+
return _p$
|
|
360
|
+
},{e:undefined,t:undefined,a:undefined
|
|
361
|
+
})
|
|
362
|
+
return _el$
|
|
363
|
+
})(),_$createComponent3(Show,{get when(){return configuring()
|
|
364
|
+
},get fallback(){return _$createComponent3(OnboardingStep,{get api(){return props.api
|
|
365
|
+
},get preferences(){return props.preferences
|
|
366
|
+
},get step(){return steps[step()]
|
|
367
|
+
},get final(){return step()===steps.length-1
|
|
368
|
+
},onBack:back,onAdvance:advance
|
|
369
|
+
})
|
|
370
|
+
},get children(){return _$createComponent3(SectionConfig,{get api(){return props.api
|
|
371
|
+
},get preferences(){return props.preferences
|
|
372
|
+
},get active(){return active()
|
|
373
|
+
},onActive:setActive,onBack:back,onFinish:finish
|
|
374
|
+
})
|
|
375
|
+
}})]
|
|
376
|
+
}})
|
|
377
|
+
}
|
|
378
|
+
export{FirstRunWizard
|
|
379
|
+
}
|
package/dist/provider-limits.js
CHANGED
|
@@ -14,8 +14,9 @@ pending.delete(id)
|
|
|
14
14
|
}}
|
|
15
15
|
function write(message){if(!child?.stdin||typeof child.stdin==="number")
|
|
16
16
|
throw new Error("Codex app-server is unavailable")
|
|
17
|
-
child.stdin.write(`${JSON.stringify(message)}
|
|
18
|
-
`)
|
|
17
|
+
Promise.resolve(child.stdin.write(`${JSON.stringify(message)}
|
|
18
|
+
`)).catch((error)=>{failAll(error instanceof Error?error:new Error("Codex app-server write failed"))
|
|
19
|
+
})
|
|
19
20
|
}
|
|
20
21
|
function accept(line){let message
|
|
21
22
|
try{message=JSON.parse(line)
|
|
@@ -677,13 +678,13 @@ setRevision((value)=>value + 1)
|
|
|
677
678
|
}),context.data.on("server.connected",()=>{generation++
|
|
678
679
|
setRevision((value)=>value + 1)
|
|
679
680
|
})]
|
|
680
|
-
const adapter={id:"opencode-usage",name:"OpenCode workspace limits",supports:(model)=>typeof context.client.usage?.limits==="function"&&provider(model)?.integrationID==="opencode",async read(model,signal){signal.throwIfAborted()
|
|
681
|
+
const adapter={id:"opencode-usage",name:"OpenCode workspace limits",supports:(model)=>typeof context.client.experimental?.usage?.limits==="function"&&provider(model)?.integrationID==="opencode",async read(model,signal){signal.throwIfAborted()
|
|
681
682
|
const epoch=generation
|
|
682
683
|
const target=key()
|
|
683
684
|
const activeProvider=provider(model)
|
|
684
685
|
if(!activeProvider||activeProvider.integrationID!=="opencode")
|
|
685
686
|
throw new Error("Native usage provider changed")
|
|
686
|
-
try{const result=await context.client.usage.limits({location:{directory:location().directory}},{signal})
|
|
687
|
+
try{const result=await context.client.experimental.usage.limits({location:{directory:location().directory}},{signal})
|
|
687
688
|
if(epoch!==generation||target!==key()||signal.aborted||result.location.directory!==location().directory)
|
|
688
689
|
throw new DOMException("Workspace usage target changed","AbortError")
|
|
689
690
|
if(!result.data)
|
|
@@ -1062,7 +1063,7 @@ return _$createComponent13(Section,{get api(){return props.api
|
|
|
1062
1063
|
},get navigationSection(){return props.navigationSection
|
|
1063
1064
|
},get credits(){return(snapshot()?.bankedResets?.availableCount??0)>0||Boolean(props.preferences.pendingResetAttempt())
|
|
1064
1065
|
},get refreshing(){return ["loading","refreshing"].includes(props.controller.state().status)
|
|
1065
|
-
},get canRefresh(){return Boolean(model()&&(props.controller.current().adapter
|
|
1066
|
+
},get canRefresh(){return Boolean(model()&&(props.controller.current().adapter??model()?.hostConnection?.status==="unavailable"))
|
|
1066
1067
|
},onCredits:openCredits,onRefresh:()=>void props.controller.refresh(true)
|
|
1067
1068
|
})
|
|
1068
1069
|
},get open(){return props.preferences.expanded().limits
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 1,
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@opencode/plugin": "2.2.5",
|
|
5
|
-
"@opentui/core": "0.8.
|
|
6
|
-
"@opentui/keymap": "0.8.
|
|
7
|
-
"@opentui/solid": "0.8.
|
|
5
|
+
"@opentui/core": "0.8.2",
|
|
6
|
+
"@opentui/keymap": "0.8.2",
|
|
7
|
+
"@opentui/solid": "0.8.2",
|
|
8
8
|
"solid-js": "1.9.18"
|
|
9
9
|
}
|
|
10
10
|
}
|