# @dai_ming/plugin-flyai-travel

OpenClaw native plugin for FlyAI / Fliggy travel search. It registers `flyai-travel__*` native tools, packages the FlyAI skill under `main-skills/`, and installs `@fly-ai/flyai-cli`, but does not start an MCP server or any resident process.

## Runtime model

- Main agent only: the gateway manifest uses `scope: "main"` for the `flyai` skill, and gateway tool policy treats `flyai-travel__*` tools as main-only.
- No resident process: native tools spawn the packaged `flyai` CLI only when a travel query needs it, then the process exits.
- Packaged CLI path in managed pods:

```text
/home/node/.openclaw/extensions/plugin-flyai-travel/node_modules/.bin/flyai
```

## Native tools

- `flyai-travel__keyword_search`
- `flyai-travel__ai_search`
- `flyai-travel__search_hotel`
- `flyai-travel__search_flight`
- `flyai-travel__search_train`
- `flyai-travel__search_poi`
- `flyai-travel__search_marriott_hotel`
- `flyai-travel__search_marriott_package`

## Install

```yaml
installPlugins:
  - "@dai_ming/plugin-flyai-travel@0.1.5"
```

For registry-managed installs, create or update:

```json
{
  "name": "plugin-flyai-travel",
  "installPackage": "@dai_ming/plugin-flyai-travel",
  "displayName": "FlyAI Travel",
  "category": "optional",
  "recommendedVersion": "0.1.5",
  "enabled": true,
  "npmRegistry": "https://registry.npmmirror.com"
}
```

Use `optional` when only selected releases should receive the plugin, or `builtin` if every pod should have the main-agent-only FlyAI skill.

## Gateway proxy

In managed pods, formal FlyAI credentials are held by `uniclaw-gateway`. When the gateway injects `FLYAI_GATEWAY_MCP_URL`, this plugin points the packaged CLI to the gateway proxy. It authenticates with `FLYAI_GATEWAY_TOKEN` / `OPENCLAW_MODEL_RELAY_TOKEN` when explicitly provided, or with a shared-pod user locator token derived from workspace scope. Do not put a formal FlyAI API key into the plugin package, Helm values, user config, or pod environment.

Gateway deployment config should only carry non-sensitive proxy settings such as `flyai.enabled`, `flyai.upstreamUrl`, and `flyai.timeout`. Store runtime credentials in the gateway `system_settings` table:

- `flyai_proxy_enabled`: `true` or `false`
- `flyai_proxy_api_key`: formal FlyAI API key
- `flyai_proxy_sign_secret`: optional formal FlyAI signing secret
