Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

718 B
Raw Blame
<script lang="ts">
	import type { Tokens } from 'marked';
	import type { MarkdownOptions, Renderers } from '$src/svelte-marked';
	import { parseXML } from '$src/widgets.js';
	import ArtifactButton from '$src/ArtifactButton.svelte';

	export const options: MarkdownOptions = undefined;
	export const renderers: Renderers = undefined;
	interface Props {
		token: Tokens.HTML;
		message: any;
	}

	let { token, message }: Props = $props();

	let xml = $derived(parseXML(token.text));
</script>

{#if xml.element === 'artifact' && message?.role === 'assistant'}
	<ArtifactButton {xml} />
{:else}
	<span class="{token.block ? 'block' : 'inline'} whitespace-pre-wrap [overflow-wrap:anywhere]"
		>{token.text}</span
	>
{/if}