Metadata-Version: 2.4
Name: aop-launcher
Version: 0.0.3.dev0
Summary: Lightweight launcher for local AI agent workflows
Author: aone
License-Expression: MIT
Keywords: agents,llm,workflow,yaml,terminal
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: PyYAML>=6.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"

# aop_launcher

Agent Orchestration Platform Launcher.

`aop_launcher` is a tiny terminal runner for local AI agent workflows. It reads
a YAML file, runs agents in sequence, optionally runs local shell tools for each
agent, sends the prompt to either a local command or an OpenAI-compatible chat
completion endpoint, and streams the result to the terminal.

This first `0.0.1.dev0` release is intentionally small. It does not provide
remote execution, scheduling, retries, memory stores, or a hosted service.

## Install

```bash
pip install aop-launcher
```

## OpenAI-compatible workflow

Use this with local or hosted inference servers that expose
`/v1/chat/completions`:

```yaml
llm:
  provider: openai-compatible
  base_url: "https://api.openai.com/v1"
  api_key_env: "OPENAI_API_KEY"
  model: "gpt-5.4-mini"
  temperature: 0.2
  max_completion_tokens: 800

agents:
  - name: assistant
    system: "You are a concise, practical assistant."
    prompt: |
      Answer this request:
      {input}
```

Run it:

```bash
aop-launcher workflow.yml "Draft a release checklist"
```

Common endpoint settings can be overridden from the terminal:

```bash
aop-launcher workflow.yml "hello" \
  --base-url https://api.openai.com/v1 \
  --model gpt-5.4-mini \
  --api-key-env OPENAI_API_KEY
```

If neither `api_key` nor `api_key_env` is configured, no `Authorization` header
is sent.

## Command workflow

```yaml
llm:
  command: "ollama run llama3.2"

tools:
  now: "date"

agents:
  - name: planner
    tools: ["now"]
    prompt: |
      Create a short plan for this task:
      {input}

      Tool results:
      {tool_results}

  - name: writer
    prompt: |
      Write the final answer from this plan:
      {input}
```

Run it:

```bash
aop-launcher workflow.yml "Draft a release checklist"
```

You can also pass the LLM command from the terminal:

```bash
aop-launcher workflow.yml "hello" --llm-command "ollama run llama3.2"
```

## Prompt variables

Agent `system` and `prompt` templates can use:

- `{input}`: previous agent output, or the initial terminal input for the first
  agent.
- `{initial_input}`: original terminal input.
- `{tool_results}`: output from shell tools configured on the current agent.
- `{history}`: prior agent outputs with agent names.

## JSON output

Set `output_format: json` on an agent to require valid JSON output:

```yaml
agents:
  - name: classifier
    output_format: json
    prompt: |
      Return valid JSON with keys: severity, summary.
      {input}
```

The JSON text is passed to the next agent unchanged.

## Fanout

Use `fanout` to run several sub-agents against the same input and join their
outputs:

```yaml
agents:
  - name: review_pack
    fanout:
      - name: correctness
        prompt: "Review for correctness: {input}"
      - name: tests
        prompt: "Review for missing tests: {input}"
```

Fanout children run sequentially. This is a small fanout/join helper, not a DAG
engine.

## Conditions

Use `condition.input_contains` to skip an agent unless the previous output
contains a string:

```yaml
agents:
  - name: refine
    condition:
      input_contains: "NEEDS_REFINEMENT"
    prompt: "Refine this: {input}"
```

Add `negate: true` to run only when the previous output does not contain the
string.

## Examples

Sample workflows live in `examples/`:

- `adr_writer.yml`
- `bug_triage.yml`
- `openai_basic.yml`
- `commit_message.yml`
- `conditional_refine.yml`
- `research_brief.yml`
- `code_review.yml`
- `dependency_risk_review.yml`
- `incident_postmortem.yml`
- `json_output.yml`
- `parallel_review.yml`
- `pull_request_review.yml`
- `release_notes.yml`
- `shell_tools.yml`
- `test_plan.yml`

## Tool safety

Workflow tools are raw local shell commands. Only run workflows you trust.
