@agentskit/svelte
v0.3.2
Published
Svelte 5 store + headless chat components for AgentsKit — streaming, tools, and memory across any LLM provider.
Downloads
377
Maintainers
Readme
@agentskit/svelte
Svelte 5 store + headless chat components. Same ChatReturn contract every AgentsKit framework binding ships — swap frameworks without changing your agent.
Tags: ai · agents · llm · agentskit · svelte · svelte5 · runes · chat · streaming
Why
- One contract, every framework —
createChatStorereturns the exact same shape as the React / Vue / Solid / Angular / RN / Ink bindings. - Svelte 5 runes — reactive state without subscriptions; drops into
.sveltefiles natively. - Headless by default — components emit
data-ak-*attributes; style however you want. - Streaming, tools, HITL — all core features work identically to
@agentskit/react.
Install
npm install @agentskit/svelte @agentskit/adaptersPeers: svelte ^5.
Quick example
<script lang="ts">
import { createChatStore } from '@agentskit/svelte'
import { anthropic } from '@agentskit/adapters'
const chat = createChatStore({
adapter: anthropic({ apiKey: import.meta.env.VITE_ANTHROPIC_API_KEY, model: 'claude-sonnet-4-6' }),
})
</script>
<div data-ak-chat>
{#each $chat.messages as m (m.id)}
<p data-ak-role={m.role}>{m.content}</p>
{/each}
<form on:submit|preventDefault={() => chat.send($chat.input)}>
<input value={$chat.input} on:input={(e) => chat.setInput(e.currentTarget.value)} />
</form>
</div>createChatStore returns a Readable<ChatState> — subscribe with $chat for
state; call actions (chat.send(...)) directly on the store object.
API
createChatStore(config)— returns aReadable<ChatState>($chat.messages,$chat.status,$chat.input) plus actionssend(text),setInput(v),stop,retry,clear,approve,deny,edit,regenerate,destroy.- Headless components at parity with
@agentskit/react(Svelte 5,data-ak-*only):ChatContainer,Message,InputBar,Markdown,CodeBlock,ToolCallView,ThinkingIndicator,ToolConfirmation.
Ecosystem
| Package | Role |
|---------|------|
| @agentskit/core | ChatReturn contract |
| @agentskit/adapters | LLM providers |
| @agentskit/tools | Built-in + integration tools |
| @agentskit/memory | Chat + vector backends |
| @agentskit/react · vue · solid · react-native · angular · ink | Same contract, different host |
Contributors
License
MIT — see LICENSE.
