JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q49059F
  • License MIT

An autonomous coding agent for building AI-powered development tools. The name "Hataraku" (働く) means "to work" in Japanese.

Package Exports

  • hataraku

Readme

Hataraku

An autonomous coding agent and SDK for building AI-powered tools. The name "Hataraku" (働く) means "to work" in Japanese.

npm version License: MIT

Description

Hataraku is a powerful toolkit that enables the creation of AI-powered development tools and autonomous coding agents. It provides a flexible SDK and CLI for building intelligent development workflows, code analysis, and automation tasks.

Key Features

  • 🤖 Autonomous coding agent capabilities
  • 🛠️ Extensible SDK for building AI-powered tools
  • 📦 Support for multiple AI providers (OpenRouter, Claude, Amazon Bedrock)
  • 🔄 Workflow automation and parallel task execution
  • 📊 Schema validation and structured tasks
  • 🧰 Built-in tool integration system
  • 🔗 Model Context Protocol (MCP) support
  • 🔄 Extends the powerful AI SDK from Vercel.

Installation

# Using npm
npm install -g hataraku

# Using yarn
yarn global add hataraku

# Using pnpm
pnpm global add hataraku

Quick Start

SDK Usage

// Import the SDK
import { createAgent, createTask } from 'hataraku';
import { z } from 'zod';

// Import provider creation functions
import { createOpenRouterModel, createAnthropicModel } from 'hataraku';

// Set up credentials (alternatively, use environment variables)
// - OPENROUTER_API_KEY for OpenRouter
// - ANTHROPIC_API_KEY for direct Anthropic access
// - BEDROCK_ACCESS_KEY_ID and BEDROCK_SECRET_ACCESS_KEY for Amazon Bedrock

// Create an agent using Claude via OpenRouter
// You can pass API key directly or use environment variable
const model = await createOpenRouterModel('anthropic/claude-3-opus-20240229', process.env.OPENROUTER_API_KEY);
const agent = createAgent({
  name: 'MyAgent',
  description: 'A helpful assistant',
  role: 'You are a helpful assistant that provides accurate information.',
  model: model
});

// Run a one-off task
const result = await agent.task('Create a hello world function');

// Create a simple reusable task with schema validation
const task = createTask({
  name: 'HelloWorld',
  description: 'Say Hello to the user',
  agent: agent,
  inputSchema: z.object({ name: z.string() }),
  task: ({name}) => `Say hello to ${name} in a friendly manner`
});

// Execute the task
const result = await task.run({name: 'Hataraku'});
console.log(result);

CLI Usage

First, install the CLI globally:

npm install -g hataraku

Initialize a new project:

hataraku init my-project
cd my-project

Run a task using the CLI:

# Run a predefined task
hataraku task run hello-world

# Run with custom input
hataraku task run hello-world --input '{"prompt": "Write a function that calculates factorial"}'

# Run with streaming output
hataraku task run hello-world --stream

Configure providers and explore available commands:

# Configure a provider
hataraku provider configure openrouter

# List all available commands
hataraku --help

API Overview

Hataraku provides several core components:

  • Task: Create and execute AI-powered tasks
  • Agent: Build autonomous coding agents
  • Workflow: Orchestrate complex multi-step operations
  • Tools: Integrate custom capabilities and external services

For detailed API documentation, see the Types Documentation.

Documentation

Examples

The package includes various examples in the /examples directory demonstrating different features:

  • Basic task execution
  • Streaming responses
  • Schema validation
  • Multi-step workflows
  • Tool integration
  • Thread management

These examples are available for reference in the repository and can be examined to understand different use cases and implementation patterns.

See the examples README for more details.

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

MIT License - see the LICENSE file for details.

Support