mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
sync
This commit is contained in:
parent
95a34a2abb
commit
dd27ba199a
2 changed files with 7 additions and 5 deletions
|
|
@ -205,7 +205,6 @@ export function Autocomplete(props: {
|
|||
})
|
||||
|
||||
const options = createMemo(() => {
|
||||
console.log(agents())
|
||||
const mixed: AutocompleteOption[] = (store.visible === "@" ? [...agents(), ...files()] : [...commands()]).filter(
|
||||
(x) => x.disabled !== true,
|
||||
)
|
||||
|
|
@ -224,6 +223,7 @@ export function Autocomplete(props: {
|
|||
|
||||
function move(direction: -1 | 1) {
|
||||
if (!store.visible) return
|
||||
if (!options().length) return
|
||||
let next = store.selected + direction
|
||||
if (next < 0) next = options().length - 1
|
||||
if (next >= options().length) next = 0
|
||||
|
|
|
|||
|
|
@ -211,10 +211,12 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
|
|||
|
||||
// non-blocking
|
||||
Promise.all([
|
||||
sdk.client.session.list().then((x) => {
|
||||
const sessions = (x.data ?? []).slice().sort((a, b) => a.id.localeCompare(b.id))
|
||||
setStore("session", sessions)
|
||||
}),
|
||||
sdk.client.session.list().then((x) =>
|
||||
setStore(
|
||||
"session",
|
||||
(x.data ?? []).toSorted((a, b) => a.id.localeCompare(b.id)),
|
||||
),
|
||||
),
|
||||
sdk.client.command.list().then((x) => setStore("command", x.data ?? [])),
|
||||
sdk.client.lsp.status().then((x) => setStore("lsp", x.data!)),
|
||||
sdk.client.mcp.status().then((x) => setStore("mcp", x.data!)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue