@fugood/bricks-project 2.24.0-beta.4 → 2.24.0-beta.41
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 +38 -0
- package/compile/index.ts +429 -160
- package/compile/util.ts +2 -0
- package/package.json +7 -3
- package/package.json.bak +27 -0
- package/skills/{bricks-project → bricks-ctor}/SKILL.md +2 -2
- package/skills/{bricks-project → bricks-ctor}/rules/animation.md +1 -1
- package/skills/{bricks-project → bricks-ctor}/rules/architecture-patterns.md +7 -0
- package/skills/bricks-ctor/rules/automations.md +221 -0
- package/skills/{bricks-project → bricks-ctor}/rules/buttress.md +10 -7
- package/skills/{bricks-project → bricks-ctor}/rules/data-calculation.md +1 -1
- package/skills/{bricks-project → bricks-ctor}/rules/local-sync.md +2 -2
- package/skills/{bricks-project → bricks-ctor}/rules/media-flow.md +3 -3
- package/skills/{bricks-project → bricks-ctor}/rules/remote-data-bank.md +6 -6
- package/skills/{bricks-project → bricks-ctor}/rules/standby-transition.md +1 -1
- package/skills/bricks-design/LICENSE.txt +180 -0
- package/skills/bricks-design/SKILL.md +66 -0
- package/tools/deploy.ts +66 -12
- package/tools/icons/fa6pro-meta.json +3669 -26125
- package/tools/mcp-server.ts +11 -878
- package/tools/mcp-tools/compile.ts +91 -0
- package/tools/mcp-tools/huggingface.ts +762 -0
- package/tools/mcp-tools/icons.ts +70 -0
- package/tools/mcp-tools/lottie.ts +102 -0
- package/tools/mcp-tools/media.ts +110 -0
- package/tools/postinstall.ts +137 -40
- package/tools/preview-main.mjs +146 -9
- package/tools/preview.ts +30 -2
- package/tools/pull.ts +37 -19
- package/tsconfig.json +16 -0
- package/types/animation.ts +4 -0
- package/types/automation.ts +4 -1
- package/types/brick-base.ts +1 -1
- package/types/bricks/Camera.ts +48 -13
- package/types/bricks/Chart.ts +10 -4
- package/types/bricks/GenerativeMedia.ts +30 -14
- package/types/bricks/Icon.ts +9 -5
- package/types/bricks/Image.ts +10 -6
- package/types/bricks/Items.ts +29 -15
- package/types/bricks/Lottie.ts +15 -7
- package/types/bricks/Maps.ts +16 -8
- package/types/bricks/QrCode.ts +9 -5
- package/types/bricks/Rect.ts +45 -6
- package/types/bricks/RichText.ts +9 -5
- package/types/bricks/Rive.ts +21 -11
- package/types/bricks/Slideshow.ts +20 -10
- package/types/bricks/Svg.ts +8 -4
- package/types/bricks/Text.ts +9 -5
- package/types/bricks/TextInput.ts +23 -13
- package/types/bricks/Video.ts +11 -7
- package/types/bricks/VideoStreaming.ts +8 -4
- package/types/bricks/WebRtcStream.ts +7 -3
- package/types/bricks/WebView.ts +12 -8
- package/types/canvas.ts +4 -2
- package/types/common.ts +19 -12
- package/types/data-calc-command.ts +2 -0
- package/types/data-calc.ts +1 -0
- package/types/data.ts +2 -0
- package/types/generators/AlarmClock.ts +17 -11
- package/types/generators/Assistant.ts +69 -18
- package/types/generators/BleCentral.ts +31 -11
- package/types/generators/BlePeripheral.ts +11 -7
- package/types/generators/CanvasMap.ts +10 -6
- package/types/generators/CastlesPay.ts +15 -7
- package/types/generators/DataBank.ts +44 -9
- package/types/generators/File.ts +109 -30
- package/types/generators/GraphQl.ts +12 -6
- package/types/generators/Http.ts +33 -10
- package/types/generators/HttpServer.ts +23 -15
- package/types/generators/Information.ts +9 -5
- package/types/generators/Intent.ts +15 -5
- package/types/generators/Iterator.ts +15 -11
- package/types/generators/Keyboard.ts +27 -13
- package/types/generators/LlmAnthropicCompat.ts +33 -11
- package/types/generators/LlmAppleBuiltin.ts +25 -10
- package/types/generators/LlmGgml.ts +140 -31
- package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
- package/types/generators/LlmMlx.ts +227 -0
- package/types/generators/LlmOnnx.ts +34 -14
- package/types/generators/LlmOpenAiCompat.ts +47 -11
- package/types/generators/LlmQualcommAiEngine.ts +45 -13
- package/types/generators/Mcp.ts +375 -34
- package/types/generators/McpServer.ts +58 -19
- package/types/generators/MediaFlow.ts +38 -12
- package/types/generators/MqttBroker.ts +29 -11
- package/types/generators/MqttClient.ts +19 -9
- package/types/generators/Question.ts +13 -9
- package/types/generators/RealtimeTranscription.ts +108 -19
- package/types/generators/RerankerGgml.ts +43 -12
- package/types/generators/SerialPort.ts +18 -10
- package/types/generators/SoundPlayer.ts +10 -4
- package/types/generators/SoundRecorder.ts +24 -9
- package/types/generators/SpeechToTextGgml.ts +52 -18
- package/types/generators/SpeechToTextOnnx.ts +18 -11
- package/types/generators/SpeechToTextPlatform.ts +15 -7
- package/types/generators/SqLite.ts +20 -10
- package/types/generators/Step.ts +9 -5
- package/types/generators/SttAppleBuiltin.ts +22 -9
- package/types/generators/Tcp.ts +13 -9
- package/types/generators/TcpServer.ts +20 -14
- package/types/generators/TextToSpeechAppleBuiltin.ts +21 -8
- package/types/generators/TextToSpeechGgml.ts +29 -11
- package/types/generators/TextToSpeechOnnx.ts +19 -12
- package/types/generators/TextToSpeechOpenAiLike.ts +14 -8
- package/types/generators/ThermalPrinter.ts +13 -9
- package/types/generators/Tick.ts +11 -7
- package/types/generators/Udp.ts +17 -8
- package/types/generators/VadGgml.ts +51 -14
- package/types/generators/VadOnnx.ts +42 -12
- package/types/generators/VadTraditional.ts +28 -13
- package/types/generators/VectorStore.ts +33 -12
- package/types/generators/Watchdog.ts +19 -10
- package/types/generators/WebCrawler.ts +11 -7
- package/types/generators/WebRtc.ts +30 -16
- package/types/generators/WebSocket.ts +11 -7
- package/types/generators/index.ts +2 -0
- package/types/subspace.ts +3 -0
- package/types/system.ts +1 -1
- package/utils/calc.ts +12 -8
- package/utils/event-props.ts +833 -1022
- package/utils/id.ts +4 -0
- package/api/index.ts +0 -1
- package/api/instance.ts +0 -213
- package/skills/bricks-project/rules/automations.md +0 -175
- package/types/generators/TextToSpeechApple.ts +0 -113
- package/types/generators/TtsAppleBuiltin.ts +0 -105
package/types/bricks/Text.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Display styled text with font, color, alignment, and truncation controls
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
@@ -12,6 +15,7 @@ import type {
|
|
|
12
15
|
EventProperty,
|
|
13
16
|
} from '../common'
|
|
14
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
15
19
|
|
|
16
20
|
interface BrickTextDef {
|
|
17
21
|
/*
|
|
@@ -105,9 +109,9 @@ Default property:
|
|
|
105
109
|
}
|
|
106
110
|
outlets?: {
|
|
107
111
|
/* Brick is pressing */
|
|
108
|
-
brickPressing?: () => Data
|
|
112
|
+
brickPressing?: () => Data<boolean>
|
|
109
113
|
/* Brick is focusing (Use TV Device with controller) */
|
|
110
|
-
brickFocusing?: () => Data
|
|
114
|
+
brickFocusing?: () => Data<boolean>
|
|
111
115
|
}
|
|
112
116
|
animation?: AnimationBasicEvents & {
|
|
113
117
|
onPress?: Animation
|
|
@@ -121,11 +125,11 @@ Default property:
|
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
127
|
|
|
124
|
-
/*
|
|
128
|
+
/* Display styled text with font, color, alignment, and truncation controls */
|
|
125
129
|
export type BrickText = Brick &
|
|
126
130
|
BrickTextDef & {
|
|
127
131
|
templateKey: 'BRICK_TEXT'
|
|
128
|
-
switches
|
|
132
|
+
switches?: Array<
|
|
129
133
|
SwitchDef &
|
|
130
134
|
BrickTextDef & {
|
|
131
135
|
conds?: Array<{
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Editable text input field with keyboard type, placeholder, and validation support
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
@@ -12,6 +15,7 @@ import type {
|
|
|
12
15
|
EventProperty,
|
|
13
16
|
} from '../common'
|
|
14
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
15
19
|
|
|
16
20
|
/* Focus TextInput */
|
|
17
21
|
export type BrickTextInputActionFocus = Action & {
|
|
@@ -172,29 +176,35 @@ Default property:
|
|
|
172
176
|
/* Event of the TextInput is empty */
|
|
173
177
|
onEmpty?: Array<EventAction>
|
|
174
178
|
/* Event of the TextInput value change */
|
|
175
|
-
onChange?: Array<EventAction
|
|
179
|
+
onChange?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onChange']>>
|
|
176
180
|
/* Event of the TextInput submit */
|
|
177
|
-
onSubmit?: Array<EventAction
|
|
181
|
+
onSubmit?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onSubmit']>>
|
|
178
182
|
/* Event of the TextInput match regex (check every value change) */
|
|
179
|
-
onMatch?: Array<EventAction
|
|
183
|
+
onMatch?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onMatch']>>
|
|
180
184
|
/* Event of the TextInput not match regex (check every value change) */
|
|
181
|
-
onNotMatch?: Array<EventAction
|
|
185
|
+
onNotMatch?: Array<EventAction<string & keyof TemplateEventPropsMap['TextInput']['onNotMatch']>>
|
|
182
186
|
/* Event of the TextInput not match regex (check every submit) */
|
|
183
|
-
onResultNotMatch?: Array<
|
|
187
|
+
onResultNotMatch?: Array<
|
|
188
|
+
EventAction<string & keyof TemplateEventPropsMap['TextInput']['onResultNotMatch']>
|
|
189
|
+
>
|
|
184
190
|
/* Event of the TextInput reach max length or match regex */
|
|
185
191
|
onFullFill?: Array<EventAction>
|
|
186
192
|
}
|
|
187
193
|
outlets?: {
|
|
188
194
|
/* The raw input */
|
|
189
|
-
rawInput?: () => Data
|
|
195
|
+
rawInput?: () => Data<any>
|
|
190
196
|
/* The regex result */
|
|
191
|
-
resultVariable?: () => Data
|
|
197
|
+
resultVariable?: () => Data<{ [key: string]: any }>
|
|
192
198
|
/* Last key in */
|
|
193
|
-
lastKey?: () => Data
|
|
199
|
+
lastKey?: () => Data<any>
|
|
194
200
|
/* Selection of the TextInput (start, end, text) */
|
|
195
|
-
selection?: () => Data
|
|
201
|
+
selection?: () => Data<{
|
|
202
|
+
start?: number
|
|
203
|
+
end?: number
|
|
204
|
+
text?: string
|
|
205
|
+
}>
|
|
196
206
|
/* Selection text of the TextInput */
|
|
197
|
-
selectionText?: () => Data
|
|
207
|
+
selectionText?: () => Data<string>
|
|
198
208
|
}
|
|
199
209
|
animation?: AnimationBasicEvents & {
|
|
200
210
|
onFocus?: Animation
|
|
@@ -209,11 +219,11 @@ Default property:
|
|
|
209
219
|
}
|
|
210
220
|
}
|
|
211
221
|
|
|
212
|
-
/*
|
|
222
|
+
/* Editable text input field with keyboard type, placeholder, and validation support */
|
|
213
223
|
export type BrickTextInput = Brick &
|
|
214
224
|
BrickTextInputDef & {
|
|
215
225
|
templateKey: 'BRICK_TEXT_INPUT'
|
|
216
|
-
switches
|
|
226
|
+
switches?: Array<
|
|
217
227
|
SwitchDef &
|
|
218
228
|
BrickTextInputDef & {
|
|
219
229
|
conds?: Array<{
|
package/types/bricks/Video.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Video playback with play/pause controls and streaming support
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
@@ -12,6 +15,7 @@ import type {
|
|
|
12
15
|
EventProperty,
|
|
13
16
|
} from '../common'
|
|
14
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
15
19
|
|
|
16
20
|
/* Play the video */
|
|
17
21
|
export type BrickVideoActionPlay = Action & {
|
|
@@ -117,7 +121,7 @@ Default property:
|
|
|
117
121
|
/* Event of the brick blur (Use TV Device with controller) */
|
|
118
122
|
onBlur?: Array<EventAction>
|
|
119
123
|
/* Event of the next video on change start */
|
|
120
|
-
nextVideo?: Array<EventAction
|
|
124
|
+
nextVideo?: Array<EventAction<string & keyof TemplateEventPropsMap['Video']['nextVideo']>>
|
|
121
125
|
/* Event on plays of path are totally end */
|
|
122
126
|
roundEnd?: Array<EventAction>
|
|
123
127
|
/* Event on video load */
|
|
@@ -125,13 +129,13 @@ Default property:
|
|
|
125
129
|
/* Event of the video playing error */
|
|
126
130
|
onError?: Array<EventAction>
|
|
127
131
|
/* Event of the video progress interval */
|
|
128
|
-
onProgress?: Array<EventAction
|
|
132
|
+
onProgress?: Array<EventAction<string & keyof TemplateEventPropsMap['Video']['onProgress']>>
|
|
129
133
|
}
|
|
130
134
|
outlets?: {
|
|
131
135
|
/* Brick is pressing */
|
|
132
|
-
brickPressing?: () => Data
|
|
136
|
+
brickPressing?: () => Data<boolean>
|
|
133
137
|
/* Brick is focusing (Use TV Device with controller) */
|
|
134
|
-
brickFocusing?: () => Data
|
|
138
|
+
brickFocusing?: () => Data<boolean>
|
|
135
139
|
}
|
|
136
140
|
animation?: AnimationBasicEvents & {
|
|
137
141
|
onPress?: Animation
|
|
@@ -148,11 +152,11 @@ Default property:
|
|
|
148
152
|
}
|
|
149
153
|
}
|
|
150
154
|
|
|
151
|
-
/* Video
|
|
155
|
+
/* Video playback with play/pause controls and streaming support */
|
|
152
156
|
export type BrickVideo = Brick &
|
|
153
157
|
BrickVideoDef & {
|
|
154
158
|
templateKey: 'BRICK_VIDEO'
|
|
155
|
-
switches
|
|
159
|
+
switches?: Array<
|
|
156
160
|
SwitchDef &
|
|
157
161
|
BrickVideoDef & {
|
|
158
162
|
conds?: Array<{
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Brick video streaming component, supports RTSP / RTMP streaming.
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
@@ -12,6 +15,7 @@ import type {
|
|
|
12
15
|
EventProperty,
|
|
13
16
|
} from '../common'
|
|
14
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
15
19
|
|
|
16
20
|
interface BrickVideoStreamingDef {
|
|
17
21
|
/*
|
|
@@ -68,9 +72,9 @@ Default property:
|
|
|
68
72
|
}
|
|
69
73
|
outlets?: {
|
|
70
74
|
/* Brick is pressing */
|
|
71
|
-
brickPressing?: () => Data
|
|
75
|
+
brickPressing?: () => Data<boolean>
|
|
72
76
|
/* Brick is focusing (Use TV Device with controller) */
|
|
73
|
-
brickFocusing?: () => Data
|
|
77
|
+
brickFocusing?: () => Data<boolean>
|
|
74
78
|
}
|
|
75
79
|
animation?: AnimationBasicEvents & {
|
|
76
80
|
onPress?: Animation
|
|
@@ -89,7 +93,7 @@ Default property:
|
|
|
89
93
|
export type BrickVideoStreaming = Brick &
|
|
90
94
|
BrickVideoStreamingDef & {
|
|
91
95
|
templateKey: 'BRICK_VIDEO_STREAMING'
|
|
92
|
-
switches
|
|
96
|
+
switches?: Array<
|
|
93
97
|
SwitchDef &
|
|
94
98
|
BrickVideoStreamingDef & {
|
|
95
99
|
conds?: Array<{
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Display WebRTC video/audio stream from a WebRTC generator connection
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
@@ -12,6 +15,7 @@ import type {
|
|
|
12
15
|
EventProperty,
|
|
13
16
|
} from '../common'
|
|
14
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
15
19
|
|
|
16
20
|
interface BrickWebRTCStreamDef {
|
|
17
21
|
/*
|
|
@@ -38,11 +42,11 @@ Default property:
|
|
|
38
42
|
}
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
/*
|
|
45
|
+
/* Display WebRTC video/audio stream from a WebRTC generator connection */
|
|
42
46
|
export type BrickWebRTCStream = Brick &
|
|
43
47
|
BrickWebRTCStreamDef & {
|
|
44
48
|
templateKey: 'BRICK_WEBRTC_STREAM'
|
|
45
|
-
switches
|
|
49
|
+
switches?: Array<
|
|
46
50
|
SwitchDef &
|
|
47
51
|
BrickWebRTCStreamDef & {
|
|
48
52
|
conds?: Array<{
|
package/types/bricks/WebView.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Embedded web browser with JS injection, DOM query selectors, content cropping, navigation control, and permission management
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
@@ -12,6 +15,7 @@ import type {
|
|
|
12
15
|
EventProperty,
|
|
13
16
|
} from '../common'
|
|
14
17
|
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
18
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
15
19
|
|
|
16
20
|
/* Run Javascript on the WebView */
|
|
17
21
|
export type BrickWebViewActionInjectJavascript = ActionWithParams & {
|
|
@@ -122,17 +126,17 @@ Default property:
|
|
|
122
126
|
}
|
|
123
127
|
events?: BrickBasicEvents & {
|
|
124
128
|
/* Event of the WebView on load */
|
|
125
|
-
onLoad?: Array<EventAction
|
|
129
|
+
onLoad?: Array<EventAction<string & keyof TemplateEventPropsMap['Webview']['onLoad']>>
|
|
126
130
|
/* Event when the WebView load fails */
|
|
127
|
-
onError?: Array<EventAction
|
|
131
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Webview']['onError']>>
|
|
128
132
|
/* Event of the webview on message by `window.ReactNativeWebView.postMessage` on you're injected javascript code */
|
|
129
|
-
onMessage?: Array<EventAction
|
|
133
|
+
onMessage?: Array<EventAction<string & keyof TemplateEventPropsMap['Webview']['onMessage']>>
|
|
130
134
|
}
|
|
131
135
|
outlets?: {
|
|
132
136
|
/* The result of the query selector action */
|
|
133
|
-
queryResult?: () => Data
|
|
137
|
+
queryResult?: () => Data<any>
|
|
134
138
|
/* The error of the query selector action */
|
|
135
|
-
queryError?: () => Data
|
|
139
|
+
queryError?: () => Data<string>
|
|
136
140
|
}
|
|
137
141
|
animation?: AnimationBasicEvents & {
|
|
138
142
|
onLoad?: Animation
|
|
@@ -141,11 +145,11 @@ Default property:
|
|
|
141
145
|
}
|
|
142
146
|
}
|
|
143
147
|
|
|
144
|
-
/*
|
|
148
|
+
/* Embedded web browser with JS injection, DOM query selectors, content cropping, navigation control, and permission management */
|
|
145
149
|
export type BrickWebView = Brick &
|
|
146
150
|
BrickWebViewDef & {
|
|
147
151
|
templateKey: 'BRICK_WEBVIEW'
|
|
148
|
-
switches
|
|
152
|
+
switches?: Array<
|
|
149
153
|
SwitchDef &
|
|
150
154
|
BrickWebViewDef & {
|
|
151
155
|
conds?: Array<{
|
package/types/canvas.ts
CHANGED
|
@@ -36,9 +36,11 @@ interface CanvasDef {
|
|
|
36
36
|
export type Canvas = CanvasDef & {
|
|
37
37
|
__typename: 'Canvas'
|
|
38
38
|
id: string
|
|
39
|
-
|
|
39
|
+
alias?: string
|
|
40
|
+
title?: string
|
|
40
41
|
description?: string
|
|
41
|
-
|
|
42
|
+
hideShortRef?: boolean
|
|
43
|
+
switches?: Array<
|
|
42
44
|
SwitchDef &
|
|
43
45
|
CanvasDef & {
|
|
44
46
|
conds?: Array<{
|
package/types/common.ts
CHANGED
|
@@ -6,9 +6,11 @@ import type { AutomationMap } from './automation'
|
|
|
6
6
|
export interface Brick {
|
|
7
7
|
__typename: 'Brick'
|
|
8
8
|
id: string
|
|
9
|
+
alias?: string
|
|
9
10
|
templateKey: string
|
|
10
|
-
title
|
|
11
|
-
description
|
|
11
|
+
title?: string
|
|
12
|
+
description?: string
|
|
13
|
+
hideShortRef?: boolean
|
|
12
14
|
property?: {}
|
|
13
15
|
events: {}
|
|
14
16
|
outlets?: {}
|
|
@@ -24,9 +26,11 @@ export enum LocalSyncStrategy {
|
|
|
24
26
|
export interface Generator {
|
|
25
27
|
__typename: 'Generator'
|
|
26
28
|
id: string
|
|
29
|
+
alias?: string
|
|
27
30
|
templateKey: string
|
|
28
|
-
title
|
|
29
|
-
description
|
|
31
|
+
title?: string
|
|
32
|
+
description?: string
|
|
33
|
+
hideShortRef?: boolean
|
|
30
34
|
localSyncRunMode?: LocalSyncStrategy
|
|
31
35
|
property?: {}
|
|
32
36
|
events: {}
|
|
@@ -43,34 +47,36 @@ export type Action = {
|
|
|
43
47
|
name?: string
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
//
|
|
50
|
+
// For standalone action types where specific event properties are not known
|
|
47
51
|
export type EventProperty = string
|
|
48
52
|
|
|
49
|
-
export type ActionWithParams = Action & {
|
|
53
|
+
export type ActionWithParams<EP extends string = string> = Action & {
|
|
50
54
|
params?: Array<{
|
|
51
55
|
input: string
|
|
52
|
-
value?: any |
|
|
56
|
+
value?: any | EP
|
|
53
57
|
mapping?: string
|
|
54
58
|
}>
|
|
55
59
|
}
|
|
56
60
|
|
|
57
|
-
export type ActionWithDataParams = Action & {
|
|
61
|
+
export type ActionWithDataParams<EP extends string = string> = Action & {
|
|
58
62
|
dataParams?: Array<{
|
|
59
63
|
input: () => Data
|
|
60
|
-
value?: any |
|
|
64
|
+
value?: any | EP
|
|
61
65
|
mapping?: string
|
|
62
66
|
}>
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
export type ItemBrickID = string
|
|
66
70
|
|
|
67
|
-
|
|
71
|
+
// EP carries available event property keys for this event context
|
|
72
|
+
// Use: EventAction<string & keyof TemplateEventPropsMap['Name']['event']>
|
|
73
|
+
export type EventAction<EP extends string = string> = {
|
|
68
74
|
handler: 'system' | (() => Brick | Generator) | SubspaceID | ItemBrickID
|
|
69
|
-
action: ActionWithParams | ActionWithDataParams
|
|
75
|
+
action: ActionWithParams<EP> | ActionWithDataParams<EP>
|
|
70
76
|
waitAsync?: boolean
|
|
71
77
|
}
|
|
72
78
|
|
|
73
|
-
export type EventActionForItem = {
|
|
79
|
+
export type EventActionForItem<EP extends string = string> = {
|
|
74
80
|
handler:
|
|
75
81
|
| 'system'
|
|
76
82
|
| (() => Brick | Generator | { brickId: string; templateKey: string })
|
|
@@ -121,6 +127,7 @@ export type ApplicationSettings = {
|
|
|
121
127
|
useOpenAiApiKeySystemData?: boolean
|
|
122
128
|
useGeminiApiKeySystemData?: boolean
|
|
123
129
|
}
|
|
130
|
+
hideShortRefs?: boolean
|
|
124
131
|
}
|
|
125
132
|
|
|
126
133
|
export type Application = {
|
|
@@ -6,6 +6,7 @@ export interface DataCalculationData {
|
|
|
6
6
|
__typename: 'DataCalculationData'
|
|
7
7
|
title?: string
|
|
8
8
|
description?: string
|
|
9
|
+
hideShortRef?: boolean
|
|
9
10
|
data: () => Data
|
|
10
11
|
inputs: Array<{
|
|
11
12
|
key: 'change'
|
|
@@ -26,6 +27,7 @@ export interface DataCommand {
|
|
|
26
27
|
id: string
|
|
27
28
|
title?: string
|
|
28
29
|
description?: string
|
|
30
|
+
hideShortRef?: boolean
|
|
29
31
|
inputs: Array<{
|
|
30
32
|
key: string
|
|
31
33
|
source: (() => DataCalculationData | DataCommand) | any
|
package/types/data-calc.ts
CHANGED
|
@@ -4,6 +4,7 @@ export interface DataCalculation {
|
|
|
4
4
|
id: string
|
|
5
5
|
title?: string
|
|
6
6
|
description?: string
|
|
7
|
+
hideShortRef?: boolean
|
|
7
8
|
// Auto: Run the calculation when inputs change and allow triggers. Careful with circular dependencies!
|
|
8
9
|
// Manual: Only run the calculation when manually triggered by System Action PROPERTY_BANK_COMMAND
|
|
9
10
|
triggerMode?: 'auto' | 'manual'
|
package/types/data.ts
CHANGED
|
@@ -17,8 +17,10 @@ interface DataDef {
|
|
|
17
17
|
export type Data<T = any> = DataDef & {
|
|
18
18
|
__typename: 'Data'
|
|
19
19
|
id: string
|
|
20
|
+
alias?: string
|
|
20
21
|
title: string
|
|
21
22
|
description?: string
|
|
23
|
+
hideShortRef?: boolean
|
|
22
24
|
metadata?: {
|
|
23
25
|
linked?: Array<SubspaceID>
|
|
24
26
|
linkedFrom?: SubspaceID
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Schedule events using cron expressions (e.g. daily, hourly)
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type {
|
|
@@ -10,6 +13,7 @@ import type {
|
|
|
10
13
|
Action,
|
|
11
14
|
EventProperty,
|
|
12
15
|
} from '../common'
|
|
16
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
13
17
|
|
|
14
18
|
/* Start the alarm clock */
|
|
15
19
|
export type GeneratorAlarmClockActionStart = Action & {
|
|
@@ -61,31 +65,33 @@ Default property:
|
|
|
61
65
|
}
|
|
62
66
|
events?: {
|
|
63
67
|
/* Event for cron rule is not invalid */
|
|
64
|
-
onRuleInvalid?: Array<
|
|
68
|
+
onRuleInvalid?: Array<
|
|
69
|
+
EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onRuleInvalid']>
|
|
70
|
+
>
|
|
65
71
|
/* Event for alarm clock start */
|
|
66
|
-
onStart?: Array<EventAction
|
|
72
|
+
onStart?: Array<EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onStart']>>
|
|
67
73
|
/* Event for alarm clock trig */
|
|
68
|
-
onTrig?: Array<EventAction
|
|
74
|
+
onTrig?: Array<EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onTrig']>>
|
|
69
75
|
/* Event for alarm clock stop */
|
|
70
|
-
onEnd?: Array<EventAction
|
|
76
|
+
onEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onEnd']>>
|
|
71
77
|
}
|
|
72
78
|
outlets?: {
|
|
73
79
|
/* Current time of each alarm clock trig */
|
|
74
|
-
trigTime?: () => Data
|
|
80
|
+
trigTime?: () => Data<string>
|
|
75
81
|
/* Current timestamp (unix time) of each alarm clock trig */
|
|
76
|
-
trigTimestamp?: () => Data
|
|
82
|
+
trigTimestamp?: () => Data<string | number>
|
|
77
83
|
/* Count of alarm clock trigs */
|
|
78
|
-
trigCount?: () => Data
|
|
84
|
+
trigCount?: () => Data<string | number>
|
|
79
85
|
/* Is alarm clock running? */
|
|
80
|
-
running?: () => Data
|
|
86
|
+
running?: () => Data<boolean | string | number>
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
|
|
84
|
-
/*
|
|
90
|
+
/* Schedule events using cron expressions (e.g. daily, hourly) */
|
|
85
91
|
export type GeneratorAlarmClock = Generator &
|
|
86
92
|
GeneratorAlarmClockDef & {
|
|
87
93
|
templateKey: 'GENERATOR_ALARM_CLOCK'
|
|
88
|
-
switches
|
|
94
|
+
switches?: Array<
|
|
89
95
|
SwitchDef &
|
|
90
96
|
GeneratorAlarmClockDef & {
|
|
91
97
|
conds?: Array<{
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Conversational AI agent orchestrating LLM (GGML/MLX/OpenAI/QNN/ONNX/Anthropic/NeuroPilot), STT, TTS, MCP tool-use, and file search (RAG) with auto-summary
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type {
|
|
@@ -10,6 +13,7 @@ import type {
|
|
|
10
13
|
Action,
|
|
11
14
|
EventProperty,
|
|
12
15
|
} from '../common'
|
|
16
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
13
17
|
|
|
14
18
|
/* Add a message to the assistant */
|
|
15
19
|
export type GeneratorAssistantActionAddMessage = ActionWithParams & {
|
|
@@ -364,7 +368,7 @@ export type GeneratorAssistantActionInsertMcpResource = ActionWithParams & {
|
|
|
364
368
|
>
|
|
365
369
|
}
|
|
366
370
|
|
|
367
|
-
/* Summarize messages based on the conversation
|
|
371
|
+
/* Summarize messages based on the conversation
|
|
368
372
|
|
|
369
373
|
Note: Summary uses the same LLM context size, so it is recommended only to use it when the system prompt (in Initial Messages) is long, otherwise it may still fail when the context is full (Ctx Shift is NO). */
|
|
370
374
|
export type GeneratorAssistantActionSummaryMessages = ActionWithParams & {
|
|
@@ -434,15 +438,15 @@ Default property:
|
|
|
434
438
|
| DataLink
|
|
435
439
|
/* Whether to cache messages */
|
|
436
440
|
cacheMessages?: boolean | DataLink
|
|
437
|
-
/* LLM Generator (Supports `LLM (GGML)`
|
|
441
|
+
/* LLM Generator (Supports `LLM (GGML)`, `LLM (MLX)`, `OpenAI LLM`, `LLM (Qualcomm AI Engine)`, `LLM (ONNX)`, `LLM (Anthropic-compat)`, and `LLM (MediaTek NeuroPilot)` generators) */
|
|
438
442
|
llmGeneratorId?: string | DataLink | (() => Generator)
|
|
439
|
-
/* LLM Live Policy. If the policy is `only-in-use`, the LLM context will be released when the assistant is not in use.
|
|
443
|
+
/* LLM Live Policy. If the policy is `only-in-use`, the LLM context will be released when the assistant is not in use.
|
|
440
444
|
|
|
441
445
|
Note: LLM (Qualcomm AI Engine) recommend use `manual` and loaded constantly. */
|
|
442
446
|
llmLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
443
447
|
/* LLM main session key */
|
|
444
448
|
llmSessionKey?: string | DataLink
|
|
445
|
-
/* Auto Summary Messages (Automatically summarize messages when the LLM context is full or content gets truncated, currently only supported with LLM (GGML) generators)
|
|
449
|
+
/* Auto Summary Messages (Automatically summarize messages when the LLM context is full or content gets truncated, currently only supported with LLM (GGML) generators)
|
|
446
450
|
|
|
447
451
|
Note: Summary uses the same LLM context size, so it is recommended only to use it when the system prompt (in Initial Messages) is long, otherwise it may still fail when the context is full (Ctx Shift is NO). */
|
|
448
452
|
llmAutoSummaryMessages?: boolean | DataLink
|
|
@@ -510,41 +514,88 @@ Default property:
|
|
|
510
514
|
}
|
|
511
515
|
events?: {
|
|
512
516
|
/* Error event */
|
|
513
|
-
onError?: Array<EventAction
|
|
517
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Assistant']['onError']>>
|
|
514
518
|
/* Log event */
|
|
515
|
-
onLogs?: Array<EventAction
|
|
519
|
+
onLogs?: Array<EventAction<string & keyof TemplateEventPropsMap['Assistant']['onLogs']>>
|
|
516
520
|
/* Messages update event */
|
|
517
|
-
onMessagesUpdate?: Array<
|
|
521
|
+
onMessagesUpdate?: Array<
|
|
522
|
+
EventAction<string & keyof TemplateEventPropsMap['Assistant']['onMessagesUpdate']>
|
|
523
|
+
>
|
|
518
524
|
/* Heatup finished event */
|
|
519
525
|
onHeatupFinished?: Array<EventAction>
|
|
520
526
|
/* Generating event (triggered when assistant starts generating response) */
|
|
521
527
|
onGenerating?: Array<EventAction>
|
|
522
528
|
/* Finished event (triggered when assistant finishes generating response) */
|
|
523
|
-
onFinished?: Array<EventAction
|
|
529
|
+
onFinished?: Array<EventAction<string & keyof TemplateEventPropsMap['Assistant']['onFinished']>>
|
|
524
530
|
}
|
|
525
531
|
outlets?: {
|
|
526
532
|
/* Whether the assistant is heating up */
|
|
527
|
-
isHeatingUp?: () => Data
|
|
533
|
+
isHeatingUp?: () => Data<boolean>
|
|
528
534
|
/* Whether the assistant is file processing */
|
|
529
|
-
isFileProcessing?: () => Data
|
|
535
|
+
isFileProcessing?: () => Data<boolean>
|
|
530
536
|
/* Whether the assistant is responding */
|
|
531
|
-
isResponding?: () => Data
|
|
537
|
+
isResponding?: () => Data<boolean>
|
|
532
538
|
/* Whether the assistant is busy */
|
|
533
|
-
isBusy?: () => Data
|
|
539
|
+
isBusy?: () => Data<boolean>
|
|
534
540
|
/* Embedding files of the assistant */
|
|
535
|
-
files?: () => Data
|
|
541
|
+
files?: () => Data<Array<any>>
|
|
536
542
|
/* Messages of the assistant */
|
|
537
|
-
messages?: () => Data
|
|
543
|
+
messages?: () => Data<
|
|
544
|
+
Array<{
|
|
545
|
+
role?: string
|
|
546
|
+
name?: string
|
|
547
|
+
content?: any
|
|
548
|
+
tool_call_id?: string
|
|
549
|
+
tool_calls?: Array<{
|
|
550
|
+
id?: string
|
|
551
|
+
type?: string
|
|
552
|
+
function?: {
|
|
553
|
+
name?: string
|
|
554
|
+
arguments?: string
|
|
555
|
+
[key: string]: any
|
|
556
|
+
}
|
|
557
|
+
[key: string]: any
|
|
558
|
+
}>
|
|
559
|
+
reasoning_content?: string
|
|
560
|
+
audio?: {
|
|
561
|
+
generating?: boolean
|
|
562
|
+
[key: string]: any
|
|
563
|
+
}
|
|
564
|
+
last_generated_at?: number
|
|
565
|
+
responding?: boolean
|
|
566
|
+
is_summary?: boolean
|
|
567
|
+
summary_created_at?: number
|
|
568
|
+
[key: string]: any
|
|
569
|
+
}>
|
|
570
|
+
>
|
|
538
571
|
/* MCP servers status and available tools */
|
|
539
|
-
mcpServers?: () => Data
|
|
572
|
+
mcpServers?: () => Data<
|
|
573
|
+
Array<{
|
|
574
|
+
generatorId?: string
|
|
575
|
+
generatorKey?: string
|
|
576
|
+
name?: string
|
|
577
|
+
version?: string
|
|
578
|
+
connected?: boolean
|
|
579
|
+
error?: string
|
|
580
|
+
resources?: Array<{
|
|
581
|
+
name?: string
|
|
582
|
+
[key: string]: any
|
|
583
|
+
}>
|
|
584
|
+
tools?: Array<{
|
|
585
|
+
name?: string
|
|
586
|
+
[key: string]: any
|
|
587
|
+
}>
|
|
588
|
+
[key: string]: any
|
|
589
|
+
}>
|
|
590
|
+
>
|
|
540
591
|
}
|
|
541
592
|
}
|
|
542
593
|
|
|
543
|
-
/* AI
|
|
594
|
+
/* Conversational AI agent orchestrating LLM (GGML/MLX/OpenAI/QNN/ONNX/Anthropic/NeuroPilot), STT, TTS, MCP tool-use, and file search (RAG) with auto-summary */
|
|
544
595
|
export type GeneratorAssistant = Generator &
|
|
545
596
|
GeneratorAssistantDef & {
|
|
546
597
|
templateKey: 'GENERATOR_ASSISTANT'
|
|
547
|
-
switches
|
|
598
|
+
switches?: Array<
|
|
548
599
|
SwitchDef &
|
|
549
600
|
GeneratorAssistantDef & {
|
|
550
601
|
conds?: Array<{
|