Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions sdk/types/scrypted_python/scrypted_sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ class ScryptedInterface(str, Enum):
VideoRecorderManagement = "VideoRecorderManagement"
VideoTextOverlays = "VideoTextOverlays"
VOCSensor = "VOCSensor"
WebComponent = "WebComponent"

class ScryptedMimeTypes(str, Enum):

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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."""

Expand Down Expand Up @@ -2224,6 +2239,7 @@ class ScryptedInterfaceMethods(str, Enum):
generateVideoFrames = "generateVideoFrames"
connectStream = "connectStream"
getTTYSettings = "getTTYSettings"
getWebComponent = "getWebComponent"
getChatCompletion = "getChatCompletion"
streamChatCompletion = "streamChatCompletion"
getTextEmbedding = "getTextEmbedding"
Expand Down Expand Up @@ -3534,6 +3550,13 @@ def systemDevice(self, value: ScryptedSystemDeviceInfo):
],
"properties": []
},
"WebComponent": {
"name": "WebComponent",
"methods": [
"getWebComponent"
],
"properties": []
},
"ChatCompletion": {
"name": "ChatCompletion",
"methods": [
Expand Down
32 changes: 28 additions & 4 deletions sdk/types/src/types.input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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>;
}
/**
* 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.
*/
Expand Down Expand Up @@ -2256,8 +2279,8 @@ export interface HttpResponse {

/**
* @deprecated
* @param socket
* @param options
* @param socket
* @param options
*/
sendSocket(socket: any, options?: HttpResponseOptions): void;

Expand Down Expand Up @@ -2466,6 +2489,7 @@ export enum ScryptedInterface {
StreamService = 'StreamService',
TTY = 'TTY',
TTYSettings = 'TTYSettings',
WebComponent = "WebComponent",

ChatCompletion = "ChatCompletion",
TextEmbedding = "TextEmbedding",
Expand Down Expand Up @@ -2685,7 +2709,7 @@ export interface ClusterForkInterfaceOptions extends Required<Pick<ForkOptions,
}

/**
* Requests that the ScryptedDevice create a fork to
* Requests that the ScryptedDevice create a fork to
*/
export interface ClusterForkInterface {
forkInterface(forkInterface: ScryptedInterface.ObjectDetection, options?: ClusterForkInterfaceOptions): Promise<ObjectDetection>;
Expand Down
Loading