Files
ESLPwn/cloud-plugins/src/plugin.ts
T
i12bp8 2739069f22 Add optional WiFi Plugins (ESP32-S2 bridge + Cloudflare Worker)
- Flipper FAP: WiFi Setup, Plugins picker, plugin-run scene wired into
  Targeted Payloads -> <tag> -> WiFi Plugins
- Framed UART link to the dev board with bulk-read RX path and 16 KB
  stream buffer to keep up with full plugin bursts
- ESP firmware: 900 KB UART<->HTTPS bridge, USB-Serial-JTAG console,
  cert-bundle TLS, 16 KB worker stack to host mbedTLS handshake
- Cloudflare Worker: Crypto, Weather, Identicon plugins out of the
  box; new plugins are a single TypeScript file, no Flipper reflash
- Shared protocol header + 1bpp BMP writer that matches web-image-prep
  palette/stride conventions
2026-04-26 20:50:16 +02:00

44 lines
1.1 KiB
TypeScript

/*
* Plugin shape. A plugin exports:
* - manifest: served verbatim from /plugins
* - render(params, w, h, accent): builds a Canvas and returns it
*
* Adding a new plugin = drop a new file in src/plugins/, import + push it
* to PLUGINS in src/index.ts. Cloudflare deploys, Flipper picks it up on
* the next "Refresh Plugins".
*/
import { Canvas } from "./canvas";
export type ParamType = "string" | "int" | "enum" | "bool";
export interface ParamSpec {
key: string;
label: string;
type: ParamType;
default: string;
options?: string[];
min?: number;
max?: number;
}
export const ACCENT_NONE = 0;
export const ACCENT_RED = 1;
export const ACCENT_YELLOW = 2;
export interface PluginManifest {
id: string;
name: string;
description: string;
/** Bitmask: 1 = mono OK, 2 = red, 4 = yellow */
accent_modes: number;
params: ParamSpec[];
}
export type AccentMode = "none" | "red" | "yellow";
export interface Plugin {
manifest: PluginManifest;
render(params: Record<string, string>, w: number, h: number, accent: AccentMode): Promise<Canvas>;
}