Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253<script lang="ts"> import type { NodeProps } from '@xyflow/svelte'; import AgentsButton from '../AgentsButton.svelte'; import ArtifactsButton from '../ArtifactsButton.svelte'; import { CHIP, type ChipWindow } from '../board.svelte'; import { boards } from '../boards.svelte'; import ModelPicker from '../chat/ModelPicker.svelte'; import JobsButton from '../JobsButton.svelte'; import { busy } from '../live.svelte'; import { sessions } from '../sessions.svelte'; import WindowFrame from './WindowFrame.svelte';
// A chat title-bar chip torn off onto the canvas, tied to the chat window it // came from. Closing it removes the window and docks the chip back into the // chat's title bar. let { id, data, selected }: NodeProps<ChipWindow> = $props(); const session = $derived(sessions.byId.get(data.sessionId)); const working = $derived(busy(session)); const rootId = $derived(session?.root_id ?? data.sessionId); const reading = $derived(sessions.readings.get(data.sessionId)); const title = $derived(data.chip === 'model' ? 'context' : data.chip);
$effect(() => { if (!session && sessions.loaded) sessions.ensure(data.sessionId); });</script>
<WindowFrame {id} selected={!!selected} {title} autoHeight minWidth={CHIP.minWidth} minHeight={CHIP.minHeight}> {#if data.chip === 'model'} {#if session} <ModelPicker {session} usage={reading?.usage ?? null} entries={reading?.entries ?? []} down inline /> {/if} {:else if data.chip === 'artifacts'} <ArtifactsButton sessionId={data.sessionId} busy={working} inline onopen={(artifact) => boards.board?.openArtifact(artifact.id, data.sessionId, artifact.version, data.parent)} /> {:else if data.chip === 'agents'} <AgentsButton sessionId={data.sessionId} {rootId} busy={working} inline onopen={(agent) => (sessions.adopt(agent), boards.board?.openSession(agent.id, data.parent))} ontree={() => boards.board?.openAgents(rootId, data.parent)} /> {:else if data.chip === 'jobs'} <JobsButton sessionId={data.sessionId} inline onopen={(job) => boards.board?.openTerminal(data.sessionId, job, data.parent)} /> {/if}</WindowFrame>