{#snippet heading( shelf: (typeof shelves)[number], all: CatalogCandidate[], open: boolean, )}
all sessions{#if scoped}this session{/if}
{/snippet}
{#if scoped && own}{own} own {own === 1 ? 'choice' : 'choices'} here{/if}
{#if below}
{@render below()}
{/if}
{#if error}

(。•︿•。) {error}

{/if} {#if notice}

{notice}

{/if} {#if pending}

{pending.question}

{/if}
{#if pinnedShelf} {@render heading( pinnedShelf, items.filter((item) => shelfOf(item) === pinnedShelf.id), !!query.trim() || !folded.has(pinnedShelf.id), )} {/if}
{#if loading && !data}

(・ω・) reading extensions…

{:else if data && !items.some(matches)}

(・_・) no extensions match this search

{/if} {#each shelves as shelf (shelf.id)} {@const all = items .filter((item) => shelfOf(item) === shelf.id) .sort((a, b) => shelf.id === 'memory' ? memoryOrder.indexOf(a.id) - memoryOrder.indexOf(b.id) : 0, )} {@const rows = all.filter(matches)} {@const open = !!query.trim() || !folded.has(shelf.id)} {#if rows.length}
{@render heading(shelf, all, open)}
{#if !open}
{count(all)}{#if scoped}{ownCount(all)}{/if}
{:else} {#if shelf.id === 'builtins'}

turning a builtin off also turns off what needs it.

{/if} {#if shelf.id === 'memory'}
one memory strategy, with notes as a layer{#if scoped}{/if}
{/if} {#each rows as item (item.id)} {@const memory = strategy(item)}
all sessions {#if memory} { event.preventDefault(); ask(item, 'global', true); }} /> {:else}{/if}
{#if scoped}
this session {#if memory} { event.preventDefault(); ask(item, 'session', true); }} /> {:else}
{#each [{ label: 'follow', value: null }, { label: 'on', value: true }, { label: 'off', value: false }] as choice (choice.label)} {/each}
{/if}
{/if}
{#if selected?.id === item.id}

{selected.description}

all sessions
{globalOn(selected) ? 'on' : 'off'}
{#if scoped}
this session
{selected.session_override === null ? 'follows all sessions' : selected.session_override ? "on, this session's own choice" : "off, this session's own choice"}
{/if}
needs
{selected.dependencies.join(', ') || 'nothing'}
provides
{[ ...(selected.extension?.tools ?? []), ...(selected.extension?.python_modules ?? []), ].join(', ') || 'no tools or python modules'}
{#if selected.quarantined}

quarantined: {selected.diagnostic?.detail ?? 'unavailable'}

{/if}
{/if} {/each} {/if}
{/if} {/each}