open-index/open-npm huggingface dataset:
npm package: @syi0808/client
Description: Client SDK for Aiki - connect to the server, start workflows, and manage execution
Latest version: 0.26.6

# @syi0808/client

Client SDK for Aiki durable execution platform.

## Installation

```bash
npm install @syi0808/client
```

## Quick Start

```typescript
import { client } from "@syi0808/client";
import { orderWorkflowV1 } from "./workflows.ts";

const aikiClient = client({
	url: "http://localhost:9850",
	apiKey: "your-api-key",
});

// Start a workflow
const handle = await orderWorkflowV1.start(aikiClient, {
	orderId: "order-123",
});

// Wait for completion
const result = await handle.waitForStatus("completed");
```

## Features

- **Server Connection** - Connect to the Aiki server via HTTP
- **Workflow Management** - Start workflows with type-safe inputs
- **Context Injection** - Pass application context to workflows
- **Custom Logging** - Plug in your own logger

## Documentation

For comprehensive documentation including configuration options and context injection, see the [Client Guide](https://github.com/aikirun/aiki/blob/main/docs/core-concepts/client.md).

## Related Packages

- [@syi0808/workflow](https://www.npmjs.com/package/@syi0808/workflow) - Define workflows and tasks
- [@syi0808/worker](https://www.npmjs.com/package/@syi0808/worker) - Execute workflows

## License

Apache-2.0
npm package: @syi0808/worker
Description: Worker SDK for Aiki - execute workflows and tasks with durable state management and automatic recovery
Latest version: 0.26.6

# @syi0808/worker

Worker SDK for Aiki durable execution platform.

## Installation

```bash
npm install @syi0808/worker
```

## Quick Start

```typescript
import { worker } from "@syi0808/worker";
import { client } from "@syi0808/client";
import { orderWorkflowV1 } from "./workflows.ts";

const aikiClient = client({
	url: "http://localhost:9850",
	apiKey: "your-api-key",
});

const aikiWorker = worker({
	workflows: [orderWorkflowV1],
});

const handle = await aikiWorker.spawn(aikiClient);

// Graceful shutdown
process.on("SIGTERM", async () => {
	await handle.stop();
	process.exit(0);
});
```

## Features

- **Horizontal Scaling** - Run multiple workers to share workload
- **Automatic Recovery** - Resume from failures without losing progress
- **Heartbeat Monitoring** - Detect and recover stuck workflows
- **Graceful Shutdown** - Complete active work before stopping
- **Sharding** - Route workflows to specific workers
- **Pluggable Subscribers** - Swap work discovery transport (DB polling default, Redis Streams via `@syi0808/redis`, or bring your own)

## Documentation

For comprehensive documentation including scaling strategies, configuration options, and how workers operate, see the [Workers Guide](https://github.com/aikirun/aiki/blob/main/docs/core-concepts/workers.md).

## Related Packages

- [@syi0808/client](https://www.npmjs.com/package/@syi0808/client) - Connect to Aiki server
- [@syi0808/workflow](https://www.npmjs.com/package/@syi0808/workflow) - Define workflows and tasks

## License

Apache-2.0