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.

chore(swarm-100): retire the coin-intel route audit now that the page is fixed

nirholasfd025d802a38
diff --git a/chat/src/Input.svelte b/chat/src/Input.svelte
deleted file mode 100644
index 9bc6c385b..000000000
--- a/chat/src/Input.svelte
+++ /dev/null
@@ -1,876 +0,0 @@
-<script>
- import { fly } from 'svelte/transition';
- import Icon from './Icon.svelte';
- import {
- feArrowUp,
- fePaperclip,
- feSquare,
- feX,
- feZap,
- feUsers,
- feTool,
- feSearch,
- feFolder,
- feLayout,
- feChevronDown,
- feSmartphone,
- } from './feather.js';
- import { afterUpdate, onDestroy, tick } from 'svelte';
- import { get } from 'svelte/store';
- import { v4 as uuidv4 } from 'uuid';
- import { readFileAsDataURL } from './util.js';
- import { anthropicAPIKey, controller, params, remoteServer, brandConfig, mode, composerFill, flowSecondary, appPlatforms, designModel } from './stores.js';
- import { modeConfig } from './three.ws/flows/utilityFlowData.js';
- import ToolPill from './ToolPill.svelte';
- import ToolDropdown from './ToolDropdown.svelte';
- import ModelSelector from './ModelSelector.svelte';
- import ReasoningEffortRangeDropdown from './ReasoningEffortRangeDropdown.svelte';
- import FilesDropdown from '$src/FilesDropdown.svelte';
- import FilePill from '$src/FilePill.svelte';
- import DesignModelPicker from './three.ws/DesignModelPicker.svelte';
-
- const imageUrlRegex = /https?:\/\/[^\s]+?\.(png|jpe?g)(?=\s|$)/gi;
-
- export let generating;
- export let convo;
- export let saveMessage;
- export let saveConversation;
- export let submitCompletion;
- export let scrollToBottom;
- export let handleAbort;
- export let tree;
-
- let content = '';
- let pendingImages = [];
- let imageUrlsBlacklist = [];
- let pendingFiles = [];
- let selectedFiles = [];
- $: console.log(`selectedFiles:`, selectedFiles);
-
- let isHoveringSend = false;
- let tokenCount = null;
- let tokenLoading = false;
- let tokenError = null;
-
- $: effectivePlaceholder = $mode === 'website'
- ? 'Describe the website you want to build'
- : $mode === 'slides'
- ? 'Describe your presentation topic'
- : $mode === 'desktop'
- ? 'Describe the app you want to build'
- : $mode === 'design'
- ? 'Describe what you want to design'
- : ($mode && modeConfig[$mode]?.placeholder)
- || 'Send a message…';
-
- let secondaryOpen = null;
-
- let designModelPickerOpen = false;
-
- const DESIGN_MODEL_LABELS = {
- 'gpt-image-2': 'GPT Image 2',
- 'sdxl': 'Stable Diffusion XL',
- 'flux-1': 'Flux 1',
- 'banana': 'Banana 🍌',
- };
-
- let toneOpen = false;
- let imgModelOpen = false;
- let selectedTone = 'Professional';
- const tones = ['Professional', 'Casual', 'Academic', 'Playful', 'Minimal'];
-
- let platformsOpen = false;
- const desktopPlatformOptions = ['macOS', 'Windows', 'Linux', 'iOS', 'Android', 'Tauri', 'Electron', 'PWA'];
- $: platformsSummary = $appPlatforms.size === 0 ? 'macOS' : [...$appPlatforms].join(', ');
-
- const unsubFill = composerFill.subscribe((fill) => {
- if (!fill) return;
- composerFill.set(null);
- const shouldFill = !fill.ifEmpty || !content;
- if (shouldFill) {
- content = fill.text;
- tick().then(() => {
- autoresizeTextarea();
- if (fill.submit) sendMessage();
- });
- }
- });
- onDestroy(unsubFill);
-
- async function calculateTokens() {
- if (convo.models[0]?.provider !== 'Anthropic') return;
-
- tokenLoading = true;
- tokenError = null;
-
- try {
- // Build system message
- const systemMsg = convo.messages.find((m) => m.role === 'system')?.content || '';
-
- // Build user message content
- let fileContent = '';
- if (pendingFiles.length > 0) {
- for (const file of pendingFiles) {
- fileContent += `\`\`\`filepath="${file.path}"\n${file.contents}\n\`\`\`\n\n`;
- }
- }
-
- const messages = [
- ...convo.messages.filter((m) => m.role !== 'system'),
- {
- role: 'user',
- content: fileContent + content,
- ...(pendingImages.length > 0 && {
- content: pendingImages.map((image) => ({
- type: 'image_url',
- image_url: { url: image.url, detail: image.fidelity },
- })),
- }),
- },
- ];
-
- const response = await fetch('https://api.anthropic.com/v1/messages/count_tokens', {
- method: 'POST',
- headers: {
- 'x-api-key': get(anthropicAPIKey),
- 'content-type': 'application/json',
- 'anthropic-version': '2023-06-01',
- 'anthropic-dangerous-direct-browser-access': 'true',
- },
- body: JSON.stringify({
- model: convo.models[0].id,
- system: systemMsg,
- messages,
- }),
- });
-
- if (!response.ok) throw new Error('Token count failed');
- const data = await response.json();
- tokenCount = data.input_tokens;
- } catch (err) {
- tokenError = err.message;
- } finally {
- tokenLoading = false;
- }
- }
-
- let toolsOpen = false;
- let filesOpen = false;
- let reasoningEffortDropdownOpen = false;
- let websearchEnabled = false;
-
- $: isMultimodal = convo.models[0].modality === 'text+image->text';
-
- async function sendMessage() {
- if (content.length > 0) {
- const _effectiveSystemPrompt = $params.customInstructions || $brandConfig.system_prompt;
- if (
- _effectiveSystemPrompt &&
- convo.messages.length === 0 &&
- !convo.messages.find((m) => m.role === 'system')
- ) {
- const systemMsg = {
- id: uuidv4(),
- role: 'system',
- customInstructions: true,
- content: _effectiveSystemPrompt,
- };
- convo.messages.push(systemMsg);
- convo.messages = convo.messages;
- saveMessage(systemMsg);
- saveConversation(convo);
- }
-
- const msg = {
- id: uuidv4(),
- role: 'user',
- content: content,
- submitted: true,
- };
-
- const imageUrlMapper = (image) => ({
- type: 'image_url',
- image_url: {
- url: image.url,
- detail: image.fidelity,
- },
- });
-
- if (pendingImages.length > 0) {
- msg.contentParts = [...pendingImages.map(imageUrlMapper)];
- }
-
- let fileContent = '';
- if (pendingFiles.length > 0) {
- for (const file of pendingFiles) {
- fileContent += `\`\`\`filepath="${file.path}"
-${file.contents}
-\`\`\`
-
-`;
- }
-
- msg.content = fileContent + msg.content;
- }
-
- convo.messages.push(msg);
- convo.messages = convo.messages;
- await tick();
- scrollToBottom();
-
- saveMessage(msg);
- saveConversation(convo);
-
- content = '';
- pendingImages = [];
- imageUrlsBlacklist = [];
- pendingFiles = [];
- selectedFiles = [];
-
- await tick();
- if (innerWidth < 880) {
- inputTextareaEl.blur();
- }
- autoresizeTextarea();
-
- submitCompletion();
- }
- }
-
- let fileInputEl;
- export let inputTextareaEl;
-
- export function autoresizeTextarea() {
- inputTextareaEl.style.height = 'auto';
- inputTextareaEl.style.height = inputTextareaEl.scrollHeight + 2 + 'px';
- }
-
- async function handlePDF(file) {
- try {
- const pdfjs = await import('pdfjs-dist');
-
- pdfjs.GlobalWorkerOptions.workerSrc = new URL(
- 'pdfjs-dist/build/pdf.worker.min.mjs',
- import.meta.url
- ).toString();
-
- const arrayBuffer = await file.arrayBuffer();
- const pdf = await pdfjs.getDocument({ data: arrayBuffer }).promise;
- let contents = '';
-
- for (let i = 1; i <= pdf.numPages; i++) {
- const page = await pdf.getPage(i);
- const content = await page.getTextContent();
- const pageText = content.items.map((item) => item.str).join(' ');
- contents += pageText;
- }
-
- pendingFiles.push({ path: file.name, contents });
- pendingFiles = pendingFiles;
- tick().then(() => {
- autoresizeTextarea();
- });
- } catch (error) {
- console.error(`Error processing PDF: ${error.message}`);
- }
- }
-
- export async function handleFileDrop(event) {
- event.preventDefault();
-
- let filenames = [];
- let promises = [];
- if (event.dataTransfer.items) {
- // Use DataTransferItemList interface to access the file(s)
- [...event.dataTransfer.items].forEach((item, _) => {
- // If dropped items aren't files, reject them
- if (item.kind !== 'file') {
- return;
- }
-
- if (item.type === 'application/pdf') {
- handlePDF(item.getAsFile());
- return;
- }
-
- const file = item.getAsFile();
- filenames.push(file.name);
- promises.push(file.text());
- });
- } else {
- // Use DataTransfer interface to access the file(s)
- [...event.dataTransfer.files].forEach((file, _) => {
- filenames.push(file.name);
- promises.push(file.text());
- });
- }
-
- const texts = await Promise.all(promises);
- for (let i = 0; i < texts.length; i++) {
- const text = texts[i];
- const filename = filenames[i];
- pendingFiles.push({ path: filename, contents: text });
- pendingFiles = pendingFiles;
- }
-
- tick().then(() => {
- autoresizeTextarea();
- });
- }
-
- async function handlePaste(event) {
- const items = (event.clipboardData || event.originalEvent.clipboardData).items;
- for (let i = 0; i < items.length; i++) {
- if (items[i].kind === 'file' && items[i].type.startsWith('image/')) {
- const file = items[i].getAsFile();
- const dataUrl = await readFileAsDataURL(file);
- pendingImages.push({ url: dataUrl, fidelity: 'high' });
- pendingImages = pendingImages;
- tick().then(() => {
- autoresizeTextarea();
- });
- } else if (items[i].kind === 'file' && items[i].type === 'application/pdf') {
- handlePDF(items[i].getAsFile());
- }
- }
- }
-
- async function handleFileUpload(event) {
- const files = event.target.files;
- for (let i = 0; i < files.length; i++) {
- const file = files[i];
- if (file.type.startsWith('image/')) {
- const dataUrl = await readFileAsDataURL(file);
- pendingImages.push({ url: dataUrl, fidelity: 'high' });
- pendingImages = pendingImages;
- tick().then(() => {
- autoresizeTextarea();
- });
- } else if (file.type === 'application/pdf') {
- handlePDF(file);
- } else {
- const text = await file.text();
- pendingFiles.push({ path: file.name, contents: text });
- pendingFiles = pendingFiles;
- tick().then(() => {
- autoresizeTextarea();
- });
- }
- }
- }
-
- function formatCompactNumber(number) {
- return new Intl.NumberFormat('en-US', {
- notation: 'compact',
- compactDisplay: 'short',
- maximumFractionDigits: 1,
- }).format(number);
- }
-
- let containerEl, leftFadeEl, rightFadeEl;
-
- function updateFades() {
- if (!containerEl || !leftFadeEl || !rightFadeEl) {
- return;
- }
- const isScrollable = containerEl.scrollWidth > containerEl.clientWidth;
-
- if (isScrollable) {
- // Update left fade - only visible if scrolled away from start
- leftFadeEl.style.opacity = containerEl.scrollLeft > 0 ? '1' : '0';
-
- // Update right fade - visible if there's more content to scroll to
- const hasMoreContent =
- containerEl.scrollLeft + containerEl.clientWidth < containerEl.scrollWidth;
- rightFadeEl.style.opacity = hasMoreContent ? '1' : '0';
- } else {
- leftFadeEl.style.opacity = '0';
- rightFadeEl.style.opacity = '0';
- }
- }
-
- afterUpdate(() => {
- updateFades();
- });
-</script>
-
-<svelte:window
- on:resize={updateFades}
- on:keydown={(event) => {
- // Check for Command+P (macOS) or Ctrl+P (Windows/Linux) to open the file picker
- if (navigator.platform.match(/Mac|iPhone|iPod|iPad/)) {
- if (event.metaKey && event.key === 'p') {
- filesOpen = true;
- event.preventDefault();
- }
- } else if (event.ctrlKey && event.key === 'p') {
- filesOpen = true;
- event.preventDefault();
- }
- }}
-/>
-
-<div class="input-floating absolute bottom-4 left-1/2 z-[99] w-full -translate-x-1/2 px-5 ld:px-8">
- <div class="mx-auto flex w-full max-w-[680px] flex-col ld:max-w-[768px]">
- <div class="relative flex">
- {#if pendingImages.length > 0 || pendingFiles.length > 0}
- <div class="absolute left-5 top-2.5 flex gap-x-3">
- {#each pendingFiles as file, i}
- <FilePill
- {file}
- canDelete
- on:delete={() => {
- const [deleted] = pendingFiles.splice(i, 1);
- pendingFiles = pendingFiles;
- selectedFiles = selectedFiles.filter((f) => f !== deleted.path);
- tick().then(() => {
- autoresizeTextarea();
- });
- }}
- />
- {/each}
- {#each pendingImages as image, i}
- <div class="relative">
- <img
- src={image.url}
- alt=""
- class="h-20 w-20 rounded-lg border border-slate-200 object-cover"
- />
- <button
- on:click={() => {
- pendingImages[i].fidelity = pendingImages[i].fidelity === 'high' ? 'low' : 'high';
- pendingImages = pendingImages;
- }}
- class="absolute -bottom-1 -left-1 flex h-4 rounded-full bg-black px-1 transition-[transform,background-color] hover:scale-110 hover:bg-blue-400"
- title="Toggle image fidelity"
- >
- <span class="m-auto text-[8px] font-bold text-white">
- {pendingImages[i].fidelity === 'high' ? 'High' : 'Low'}
- </span>
- </button>
- <button
- on:click={() => {
- pendingImages.splice(i, 1);
- pendingImages = pendingImages;
- imageUrlsBlacklist.push(image.url);
- tick().then(() => {
- autoresizeTextarea();
- });
- }}
- class="absolute -bottom-1 -right-1 flex h-4 w-4 rounded-full bg-black transition-[transform,background-color] hover:scale-110 hover:bg-red-400"
- >
- <Icon icon={feX} class="m-auto h-3 w-3 text-white" />
- </button>
- </div>
- {/each}
- </div>
- {/if}
- <textarea
- bind:this={inputTextareaEl}
- class="{isMultimodal ? 'pr-[84px]' : 'pr-14'} {pendingImages.length > 0
- ? '!pt-[112px]'
- : pendingFiles.length > 0
- ? '!pt-[48px]'
- : ''} max-h-[90dvh] w-full resize-none rounded-[18px] border border-slate-200 pb-14 pl-5 pt-4 font-normal text-slate-800 shadow-sm transition-colors scrollbar-slim focus:border-slate-300 focus:outline-none"
- placeholder={effectivePlaceholder}
- rows={1}
- bind:value={content}
- on:paste={handlePaste}
- on:keydown={(event) => {
- if (event.key === 'Enter' && !event.shiftKey && innerWidth > 880) {
- event.preventDefault();
- sendMessage();
- }
- }}
- on:input={async () => {
- autoresizeTextarea();
-
- const imageLinkedUrls = content.match(imageUrlRegex) || [];
- for (const url of imageLinkedUrls) {
- if (
- !pendingImages.find((image) => image.url === url) &&
- !imageUrlsBlacklist.includes(url)
- ) {
- pendingImages.push({ url, fidelity: 'high' });
- pendingImages = pendingImages;
- tick().then(() => {
- autoresizeTextarea();
- });
- }
- }
- }}
- />
-
- <div class="absolute bottom-3 left-4">
- <!-- Left fade -->
- <div
- bind:this={leftFadeEl}
- class="pointer-events-none absolute bottom-0 left-0 z-10 h-full w-6 bg-gradient-to-r from-white to-transparent opacity-0 transition-opacity sm:hidden"
- />
-
- <!-- Right fade -->
- <div
- bind:this={rightFadeEl}
- class="pointer-events-none absolute bottom-0 right-0 z-10 h-full w-6 bg-gradient-to-l from-white to-transparent opacity-0 transition-opacity sm:hidden"
- />
-
- <div
- bind:this={containerEl}
- on:scroll={updateFades}
- class="flex max-w-[220px] gap-2 overflow-x-auto scrollbar-none sm:max-w-none sm:overflow-x-visible"
- >
- {#if $mode === 'website'}
- <button
- class="three-ui-chip three-ui-chip-selected h-7 px-3 text-xs"
- on:click={() => mode.set(null)}
- >
- Website
- </button>
- {/if}
- {#if $mode === 'desktop'}
- <button
- class="three-ui-chip three-ui-chip-selected h-7 px-3 text-xs inline-flex items-center gap-1.5"
- on:click={() => mode.set(null)}
- >
- <Icon icon={feSmartphone} class="w-3.5 h-3.5" />
- Develop apps
- </button>
- <div class="relative">
- <button
- class="three-ui-chip h-7 px-3 text-xs inline-flex items-center gap-1.5"
- on:click={() => { platformsOpen = !platformsOpen; }}
- >
- {platformsSummary}
- <Icon icon={feChevronDown} class="w-3 h-3" />
- </button>
- {#if platformsOpen}
- <div class="absolute left-0 bottom-full mb-2 bg-white border border-rule rounded-xl shadow-pop z-10 min-w-[160px] py-1">
- {#each desktopPlatformOptions as p}
- <label class="flex items-center gap-2 w-full px-3 py-1.5 text-sm text-ink hover:bg-paper cursor-pointer">
- <input
- type="checkbox"
- class="accent-blue-500"
- checked={$appPlatforms.has(p)}
- on:change={() => {
- appPlatforms.update((set) => {
- const next = new Set(set);
- if (next.has(p)) {
- if (next.size > 1) next.delete(p);
- } else {
- next.add(p);
- }
- return next;
- });
- }}
- />
- {p}
- </label>
- {/each}
- </div>
- {/if}
- </div>
- {/if}
- {#if $mode === 'slides'}
- <button
- class="three-ui-chip three-ui-chip-selected h-7 px-3 text-xs inline-flex items-center gap-1.5"
- on:click={() => mode.set(null)}
- >
- <Icon icon={feLayout} class="w-3.5 h-3.5" />
- Slides
- </button>
- <div class="relative">
- <button
- class="three-ui-chip h-7 px-3 text-xs inline-flex items-center gap-1.5"
- on:click={() => { toneOpen = !toneOpen; imgModelOpen = false; }}
- >
- <Icon icon={feZap} class="w-3.5 h-3.5" />
- {selectedTone}
- <Icon icon={feChevronDown} class="w-3 h-3" />
- </button>
- {#if toneOpen}
- <div class="absolute left-0 bottom-full mb-2 bg-white border border-rule rounded-xl shadow-pop z-10 min-w-[140px]">
- {#each tones as tone}
- <button
- class="block w-full px-4 py-2 text-sm text-left text-ink hover:bg-paper first:rounded-t-xl last:rounded-b-xl"
- on:click={() => { selectedTone = tone; toneOpen = false; }}
- >
- {tone}
- </button>
- {/each}
- </div>
- {/if}
- </div>
- <div class="relative">
- <button
- class="rounded-full bg-white border border-rule h-7 px-2 inline-flex items-center gap-1 hover:bg-paper transition-colors"
- on:click={() => { imgModelOpen = !imgModelOpen; toneOpen = false; }}
- >
- <span class="w-[18px] h-[18px] rounded-full bg-black shrink-0 inline-block"></span>
- <span class="text-base leading-none">🍌</span>
- <Icon icon={feChevronDown} class="w-3 h-3 text-ink-soft" />
- </button>
- {#if imgModelOpen}
- <div class="absolute left-0 bottom-full mb-2 bg-white border border-rule rounded-xl shadow-pop z-10 min-w-[140px]">
- <button class="flex items-center gap-2 w-full px-3 py-2 text-sm text-left text-ink hover:bg-paper rounded-t-xl">
- <span class="w-[18px] h-[18px] rounded-full bg-black shrink-0 inline-block"></span>
- OpenAI
- </button>
- <button class="flex items-center gap-2 w-full px-3 py-2 text-sm text-left text-ink hover:bg-paper rounded-b-xl">
- <span class="text-base leading-none shrink-0">🍌</span>
- Banana
- </button>
- </div>
- {/if}
- </div>
- {/if}
- {#if $mode === 'design'}
- <button
- class="three-ui-chip three-ui-chip-selected h-7 px-3 text-xs inline-flex items-center gap-1.5"
- on:click={() => mode.set(null)}
- >
- <Icon icon={feZap} class="w-3.5 h-3.5" />
- Design
- </button>
- <div class="relative">
- <button
- class="inline-flex items-center gap-2 h-8 px-2 pr-1 rounded-full border border-rule bg-white text-sm hover:bg-paper transition-colors"
- on:click={() => (designModelPickerOpen = !designModelPickerOpen)}
- >
- <span class="w-4 h-4 rounded-full bg-gray-900 shrink-0 inline-block"></span>
- <span>{DESIGN_MODEL_LABELS[$designModel] ?? $designModel}</span>
- <Icon icon={feChevronDown} class="w-3.5 h-3.5 text-ink-soft" />
- </button>
- {#if designModelPickerOpen}
- <DesignModelPicker on:close={() => (designModelPickerOpen = false)} />
- {/if}
- </div>
- {/if}
- {#if $mode && modeConfig[$mode]}
- {@const cfg = modeConfig[$mode]}
- <button
- class="three-ui-chip three-ui-chip-selected h-7 px-3 text-xs inline-flex items-center gap-1.5 shrink-0"
- on:click={() => mode.set(null)}
- >
- <Icon icon={cfg.icon} class="w-3.5 h-3.5" />
- {cfg.label}
- </button>
- {#if cfg.secondary}
- {@const sec = cfg.secondary}
- {@const currentVal = $flowSecondary[$mode] ?? sec.default}
- <div class="relative">
- <button
- class="three-ui-chip h-7 px-3 text-xs inline-flex items-center gap-1.5 shrink-0"
- on:click={() => { secondaryOpen = secondaryOpen === $mode ? null : $mode; }}
- >
- {sec.prefix}: {currentVal}
- <Icon icon={feChevronDown} class="w-3 h-3" />
- </button>
- {#if secondaryOpen === $mode}
- <button
- class="fixed inset-0 z-20 cursor-default"
- tabindex="-1"
- on:click={() => (secondaryOpen = null)}
- />
- <div class="absolute left-0 bottom-full mb-2 bg-white border border-rule rounded-xl shadow-pop z-30 min-w-[160px] py-1">
- {#each sec.options as opt}
- <button
- class="block w-full px-4 py-2 text-sm text-left text-ink hover:bg-paper {currentVal === opt ? 'font-medium' : ''} first:rounded-t-xl last:rounded-b-xl"
- on:click={() => { $flowSecondary = { ...$flowSecondary, [$mode]: opt }; secondaryOpen = null; }}
- >
- {opt}
- </button>
- {/each}
- </div>
- {/if}
- </div>
- {/if}
- {/if}
- <div id="tool-dropdown" class="contents">
- <ToolPill icon={feTool} selected={toolsOpen} on:click={() => (toolsOpen = !toolsOpen)}>
- Tools
- {#if convo.tools?.length > 0}
- <span
- class="{toolsOpen
- ? 'bg-white text-slate-800'
- : 'bg-slate-800 text-white'} flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-[10px] transition-colors"
- >
- {convo.tools.length}
- </span>
- {/if}
- </ToolPill>
- <ToolDropdown bind:open={toolsOpen} {convo} {saveConversation} />
- </div>
-
- {#if tree}
- <div id="files-dropdown" class="contents">
- <ToolPill
- icon={feFolder}
- selected={filesOpen}
- on:click={() => (filesOpen = !filesOpen)}
- >
- Files
- {#if pendingFiles.length > 0}
- <span
- class="{filesOpen
- ? 'bg-white text-slate-800'
- : 'bg-slate-800 text-white'} flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-[10px] transition-colors"
- >
- {pendingFiles.length}
- </span>
- {/if}
- </ToolPill>
- <FilesDropdown
- bind:open={filesOpen}
- {tree}
- bind:selectedFiles
- on:fileSelected={async ({ detail }) => {
- const path = detail.path;
- const response = await fetch(`${$remoteServer.address}/read_file?path=${path}`);
- const contents = await response.text();
- pendingFiles = [...pendingFiles, { path, contents }];
- tick().then(() => {
- autoresizeTextarea();
- });
- }}
- on:fileDeselected={({ detail }) => {
- const path = detail.path;
- pendingFiles = pendingFiles.filter((f) => f.path !== path);
- tick().then(() => {
- autoresizeTextarea();
- });
- }}
- />
- </div>
- {/if}
-
- {#if convo.models.every((m) => m.provider === 'OpenRouter')}
- <ToolPill
- icon={feSearch}
- selected={convo.websearch}
- on:click={() => {
- if (convo.websearch) {
- convo.websearch = false;
- saveConversation(convo);
- } else {
- convo.websearch = true;
- saveConversation(convo);
- }
- }}
- >
- Search
- </ToolPill>
- {/if}
- {#if convo.models[0].reasoningEffortControls === 'low-medium-high'}
- <ToolPill
- icon={feZap}
- selected={false}
- on:click={() => {
- // Toggle between low, medium, and high reasoning effort
- if (convo.reasoningEffort === 'low') {
- convo.reasoningEffort = 'medium';
- saveConversation(convo);
- } else if (convo.reasoningEffort === 'medium') {
- convo.reasoningEffort = 'high';
- saveConversation(convo);
- } else if (!convo.reasoningEffort || convo.reasoningEffort === 'high') {
- convo.reasoningEffort = 'low';
- saveConversation(convo);
- }
- }}
- >
- {#if convo.reasoningEffort === 'low'}
- Low
- {:else if convo.reasoningEffort === 'medium'}
- Medium
- {:else if !convo.reasoningEffort || convo.reasoningEffort === 'high'}
- High
- {/if}
- </ToolPill>
- {:else if convo.models[0].reasoningEffortControls === 'range'}
- <div id="reasoning-effort-dropdown" class="contents">
- <ToolPill
- icon={feZap}
- selected={reasoningEffortDropdownOpen}
- on:click={() => (reasoningEffortDropdownOpen = !reasoningEffortDropdownOpen)}
- >
- Thinking {$params.reasoningEffort['range'] === 0
- ? 'off'
- : formatCompactNumber($params.reasoningEffort['range'])}
- </ToolPill>
- <ReasoningEffortRangeDropdown bind:open={reasoningEffortDropdownOpen} {convo} />
- </div>
- {/if}
- </div>
- </div>
-
- <div class="absolute bottom-[13px] right-4 flex gap-2">
- {#if isMultimodal}
- <button
- class="h-8 w-8 rounded-full transition-transform hover:scale-110 hover:bg-slate-200"
- on:click={() => fileInputEl.click()}
- >
- <input
- type="file"
- class="hidden"
- bind:this={fileInputEl}
- on:change={handleFileUpload}
- />
- <Icon
- icon={fePaperclip}
- strokeWidth={2.5}
- class="m-auto h-5 w-5 text-slate-800 transition-colors group-disabled:text-slate-400"
- />
- </button>
- {/if}
- {#if generating && convo.messages.filter((msg) => msg.generated).length > 0}
- <button
- class="group flex h-8 w-8 rounded-full bg-slate-800 transition-transform hover:scale-110"
- on:click={() => {
- handleAbort();
- }}
- >
- <Icon
- icon={feSquare}
- strokeWidth={4}
- class="m-auto h-3.5 w-3.5 text-white transition-colors group-disabled:text-slate-100"
- />
- </button>
- {:else}
- <button
- disabled={content.length === 0}
- class="group relative flex h-8 w-8 rounded-full bg-slate-800 transition-transform hover:scale-110 disabled:bg-slate-400 disabled:hover:scale-100"
- on:click={sendMessage}
- on:mouseenter={() => {
- if (content.length === 0) {
- return;
- }
- // isHoveringSend = true;
- // calculateTokens();
- }}
- on:mouseleave={() => {
- // isHoveringSend = false;
- // tokenCount = null;
- }}
- >
- <Icon
- icon={feArrowUp}
- class="m-auto h-4 w-4 text-white transition-colors group-disabled:text-slate-100"
- />
- {#if convo.models[0]?.provider === 'Anthropic'}
- <div
- class="absolute bottom-full right-0 mb-2 whitespace-nowrap rounded-lg bg-slate-900 px-3 py-2 text-xs text-white shadow-xl"
- class:invisible={!tokenError && !tokenCount}
- >
- {#if tokenError}
- Error: {tokenError}
- {:else}
- {tokenCount} tokens
- {/if}
- </div>
- {/if}
- </button>
- {/if}
- </div>
- </div>
- </div>
-</div>
diff --git a/chat/src/three-ui/dropdowns/BusinessDropdown.svelte b/chat/src/three-ui/dropdowns/BusinessDropdown.svelte
deleted file mode 100644
index 6d61ec3a5..000000000
--- a/chat/src/three-ui/dropdowns/BusinessDropdown.svelte
+++ /dev/null
@@ -1,29 +0,0 @@
-<script>
- import { route } from '../../stores.js';
- import Icon from '../../Icon.svelte';
- import { feBriefcase, feShield, feServer, feUsers, feMessageCircle } from '../../feather.js';
-
- const items = [
- { title: 'Enterprise', subtitle: 'Deploy three.ws across your org', route: 'business/enterprise', icon: feBriefcase },
- { title: 'Security & compliance', subtitle: 'SOC 2, GDPR, custom DPAs', route: 'business/security', icon: feShield },
- { title: 'Custom deployments', subtitle: 'VPC and on-prem options', route: 'business/deployments', icon: feServer },
- { title: 'Customer stories', subtitle: 'How teams ship faster with three.ws', route: 'business/customers', icon: feUsers },
- { title: 'Contact sales', subtitle: 'Talk to a real human', route: 'business/contact-sales', icon: feMessageCircle },
- ];
-</script>
-
-<div class="bg-white border border-rule rounded-2xl shadow-pop p-3 w-[420px]">
- {#each items as item}
- <button
- class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-paper"
- on:click={() => route.set(item.route)}>
- <span class="w-9 h-9 rounded-lg bg-paper flex items-center justify-center shrink-0">
- <Icon icon={item.icon} class="w-[18px] h-[18px] text-ink" />
- </span>
- <span class="flex-1 min-w-0">
- <span class="block text-sm font-semibold text-ink">{item.title}</span>
- <span class="block text-xs text-ink-soft mt-0.5">{item.subtitle}</span>
- </span>
- </button>
- {/each}
-</div>
diff --git a/chat/src/three-ui/dropdowns/EventsDropdown.svelte b/chat/src/three-ui/dropdowns/EventsDropdown.svelte
deleted file mode 100644
index cdca57fe2..000000000
--- a/chat/src/three-ui/dropdowns/EventsDropdown.svelte
+++ /dev/null
@@ -1,29 +0,0 @@
-<script>
- import { route } from '../../stores.js';
- import Icon from '../../Icon.svelte';
- import { feVideo, feMapPin, feClock, feZap, fePlay } from '../../feather.js';
-
- const items = [
- { title: 'Webinars', subtitle: 'Live sessions with the three.ws team', route: 'events/webinars', icon: feVideo },
- { title: 'Conferences', subtitle: 'Where you can find us in person', route: 'events/conferences', icon: feMapPin },
- { title: 'Office hours', subtitle: 'Weekly Q&A with engineers', route: 'events/office-hours', icon: feClock },
- { title: 'Hackathons', subtitle: 'Build with three.ws alongside the community', route: 'events/hackathons', icon: feZap },
- { title: 'Past recordings', subtitle: 'Replay every session on demand', route: 'events/recordings', icon: fePlay },
- ];
-</script>
-
-<div class="bg-white border border-rule rounded-2xl shadow-pop p-3 w-[420px]">
- {#each items as item}
- <button
- class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-paper"
- on:click={() => route.set(item.route)}>
- <span class="w-9 h-9 rounded-lg bg-paper flex items-center justify-center shrink-0">
- <Icon icon={item.icon} class="w-[18px] h-[18px] text-ink" />
- </span>
- <span class="flex-1 min-w-0">
- <span class="block text-sm font-semibold text-ink">{item.title}</span>
- <span class="block text-xs text-ink-soft mt-0.5">{item.subtitle}</span>
- </span>
- </button>
- {/each}
-</div>
diff --git a/chat/src/three-ui/dropdowns/FeaturesDropdown.svelte b/chat/src/three-ui/dropdowns/FeaturesDropdown.svelte
deleted file mode 100644
index 88188c0ab..000000000
--- a/chat/src/three-ui/dropdowns/FeaturesDropdown.svelte
+++ /dev/null
@@ -1,35 +0,0 @@
-<script>
- import { route } from '../../stores.js';
- import Icon from '../../Icon.svelte';
- import {
- feGlobe, feSmartphone, feZap, feLayout, feMonitor,
- feTarget, feMail, feGrid
- } from '../../feather.js';
-
- const items = [
- { title: 'Web app', subtitle: 'Build full-stack, AI-powered sites', route: 'features/web-app', icon: feGlobe },
- { title: 'Mobile app', subtitle: 'Build native iOS & Android apps', route: 'features/mobile-app', icon: feSmartphone },
- { title: 'AI design', subtitle: 'Automates the entire design journey', route: 'features/ai-design', icon: feZap },
- { title: 'AI slides', subtitle: 'Use Nano Banana Pro to create slides', route: 'features/ai-slides', icon: feLayout },
- { title: 'three.ws browser operator', subtitle: 'Lend a tab to three.ws', route: 'features/browser-operator', icon: feMonitor },
- { title: 'Wide Research', subtitle: 'Parallel research at scale', route: 'features/wide-research', icon: feTarget },
- { title: 'Mail three.ws', subtitle: 'Turn any email into action', route: 'features/mail-three.ws', icon: feMail },
- { title: 'Agent Skills', subtitle: 'Automate your expertise', route: 'features/agent-skills', icon: feGrid },
- ];
-</script>
-
-<div class="bg-white border border-rule rounded-2xl shadow-pop p-3 w-[420px]">
- {#each items as item}
- <button
- class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-paper"
- on:click={() => route.set(item.route)}>
- <span class="w-9 h-9 rounded-lg bg-paper flex items-center justify-center shrink-0">
- <Icon icon={item.icon} class="w-[18px] h-[18px] text-ink" />
- </span>
- <span class="flex-1 min-w-0">
- <span class="block text-sm font-semibold text-ink">{item.title}</span>
- <span class="block text-xs text-ink-soft mt-0.5">{item.subtitle}</span>
- </span>
- </button>
- {/each}
-</div>
diff --git a/chat/src/three-ui/dropdowns/ResourcesDropdown.svelte b/chat/src/three-ui/dropdowns/ResourcesDropdown.svelte
deleted file mode 100644
index 2915ea364..000000000
--- a/chat/src/three-ui/dropdowns/ResourcesDropdown.svelte
+++ /dev/null
@@ -1,31 +0,0 @@
-<script>
- import { route } from '../../stores.js';
- import Icon from '../../Icon.svelte';
- import {
- feFileText, feBook, feList, feCompass, feShield
- } from '../../feather.js';
-
- const items = [
- { title: 'Blog', subtitle: 'Ideas, guides, and user stories', route: 'resources/blog', icon: feFileText },
- { title: 'Docs', subtitle: 'Learn about three.ws and get started', route: 'resources/docs', icon: feBook },
- { title: 'Updates', subtitle: "What's new with three.ws?", route: 'resources/updates', icon: feList },
- { title: 'Use cases', subtitle: 'Best practices in action', route: 'resources/use-cases', icon: feCompass },
- { title: 'Trust center', subtitle: 'Security and compliance', route: 'resources/trust-center', icon: feShield },
- ];
-</script>
-
-<div class="bg-white border border-rule rounded-2xl shadow-pop p-3 w-[420px]">
- {#each items as item}
- <button
- class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-paper"
- on:click={() => route.set(item.route)}>
- <span class="w-9 h-9 rounded-lg bg-paper flex items-center justify-center shrink-0">
- <Icon icon={item.icon} class="w-[18px] h-[18px] text-ink" />
- </span>
- <span class="flex-1 min-w-0">
- <span class="block text-sm font-semibold text-ink">{item.title}</span>
- <span class="block text-xs text-ink-soft mt-0.5">{item.subtitle}</span>
- </span>
- </button>
- {/each}
-</div>
diff --git a/chat/src/three-ui/dropdowns/SolutionsDropdown.svelte b/chat/src/three-ui/dropdowns/SolutionsDropdown.svelte
deleted file mode 100644
index 2ee5e1c3c..000000000
--- a/chat/src/three-ui/dropdowns/SolutionsDropdown.svelte
+++ /dev/null
@@ -1,36 +0,0 @@
-<script>
- import { route } from '../../stores.js';
- import Icon from '../../Icon.svelte';
- import {
- feTrendingUp, feSpeaker, feCpu, feActivity,
- feLifeBuoy, feDollarSign, feUsers, feStar,
- } from '../../feather.js';
-
- const items = [
- { title: 'Sales', subtitle: 'Pipeline insights and deal acceleration', slug: 'solutions/sales', icon: feTrendingUp },
- { title: 'Marketing', subtitle: 'Campaigns, content, and analytics', slug: 'solutions/marketing', icon: feSpeaker },
- { title: 'Engineering', subtitle: 'Internal tools and automations', slug: 'solutions/engineering', icon: feCpu },
- { title: 'Operations', subtitle: 'Reporting, dashboards, workflows', slug: 'solutions/operations', icon: feActivity },
- { title: 'Customer Support', subtitle: 'Ticket triage and knowledge bots', slug: 'solutions/support', icon: feLifeBuoy },
- { title: 'Finance', subtitle: 'Spend analysis and forecasting', slug: 'solutions/finance', icon: feDollarSign },
- { title: 'HR & People', subtitle: 'Hiring, onboarding, internal Q&A', slug: 'solutions/hr', icon: feUsers },
- { title: 'Founders & Startups', subtitle: 'Launch faster with fewer engineers', slug: 'solutions/founders', icon: feStar },
- ];
-</script>
-
-<div class="bg-white border border-rule rounded-2xl shadow-pop p-3 w-[420px]">
- {#each items as item}
- <button
- class="flex items-start gap-3 w-full px-3 py-3 rounded-xl text-left hover:bg-paper"
- on:click={() => route.set(item.slug)}
- >
- <span class="w-9 h-9 rounded-lg bg-paper flex items-center justify-center shrink-0">
- <Icon icon={item.icon} class="w-[18px] h-[18px] text-ink" />
- </span>
- <span class="flex-1 min-w-0">
- <span class="block text-sm font-semibold text-ink">{item.title}</span>
- <span class="block text-xs text-ink-soft mt-0.5">{item.subtitle}</span>
- </span>
- </button>
- {/each}
-</div>
diff --git a/prompts/swarm-100/route-coin-intel.md b/prompts/swarm-100/route-coin-intel.md
deleted file mode 100644
index 8c969eb68..000000000
--- a/prompts/swarm-100/route-coin-intel.md
+++ /dev/null
@@ -1,119 +0,0 @@
-# Route audit: /coin-intel (Coin Intelligence)
-
-How to run: paste this file's repo path into a fresh Claude Code chat in this
-repository and say "run this work order". This file is fully self-contained:
-it depends on no other prompt file anywhere. If neighboring files in
-prompts/swarm-100/ are gone, that work is done; if present, ignore them.
-Every claim below rots; step 0 re-measures, and what you measure wins.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first. Its rules override everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option
- list, or an unexecuted plan. A judgment call goes in one line of the final
- report; it never becomes a question that halts work.
-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real
- funds or any irreversible on-chain write, git push or a production deploy,
- committing content that references a crypto project other than $THREE, and
- destroying unrecoverable data.
-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no
- commented-out code. Real APIs and real integrations only.
-- The em-dash and en-dash characters are banned in everything you write.
-- Concurrent agents share this worktree: stage explicit paths only (never a
- bare add-everything), and commit finished work promptly.
-- Before committing, run: npm run check:rules -- --paths <files you touched>.
- It must exit 0.
-
-## Step 0: re-derive the current state
-
-1. This route's declared entry (path, description, added date):
-
- node -e "const p=require('./data/pages.json');for(const s of p.sections)for(const g of s.pages)if(g.path==='/coin-intel')console.log(JSON.stringify(g,null,2))"
-
-2. Find the serving implementation: grep "/coin-intel" in vercel.json (the live
- route table server/index.mjs boots from), then list matching files in
- pages/ and src/. STRUCTURE.md maps every surface to its directory if the
- grep is ambiguous.
-3. Production right now:
-
- curl -so /dev/null -w '%{http_code}\n' https://three.ws/coin-intel
-
-4. Start (or reuse) the local dev server: npm run dev (vite, port 3000).
-
-## Task: audit this one route end to end, then fix everything found
-
-Route: /coin-intel ("Coin Intelligence", section "crypto").
-Declared purpose: Every pump.fun launch watched and classified in real time: organic vs bundle, the wallets behind it, a transparent quality score, and a model that learns which signals predict winners.
-
-Drive the page in a real headless browser. Playwright is already a dev
-dependency; keep your probe script in the session scratchpad, never in the
-repo.
-
-1. Load http://localhost:3000/coin-intel. Record the HTTP status, every console
- error and warning, and every failed network request.
-2. Exercise it like a first-time user: click the primary actions, run the
- primary flow if one exists, follow the page's internal links. Every button
- must do something real; every link must resolve. If the page renders data,
- prove in the network log that it came from a live endpoint, not a baked-in
- fallback array.
-3. States: verify populated, empty, loading, and error states are designed and
- reachable. Block the page's primary fetch in Playwright and confirm an
- actionable error state appears, not a blank void or a raw exception.
-4. Responsive: render at 320, 768, and 1440 px. No horizontal page scroll, no
- overlapping or clipped controls.
-5. Accessibility basics: one h1; interactive elements are real buttons or
- links with visible focus states; images carry alt text; form fields have
- labels.
-6. Head: a specific title tag and meta description that match the declared
- purpose above.
-7. Fix every defect at its root in the page's real source files and re-run the
- probe until clean. Defects in shared modules are in scope when this route
- exercises them.
-
-## Definition of done
-
-- [ ] Local load of /coin-intel: HTTP 200, zero console errors, zero unhandled
- failed requests (a third-party outage must land in a designed fallback,
- not a broken page).
-- [ ] No dead interactive element on the page: no stub href="#", no button
- without a handler, no link to a missing path.
-- [ ] Empty, loading, error, and populated states verified.
-- [ ] 320 / 768 / 1440 px renders verified clean.
-- [ ] Title and meta description present and specific.
-- [ ] npm test passes; npm run check:rules -- --paths <touched files> exits 0.
-- [ ] Production status from step 0 recorded in the report; if production
- needs a deploy to pick up a fix, the report says so (deploys stay
- owner-gated).
-
-## Never blocked
-
-| Blocker | Resolution (act, do not ask) |
-|---|---|
-| Missing env var or credential | Check .env and .env.local, then the Cloud Run service env, then Secret Manager (the CLAUDE.md self-unblock playbook has the exact commands). If it truly exists nowhere, wire the code fully behind the env var, prove the wiring with a dry run, and name the single missing var in the report. |
-| gcloud not on PATH | Run: export PATH="$HOME/google-cloud-sdk/bin:$PATH" |
-| Dev server port 3000 busy | Another agent may be serving this repo; probe it and reuse if so. Otherwise start your own on a free port: npx vite --port 3101 |
-| Playwright browser missing | npx playwright install chromium |
-| A surface needs a signed-in user | Register a fresh account through the real /register flow against the real API and use it. Never mock the session. |
-| A defect sits in code you did not touch | Fix it if it blocks a Definition of done line (root cause it, never mask it). Otherwise note it in the report and continue. |
-| An unrelated test is red | Same rule. Never pipe npm test through tail; it masks exit codes. |
-
-## Close out (required)
-
-1. Verify every Definition of done line with the actual command output in
- front of you. Never claim a line you did not verify.
-2. Commit with explicit paths and a subject that describes the diff (house
- style: type(scope): what changed and why a reader cares).
-3. Delete this prompt file in that same commit:
-
- git rm prompts/swarm-100/route-coin-intel.md
-
- The shrinking directory is this campaign's only progress ledger; there is
- no progress log to update.
-4. Final report: what step 0 measured, what changed (file list), evidence per
- Definition of done line, and any one-line judgment calls. No trailing
- questions, no unexecuted plans.
-
-If a line genuinely cannot pass inside this session (an external party must
-respond, or an owner-gated action is the final step), finish everything else,
-leave this file in place, and state exactly which line remains and who owns
-it. Never delete this file on a partial.