{#if failure}
{:else if notConfigured}
{:else if !tree}
{:else if tree.tree.length === 0}
{:else} {@render nodes(tree.tree, 0)} {/if}
{#if !selected}
Pick a file to read it. This is the agent's own zone: state, handouts, prompts, skills - everything it can write.
{:else if fileError}
open(selected ?? "")} />
{:else if !file}
{:else}
{file.path}
{fmtBytes(file.size)}
modified {fmtRelative(file.mtime)}
{file.content}
{/if}
{#snippet nodes(list: MemoryNode[], depth: number)}
{#each list as node (node.path)}
{#if node.type === "dir"}
toggle(node.path)} style="padding-left: {depth * 0.75 + 0.25}rem" type="button" >
{node.name}
{#if !collapsed.has(node.path) && node.children} {@render nodes(node.children, depth + 1)} {/if} {:else}
open(node.path)} style="padding-left: {depth * 0.75 + 1.5}rem" type="button" >
{node.name}
{fmtBytes(node.size)}
{/if}
{/each}
{/snippet}