@fugood/bricks-project 2.24.0-beta.9 → 2.24.0
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 +460 -158
- 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-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 +135 -2
- package/tools/preview.ts +41 -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 +47 -12
- package/types/bricks/Chart.ts +9 -3
- package/types/bricks/GenerativeMedia.ts +29 -13
- package/types/bricks/Icon.ts +8 -4
- package/types/bricks/Image.ts +9 -5
- package/types/bricks/Items.ts +28 -14
- package/types/bricks/Lottie.ts +14 -6
- package/types/bricks/Maps.ts +15 -7
- package/types/bricks/QrCode.ts +8 -4
- package/types/bricks/Rect.ts +44 -5
- package/types/bricks/RichText.ts +8 -4
- package/types/bricks/Rive.ts +20 -10
- package/types/bricks/Slideshow.ts +19 -9
- package/types/bricks/Svg.ts +7 -3
- package/types/bricks/Text.ts +8 -4
- package/types/bricks/TextInput.ts +22 -12
- package/types/bricks/Video.ts +10 -6
- package/types/bricks/VideoStreaming.ts +7 -3
- package/types/bricks/WebRtcStream.ts +6 -2
- package/types/bricks/WebView.ts +11 -7
- package/types/canvas.ts +2 -0
- package/types/common.ts +15 -8
- 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 +16 -10
- package/types/generators/Assistant.ts +68 -17
- package/types/generators/BleCentral.ts +30 -10
- package/types/generators/BlePeripheral.ts +10 -6
- package/types/generators/CanvasMap.ts +9 -5
- package/types/generators/CastlesPay.ts +14 -6
- package/types/generators/DataBank.ts +43 -8
- package/types/generators/File.ts +108 -29
- package/types/generators/GraphQl.ts +11 -5
- package/types/generators/Http.ts +32 -9
- package/types/generators/HttpServer.ts +22 -14
- package/types/generators/Information.ts +8 -4
- package/types/generators/Intent.ts +14 -4
- package/types/generators/Iterator.ts +14 -10
- package/types/generators/Keyboard.ts +26 -12
- package/types/generators/LlmAnthropicCompat.ts +32 -10
- package/types/generators/LlmAppleBuiltin.ts +24 -9
- package/types/generators/LlmGgml.ts +139 -30
- package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
- package/types/generators/LlmMlx.ts +227 -0
- package/types/generators/LlmOnnx.ts +33 -13
- package/types/generators/LlmOpenAiCompat.ts +46 -10
- package/types/generators/LlmQualcommAiEngine.ts +44 -12
- package/types/generators/Mcp.ts +374 -33
- package/types/generators/McpServer.ts +57 -18
- package/types/generators/MediaFlow.ts +37 -11
- package/types/generators/MqttBroker.ts +28 -10
- package/types/generators/MqttClient.ts +18 -8
- package/types/generators/Question.ts +12 -8
- package/types/generators/RealtimeTranscription.ts +107 -18
- package/types/generators/RerankerGgml.ts +42 -11
- package/types/generators/SerialPort.ts +17 -9
- package/types/generators/SoundPlayer.ts +9 -3
- package/types/generators/SoundRecorder.ts +23 -8
- package/types/generators/SpeechToTextGgml.ts +51 -17
- package/types/generators/SpeechToTextOnnx.ts +17 -10
- package/types/generators/SpeechToTextPlatform.ts +14 -6
- package/types/generators/SqLite.ts +19 -9
- package/types/generators/Step.ts +8 -4
- package/types/generators/SttAppleBuiltin.ts +21 -8
- package/types/generators/Tcp.ts +12 -8
- package/types/generators/TcpServer.ts +19 -13
- package/types/generators/TextToSpeechAppleBuiltin.ts +20 -7
- package/types/generators/TextToSpeechGgml.ts +28 -10
- package/types/generators/TextToSpeechOnnx.ts +18 -11
- package/types/generators/TextToSpeechOpenAiLike.ts +13 -7
- package/types/generators/ThermalPrinter.ts +12 -8
- package/types/generators/Tick.ts +10 -6
- package/types/generators/Udp.ts +16 -7
- package/types/generators/VadGgml.ts +50 -13
- package/types/generators/VadOnnx.ts +41 -11
- package/types/generators/VadTraditional.ts +27 -12
- package/types/generators/VectorStore.ts +32 -11
- package/types/generators/Watchdog.ts +18 -9
- package/types/generators/WebCrawler.ts +10 -6
- package/types/generators/WebRtc.ts +29 -15
- package/types/generators/WebSocket.ts +10 -6
- package/types/generators/index.ts +2 -0
- package/types/subspace.ts +4 -0
- package/types/system.ts +1 -1
- package/utils/event-props.ts +833 -1022
- package/api/index.ts +0 -1
- package/api/instance.ts +0 -213
- package/types/generators/TextToSpeechApple.ts +0 -113
- package/types/generators/TtsAppleBuiltin.ts +0 -105
- /package/skills/{bricks-project → bricks-ctor}/rules/automations.md +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Fetch box's file list from Media Flow
|
|
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 fetcn Media box file list */
|
|
15
19
|
export type GeneratorMediaFlowActionFetch = Action & {
|
|
@@ -54,7 +58,7 @@ Default property:
|
|
|
54
58
|
passcode?: string | DataLink
|
|
55
59
|
/* Include File Types */
|
|
56
60
|
includeTypes?: Array<'IMAGE' | 'VIDEO' | 'AUDIO' | 'FILE' | DataLink> | DataLink
|
|
57
|
-
/* Determine the cache behavior
|
|
61
|
+
/* Determine the cache behavior
|
|
58
62
|
|
|
59
63
|
cache-first: Cache first if existing, then fetch from network
|
|
60
64
|
network-and-cache: Fetch from network, then save cache
|
|
@@ -87,13 +91,17 @@ Default property:
|
|
|
87
91
|
}
|
|
88
92
|
events?: {
|
|
89
93
|
/* Event of media box fetch error */
|
|
90
|
-
fetchError?: Array<EventAction
|
|
94
|
+
fetchError?: Array<EventAction<string & keyof TemplateEventPropsMap['MediaFlow']['fetchError']>>
|
|
91
95
|
/* Event of subscribe box change connected (If set `Subscribe Box Change`) */
|
|
92
96
|
subscribeBoxConnect?: Array<EventAction>
|
|
93
97
|
/* Event of subscribe box change error (If set `Subscribe Box Change`) */
|
|
94
|
-
subscribeBoxError?: Array<
|
|
98
|
+
subscribeBoxError?: Array<
|
|
99
|
+
EventAction<string & keyof TemplateEventPropsMap['MediaFlow']['subscribeBoxError']>
|
|
100
|
+
>
|
|
95
101
|
/* Event of subscribe box change connection error (If set `Subscribe Box Change`) */
|
|
96
|
-
subscribeBoxConnectError?: Array<
|
|
102
|
+
subscribeBoxConnectError?: Array<
|
|
103
|
+
EventAction<string & keyof TemplateEventPropsMap['MediaFlow']['subscribeBoxConnectError']>
|
|
104
|
+
>
|
|
97
105
|
/* Event of file sync completed for used `saveToStorage` */
|
|
98
106
|
saveStorageCompleted?: Array<EventAction>
|
|
99
107
|
/* Event when file list size exceed of Load size limit */
|
|
@@ -101,17 +109,35 @@ Default property:
|
|
|
101
109
|
}
|
|
102
110
|
outlets?: {
|
|
103
111
|
/* File sync status */
|
|
104
|
-
downloadStatus?: () => Data
|
|
112
|
+
downloadStatus?: () => Data<string>
|
|
105
113
|
/* File sync progress */
|
|
106
|
-
downloadProgress?: () => Data
|
|
114
|
+
downloadProgress?: () => Data<
|
|
115
|
+
Array<{
|
|
116
|
+
key?: string
|
|
117
|
+
progress?: number
|
|
118
|
+
finished?: boolean
|
|
119
|
+
[key: string]: any
|
|
120
|
+
}>
|
|
121
|
+
>
|
|
107
122
|
/* File sync download errors */
|
|
108
|
-
downloadErrors?: () => Data
|
|
123
|
+
downloadErrors?: () => Data<Array<string>>
|
|
109
124
|
/* Media box info */
|
|
110
|
-
box?: () => Data
|
|
125
|
+
box?: () => Data<{ [key: string]: any }>
|
|
111
126
|
/* Save Media Flow fetch result [ { "url": "https://d1kk0369g9vrck.cloudfront.net/box/5b431e29efd40c01e8b2019c/photo5b431e37efd40c01e8b201d1" "extension": "", // enum("jpg", "png", "mp4") "id": "5b431e37efd40c01e8b201d1", "md5": "6134ab412351651324" // md5 came from media resource api } ] */
|
|
112
|
-
result?: () => Data
|
|
127
|
+
result?: () => Data<
|
|
128
|
+
Array<{
|
|
129
|
+
id?: string
|
|
130
|
+
key?: string
|
|
131
|
+
mediaType?: string
|
|
132
|
+
extension?: string
|
|
133
|
+
original?: string
|
|
134
|
+
url?: string
|
|
135
|
+
metadata?: { [key: string]: any }
|
|
136
|
+
[key: string]: any
|
|
137
|
+
}>
|
|
138
|
+
>
|
|
113
139
|
/* File sync result [ { "url": "/storage/emulated/0/Download/SyncFolder/Asset/1.png", "mediaType": "photo" // enum("photo", "video"), used to distingiush "id": "", } ] */
|
|
114
|
-
downloadFileUrls?: () => Data
|
|
140
|
+
downloadFileUrls?: () => Data<Array<string>>
|
|
115
141
|
}
|
|
116
142
|
}
|
|
117
143
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Embedded MQTT broker server with client authentication, publish/subscribe messaging, keepalive, and retry support
|
|
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 MQTT broker server */
|
|
15
19
|
export type GeneratorMQTTBrokerActionStart = Action & {
|
|
@@ -80,27 +84,41 @@ Default property:
|
|
|
80
84
|
/* Event of MQTT server is ready */
|
|
81
85
|
onReady?: Array<EventAction>
|
|
82
86
|
/* Event of server or connection error */
|
|
83
|
-
onError?: Array<EventAction
|
|
87
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onError']>>
|
|
84
88
|
/* Event of client connected */
|
|
85
|
-
onClientConnected?: Array<
|
|
89
|
+
onClientConnected?: Array<
|
|
90
|
+
EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onClientConnected']>
|
|
91
|
+
>
|
|
86
92
|
/* Event of client disconnected */
|
|
87
|
-
onClientDisconnected?: Array<
|
|
93
|
+
onClientDisconnected?: Array<
|
|
94
|
+
EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onClientDisconnected']>
|
|
95
|
+
>
|
|
88
96
|
/* Event of message received */
|
|
89
|
-
onMessageReceived?: Array<
|
|
97
|
+
onMessageReceived?: Array<
|
|
98
|
+
EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onMessageReceived']>
|
|
99
|
+
>
|
|
90
100
|
/* Event of message published */
|
|
91
|
-
onMessagePublished?: Array<
|
|
101
|
+
onMessagePublished?: Array<
|
|
102
|
+
EventAction<string & keyof TemplateEventPropsMap['MqttBroker']['onMessagePublished']>
|
|
103
|
+
>
|
|
92
104
|
}
|
|
93
105
|
outlets?: {
|
|
94
106
|
/* Is server started */
|
|
95
|
-
started?: () => Data
|
|
107
|
+
started?: () => Data<boolean>
|
|
96
108
|
/* Last received message */
|
|
97
|
-
lastMessage?: () => Data
|
|
109
|
+
lastMessage?: () => Data<{
|
|
110
|
+
topic?: string
|
|
111
|
+
payload?: any
|
|
112
|
+
qos?: number
|
|
113
|
+
retain?: boolean
|
|
114
|
+
[key: string]: any
|
|
115
|
+
}>
|
|
98
116
|
/* Error message */
|
|
99
|
-
errorMessage?: () => Data
|
|
117
|
+
errorMessage?: () => Data<string>
|
|
100
118
|
}
|
|
101
119
|
}
|
|
102
120
|
|
|
103
|
-
/* MQTT
|
|
121
|
+
/* Embedded MQTT broker server with client authentication, publish/subscribe messaging, keepalive, and retry support */
|
|
104
122
|
export type GeneratorMQTTBroker = Generator &
|
|
105
123
|
GeneratorMQTTBrokerDef & {
|
|
106
124
|
templateKey: 'GENERATOR_MQTT_BROKER'
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* MQTT client with topic subscribe/publish, QoS levels (0/1/2), auto-reconnect, and auth support. Connects via mqtt:// or wss://
|
|
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
|
/* Connect to MQTT broker */
|
|
15
19
|
export type GeneratorMQTTActionConnect = Action & {
|
|
@@ -92,23 +96,29 @@ Default property:
|
|
|
92
96
|
/* When disconnected from MQTT broker */
|
|
93
97
|
onDisconnected?: Array<EventAction>
|
|
94
98
|
/* When error occurred */
|
|
95
|
-
onError?: Array<EventAction
|
|
99
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Mqtt']['onError']>>
|
|
96
100
|
/* When received message from MQTT broker within subscribe topic */
|
|
97
|
-
onMessage?: Array<EventAction
|
|
101
|
+
onMessage?: Array<EventAction<string & keyof TemplateEventPropsMap['Mqtt']['onMessage']>>
|
|
98
102
|
}
|
|
99
103
|
outlets?: {
|
|
100
104
|
/* Connected or not */
|
|
101
|
-
connected?: () => Data
|
|
105
|
+
connected?: () => Data<boolean>
|
|
102
106
|
/* Error Message */
|
|
103
|
-
error?: () => Data
|
|
107
|
+
error?: () => Data<string>
|
|
104
108
|
/* The receive message */
|
|
105
|
-
message?: () => Data
|
|
109
|
+
message?: () => Data<{
|
|
110
|
+
topic?: string
|
|
111
|
+
payload?: any
|
|
112
|
+
qos?: number
|
|
113
|
+
retain?: boolean
|
|
114
|
+
[key: string]: any
|
|
115
|
+
}>
|
|
106
116
|
/* The receive message (payload only) */
|
|
107
|
-
messagePayload?: () => Data
|
|
117
|
+
messagePayload?: () => Data<any>
|
|
108
118
|
}
|
|
109
119
|
}
|
|
110
120
|
|
|
111
|
-
/* MQTT
|
|
121
|
+
/* MQTT client with topic subscribe/publish, QoS levels (0/1/2), auto-reconnect, and auth support. Connects via mqtt:// or wss:// */
|
|
112
122
|
export type GeneratorMQTT = Generator &
|
|
113
123
|
GeneratorMQTTDef & {
|
|
114
124
|
templateKey: 'GENERATOR_MQTT'
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Prompt user for input via dialog and return the response
|
|
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 inquire */
|
|
15
19
|
export type GeneratorQuestionActionStart = Action & {
|
|
@@ -60,7 +64,7 @@ Default property:
|
|
|
60
64
|
property?: {
|
|
61
65
|
/* Modal mode */
|
|
62
66
|
modalMode?: 'root' | 'in-subspace' | DataLink
|
|
63
|
-
/* Inquirer schema
|
|
67
|
+
/* Inquirer schema
|
|
64
68
|
`key`: Field key (unique, required)
|
|
65
69
|
`kind`: Field type (required)
|
|
66
70
|
`title`: Field or message title
|
|
@@ -367,21 +371,21 @@ Default property:
|
|
|
367
371
|
/* Event of completed inquire */
|
|
368
372
|
onCompleted?: Array<EventAction>
|
|
369
373
|
/* Event of error occured */
|
|
370
|
-
onError?: Array<EventAction
|
|
374
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Question']['onError']>>
|
|
371
375
|
}
|
|
372
376
|
outlets?: {
|
|
373
377
|
/* Result data */
|
|
374
|
-
data?: () => Data
|
|
378
|
+
data?: () => Data<{ [key: string]: any }>
|
|
375
379
|
/* Currnet question */
|
|
376
|
-
currectKey?: () => Data
|
|
380
|
+
currectKey?: () => Data<string>
|
|
377
381
|
/* Currnet input value */
|
|
378
|
-
currectValue?: () => Data
|
|
382
|
+
currectValue?: () => Data<any>
|
|
379
383
|
/* Error message */
|
|
380
|
-
errorMessage?: () => Data
|
|
384
|
+
errorMessage?: () => Data<string>
|
|
381
385
|
}
|
|
382
386
|
}
|
|
383
387
|
|
|
384
|
-
/*
|
|
388
|
+
/* Prompt user for input via dialog and return the response */
|
|
385
389
|
export type GeneratorQuestion = Generator &
|
|
386
390
|
GeneratorQuestionDef & {
|
|
387
391
|
templateKey: 'GENERATOR_QUESTION'
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Realtime speech-to-text transcription using Whisper and VAD with live audio streaming
|
|
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 realtime transcription */
|
|
15
19
|
export type GeneratorRealtimeTranscriptionActionStart = Action & {
|
|
@@ -31,6 +35,11 @@ export type GeneratorRealtimeTranscriptionActionReset = Action & {
|
|
|
31
35
|
__actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_RESET'
|
|
32
36
|
}
|
|
33
37
|
|
|
38
|
+
/* List available microphone devices (Web / Desktop only) */
|
|
39
|
+
export type GeneratorRealtimeTranscriptionActionListDevices = Action & {
|
|
40
|
+
__actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_LIST_DEVICES'
|
|
41
|
+
}
|
|
42
|
+
|
|
34
43
|
interface GeneratorRealtimeTranscriptionDef {
|
|
35
44
|
/*
|
|
36
45
|
Default property:
|
|
@@ -57,6 +66,10 @@ Default property:
|
|
|
57
66
|
}
|
|
58
67
|
*/
|
|
59
68
|
property?: {
|
|
69
|
+
/* Specifies the device ID to use for audio input.
|
|
70
|
+
Web / Desktop: device ID string from enumerateDevices
|
|
71
|
+
Android: audio source name - DEFAULT, MIC, VOICE_UPLINK, VOICE_DOWNLINK, VOICE_CALL, CAMCORDER, VOICE_RECOGNITION, VOICE_COMMUNICATION, UNPROCESSED */
|
|
72
|
+
deviceId?: string | DataLink
|
|
60
73
|
/* STT Generator for Whisper context */
|
|
61
74
|
sttGeneratorId?: string | DataLink | (() => Generator)
|
|
62
75
|
/* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when not in use. */
|
|
@@ -119,41 +132,116 @@ Default property:
|
|
|
119
132
|
}
|
|
120
133
|
events?: {
|
|
121
134
|
/* Event triggered when transcription starts, processes, or ends */
|
|
122
|
-
onTranscribe?: Array<
|
|
135
|
+
onTranscribe?: Array<
|
|
136
|
+
EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onTranscribe']>
|
|
137
|
+
>
|
|
123
138
|
/* Event triggered on VAD (Voice Activity Detection) events */
|
|
124
|
-
onVad?: Array<
|
|
139
|
+
onVad?: Array<
|
|
140
|
+
EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onVad']>
|
|
141
|
+
>
|
|
125
142
|
/* Event triggered when error occurs */
|
|
126
|
-
onError?: Array<
|
|
143
|
+
onError?: Array<
|
|
144
|
+
EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onError']>
|
|
145
|
+
>
|
|
127
146
|
/* Event triggered when status changes */
|
|
128
|
-
onStatusChange?: Array<
|
|
147
|
+
onStatusChange?: Array<
|
|
148
|
+
EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStatusChange']>
|
|
149
|
+
>
|
|
129
150
|
/* Event triggered when statistics update */
|
|
130
|
-
onStatsUpdate?: Array<
|
|
151
|
+
onStatsUpdate?: Array<
|
|
152
|
+
EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStatsUpdate']>
|
|
153
|
+
>
|
|
131
154
|
/* Event triggered when slice transcription is stabilized */
|
|
132
|
-
onStabilized?: Array<
|
|
155
|
+
onStabilized?: Array<
|
|
156
|
+
EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStabilized']>
|
|
157
|
+
>
|
|
133
158
|
/* Event triggered when transcription ends */
|
|
134
|
-
onEnd?: Array<
|
|
159
|
+
onEnd?: Array<
|
|
160
|
+
EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onEnd']>
|
|
161
|
+
>
|
|
135
162
|
}
|
|
136
163
|
outlets?: {
|
|
137
164
|
/* Is realtime transcription currently active */
|
|
138
|
-
isActive?: () => Data
|
|
165
|
+
isActive?: () => Data<boolean>
|
|
139
166
|
/* Is currently transcribing audio */
|
|
140
|
-
isTranscribing?: () => Data
|
|
167
|
+
isTranscribing?: () => Data<boolean>
|
|
141
168
|
/* Current transcription results */
|
|
142
|
-
results?: () => Data
|
|
169
|
+
results?: () => Data<
|
|
170
|
+
Array<{
|
|
171
|
+
transcribeEvent?: {
|
|
172
|
+
type?: string
|
|
173
|
+
sliceIndex?: number
|
|
174
|
+
isCapturing?: boolean
|
|
175
|
+
data?: {
|
|
176
|
+
result?: string
|
|
177
|
+
[key: string]: any
|
|
178
|
+
}
|
|
179
|
+
vadEvent?: {
|
|
180
|
+
type?: string
|
|
181
|
+
confidence?: number
|
|
182
|
+
duration?: number
|
|
183
|
+
sliceIndex?: number
|
|
184
|
+
timestamp?: number
|
|
185
|
+
[key: string]: any
|
|
186
|
+
}
|
|
187
|
+
[key: string]: any
|
|
188
|
+
}
|
|
189
|
+
vadEvent?: {
|
|
190
|
+
type?: string
|
|
191
|
+
confidence?: number
|
|
192
|
+
duration?: number
|
|
193
|
+
sliceIndex?: number
|
|
194
|
+
timestamp?: number
|
|
195
|
+
[key: string]: any
|
|
196
|
+
}
|
|
197
|
+
[key: string]: any
|
|
198
|
+
}>
|
|
199
|
+
>
|
|
143
200
|
/* Current transcription result text */
|
|
144
|
-
resultText?: () => Data
|
|
201
|
+
resultText?: () => Data<string>
|
|
145
202
|
/* Last stabilized transcription result segment */
|
|
146
|
-
lastStabilizedSegment?: () => Data
|
|
203
|
+
lastStabilizedSegment?: () => Data<string>
|
|
147
204
|
/* Current statistics */
|
|
148
|
-
statistics?: () => Data
|
|
205
|
+
statistics?: () => Data<{
|
|
206
|
+
type?: string
|
|
207
|
+
timestamp?: number
|
|
208
|
+
data?: { [key: string]: any }
|
|
209
|
+
[key: string]: any
|
|
210
|
+
}>
|
|
149
211
|
/* Latest transcribe event */
|
|
150
|
-
lastTranscribeEvent?: () => Data
|
|
212
|
+
lastTranscribeEvent?: () => Data<{
|
|
213
|
+
type?: string
|
|
214
|
+
sliceIndex?: number
|
|
215
|
+
isCapturing?: boolean
|
|
216
|
+
data?: {
|
|
217
|
+
result?: string
|
|
218
|
+
[key: string]: any
|
|
219
|
+
}
|
|
220
|
+
vadEvent?: {
|
|
221
|
+
type?: string
|
|
222
|
+
confidence?: number
|
|
223
|
+
duration?: number
|
|
224
|
+
sliceIndex?: number
|
|
225
|
+
timestamp?: number
|
|
226
|
+
[key: string]: any
|
|
227
|
+
}
|
|
228
|
+
[key: string]: any
|
|
229
|
+
}>
|
|
151
230
|
/* Latest VAD event */
|
|
152
|
-
lastVadEvent?: () => Data
|
|
231
|
+
lastVadEvent?: () => Data<{
|
|
232
|
+
type?: string
|
|
233
|
+
confidence?: number
|
|
234
|
+
duration?: number
|
|
235
|
+
sliceIndex?: number
|
|
236
|
+
timestamp?: number
|
|
237
|
+
[key: string]: any
|
|
238
|
+
}>
|
|
153
239
|
/* Stabilized transcription text from completed slices */
|
|
154
|
-
stabilizedText?: () => Data
|
|
240
|
+
stabilizedText?: () => Data<string>
|
|
155
241
|
/* Audio output file path (auto-generated when saving audio) */
|
|
156
|
-
audioOutputPath?: () => Data
|
|
242
|
+
audioOutputPath?: () => Data<string>
|
|
243
|
+
/* Available microphone devices (Web / Desktop only) */
|
|
244
|
+
devices?: () => Data<Array<any>>
|
|
157
245
|
}
|
|
158
246
|
}
|
|
159
247
|
|
|
@@ -182,6 +270,7 @@ export type GeneratorRealtimeTranscription = Generator &
|
|
|
182
270
|
| 'lastVadEvent'
|
|
183
271
|
| 'stabilizedText'
|
|
184
272
|
| 'audioOutputPath'
|
|
273
|
+
| 'devices'
|
|
185
274
|
value: any
|
|
186
275
|
}
|
|
187
276
|
}>
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
|
|
4
|
+
*
|
|
5
|
+
* ## Notice
|
|
6
|
+
* - The device RAM must be larger than 8GB
|
|
7
|
+
* - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
|
|
8
|
+
* - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
|
|
9
|
+
* - Android: Recommended use Android 13+ system.
|
|
10
|
+
* - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
|
|
11
|
+
* - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs.
|
|
12
|
+
* - Linux / Windows
|
|
13
|
+
* - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
|
|
14
|
+
* - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux)
|
|
15
|
+
*/
|
|
2
16
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
17
|
import type { Data, DataLink } from '../data'
|
|
4
18
|
import type {
|
|
@@ -10,6 +24,7 @@ import type {
|
|
|
10
24
|
Action,
|
|
11
25
|
EventProperty,
|
|
12
26
|
} from '../common'
|
|
27
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
13
28
|
|
|
14
29
|
/* Load the model */
|
|
15
30
|
export type GeneratorRerankerActionLoadModel = Action & {
|
|
@@ -69,13 +84,13 @@ Default property:
|
|
|
69
84
|
batchSize?: number | DataLink
|
|
70
85
|
/* Physical maximum batch size (default: 512) */
|
|
71
86
|
uBatchSize?: number | DataLink
|
|
72
|
-
/* GGML accelerator variant (Only for desktop)
|
|
87
|
+
/* GGML accelerator variant (Only for desktop)
|
|
73
88
|
`default` - CPU / Metal (macOS)
|
|
74
89
|
`vulkan` - Use Vulkan
|
|
75
90
|
`cuda` - Use CUDA
|
|
76
91
|
`snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
|
|
77
92
|
accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
|
|
78
|
-
/* Devices. For example:
|
|
93
|
+
/* Devices. For example:
|
|
79
94
|
|
|
80
95
|
Metal or CPU for iOS/tvOS/MacOS
|
|
81
96
|
OpenCL or CPU for Android
|
|
@@ -103,25 +118,41 @@ Default property:
|
|
|
103
118
|
}
|
|
104
119
|
events?: {
|
|
105
120
|
/* Event triggered when the reranker context state changes (loading, ready, error, released) */
|
|
106
|
-
onContextStateChange?: Array<
|
|
121
|
+
onContextStateChange?: Array<
|
|
122
|
+
EventAction<string & keyof TemplateEventPropsMap['Reranker']['onContextStateChange']>
|
|
123
|
+
>
|
|
107
124
|
/* Event triggered when an error occurs during reranker operations */
|
|
108
|
-
onError?: Array<EventAction
|
|
125
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Reranker']['onError']>>
|
|
109
126
|
}
|
|
110
127
|
outlets?: {
|
|
111
128
|
/* Current state of the reranker context (loading, ready, error, released) */
|
|
112
|
-
contextState?: () => Data
|
|
129
|
+
contextState?: () => Data<string>
|
|
113
130
|
/* Loading progress of the reranker model (0-100) */
|
|
114
|
-
contextLoadProgress?: () => Data
|
|
131
|
+
contextLoadProgress?: () => Data<number>
|
|
115
132
|
/* Detailed information about the reranker context including instance ID and processing status */
|
|
116
|
-
contextDetails?: () => Data
|
|
133
|
+
contextDetails?: () => Data<{
|
|
134
|
+
state?: string
|
|
135
|
+
contextId?: string
|
|
136
|
+
gpu?: string
|
|
137
|
+
reasonNoGPU?: string
|
|
138
|
+
[key: string]: any
|
|
139
|
+
}>
|
|
117
140
|
/* Result of the reranking operation containing scored and ranked documents */
|
|
118
|
-
rerankResult?: () => Data
|
|
141
|
+
rerankResult?: () => Data<
|
|
142
|
+
Array<{
|
|
143
|
+
index?: number
|
|
144
|
+
score?: number
|
|
145
|
+
text?: string
|
|
146
|
+
payload?: { [key: string]: any }
|
|
147
|
+
[key: string]: any
|
|
148
|
+
}>
|
|
149
|
+
>
|
|
119
150
|
/* Boolean indicating whether the reranker is currently processing a request */
|
|
120
|
-
isProcessing?: () => Data
|
|
151
|
+
isProcessing?: () => Data<boolean>
|
|
121
152
|
}
|
|
122
153
|
}
|
|
123
154
|
|
|
124
|
-
/* Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
|
|
155
|
+
/* Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
|
|
125
156
|
|
|
126
157
|
## Notice
|
|
127
158
|
- The device RAM must be larger than 8GB
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Serial port communication for USB/UART devices (Android, Desktop only)
|
|
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
|
/* Get available serial devices */
|
|
15
19
|
export type GeneratorSerialPortActionGeneratorSerialGetDeviceList = Action & {
|
|
@@ -97,25 +101,29 @@ Default property:
|
|
|
97
101
|
/* Event for detach the device */
|
|
98
102
|
generatorSerialOnDetach?: Array<EventAction>
|
|
99
103
|
/* Event on error */
|
|
100
|
-
generatorSerialOnError?: Array<
|
|
104
|
+
generatorSerialOnError?: Array<
|
|
105
|
+
EventAction<string & keyof TemplateEventPropsMap['SerialPort']['generatorSerialOnError']>
|
|
106
|
+
>
|
|
101
107
|
/* Event for receive data */
|
|
102
|
-
generatorSerialOnData?: Array<
|
|
108
|
+
generatorSerialOnData?: Array<
|
|
109
|
+
EventAction<string & keyof TemplateEventPropsMap['SerialPort']['generatorSerialOnData']>
|
|
110
|
+
>
|
|
103
111
|
}
|
|
104
112
|
outlets?: {
|
|
105
113
|
/* Available serial devices */
|
|
106
|
-
generatorSerialDeviceList?: () => Data
|
|
114
|
+
generatorSerialDeviceList?: () => Data<Array<{ [key: string]: any }>>
|
|
107
115
|
/* Is serial open */
|
|
108
|
-
generatorSerialIsOpen?: () => Data
|
|
116
|
+
generatorSerialIsOpen?: () => Data<boolean>
|
|
109
117
|
/* Last rerceive data (Base64) */
|
|
110
|
-
generatorSerialLastDataBase64?: () => Data
|
|
118
|
+
generatorSerialLastDataBase64?: () => Data<string>
|
|
111
119
|
/* Last rerceive plain text */
|
|
112
|
-
generatorSerialLastDataString?: () => Data
|
|
120
|
+
generatorSerialLastDataString?: () => Data<string>
|
|
113
121
|
/* Error message */
|
|
114
|
-
generatorSerialErrorMessage?: () => Data
|
|
122
|
+
generatorSerialErrorMessage?: () => Data<string>
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
125
|
|
|
118
|
-
/* Serial
|
|
126
|
+
/* Serial port communication for USB/UART devices (Android, Desktop only) */
|
|
119
127
|
export type GeneratorSerialPort = Generator &
|
|
120
128
|
GeneratorSerialPortDef & {
|
|
121
129
|
templateKey: 'GENERATOR_SERIAL_PORT'
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Play sound, see supported formats at https://developer.android.com/guide/topics/media/media-formats
|
|
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 playing sound */
|
|
15
19
|
export type GeneratorSoundPlayerActionPlay = Action & {
|
|
@@ -53,7 +57,9 @@ Default property:
|
|
|
53
57
|
/* Sound file loaded successfully */
|
|
54
58
|
onLoad?: Array<EventAction>
|
|
55
59
|
/* Sound file load error */
|
|
56
|
-
onLoadError?: Array<
|
|
60
|
+
onLoadError?: Array<
|
|
61
|
+
EventAction<string & keyof TemplateEventPropsMap['SoundPlayer']['onLoadError']>
|
|
62
|
+
>
|
|
57
63
|
/* Sound playback complete */
|
|
58
64
|
onPlay?: Array<EventAction>
|
|
59
65
|
/* Sound file playback end */
|
|
@@ -61,7 +67,7 @@ Default property:
|
|
|
61
67
|
}
|
|
62
68
|
outlets?: {
|
|
63
69
|
/* Whether the sound is playing */
|
|
64
|
-
isPlaying?: () => Data
|
|
70
|
+
isPlaying?: () => Data<any>
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
|