Metadata-Version: 2.4
Name: waken-copilot
Version: 0.1.0
Summary: GitHub Copilot Target adapter for Waken — routes waken Events to the copilot CLI.
Project-URL: Homepage, https://github.com/WakenHQ/waken-copilot
Project-URL: Repository, https://github.com/WakenHQ/waken-copilot
Project-URL: Issues, https://github.com/WakenHQ/waken-copilot/issues
Author: Waken contributors
License: MIT
License-File: LICENSE
Keywords: agents,ai,copilot,github,waken
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.12
Requires-Dist: waken>=0.1.0
Provides-Extra: dev
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# waken-copilot

[![CI](https://github.com/WakenHQ/waken-copilot/actions/workflows/ci.yml/badge.svg)](https://github.com/WakenHQ/waken-copilot/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-lightgrey)](https://github.com/WakenHQ/waken-copilot/blob/main/LICENSE)

GitHub Copilot [Target adapter](https://github.com/WakenHQ/waken) for
[Waken](https://github.com/WakenHQ/waken) — "nginx for AI agents." Routes a
waken `Event` to the [Copilot CLI](https://github.com/github/copilot-cli)
(`@github/copilot`) and wraps its output back into a `Response`.

## Status: less mature than its siblings — read this before using it

Unlike `waken-claude` (wraps `claude_agent_sdk`) and `waken-gemini` (wraps
`google-genai`), GitHub does not publish a documented request/response HTTP
SDK for third-party programmatic use of Copilot. The only real integration
point is GitHub's own terminal coding agent, the `copilot` CLI — so this
adapter shells out to it as a subprocess rather than calling an API. Two
concrete consequences:

- **Session resumption is unverified.** This adapter tracks "has this waken
  session talked to `copilot` before" and passes the waken `session_id`
  back via `--resume` on later turns, but there is no confirmed mechanism
  for getting a real, provider-issued conversation id out of the CLI's
  output the way `waken_claude` gets one from the Claude Agent SDK. Treat
  multi-turn continuity through this adapter as unverified, not solved.
- **No CI integration testing against the real CLI.** `copilot`
  authenticates via an interactive OAuth device flow (or an existing
  `gh auth login` session) — there's no static API key to hand to CI the
  way `ANTHROPIC_API_KEY`/`GEMINI_API_KEY` work for its siblings. This
  package's test suite mocks `asyncio.create_subprocess_exec` entirely; no
  test here has ever run a real `copilot` process.

The CLI itself is also young and its flags move quickly — `-p`,
`--allow-all-tools`, and `--resume <id>` are this adapter's best-known
reading of `copilot --help` as of this writing, not a guarantee. Check
`copilot --help` yourself before depending on this in production.

## Install

```bash
pip install waken-copilot
```

Prerequisite: the `copilot` CLI must already be installed and authenticated
on the machine running Waken — this adapter does not manage authentication
itself.

```bash
npm install -g @github/copilot
copilot   # first run: interactive OAuth device-flow login
          # (or reuse an existing `gh auth login` session)
```

## Usage

```python
from waken import Runtime
from waken_copilot import CopilotAdapter

runtime = Runtime()
runtime.target("copilot", CopilotAdapter())
runtime.run()
```

```bash
waken send copilot "Build tic tac toe." --wait
```

## Development

```bash
git clone https://github.com/WakenHQ/waken-copilot
cd waken-copilot
pip install -e ".[dev]"
pytest
```

Tests mock the `copilot` subprocess call — no `copilot` binary or network
access is required to run them.

## License

[MIT](https://github.com/WakenHQ/waken-copilot/blob/main/LICENSE)
