@agentskit/svelte
v0.5.3
Published
Svelte 5 store + headless chat components for AgentsKit — streaming, tools, and memory across any LLM provider.
Maintainers
Readme
@agentskit/svelte
Profile: concise-package
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
Verified proof
- Package metadata and tests live under
packages/svelte/. - Package guide: https://www.agentskit.io/docs/reference/packages/svelte
- Stability map: docs/STABILITY.md
How this fits the ecosystem
@agentskit/svelte brings the shared AgentsKit chat contract to Svelte 5 stores and headless chat components.
- AgentsKit: compose it with the other packages in this repo to build agents from small, swappable parts.
- Registry: look for ready agents and templates that already use this layer at registry.agentskit.io.
- Playbook: learn the production patterns behind this layer at playbook.agentskit.io.
- AKOS: run the same concepts with enterprise deployment, governance, and observability at akos.agentskit.io.
Docs: package guide · agent handoff
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. Calldestroy()fromonDestroy(or equivalent); it unsubscribes and stops in-flight work, and is safe to call repeatedly.- Headless components at parity with
@agentskit/react(Svelte 5,data-ak-*only):ChatContainer,Message,InputBar(blocks submit/Enter while streaming),Markdown,CodeBlock,ToolCallView(aria-expandedon the toggle),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.
Docs
Quick start
import '@agentskit/svelte'
console.log('@agentskit/svelte loaded')Maturity and compatibility
- Stability: beta — see docs/STABILITY.md
- Node.js 20+ and TypeScript strict mode
- Published as
@agentskit/svelte
Contributing
See CONTRIBUTING.md and the monorepo LICENSE.
