@fugood/bricks-project 2.22.0-beta.3 → 2.22.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compile/action-name-map.ts +176 -1
- package/compile/index.ts +1 -0
- package/package.json +3 -3
- package/tools/postinstall.ts +17 -11
- package/types/animation.ts +2 -1
- package/types/brick-base.ts +77 -0
- package/types/bricks/3DViewer.ts +200 -0
- package/types/bricks/Camera.ts +195 -0
- package/types/bricks/Chart.ts +362 -0
- package/types/bricks/GenerativeMedia.ts +237 -0
- package/types/bricks/Icon.ts +90 -0
- package/types/bricks/Image.ts +101 -0
- package/types/bricks/Items.ts +461 -0
- package/types/bricks/Lottie.ts +156 -0
- package/types/bricks/QrCode.ts +109 -0
- package/types/bricks/Rect.ts +107 -0
- package/types/bricks/RichText.ts +120 -0
- package/types/bricks/Rive.ts +209 -0
- package/types/bricks/Slideshow.ts +155 -0
- package/types/bricks/Svg.ts +91 -0
- package/types/bricks/Text.ts +140 -0
- package/types/bricks/TextInput.ts +231 -0
- package/types/bricks/Video.ts +167 -0
- package/types/bricks/VideoStreaming.ts +104 -0
- package/types/bricks/WebRtcStream.ts +60 -0
- package/types/bricks/WebView.ts +157 -0
- package/types/bricks/index.ts +20 -0
- package/types/canvas.ts +1 -1
- package/types/common.ts +3 -3
- package/types/data.ts +6 -0
- package/types/generators/AlarmClock.ts +102 -0
- package/types/generators/Assistant.ts +546 -0
- package/types/generators/BleCentral.ts +225 -0
- package/types/generators/BlePeripheral.ts +202 -0
- package/types/generators/CanvasMap.ts +57 -0
- package/types/generators/CastlesPay.ts +77 -0
- package/types/generators/DataBank.ts +123 -0
- package/types/generators/File.ts +351 -0
- package/types/generators/GraphQl.ts +124 -0
- package/types/generators/Http.ts +117 -0
- package/types/generators/HttpServer.ts +156 -0
- package/types/generators/Information.ts +97 -0
- package/types/generators/Intent.ts +107 -0
- package/types/generators/Iterator.ts +95 -0
- package/types/generators/Keyboard.ts +85 -0
- package/types/generators/LlmAnthropicCompat.ts +188 -0
- package/types/generators/LlmGgml.ts +719 -0
- package/types/generators/LlmOnnx.ts +184 -0
- package/types/generators/LlmOpenAiCompat.ts +206 -0
- package/types/generators/LlmQualcommAiEngine.ts +213 -0
- package/types/generators/Mcp.ts +294 -0
- package/types/generators/McpServer.ts +245 -0
- package/types/generators/MediaFlow.ts +142 -0
- package/types/generators/MqttBroker.ts +121 -0
- package/types/generators/MqttClient.ts +129 -0
- package/types/generators/Question.ts +395 -0
- package/types/generators/RealtimeTranscription.ts +172 -0
- package/types/generators/RerankerGgml.ts +153 -0
- package/types/generators/SerialPort.ts +141 -0
- package/types/generators/SoundPlayer.ts +86 -0
- package/types/generators/SoundRecorder.ts +113 -0
- package/types/generators/SpeechToTextGgml.ts +462 -0
- package/types/generators/SpeechToTextOnnx.ts +227 -0
- package/types/generators/SpeechToTextPlatform.ts +75 -0
- package/types/generators/SqLite.ts +118 -0
- package/types/generators/Step.ts +101 -0
- package/types/generators/TapToPayOnIPhone.ts +175 -0
- package/types/generators/Tcp.ts +120 -0
- package/types/generators/TcpServer.ts +137 -0
- package/types/generators/TextToSpeechGgml.ts +182 -0
- package/types/generators/TextToSpeechOnnx.ts +169 -0
- package/types/generators/TextToSpeechOpenAiLike.ts +113 -0
- package/types/generators/ThermalPrinter.ts +185 -0
- package/types/generators/Tick.ts +75 -0
- package/types/generators/Udp.ts +109 -0
- package/types/generators/VadGgml.ts +211 -0
- package/types/generators/VectorStore.ts +223 -0
- package/types/generators/Watchdog.ts +96 -0
- package/types/generators/WebCrawler.ts +97 -0
- package/types/generators/WebRtc.ts +165 -0
- package/types/generators/WebSocket.ts +142 -0
- package/types/generators/index.ts +51 -0
- package/types/system.ts +64 -0
- package/utils/data.ts +45 -0
- package/utils/event-props.ts +210 -0
- package/types/bricks.ts +0 -3166
- package/types/generators.ts +0 -6671
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
|
+
import type { Data, DataLink } from '../data'
|
|
3
|
+
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
4
|
+
import type {
|
|
5
|
+
Brick,
|
|
6
|
+
EventAction,
|
|
7
|
+
EventActionForItem,
|
|
8
|
+
ActionWithDataParams,
|
|
9
|
+
ActionWithParams,
|
|
10
|
+
Action,
|
|
11
|
+
EventProperty,
|
|
12
|
+
} from '../common'
|
|
13
|
+
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
14
|
+
|
|
15
|
+
interface BrickVideoStreamingDef {
|
|
16
|
+
/*
|
|
17
|
+
Default property:
|
|
18
|
+
{
|
|
19
|
+
"networkCaching": 300,
|
|
20
|
+
"paused": false,
|
|
21
|
+
"volume": 100,
|
|
22
|
+
"muted": false,
|
|
23
|
+
"replayTimeout": 500
|
|
24
|
+
}
|
|
25
|
+
*/
|
|
26
|
+
property?: BrickBasicProperty & {
|
|
27
|
+
/* The video path list or single path (File, URL) */
|
|
28
|
+
uri?: string | DataLink
|
|
29
|
+
/* Set cache time from streaming (You can adjust according to network conditions), it will delay the playing. */
|
|
30
|
+
networkCaching?: number | DataLink
|
|
31
|
+
/* Controls whether the video is paused */
|
|
32
|
+
paused?: boolean | DataLink
|
|
33
|
+
/* Volume */
|
|
34
|
+
volume?: number | DataLink
|
|
35
|
+
/* Muted */
|
|
36
|
+
muted?: boolean | DataLink
|
|
37
|
+
/* Video Auto Aspect Ratio */
|
|
38
|
+
autoAspectRatio?: boolean | DataLink
|
|
39
|
+
/* Video Aspect Ratio */
|
|
40
|
+
aspectRatio?: string | DataLink
|
|
41
|
+
/* Repeat the video path list */
|
|
42
|
+
repeat?: boolean | DataLink
|
|
43
|
+
/* Replay on playing error */
|
|
44
|
+
replayOnError?: boolean | DataLink
|
|
45
|
+
/* Timeout to replay if repeat or replayOnError is true and video is end or error */
|
|
46
|
+
replayTimeout?: number | DataLink
|
|
47
|
+
}
|
|
48
|
+
events?: BrickBasicEvents & {
|
|
49
|
+
/* Event of the brick press */
|
|
50
|
+
onPress?: Array<EventAction>
|
|
51
|
+
/* Event of the brick press in */
|
|
52
|
+
onPressIn?: Array<EventAction>
|
|
53
|
+
/* Event of the brick press out */
|
|
54
|
+
onPressOut?: Array<EventAction>
|
|
55
|
+
/* Event of the brick focus (Use TV Device with controller) */
|
|
56
|
+
onFocus?: Array<EventAction>
|
|
57
|
+
/* Event of the brick blur (Use TV Device with controller) */
|
|
58
|
+
onBlur?: Array<EventAction>
|
|
59
|
+
/* Event on plays of path are end */
|
|
60
|
+
onEnd?: Array<EventAction>
|
|
61
|
+
/* Event on plays of path are end */
|
|
62
|
+
onLoad?: Array<EventAction>
|
|
63
|
+
/* Event of the video playing error */
|
|
64
|
+
onError?: Array<EventAction>
|
|
65
|
+
}
|
|
66
|
+
outlets?: {
|
|
67
|
+
/* Brick is pressing */
|
|
68
|
+
brickPressing?: () => Data
|
|
69
|
+
/* Brick is focusing (Use TV Device with controller) */
|
|
70
|
+
brickFocusing?: () => Data
|
|
71
|
+
}
|
|
72
|
+
animation?: AnimationBasicEvents & {
|
|
73
|
+
onPress?: Animation
|
|
74
|
+
onPressIn?: Animation
|
|
75
|
+
onPressOut?: Animation
|
|
76
|
+
onFocus?: Animation
|
|
77
|
+
onBlur?: Animation
|
|
78
|
+
onEnd?: Animation
|
|
79
|
+
onLoad?: Animation
|
|
80
|
+
onError?: Animation
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Brick video streaming component, supports RTSP / RTMP streaming. */
|
|
85
|
+
export type BrickVideoStreaming = Brick &
|
|
86
|
+
BrickVideoStreamingDef & {
|
|
87
|
+
templateKey: 'BRICK_VIDEO_STREAMING'
|
|
88
|
+
switches: Array<
|
|
89
|
+
SwitchDef &
|
|
90
|
+
BrickVideoStreamingDef & {
|
|
91
|
+
conds?: Array<{
|
|
92
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
93
|
+
cond:
|
|
94
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
95
|
+
| SwitchCondData
|
|
96
|
+
| {
|
|
97
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
98
|
+
outlet: 'brickPressing' | 'brickFocusing'
|
|
99
|
+
value: any
|
|
100
|
+
}
|
|
101
|
+
}>
|
|
102
|
+
}
|
|
103
|
+
>
|
|
104
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
|
+
import type { Data, DataLink } from '../data'
|
|
3
|
+
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
4
|
+
import type {
|
|
5
|
+
Brick,
|
|
6
|
+
EventAction,
|
|
7
|
+
EventActionForItem,
|
|
8
|
+
ActionWithDataParams,
|
|
9
|
+
ActionWithParams,
|
|
10
|
+
Action,
|
|
11
|
+
EventProperty,
|
|
12
|
+
} from '../common'
|
|
13
|
+
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
14
|
+
|
|
15
|
+
interface BrickWebRTCStreamDef {
|
|
16
|
+
/*
|
|
17
|
+
Default property:
|
|
18
|
+
{
|
|
19
|
+
"mirror": false,
|
|
20
|
+
"resizeMode": "contain",
|
|
21
|
+
"noStreamViewText": "no stream",
|
|
22
|
+
"noStreamViewTextSize": 44,
|
|
23
|
+
"noStreamViewTextColor": "#000"
|
|
24
|
+
}
|
|
25
|
+
*/
|
|
26
|
+
property?: BrickBasicProperty & {
|
|
27
|
+
/* Mirror video */
|
|
28
|
+
mirror?: boolean | DataLink
|
|
29
|
+
/* The stream resize mode */
|
|
30
|
+
resizeMode?: 'contain' | 'cover' | DataLink
|
|
31
|
+
/* Show text content if no stream */
|
|
32
|
+
noStreamViewText?: string | DataLink
|
|
33
|
+
/* The font size of shown text content if no stream */
|
|
34
|
+
noStreamViewTextSize?: number | DataLink
|
|
35
|
+
/* The color of shown text content if no stream */
|
|
36
|
+
noStreamViewTextColor?: string | DataLink
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* WebRTCStream brick */
|
|
41
|
+
export type BrickWebRTCStream = Brick &
|
|
42
|
+
BrickWebRTCStreamDef & {
|
|
43
|
+
templateKey: 'BRICK_WEBRTC_STREAM'
|
|
44
|
+
switches: Array<
|
|
45
|
+
SwitchDef &
|
|
46
|
+
BrickWebRTCStreamDef & {
|
|
47
|
+
conds?: Array<{
|
|
48
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
49
|
+
cond:
|
|
50
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
51
|
+
| SwitchCondData
|
|
52
|
+
| {
|
|
53
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
54
|
+
outlet: ''
|
|
55
|
+
value: any
|
|
56
|
+
}
|
|
57
|
+
}>
|
|
58
|
+
}
|
|
59
|
+
>
|
|
60
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
|
+
import type { Data, DataLink } from '../data'
|
|
3
|
+
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
4
|
+
import type {
|
|
5
|
+
Brick,
|
|
6
|
+
EventAction,
|
|
7
|
+
EventActionForItem,
|
|
8
|
+
ActionWithDataParams,
|
|
9
|
+
ActionWithParams,
|
|
10
|
+
Action,
|
|
11
|
+
EventProperty,
|
|
12
|
+
} from '../common'
|
|
13
|
+
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
14
|
+
|
|
15
|
+
/* Run Javascript on the WebView */
|
|
16
|
+
export type BrickWebViewActionInjectJavascript = ActionWithParams & {
|
|
17
|
+
__actionName: 'BRICK_WEBVIEW_INJECT_JAVASCRIPT'
|
|
18
|
+
params?: Array<{
|
|
19
|
+
input: 'javascriptCode'
|
|
20
|
+
value?: string | DataLink | EventProperty
|
|
21
|
+
mapping?: string
|
|
22
|
+
}>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Query selector on the WebView */
|
|
26
|
+
export type BrickWebViewActionQuerySelector = ActionWithParams & {
|
|
27
|
+
__actionName: 'BRICK_WEBVIEW_QUERY_SELECTOR'
|
|
28
|
+
params?: Array<
|
|
29
|
+
| {
|
|
30
|
+
input: 'querySelector'
|
|
31
|
+
value?: string | DataLink | EventProperty
|
|
32
|
+
mapping?: string
|
|
33
|
+
}
|
|
34
|
+
| {
|
|
35
|
+
input: 'expression'
|
|
36
|
+
value?: string | DataLink | EventProperty
|
|
37
|
+
mapping?: string
|
|
38
|
+
}
|
|
39
|
+
>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Do go forward on the WebView */
|
|
43
|
+
export type BrickWebViewActionGoForward = Action & {
|
|
44
|
+
__actionName: 'BRICK_WEBVIEW_GO_FORWARD'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Do go back on the webview */
|
|
48
|
+
export type BrickWebViewActionGoBack = Action & {
|
|
49
|
+
__actionName: 'BRICK_WEBVIEW_GO_BACK'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Do reload on the webview */
|
|
53
|
+
export type BrickWebViewActionReload = Action & {
|
|
54
|
+
__actionName: 'BRICK_WEBVIEW_RELOAD'
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface BrickWebViewDef {
|
|
58
|
+
/*
|
|
59
|
+
Default property:
|
|
60
|
+
{
|
|
61
|
+
"cropLeft": 0,
|
|
62
|
+
"cropRight": 0,
|
|
63
|
+
"cropTop": 0,
|
|
64
|
+
"cropBottom": 0,
|
|
65
|
+
"allowContentControl": true,
|
|
66
|
+
"allowFileAccess": true,
|
|
67
|
+
"domStorageEnabled": true,
|
|
68
|
+
"cacheEnabled": true,
|
|
69
|
+
"geolocationEnabled": true,
|
|
70
|
+
"thirdPartyCookiesEnabled": true,
|
|
71
|
+
"javaScriptEnabled": true
|
|
72
|
+
}
|
|
73
|
+
*/
|
|
74
|
+
property?: BrickBasicProperty & {
|
|
75
|
+
/* The WebView content URL */
|
|
76
|
+
url?: string | DataLink
|
|
77
|
+
/* The request headers to load content */
|
|
78
|
+
headers?: {} | DataLink
|
|
79
|
+
/* The request UserAgent */
|
|
80
|
+
userAgent?: string | DataLink
|
|
81
|
+
/* The webview content HTML (Use `url` first) */
|
|
82
|
+
html?: string | DataLink
|
|
83
|
+
/* Crop webview content left position (px) */
|
|
84
|
+
cropLeft?: number | DataLink
|
|
85
|
+
/* Crop webview content right position (px) */
|
|
86
|
+
cropRight?: number | DataLink
|
|
87
|
+
/* Crop webview content top position (px) */
|
|
88
|
+
cropTop?: number | DataLink
|
|
89
|
+
/* Crop webview content bottom position (px) */
|
|
90
|
+
cropBottom?: number | DataLink
|
|
91
|
+
/* Allow content control */
|
|
92
|
+
allowContentControl?: boolean | DataLink
|
|
93
|
+
/* List of origin strings to allow being navigated to. (Allowed all if not provided) */
|
|
94
|
+
originAllowList?: Array<string | DataLink> | DataLink
|
|
95
|
+
/* Allow file:// access */
|
|
96
|
+
allowFileAccess?: boolean | DataLink
|
|
97
|
+
/* Enable DOM Storage */
|
|
98
|
+
domStorageEnabled?: boolean | DataLink
|
|
99
|
+
/* Enable Cache */
|
|
100
|
+
cacheEnabled?: boolean | DataLink
|
|
101
|
+
/* Enable Geolocation */
|
|
102
|
+
geolocationEnabled?: boolean | DataLink
|
|
103
|
+
/* Enable Third Party Cooikies */
|
|
104
|
+
thirdPartyCookiesEnabled?: boolean | DataLink
|
|
105
|
+
/* Enable JavaScript */
|
|
106
|
+
javaScriptEnabled?: boolean | DataLink
|
|
107
|
+
/* Inject JavaScript code */
|
|
108
|
+
code?: string | DataLink
|
|
109
|
+
/* Inject JavaScript code before content loaded */
|
|
110
|
+
beforeContentLoaded?: string | DataLink
|
|
111
|
+
/* Inject JavaScript code for main frame only (only `YES` supported for Android) */
|
|
112
|
+
forMainFrameOnly?: boolean | DataLink
|
|
113
|
+
/* Inject JavaScript code before content loaded for main frame only (only `YES` supported for Android) */
|
|
114
|
+
beforeContentLoadedForMainFrameOnly?: boolean | DataLink
|
|
115
|
+
}
|
|
116
|
+
events?: BrickBasicEvents & {
|
|
117
|
+
/* Event of the WebView on load */
|
|
118
|
+
onLoad?: Array<EventAction>
|
|
119
|
+
/* Event when the WebView load fails */
|
|
120
|
+
onError?: Array<EventAction>
|
|
121
|
+
/* Event of the webview on message by `window.ReactNativeWebView.postMessage` on you're injected javascript code */
|
|
122
|
+
onMessage?: Array<EventAction>
|
|
123
|
+
}
|
|
124
|
+
outlets?: {
|
|
125
|
+
/* The result of the query selector action */
|
|
126
|
+
queryResult?: () => Data
|
|
127
|
+
/* The error of the query selector action */
|
|
128
|
+
queryError?: () => Data
|
|
129
|
+
}
|
|
130
|
+
animation?: AnimationBasicEvents & {
|
|
131
|
+
onLoad?: Animation
|
|
132
|
+
onError?: Animation
|
|
133
|
+
onMessage?: Animation
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* WebView brick ([Tutorial](https://intercom.help/bricks-dag-inc/articles/5378588-web-view)) */
|
|
138
|
+
export type BrickWebView = Brick &
|
|
139
|
+
BrickWebViewDef & {
|
|
140
|
+
templateKey: 'BRICK_WEBVIEW'
|
|
141
|
+
switches: Array<
|
|
142
|
+
SwitchDef &
|
|
143
|
+
BrickWebViewDef & {
|
|
144
|
+
conds?: Array<{
|
|
145
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
146
|
+
cond:
|
|
147
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
148
|
+
| SwitchCondData
|
|
149
|
+
| {
|
|
150
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
151
|
+
outlet: 'queryResult' | 'queryError'
|
|
152
|
+
value: any
|
|
153
|
+
}
|
|
154
|
+
}>
|
|
155
|
+
}
|
|
156
|
+
>
|
|
157
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './Rect'
|
|
2
|
+
export * from './Text'
|
|
3
|
+
export * from './TextInput'
|
|
4
|
+
export * from './RichText'
|
|
5
|
+
export * from './Image'
|
|
6
|
+
export * from './Svg'
|
|
7
|
+
export * from './Icon'
|
|
8
|
+
export * from './Video'
|
|
9
|
+
export * from './VideoStreaming'
|
|
10
|
+
export * from './QrCode'
|
|
11
|
+
export * from './Slideshow'
|
|
12
|
+
export * from './Chart'
|
|
13
|
+
export * from './Items'
|
|
14
|
+
export * from './Lottie'
|
|
15
|
+
export * from './Rive'
|
|
16
|
+
export * from './WebView'
|
|
17
|
+
export * from './Camera'
|
|
18
|
+
export * from './WebRtcStream'
|
|
19
|
+
export * from './3DViewer'
|
|
20
|
+
export * from './GenerativeMedia'
|
package/types/canvas.ts
CHANGED
|
@@ -14,7 +14,7 @@ interface CanvasDef {
|
|
|
14
14
|
showingTimeout?: number | DataLink
|
|
15
15
|
/* Canvas ID for change next canvas on showing timeout */
|
|
16
16
|
nextCanvasId?: string | DataLink | (() => Canvas)
|
|
17
|
-
/*
|
|
17
|
+
/* Background color of Canvas */
|
|
18
18
|
backgroundColor?: string | DataLink
|
|
19
19
|
/* Dismiss keyboard on press */
|
|
20
20
|
dismissKeyboardOnPress?: boolean | DataLink
|
package/types/common.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type SubpsaceAction = string
|
|
|
39
39
|
export type Action = {
|
|
40
40
|
__actionName: string
|
|
41
41
|
parent: 'Brick' | 'Generator' | 'Subspace' | 'System'
|
|
42
|
-
name
|
|
42
|
+
name?: string
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// Find correct key in bricks-project/utils/event-props for EventAction
|
|
@@ -65,7 +65,7 @@ export type ItemBrickID = string
|
|
|
65
65
|
|
|
66
66
|
export type EventAction = {
|
|
67
67
|
handler: 'system' | (() => Brick | Generator) | SubspaceID | ItemBrickID
|
|
68
|
-
action:
|
|
68
|
+
action: ActionWithParams | ActionWithDataParams
|
|
69
69
|
waitAsync?: boolean
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -82,7 +82,7 @@ export type EventActionForItem = {
|
|
|
82
82
|
export type ApplicationFont = {
|
|
83
83
|
name: string
|
|
84
84
|
url: string
|
|
85
|
-
md5
|
|
85
|
+
md5?: string
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
export type ApplicationSettings = {
|
package/types/data.ts
CHANGED
|
@@ -56,6 +56,11 @@ export type Data<T = any> = DataDef & {
|
|
|
56
56
|
| 'rich-text-content'
|
|
57
57
|
| 'sandbox-script'
|
|
58
58
|
| 'llm-prompt'
|
|
59
|
+
| 'llm-messages'
|
|
60
|
+
| 'llm-tools'
|
|
61
|
+
| 'mcp-server-resources'
|
|
62
|
+
| 'mcp-server-tools'
|
|
63
|
+
| 'mcp-server-prompts'
|
|
59
64
|
}
|
|
60
65
|
value: T
|
|
61
66
|
}
|
|
@@ -67,6 +72,7 @@ export type DataAssetKind = {
|
|
|
67
72
|
| 'media-resource-audio'
|
|
68
73
|
| 'media-resource-file'
|
|
69
74
|
| 'lottie-file-uri'
|
|
75
|
+
| 'rive-file-uri'
|
|
70
76
|
| 'ggml-model-asset'
|
|
71
77
|
| 'gguf-model-asset'
|
|
72
78
|
| 'binary-asset'
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
|
+
import type { Data, DataLink } from '../data'
|
|
3
|
+
import type {
|
|
4
|
+
Generator,
|
|
5
|
+
EventAction,
|
|
6
|
+
ActionWithDataParams,
|
|
7
|
+
ActionWithParams,
|
|
8
|
+
Action,
|
|
9
|
+
EventProperty,
|
|
10
|
+
} from '../common'
|
|
11
|
+
|
|
12
|
+
/* Start the alarm clock */
|
|
13
|
+
export type GeneratorAlarmClockActionStart = Action & {
|
|
14
|
+
__actionName: 'GENERATOR_ALARM_CLOCK_START'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Pause the alarm clock */
|
|
18
|
+
export type GeneratorAlarmClockActionPause = Action & {
|
|
19
|
+
__actionName: 'GENERATOR_ALARM_CLOCK_PAUSE'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface GeneratorAlarmClockDef {
|
|
23
|
+
/*
|
|
24
|
+
Default property:
|
|
25
|
+
{
|
|
26
|
+
"init": false,
|
|
27
|
+
"timezone": "UTC",
|
|
28
|
+
"cron": "* * * * *",
|
|
29
|
+
"min": "",
|
|
30
|
+
"hour": "",
|
|
31
|
+
"dom": "",
|
|
32
|
+
"mon": "",
|
|
33
|
+
"dow": ""
|
|
34
|
+
}
|
|
35
|
+
*/
|
|
36
|
+
property?: {
|
|
37
|
+
/* Start alarm clock on generator initialized */
|
|
38
|
+
init?: boolean | DataLink
|
|
39
|
+
/* Timezone */
|
|
40
|
+
timezone?: string | DataLink
|
|
41
|
+
/* Max count of alarm clock trigs */
|
|
42
|
+
maxTrigs?: number | DataLink
|
|
43
|
+
/* Time to start alarm clock */
|
|
44
|
+
startAt?: string | DataLink | string | DataLink | DataLink
|
|
45
|
+
/* Time to end alarm clock (Empty for not end) */
|
|
46
|
+
stopAt?: string | DataLink | string | DataLink | DataLink
|
|
47
|
+
/* Setting trigger rule by cron tab (Ref: https://crontab.guru/) */
|
|
48
|
+
cron?: string | DataLink
|
|
49
|
+
/* minute */
|
|
50
|
+
min?: string | DataLink
|
|
51
|
+
/* hour */
|
|
52
|
+
hour?: string | DataLink
|
|
53
|
+
/* day (month) */
|
|
54
|
+
dom?: string | DataLink
|
|
55
|
+
/* month */
|
|
56
|
+
mon?: string | DataLink
|
|
57
|
+
/* day (week) */
|
|
58
|
+
dow?: string | DataLink
|
|
59
|
+
}
|
|
60
|
+
events?: {
|
|
61
|
+
/* Event for cron rule is not invalid */
|
|
62
|
+
onRuleInvalid?: Array<EventAction>
|
|
63
|
+
/* Event for alarm clock start */
|
|
64
|
+
onStart?: Array<EventAction>
|
|
65
|
+
/* Event for alarm clock trig */
|
|
66
|
+
onTrig?: Array<EventAction>
|
|
67
|
+
/* Event for alarm clock stop */
|
|
68
|
+
onEnd?: Array<EventAction>
|
|
69
|
+
}
|
|
70
|
+
outlets?: {
|
|
71
|
+
/* Current time of each alarm clock trig */
|
|
72
|
+
trigTime?: () => Data
|
|
73
|
+
/* Current timestamp (unix time) of each alarm clock trig */
|
|
74
|
+
trigTimestamp?: () => Data
|
|
75
|
+
/* Count of alarm clock trigs */
|
|
76
|
+
trigCount?: () => Data
|
|
77
|
+
/* Is alarm clock running? */
|
|
78
|
+
running?: () => Data
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Execute event by cron tab */
|
|
83
|
+
export type GeneratorAlarmClock = Generator &
|
|
84
|
+
GeneratorAlarmClockDef & {
|
|
85
|
+
templateKey: 'GENERATOR_ALARM_CLOCK'
|
|
86
|
+
switches: Array<
|
|
87
|
+
SwitchDef &
|
|
88
|
+
GeneratorAlarmClockDef & {
|
|
89
|
+
conds?: Array<{
|
|
90
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
91
|
+
cond:
|
|
92
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
93
|
+
| SwitchCondData
|
|
94
|
+
| {
|
|
95
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
96
|
+
outlet: 'trigTime' | 'trigTimestamp' | 'trigCount' | 'running'
|
|
97
|
+
value: any
|
|
98
|
+
}
|
|
99
|
+
}>
|
|
100
|
+
}
|
|
101
|
+
>
|
|
102
|
+
}
|