Metadata-Version: 2.5
Name: ai-hats-cline
Version: 0.5.0
Summary: Cline surface plugin for the ai-hats framework — registers the `cline` CLI as an ai-hats provider via the `ai_hats.providers` entry point.
Project-URL: Homepage, https://github.com/muratovv/ai-hats
Project-URL: Repository, https://github.com/muratovv/ai-hats
Project-URL: Changelog, https://github.com/muratovv/ai-hats/blob/master/packages/surfaces/cline/CHANGELOG.md
Author-email: muratovv <f@muratovv.me>
License-Expression: MIT
License-File: LICENSE
Keywords: agent,ai-hats,cline,llm,provider,surface
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: ai-hats-observe>=0.6.0
Requires-Dist: ai-hats>=0.15.0
Requires-Dist: filelock>=3.0
Description-Content-Type: text/markdown

# ai-hats-cline

A **Cline surface plugin** for the [ai-hats](https://github.com/muratovv/ai-hats)
framework. It registers the [`cline`](https://cline.bot) CLI as a first-class
ai-hats **provider** through the `ai_hats.providers` entry point, so ai-hats
discovers it with zero edits to `src/ai_hats/**` (the T10 IoC seam, HATS-870).

Install it alongside `ai-hats` and `cline` appears next to the built-ins:

```console
$ ai-hats list providers
  agy     →  GEMINI.md
  claude  →  (session cache)
  cline   →  (session cache)
```

(The right-hand column is where the role reaches the surface from. Only agy has
a project-root file; claude and cline receive the composition from the
per-session cache and write nothing to the root.)

Then compose any role onto cline:

```console
$ ai-hats -p cline -r <role>          # HITL: launches an interactive cline TUI
```

## What it owns

- **`ClineProvider`** — the `ai_hats.providers.Provider` adapter for `cline`:
  - the composed role reaches cline **inline** via `-s "<role>"` (no static
    `CLINE.md` — `update_system_prompt` is a no-op);
  - HITL launches the interactive TUI (`cline -i`); the automate path runs
    headless (`cline --yolo --json "<prompt>"`);
  - `--worktree` is never passed (ai-hats-wt owns isolation);
  - the role's skills are materialized into the **per-session cache**
    (`<cache_root>/sessions/<sid>/skills` — outside the project, default
    `~/.cache/ai-hats/<project-key>/`, HATS-1398) and delivered to cline via
    `--config <cache>` (cline scans `<base>/skills`) — nothing lands in the
    project root (clean-root invariant, HATS-1171). `CLINE_DATA_DIR` is pinned
    to the real cline home so `--config` keeps the machine's auth.
- **`ClineParser` + `resolve_transcript`** — cline's
  `~/.cline/data/sessions/<id>/<id>.messages.json` is discovered by the
  provider and parsed into a real `audit.md` (👤/👾 turn markers) and
  `usage.json` (token metrics), so `reflect` gets a factual layer for cline
  sessions (HATS-960, HATS-1087).

## Requirements

- `cline` v3.x on `PATH`, authenticated (`cline auth`).
- `ai-hats` (this plugin depends on the integrator for the `Provider` ABC, per
  ADR-0014).

## Not yet here

- Runtime bash-tool hooks: cline's TS plugin sandbox needs `jiti` (unbundled),
  so ai-hats ships no plugin — guarding falls to `SurfaceGuard`. A native
  `hooks.json` guard (no jiti) is tracked in HATS-1083.
- cline `teams`/`spawn`, and PyPI publish.
