---
sidebar_position: 2
title: '@zibby/core'
---

# @zibby/core

[![npm](https://img.shields.io/npm/v/@zibby/core.svg)](https://www.npmjs.com/package/@zibby/core)

The batteries — five built-in agent strategies, the runtime, and a re-export of the `@zibby/agent-workflow` engine. This is what `zibby agent new` scaffolds agents against.

```bash
npm install @zibby/core
```

## What's in it

### Built-in agent strategies

| Strategy | Backed by |
|---|---|
| `CursorAgentStrategy` | `cursor-agent` CLI |
| `ClaudeAgentStrategy` | `@anthropic-ai/claude-agent-sdk` |
| `CodexAgentStrategy` | `@openai/codex` CLI |
| `GeminiAgentStrategy` | `@google/gemini-cli` |
| `AssistantStrategy` | OpenAI Assistants API |

Importing `@zibby/core` registers all five into the `@zibby/agent-workflow` strategy registry automatically. So:

```js
import { WorkflowGraph } from '@zibby/core';

const graph = new WorkflowGraph()
  .addNode('plan', { prompt, outputSchema, agent: 'cursor' })   // already registered
  .setEntryPoint('plan');
```

### Re-exports from agent-workflow

So you can do `import { WorkflowGraph, z, AgentStrategy } from '@zibby/core'` without separately importing the engine:

- `WorkflowGraph`, `WorkflowAgent`, `Node`, `WorkflowState`
- `AgentStrategy`, `registerStrategy`, `getAgentStrategy`, `invokeAgent`
- `registerSkill`, `getSkill`, `getAllSkills`
- `compileGraph`, `validateGraphConfig`
- `timeline`, session helpers, constants

### z (Zod)

Re-exports `zod/v3` so you don't need a separate Zod dep:

```js
import { z } from '@zibby/core';

const Plan = z.object({ tasks: z.array(z.string()) });
```

### Cloud-runtime helpers

Functions used by the cloud executor and Studio integration — `ZibbyRuntime`, `StableIdRuntime`, `resolveIntegrationToken`, `cloneRepo`, `patchCursorAgentForCI`, `runPlaywrightTestTool`. Most users don't import these directly.

## When to depend on this vs. agent-workflow

| Goal | Pick |
|---|---|
| Build an agent with built-in strategies (cursor/claude/codex/gemini/assistant) | `@zibby/core` |
| Embed the engine in your own app with custom agents only | `@zibby/agent-workflow` |
| Use the CLI | `@zibby/cli` (transitively pulls both) |

## Source

- npm: [`@zibby/core`](https://www.npmjs.com/package/@zibby/core)
