Metadata-Version: 2.4
Name: nightshift-sdk
Version: 0.2.0
Summary: Nightshift — autonomous agent orchestrator with Firecracker VMs
Project-URL: Homepage, https://nightshift.sh
Project-URL: Documentation, https://docs.nightshift.sh
Project-URL: Repository, https://github.com/tensor-ninja/nightshift
Project-URL: Issues, https://github.com/tensor-ninja/nightshift/issues
Author: Nightshift Contributors
License: Apache-2.0
License-File: LICENSE
Keywords: agents,ai,claude,firecracker,microvm,orchestrator
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.12
Requires-Dist: aiosqlite>=0.22.1
Requires-Dist: anthropic
Requires-Dist: claude-agent-sdk
Requires-Dist: click
Requires-Dist: fastapi
Requires-Dist: httpx
Requires-Dist: httpx-sse
Requires-Dist: sse-starlette
Requires-Dist: tomli-w
Requires-Dist: uvicorn
Description-Content-Type: text/markdown

# Nightshift

Autonomous agent orchestrator with Firecracker VM isolation.

Nightshift runs AI agents in isolated [Firecracker](https://firecracker-microvm.github.io/) microVMs on bare-metal infrastructure. Each agent gets its own VM with a dedicated filesystem, network, and resource limits — so agents can execute code, edit files, and make network calls without affecting the host or each other.

## Installation

```bash
uv add nightshift-sdk
```

or

```bash
pip install nightshift-sdk
```

## Quick Start

Define an agent with `NightshiftApp` and `AgentConfig`:

```python
from nightshift import NightshiftApp, AgentConfig
from claude_agent_sdk import query, ClaudeAgentOptions

app = NightshiftApp()

@app.agent(
    AgentConfig(
        workspace="./my-project",
        vcpu_count=2,
        mem_size_mib=2048,
        timeout_seconds=1800,
    )
)
async def code_reviewer(prompt: str):
    async for message in query(
        prompt=prompt,
        options=ClaudeAgentOptions(
            cwd="/workspace",
            allowed_tools=["Read", "Glob", "Grep"],
            model="claude-sonnet-4-6",
        ),
    ):
        yield message
```

Deploy to a Nightshift platform:

```bash
nightshift login --url https://api.nightshift.sh
nightshift deploy agent.py
nightshift run code_reviewer --prompt "Review the auth module for security issues"
```

Or run locally on a machine with Firecracker:

```bash
nightshift run code_reviewer agent.py --prompt "Review the auth module"
```

## AgentConfig

| Parameter | Default | Description |
|-----------|---------|-------------|
| `workspace` | `""` | Host directory to mount into the VM at `/workspace` |
| `vcpu_count` | `2` | Number of vCPUs allocated to the VM |
| `mem_size_mib` | `2048` | Memory in MiB allocated to the VM |
| `timeout_seconds` | `1800` | Maximum agent execution time (30 min default) |
| `forward_env` | `[]` | Environment variables to forward from host |
| `env` | `{}` | Static environment variables set in the VM |

## Documentation

Full documentation at [docs.nightshift.sh](https://docs.nightshift.sh).

## License

Apache 2.0 — see [LICENSE](LICENSE).
