molykit_skill

This skill helps you build cross-platform AI chat interfaces with Makepad using MolyKit, offering ready-made widgets, BotClient, and SSE streaming.
  • Shell

715

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill zhanghandong/makepad-skills --skill molykit

  • llms.txt23.0 KB
  • SKILL.md9.9 KB

Overview

This skill documents MolyKit, a cross-platform AI chat toolkit for building chat interfaces with Makepad. It focuses on integrating LLM providers, streaming responses, and reusable widgets so you can ship native and WASM chat apps with a single codebase. The guidance emphasizes safe async patterns, widget lifecycles, and protocol types for robust chat UX.

How this skill works

MolyKit exposes platform-agnostic primitives (PlatformSend, spawn, ThreadToken) and widget components (Chat, Messages, PromptInput, Avatar) to coordinate async LLM calls and UI updates. A BotClient trait standardizes streaming send/bots APIs and works with SSE parsing to incrementally stream message content into Messages widgets. Utility types (AbortOnDropHandle, Slot, BotContext) manage task cancellation, runtime content replacement, and shared client state between UI and background tasks.

When to use it

  • Building chat UIs with Makepad for native and WASM targets
  • Integrating OpenAI or other LLMs that support SSE streaming
  • Implementing streaming, incremental AI responses in a message list
  • Managing cross-platform async tasks and non-Send values on WASM
  • Providing custom avatar, attachment, or content widgets from providers

Best practices

  • Prefer PlatformSend and spawn() so code runs on native and WASM without conditional forks
  • Wrap cancellable work with AbortOnDropHandle so tasks stop when widgets are dropped
  • Use ThreadToken to store non-Send data safely for WASM and access it inside spawned tasks
  • Expose provider-specific UI via Slot so clients can replace or restore runtime content
  • Use BotContext to load and cache bots for synchronous UI reads and background refreshes
  • Parse SSE into a stream and emit incremental MessageContent to support progressive rendering

Example use cases

  • A chat client that streams OpenAI completions into the Messages view using SSE and parse_sse
  • Embedding provider-supplied custom content widgets into message slots (images, charts, tool results)
  • A PromptInput widget that toggles send/stop icons while the send task runs and cancels on widget drop
  • Storing a non-Send browser-only resource in a ThreadToken and accessing it from background tasks
  • A BotClient implementation for a private LLM endpoint exposing bots() and streamed send() results

FAQ

Use AbortOnDropHandle to wrap the send future; dropping the widget clears the handle and aborts the task.

Can the same code run on native and WASM without change?

Yes. Use PlatformSend, spawn(), and ThreadToken patterns so tasks and non-Send values behave correctly across targets.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
molykit skill by zhanghandong/makepad-skills | VeilStrat