@skopiklabs/client
v0.2.0
Published
Skopik TypeScript SDK — typed client for the Skopik agent control plane API.
Readme
@skopiklabs/client
TypeScript SDK for the Skopik agent control plane.
import { createSkopikClient } from '@skopiklabs/client'
const skopik = createSkopikClient({
baseUrl: 'https://api.skopik.com/api/v1',
apiKey: process.env.SKOPIK_API_KEY,
})The SDK exposes camelCase TypeScript types at the boundary and translates to the API's snake_case wire format. Every resource lives under a nested accessor:
await skopik.agents.create({ /* … */ })
await skopik.agents.templates.create({ /* … */ })
await skopik.sessions.open({ agent: 'agent_123', prompt: 'Prepare a concise release draft.' })Resources
| Accessor | What it manages |
| --- | --- |
| skopik.agents | Agents. Nested: .templates, .brain (.snapshots), .email, .skills |
| skopik.skills | The reusable skill catalog |
| skopik.sessions | Agent work: open, continue, send, stream, inspect, and cancel |
| skopik.automations | Scheduled / event-triggered sessions |
| skopik.runs | Runtime executor wire for serving sessions on Remotes |
| skopik.files | File uploads, downloads, indexing, summaries |
| skopik.search | Semantic and reference search |
| skopik.remotes | Remote compute mounts |
| skopik.apiKeys | API key management |
skopik.me() returns the authenticated caller (whoami). Workspace and identity
surfaces — auth/sessions, the user directory, orgs, onboarding, waitlist, admin —
are first-party and live in the internal, unpublished @skopik/client-internal
package, whose SkopikInternalClient extends this client.
Agents
const { agent, activeBrainSnapshot } = await skopik.agents.create({
name: 'Release Helper',
description: 'Prepares release notes and follows deployment checklists.',
status: 'active',
defaultModelId: 'gpt-5',
canWrite: true,
dailyBudgetUsd: 20,
})
await skopik.agents.brain.writeFile(agent.agentId, 'AGENTS.md', {
content: '# Release Helper\n\nYou prepare release notes and checklist updates.',
})
await skopik.agents.brain.snapshots.publish(agent.agentId, activeBrainSnapshot.snapshotId, {
label: 'Initial release brain',
})Templates and skills
Templates are reusable agent blueprints; skills are reusable capability
packages. Agent templates hang off agents.templates.
// Author an agent template, add a brain file to its draft, publish it.
const { template } = await skopik.agents.templates.create({
name: 'Support Triage',
description: 'Triages inbound support email and drafts replies.',
tags: ['support'],
})
await skopik.agents.templates.files.write(template.templateId, 'AGENTS.md', {
content: '# Support Triage\n\nYou triage inbound support requests.',
})
await skopik.agents.templates.publish(template.templateId)
// Spin up a new agent from a template.
const { agent } = await skopik.agents.templates.use(template.templateId, {
name: 'Support Bot',
})
// Browse and install skills.
const { data: skills } = await skopik.skills.list({ tag: 'email' })
await skopik.agents.skills.install(agent.agentId, { skillId: skills[0]!.skillId })Sessions
const result = await skopik.run({
agent: agent.agentId,
prompt: 'Summarize the shipped API and SDK changes into launch notes.',
waitTimeoutMs: 5 * 60_000,
})
console.log(result.text)For detached execution, open a session directly and attach to its resumable stream:
const { session } = await skopik.sessions.open({
agent: agent.agentId,
prompt: 'Prepare a concise release draft.',
})
for await (const frame of skopik.sessions.stream(session.sessionId)) {
console.log(frame.chunk)
}For recurring work, use skopik.automations (schedule- or event-triggered).
Files
const upload = await skopik.files.createUploadUrl({
scope: 'agent',
scopeId: agent.agentId,
area: 'brain',
brainSnapshotId: activeBrainSnapshot.snapshotId,
path: 'references/release-checklist.md',
contentType: 'text/markdown',
})
await fetch(upload.uploadUrl, {
method: 'PUT',
headers: upload.uploadHeaders,
body: '# Release checklist\n',
})
await skopik.files.finalize(upload.file.fileRefId)Pagination
Current v1 list routes return one page in { data }. The exported paginate
helper also follows page.nextCursor when a route exposes it.
import { paginate } from '@skopiklabs/client'
for await (const agent of paginate((params) => skopik.agents.list(params), { limit: 50 })) {
console.log(agent.agentId, agent.name)
}