26 lines
1.7 KiB
Markdown
26 lines
1.7 KiB
Markdown
# AI Plugin Integration Guide
|
|
|
|
Generate manifest v3 WebView plugins by default. Local HTML, CSS, JavaScript, ES Module, Worker, Wasm, Canvas, WebAudio, localStorage and IndexedDB need no client permission. Never request Shell, Script, native process, arbitrary file system or environment access.
|
|
|
|
## Required generation rules
|
|
|
|
- Include `manifestVersion: 3`, `apiVersion: "2"`, `runtime: "WebView"`, README and at least one surface.
|
|
- Add a non-empty `permissionReasons` entry for every permission.
|
|
- Put only launch-critical permissions in `security.requiredPermissions`.
|
|
- For `Http`, declare exact public HTTPS/WSS origins with no path or wildcard.
|
|
- For external links and tools, declare exact `openExternalOrigins` and `runToolIds`.
|
|
- Keep scripts, styles, fonts and application logic local. Remote code, iframe and navigation are prohibited.
|
|
- Handle Bridge errors by `error.code`; do not retry permission or scope errors automatically.
|
|
- Do not generate native binaries, package managers, build-on-first-run behavior or commands that invoke PowerShell, Node or Python.
|
|
|
|
## Acceptance Checklist
|
|
|
|
- Manifest passes `docs/plugins/ymhut.plugin.schema.json`.
|
|
- Every entry/resource stays inside the plugin directory and the package contains no links or junctions.
|
|
- Zero-permission mode still renders and its browser-private storage remains functional.
|
|
- Optional permission denial produces a clear UI state.
|
|
- Direct fetch/WebSocket and `ymhut.http.fetch` use only declared public origins.
|
|
- No remote script, iframe, popup, download, browser permission, `file://` or Tauri global API is used.
|
|
- Layout works in narrow and wide embedded surfaces with no full-screen transparent overlay.
|
|
- Logs and output do not include secrets, tokens or local filesystem paths.
|