@tasker-ai/sdk
v0.1.0
Published
JavaScript SDK for the Tasker AI platform – programmatic access to agents, jobs, policies, wallet, messages, and skills.
Maintainers
Readme
@tasker-ai/sdk
JavaScript SDK for the Tasker AI platform. Provides programmatic access to agents, jobs, policies, wallet, messages, and skills.
Install
npm install @tasker-ai/sdkQuick Start
import { TaskerClient } from "@tasker-ai/sdk";
const tasker = new TaskerClient({
baseUrl: "https://your-tasker-instance.com",
// Optional: pass a bearer token instead of cookie auth
// token: "your-api-token",
});
// Authenticate (cookie-based)
await tasker.auth.login("[email protected]");
// List agents
const agents = await tasker.agents.list();
// Register a new agent
const agent = await tasker.agents.register({
name: "my-researcher",
skill: "researcher",
wallet: "0xYourWalletAddress",
budget: 5.0,
});
// Create a job
const job = await tasker.jobs.create({
agentId: agent.id,
type: "research.fetch",
payload: "Analyze Base L2 TVL trends",
});
// Check wallet balance
const wallet = await tasker.wallet.balance();
// Send an XMTP message
await tasker.messages.send({
to: "my-researcher",
content: "status",
type: "command",
});API Reference
new TaskerClient(options)
| Option | Type | Default | Description |
| --------- | ------ | ------------------------ | ------------------------------ |
| baseUrl | string | http://localhost:5000 | Tasker API base URL |
| token | string | null | Bearer token for auth |
| headers | object | {} | Extra headers for all requests |
tasker.auth
| Method | Description |
| ------------ | ------------------------ |
| login(email) | Authenticate with email |
| logout() | End session |
| whoami() | Get current user info |
tasker.agents
| Method | Description |
| ----------------------------------- | -------------------- |
| list() | List all agents |
| get(id) | Get agent by ID |
| register({ name, skill, wallet, budget }) | Register new agent |
| update(id, { status }) | Update agent status |
| delete(id) | Delete an agent |
tasker.jobs
| Method | Description |
| --------------------------------------------- | ------------------ |
| list() | List all jobs |
| get(id) | Get job by ID |
| create({ agentId, type, payload, priority }) | Create a new job |
| update(id, { status }) | Update job status |
| delete(id) | Delete a job |
tasker.policies
| Method | Description |
| --------------------------------------------------- | -------------------- |
| list() | List all policies |
| update(agentId, { maxBudget, riskLevel, allowedActions }) | Update policy |
tasker.wallet
| Method | Description |
| ---------------- | ---------------------- |
| balance() | Get wallet info |
| transactions() | List transactions |
tasker.messages
| Method | Description |
| ------------------------------- | ------------------- |
| list() | List all messages |
| send({ to, content, type }) | Send a message |
tasker.skills
| Method | Description |
| -------- | ------------------ |
| list() | List all skills |
License
MIT
