Metadata-Version: 2.4
Name: agent-launch
Version: 0.1.0
Summary: Draft platform-native release announcements (HN, Reddit, X, Mastodon, LinkedIn) from CHANGELOG + README (Python port of @p-vbordei/agent-launch)
Project-URL: Homepage, https://github.com/p-vbordei/agent-launch-py
Project-URL: Reference, https://github.com/p-vbordei/agent-launch
Project-URL: Issues, https://github.com/p-vbordei/agent-launch-py/issues
Author-email: Vlad Bordei <bordeivlad@gmail.com>
License: Apache-2.0
License-File: LICENSE
Keywords: changelog,cli,linkedin,mastodon,open-source,reddit,release-announcements,release-notes,show-hn,twitter
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Requires-Dist: anthropic>=0.40
Requires-Dist: pydantic>=2.6
Requires-Dist: pyyaml>=6.0
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
Description-Content-Type: text/markdown

# agent-launch (Python)

[![CI](https://github.com/p-vbordei/agent-launch-py/actions/workflows/ci.yml/badge.svg)](https://github.com/p-vbordei/agent-launch-py/actions/workflows/ci.yml)
[![Spec](https://img.shields.io/badge/spec-v0.1-blue)](./SPEC.md)
[![License](https://img.shields.io/badge/license-Apache%202.0-green)](./LICENSE)

> **Idiomatic Python port of [@p-vbordei/agent-launch](https://www.npmjs.com/package/@p-vbordei/agent-launch).** Draft platform-native release announcements (HN, Reddit, X, Mastodon, LinkedIn) from your repo's CHANGELOG + README. v0.1: drafts only — you post. Output is **textually identical** to the TS reference when given the same inputs.

## What's in the box

- `draft_one(platform, project, context, repo, anthropic)` — produce a platform-tuned post draft
- Platforms: `hn`, `reddit`, `x`, `mastodon`, `linkedin`
- `gather_context(cwd, version)` — collect CHANGELOG section + README + recent commits
- `load_launch_config(path)` — strict pydantic-validated `launch.yaml`
- CLI: `agent-launch draft <version> [--platforms hn,x] [--out drafts/]`
- Strict input validation — no surprises in output

## Install

```bash
pip install agent-launch
# or
uv add agent-launch
```

## Quickstart

CLI (run inside any repo with a CHANGELOG.md, README.md, and `launch.yaml`):

```bash
cp launch.yaml.example launch.yaml && $EDITOR launch.yaml
ANTHROPIC_API_KEY=... agent-launch draft 0.2.0
# → launches/v0.2.0/{hn,reddit-*,x,mastodon,linkedin}.md
```

Library (offline — uses a scripted fake Anthropic client):

```bash
python examples/quickstart.py
```

See [`examples/quickstart.py`](examples/quickstart.py) for the 40-line walkthrough.

## How it relates

| Repo | Lang | Install |
|---|---|---|
| [`agent-launch`](https://github.com/p-vbordei/agent-launch) | TypeScript (reference) | `npm i -g @p-vbordei/agent-launch` |
| [`agent-launch-py`](https://github.com/p-vbordei/agent-launch-py) | Python (this repo) | `pip install agent-launch` |
| [`agent-launch-rs`](https://github.com/p-vbordei/agent-launch-rs) | Rust | `cargo install agent-launch` |

All three share the same `launch.yaml` schema, the same vendored prompt templates, and the same conformance clauses.

## Conformance

```bash
uv sync --extra dev
uv run pytest -v
```

The TS reference defines five conformance clauses (see [SPEC.md](./SPEC.md) §6). All pass here:

- **C1 — Determinism.** Same inputs → same output (with `temperature=0` and a scripted client, byte-identical).
- **C2 — Length caps.** Per-platform caps enforced with up to 2 retries; over-cap drafts marked `capped: false`.
- **C3 — Repo URL.** Every draft body contains the GitHub URL.
- **C4 — No secrets / declared fields only.** Env-var values are never echoed; `DraftResult` exposes only declared fields.
- **C5 — Strict `launch.yaml`.** Missing/extra/invalid fields fail fast with a clear error.

Plus security clauses **S2** (no `tools` field in the Anthropic call — model has no shell access), **S4** (no sockets opened during drafting with a scripted client), **S5** (`--out` sandboxed under cwd).

## Architecture

See [docs/architecture.md](docs/architecture.md).

## Development

```bash
git clone https://github.com/p-vbordei/agent-launch-py
cd agent-launch-py
uv sync --extra dev
uv run pytest -v
```

## License

Apache-2.0
