aiskin-core
v0.6.1
Published
Typed client, SSE stream parser and Blocks protocol for the WRKS AI Agent API v2. Zero dependencies.
Maintainers
Readme
aiskin-core
Typed client, SSE stream parser and Blocks protocol for the WRKS AI Agent API v2. Zero dependencies, works in browsers, Node 18+, Workers.
Part of AIskin — beautiful ready-made UI for WRKS agents. AIskin is an independent SDK, not an official wrks.ai product.
npm install aiskin-coreQuick start (server-side)
import { AiSkinClient } from 'aiskin-core';
const client = new AiSkinClient({ apiKey: process.env.WRKS_API_KEY });
const agents = await client.listAgents();
const stream = await client.chatStream({ agentId: agents[0].id, message: '연차 규정 알려줘' });
const final = await stream.collect((state) => process.stdout.write('.'));
console.log(final.text); // full answer (markdown)
console.log(stream.chatId); // continue the conversation with thisBrowser use
Never ship your API key to the browser. Point baseUrl at your aiskin-proxy mount instead:
const client = new AiSkinClient({ baseUrl: '/api/aiskin' });What's inside
AiSkinClient—listAgents,getAgent,chat,chatStream,uploadFile,getFileUrlparseSSEStream/MessageAccumulator— AI-SDK-style stream parts (text-delta,reasoning-delta, tool parts…) folded into a renderable message; unknown part types pass through (forward compatible)parseBlocks/briefingPrompt— the AIskin Blocks protocol: ask an agent to answer as structured JSON (KPIs, charts, tables, insights) and parse it safelyrenderMarkdown— dependency-free, escape-first markdown renderer for streaming chat
MIT © AIskin
