From d5cc844858a1aa2a9a4972dc15970287eebaa725 Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Tue, 2 Dec 2025 21:18:45 -0500 Subject: [PATCH 1/2] sdk: add WebComponent interface --- sdk/types/src/types.input.ts | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/sdk/types/src/types.input.ts b/sdk/types/src/types.input.ts index 158bf0f110..8859fe1487 100644 --- a/sdk/types/src/types.input.ts +++ b/sdk/types/src/types.input.ts @@ -1681,7 +1681,7 @@ export interface ObjectsDetected { resources?: VideoResource; /** * The id of the generation source. - * Can be a camera id or a plugin id + * Can be a camera id or a plugin id */ sourceId?: string; } @@ -1816,6 +1816,29 @@ export interface TTYSettings { paths?: string[]; }>; } +/** + * WebComponent allows plugins to expose custom web components to be used in the Scrypted management console. + */ +export interface WebComponent { + getWebComponent(): Promise; +} +/** + * WebComponentManifest describes a web component to be rendered in the Scrypted management console. + */ +export interface WebComponentManifest { + /** + * Raw scripts to be included in the web component. + */ + scripts?: string[]; + /** + * Raw styles to be included in the web component. + */ + styles?: string[]; + /** + * The name of the web component. + */ + name: string; +} /** * Logger is exposed via log.* to allow writing to the Scrypted log. */ @@ -2256,8 +2279,8 @@ export interface HttpResponse { /** * @deprecated - * @param socket - * @param options + * @param socket + * @param options */ sendSocket(socket: any, options?: HttpResponseOptions): void; @@ -2685,7 +2708,7 @@ export interface ClusterForkInterfaceOptions extends Required; From 577a62d8662b6629865ae4c8bc2dfcf1ed4bc296 Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Tue, 2 Dec 2025 21:31:09 -0500 Subject: [PATCH 2/2] regen --- .../scrypted_python/scrypted_sdk/types.py | 23 +++++++++++++++++++ sdk/types/src/types.input.ts | 1 + 2 files changed, 24 insertions(+) diff --git a/sdk/types/scrypted_python/scrypted_sdk/types.py b/sdk/types/scrypted_python/scrypted_sdk/types.py index 8182f88ba3..513a99451b 100644 --- a/sdk/types/scrypted_python/scrypted_sdk/types.py +++ b/sdk/types/scrypted_python/scrypted_sdk/types.py @@ -216,6 +216,7 @@ class ScryptedInterface(str, Enum): VideoRecorderManagement = "VideoRecorderManagement" VideoTextOverlays = "VideoTextOverlays" VOCSensor = "VOCSensor" + WebComponent = "WebComponent" class ScryptedMimeTypes(str, Enum): @@ -1072,6 +1073,13 @@ class VideoTextOverlay(TypedDict): readonly: bool text: str | bool # The text value to set the overlay to, if it is not readonly. True or false otherwise to enable/disable. +class WebComponentManifest(TypedDict): + """WebComponentManifest describes a web component to be rendered in the Scrypted management console.""" + + name: str # The name of the web component. + scripts: list[str] # Raw scripts to be included in the web component. + styles: list[str] # Raw styles to be included in the web component. + class ChatCompletionMessageParam(TypedDict): """ Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, @@ -1851,6 +1859,13 @@ class VOCSensor: vocDensity: float +class WebComponent: + """WebComponent allows plugins to expose custom web components to be used in the Scrypted management console.""" + + async def getWebComponent(self) -> WebComponentManifest: + pass + + class Logger: """Logger is exposed via log.* to allow writing to the Scrypted log.""" @@ -2224,6 +2239,7 @@ class ScryptedInterfaceMethods(str, Enum): generateVideoFrames = "generateVideoFrames" connectStream = "connectStream" getTTYSettings = "getTTYSettings" + getWebComponent = "getWebComponent" getChatCompletion = "getChatCompletion" streamChatCompletion = "streamChatCompletion" getTextEmbedding = "getTextEmbedding" @@ -3534,6 +3550,13 @@ def systemDevice(self, value: ScryptedSystemDeviceInfo): ], "properties": [] }, + "WebComponent": { + "name": "WebComponent", + "methods": [ + "getWebComponent" + ], + "properties": [] + }, "ChatCompletion": { "name": "ChatCompletion", "methods": [ diff --git a/sdk/types/src/types.input.ts b/sdk/types/src/types.input.ts index 8859fe1487..37c97afc9e 100644 --- a/sdk/types/src/types.input.ts +++ b/sdk/types/src/types.input.ts @@ -2489,6 +2489,7 @@ export enum ScryptedInterface { StreamService = 'StreamService', TTY = 'TTY', TTYSettings = 'TTYSettings', + WebComponent = "WebComponent", ChatCompletion = "ChatCompletion", TextEmbedding = "TextEmbedding",