Metadata-Version: 2.4
Name: aicortex-bridge
Version: 0.1.1
Summary: Windows Outlook COM HTTP bridge for AICortex pods (companion to aicorkit)
Author: AICortex
License: MIT
Requires-Python: >=3.11
Requires-Dist: fastapi>=0.115.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pywin32>=306; sys_platform == 'win32'
Requires-Dist: pyyaml>=6.0
Requires-Dist: uvicorn[standard]>=0.32.0
Provides-Extra: windows
Requires-Dist: pywin32>=306; extra == 'windows'
Description-Content-Type: text/markdown

# aicortex-bridge

Windows host HTTP service for Outlook COM. Lives in the **aicorkit** repo alongside the `aicorkit` package.

## Install (Windows)

```powershell
pip install aicorkit aicortex-bridge
aicortex-bridge serve
```

`serve` **defaults to background mode** and adds a **logon Run key** (`AICortexBridge`) so the bridge starts when you sign in. Logs: `%USERPROFILE%\.aicorkit\logs\aicortex-bridge.log`.

```powershell
aicortex-bridge status          # running / pid / auto-start
aicortex-bridge stop            # stop background process
aicortex-bridge uninstall       # stop + remove logon task
aicortex-bridge serve -f        # foreground (debug)
aicortex-bridge serve --no-autostart   # background only, no boot task
```

From source (repo root):

```powershell
pip install .
pip install ./bridge
aicortex-bridge serve
```

Requires Outlook desktop signed in. Default listen: `0.0.0.0:8766`.

## Release (publish both packages)

```powershell
cd D:\CODE\aicorkit
python -m pip install build
python -m build
python -m build bridge
# twine upload dist/* bridge/dist/*
```

## Pod usage

Windows host:

```powershell
aicortex-bridge serve
```

Runs in the background and registers logon auto-start. Pod env:

```bash
AICORTEX_OUTLOOK_BRIDGE_URL=http://host.docker.internal:8766
```

**aicorkit** auto-routes `outlook *` and `graph ingest email --from outlook` when the URL is set (`aicorkit/outlook_bridge.py`).

## HTTP API

| aicorkit CLI | Bridge |
|--------------|--------|
| `outlook list-emails` | `GET /v1/outlook/list-emails` |
| `outlook read-email` | `GET /v1/outlook/read-email?q=...` |
| `outlook send-email` | `POST /v1/outlook/send-email` |
| `outlook list-calendar` | `GET /v1/outlook/list-calendar?d=14` |
| `outlook create-meeting` | `POST /v1/outlook/create-meeting` |
| `outlook free-busy -e ...` | `GET /v1/outlook/free-busy?email=...` |
| `outlook list-rooms` | `GET /v1/outlook/list-rooms` |
| graph ingest (full body) | `GET /v1/outlook/list-emails-full` |

Also: `GET /v1/outlook/new`, `POST /v1/outlook/download-attachments`, `GET /health`, `GET /v1/outlook/ping`.

## Config

Shared with aicorkit: `~/.aicorkit/config.yaml` (`email.whitelist`), `~/.aicorkit/state/outlook.json`.

Optional auth: `AICORTEX_BRIDGE_TOKEN` / `AICORKIT_OUTLOOK_BRIDGE_TOKEN`.

**Not via bridge:** `aicorkit meeting *`, `resolve_contact` (COM-only).
