---
name: expose-fmap-worker
description: Configure frpc to expose a Mac mini worker service through one of the 24 reserved solar-term pinyin HTTPS endpoints under fmap.dev. Use when an agent needs to publish, inspect, restart, or stop a local worker service through the fmap.dev FRP tunnel.
---

# Expose fmap Worker

Use the installed `fmap-worker` command. It manages one isolated FRPC LaunchAgent per active slot and connects through `frp.fmap.dev:443` over WSS.

The canonical agent-readable copy of these instructions is available at `https://gateway.fmap.dev`.

## Required inputs

- A user-confirmed free name from the reserved list. Do not infer availability from an HTTP response:
  - Spring: `lichun`, `yushui`, `jingzhe`, `chunfen`, `qingming`, `guyu`
  - Summer: `lixia`, `xiaoman`, `mangzhong`, `xiazhi`, `xiaoshu`, `dashu`
  - Autumn: `liqiu`, `chushu`, `bailu`, `qiufen`, `hanlu`, `shuangjiang`
  - Winter: `lidong`, `xiaoxue`, `daxue`, `dongzhi`, `xiaohan`, `dahan`
- The local HTTP service port. The service must listen on `127.0.0.1` on the Mac mini.

## Expose a service

1. Verify the service locally without printing environment files or secrets.
2. Start the assigned slot:

```bash
/Users/bencode/bin/fmap-worker start lichun 3000
```

3. Check the managed process and verify the public application endpoint:

```bash
/Users/bencode/bin/fmap-worker status lichun
curl -fsS https://lichun.fmap.dev
```

Report the public URL, local service port, process state, and configuration path. Keep the service and tunnel running unless the user requests cleanup.

## Release a slot

```bash
/Users/bencode/bin/fmap-worker stop lichun
```

Confirm the old public URL no longer reaches the local service before reassigning the slot.

## Boundaries

- Treat name assignment as manual coordination; this setup has no registry or locking service.
- Never read, print, copy, or edit `/Users/bencode/.config/frp/fmap.env`; `fmap-worker` is its only consumer.
- Do not search for, download, install, or replace FRPC. If `fmap-worker` reports a missing prerequisite, report the error.
- Do not edit generated TOML files or LaunchAgents directly.
- Do not use arbitrary `*.fmap.dev` names.
- Do not connect directly to `49.0.200.80:7000`.
- Do not expose the local service port publicly as a substitute for the tunnel.
- If `frps` or Caddy is unavailable, report the failure; do not mutate the `i` machine unless explicitly asked.
