# Game-source plugin template

This is a minimal working game-source provider template. It demonstrates the
complete source lifecycle:

- `game-sources.search` — text search with pagination;
- `game-sources.resolve` — convert a provider URL or external id into one draft;
- `game-sources.refresh` — refresh an existing game through a patch;
- `game-sources.parse-page` — parse a safe page snapshot from the browser extension.

The template intentionally requests no other permissions. For imports, exports,
`host.storage`, UI slots, filters, tracking, backup, and auth, see
`../plugin-reference` and the documentation in `../../docs/`.

## Run

```sh
pnpm install
pnpm test
pnpm build
zip -r my-plugin.xlplugin manifest.json runtime
```

Before packaging, replace these values in `manifest.json`:

1. `id`, `name`, `version`, and `description`;
2. `catalog.example` with the provider's real HTTPS domains;
3. localized metadata and labels;
4. `src/index.ts` with the site's network client and parser.

The plugin receives no DOM or browser session. It receives only a
`PluginGameSourcePageCapture` containing the URL, title, HTML, text, and
timestamp. Tokens, cookies, Electron APIs, and the filesystem are unavailable
inside the plugin runtime.
