@fugood/bricks-project 2.23.0-beta.3 → 2.23.0-beta.31
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 +59 -0
- package/compile/index.ts +52 -60
- package/package.json +4 -4
- package/tools/mcp-server.ts +3 -3
- package/tools/postinstall.ts +2 -5
- package/tools/preview.ts +1 -1
- package/tools/pull.ts +1 -1
- package/types/brick-base.ts +1 -0
- package/types/bricks/Camera.ts +1 -0
- package/types/bricks/Chart.ts +1 -0
- package/types/bricks/GenerativeMedia.ts +21 -3
- package/types/bricks/Icon.ts +1 -0
- package/types/bricks/Image.ts +1 -0
- package/types/bricks/Items.ts +1 -0
- package/types/bricks/Lottie.ts +1 -0
- package/types/bricks/QrCode.ts +1 -0
- package/types/bricks/Rect.ts +1 -0
- package/types/bricks/RichText.ts +1 -0
- package/types/bricks/Rive.ts +1 -0
- package/types/bricks/Slideshow.ts +38 -2
- package/types/bricks/Svg.ts +1 -0
- package/types/bricks/Text.ts +1 -0
- package/types/bricks/TextInput.ts +1 -0
- package/types/bricks/Video.ts +1 -0
- package/types/bricks/VideoStreaming.ts +1 -0
- package/types/bricks/WebRtcStream.ts +1 -0
- package/types/bricks/WebView.ts +1 -0
- package/types/bricks/index.ts +1 -0
- package/types/canvas.ts +1 -0
- package/types/data-calc.ts +44 -0
- package/types/data.ts +1 -0
- package/types/generators/AlarmClock.ts +1 -0
- package/types/generators/Assistant.ts +11 -1
- package/types/generators/BleCentral.ts +1 -0
- package/types/generators/BlePeripheral.ts +1 -0
- package/types/generators/CanvasMap.ts +15 -3
- package/types/generators/CastlesPay.ts +1 -0
- package/types/generators/DataBank.ts +1 -0
- package/types/generators/File.ts +1 -0
- package/types/generators/GraphQl.ts +1 -0
- package/types/generators/Http.ts +75 -1
- package/types/generators/HttpServer.ts +1 -0
- package/types/generators/Information.ts +1 -0
- package/types/generators/Intent.ts +50 -0
- package/types/generators/Iterator.ts +10 -2
- package/types/generators/Keyboard.ts +1 -0
- package/types/generators/LlmAnthropicCompat.ts +1 -0
- package/types/generators/LlmAppleBuiltin.ts +143 -0
- package/types/generators/LlmGgml.ts +23 -5
- package/types/generators/LlmOnnx.ts +8 -0
- package/types/generators/LlmOpenAiCompat.ts +1 -0
- package/types/generators/LlmQualcommAiEngine.ts +1 -0
- package/types/generators/Mcp.ts +1 -0
- package/types/generators/McpServer.ts +1 -0
- package/types/generators/MediaFlow.ts +1 -0
- package/types/generators/MqttBroker.ts +1 -0
- package/types/generators/MqttClient.ts +1 -0
- package/types/generators/Question.ts +8 -0
- package/types/generators/RealtimeTranscription.ts +1 -0
- package/types/generators/RerankerGgml.ts +22 -16
- package/types/generators/SerialPort.ts +1 -0
- package/types/generators/SoundPlayer.ts +1 -0
- package/types/generators/SoundRecorder.ts +1 -0
- package/types/generators/SpeechToTextGgml.ts +13 -4
- package/types/generators/SpeechToTextOnnx.ts +1 -0
- package/types/generators/SpeechToTextPlatform.ts +1 -0
- package/types/generators/SqLite.ts +31 -1
- package/types/generators/Step.ts +1 -0
- package/types/generators/SttAppleBuiltin.ts +116 -0
- package/types/generators/Tcp.ts +1 -0
- package/types/generators/TcpServer.ts +1 -0
- package/types/generators/TextToSpeechApple.ts +113 -0
- package/types/generators/TextToSpeechAppleBuiltin.ts +113 -0
- package/types/generators/TextToSpeechGgml.ts +23 -3
- package/types/generators/TextToSpeechOnnx.ts +1 -0
- package/types/generators/TextToSpeechOpenAiLike.ts +1 -0
- package/types/generators/ThermalPrinter.ts +1 -0
- package/types/generators/Tick.ts +4 -1
- package/types/generators/TtsAppleBuiltin.ts +105 -0
- package/types/generators/Udp.ts +1 -0
- package/types/generators/VadGgml.ts +3 -2
- package/types/generators/VectorStore.ts +14 -2
- package/types/generators/Watchdog.ts +1 -0
- package/types/generators/WebCrawler.ts +1 -0
- package/types/generators/WebRtc.ts +1 -0
- package/types/generators/WebSocket.ts +1 -0
- package/types/generators/index.ts +3 -0
- package/types/system.ts +1 -0
- package/utils/data.ts +1 -0
- package/utils/event-props.ts +72 -3
- package/utils/id.ts +3 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* Auto generated by build script */
|
|
1
2
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
3
|
import type { Data, DataLink } from '../data'
|
|
3
4
|
import type {
|
|
@@ -252,6 +253,13 @@ Default property:
|
|
|
252
253
|
manuallyStart?: boolean | DataLink
|
|
253
254
|
recordDuration?: number | DataLink
|
|
254
255
|
}
|
|
256
|
+
codeScanOptions?:
|
|
257
|
+
| DataLink
|
|
258
|
+
| {
|
|
259
|
+
inputSource?: 'camera' | 'hid-barcode-scanner' | DataLink
|
|
260
|
+
hidFlushMode?: 'enter-key' | 'timeout' | DataLink
|
|
261
|
+
hidFlushTimeout?: number | DataLink
|
|
262
|
+
}
|
|
255
263
|
messageOptions?:
|
|
256
264
|
| DataLink
|
|
257
265
|
| {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* Auto generated by build script */
|
|
1
2
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
3
|
import type { Data, DataLink } from '../data'
|
|
3
4
|
import type {
|
|
@@ -67,18 +68,19 @@ Default property:
|
|
|
67
68
|
batchSize?: number | DataLink
|
|
68
69
|
/* Physical maximum batch size (default: 512) */
|
|
69
70
|
uBatchSize?: number | DataLink
|
|
70
|
-
/*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
/* GGML accelerator variant (Only for desktop)
|
|
72
|
+
`default` - CPU / Metal (macOS)
|
|
73
|
+
`vulkan` - Use Vulkan
|
|
74
|
+
`cuda` - Use CUDA
|
|
75
|
+
`snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
|
|
76
|
+
accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
|
|
77
|
+
/* Devices. For example:
|
|
78
|
+
|
|
79
|
+
Metal or CPU for iOS/tvOS/MacOS
|
|
80
|
+
OpenCL or CPU for Android
|
|
81
|
+
- Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices)
|
|
82
|
+
For Desktop, you may want to include/exclude GPUs */
|
|
83
|
+
devices?: Array<string | DataLink> | DataLink
|
|
82
84
|
/* Main GPU index (default: 0) */
|
|
83
85
|
mainGpu?: number | DataLink
|
|
84
86
|
/* Number of layers to store in VRAM (default: 0) */
|
|
@@ -122,10 +124,14 @@ Default property:
|
|
|
122
124
|
|
|
123
125
|
## Notice
|
|
124
126
|
- The device RAM must be larger than 8GB
|
|
125
|
-
- iOS:
|
|
126
|
-
- macOS:
|
|
127
|
-
- Android:
|
|
128
|
-
|
|
127
|
+
- iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
|
|
128
|
+
- macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
|
|
129
|
+
- Android: Recommended use Android 13+ system.
|
|
130
|
+
- Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
|
|
131
|
+
- Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs.
|
|
132
|
+
- Linux / Windows
|
|
133
|
+
- Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
|
|
134
|
+
- Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux) */
|
|
129
135
|
export type GeneratorReranker = Generator &
|
|
130
136
|
GeneratorRerankerDef & {
|
|
131
137
|
templateKey: 'GENERATOR_RERANKER'
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* Auto generated by build script */
|
|
1
2
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
3
|
import type { Data, DataLink } from '../data'
|
|
3
4
|
import type {
|
|
@@ -216,7 +217,7 @@ Default property:
|
|
|
216
217
|
| 'medium-q5_0'
|
|
217
218
|
| 'medium-q8_0'
|
|
218
219
|
| 'medium.en'
|
|
219
|
-
| 'medium.en-
|
|
220
|
+
| 'medium.en-q5_0'
|
|
220
221
|
| 'medium.en-q8_0'
|
|
221
222
|
| 'large-v1'
|
|
222
223
|
| 'large-v2'
|
|
@@ -224,15 +225,14 @@ Default property:
|
|
|
224
225
|
| 'large-v2-q8_0'
|
|
225
226
|
| 'large-v3'
|
|
226
227
|
| 'large-v3-q5_0'
|
|
227
|
-
| 'large-v3-q8_0'
|
|
228
228
|
| 'large-v3-turbo'
|
|
229
229
|
| 'large-v3-turbo-q5_0'
|
|
230
230
|
| 'large-v3-turbo-q8_0'
|
|
231
231
|
| 'small.en-tdrz'
|
|
232
|
-
| 'small.en-tdrz-
|
|
232
|
+
| 'small.en-tdrz-q5_1'
|
|
233
233
|
| 'small.en-tdrz-q8_0'
|
|
234
234
|
| 'distil-small.en'
|
|
235
|
-
| 'distil-small.en-
|
|
235
|
+
| 'distil-small.en-q5_1'
|
|
236
236
|
| 'distil-small.en-q8_0'
|
|
237
237
|
| 'distil-medium.en'
|
|
238
238
|
| 'distil-medium.en-q5_0'
|
|
@@ -397,6 +397,15 @@ Default property:
|
|
|
397
397
|
inferRealtimeVadThold?: number | DataLink
|
|
398
398
|
/* Frequency to apply High-pass filter in VAD */
|
|
399
399
|
inferRealtimeVadFreqThold?: number | DataLink
|
|
400
|
+
/* Buttress connection settings for remote inference */
|
|
401
|
+
buttressConnectionSettings?:
|
|
402
|
+
| DataLink
|
|
403
|
+
| {
|
|
404
|
+
enabled?: boolean | DataLink
|
|
405
|
+
url?: string | DataLink
|
|
406
|
+
fallbackType?: 'use-local' | 'no-op' | DataLink
|
|
407
|
+
strategy?: 'prefer-local' | 'prefer-buttress' | 'prefer-best' | DataLink
|
|
408
|
+
}
|
|
400
409
|
}
|
|
401
410
|
events?: {
|
|
402
411
|
/* Event triggered when context state changes */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* Auto generated by build script */
|
|
1
2
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
3
|
import type { Data, DataLink } from '../data'
|
|
3
4
|
import type {
|
|
@@ -53,6 +54,33 @@ export type GeneratorSqliteActionQuery = ActionWithParams & {
|
|
|
53
54
|
>
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
/* Execute multiple SQL statements in transaction */
|
|
58
|
+
export type GeneratorSqliteActionTransaction = ActionWithParams & {
|
|
59
|
+
__actionName: 'GENERATOR_SQLITE_TRANSACTION'
|
|
60
|
+
params?: Array<{
|
|
61
|
+
input: 'statements'
|
|
62
|
+
value?: Array<any> | DataLink | EventProperty
|
|
63
|
+
mapping?: string
|
|
64
|
+
}>
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Execute same SQL statement with multiple parameter sets */
|
|
68
|
+
export type GeneratorSqliteActionBatchExecute = ActionWithParams & {
|
|
69
|
+
__actionName: 'GENERATOR_SQLITE_BATCH_EXECUTE'
|
|
70
|
+
params?: Array<
|
|
71
|
+
| {
|
|
72
|
+
input: 'sql'
|
|
73
|
+
value?: string | DataLink | EventProperty
|
|
74
|
+
mapping?: string
|
|
75
|
+
}
|
|
76
|
+
| {
|
|
77
|
+
input: 'batchParams'
|
|
78
|
+
value?: Array<any> | DataLink | EventProperty
|
|
79
|
+
mapping?: string
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
}
|
|
83
|
+
|
|
56
84
|
interface GeneratorSqliteDef {
|
|
57
85
|
/*
|
|
58
86
|
Default property:
|
|
@@ -92,6 +120,8 @@ Default property:
|
|
|
92
120
|
error?: () => Data
|
|
93
121
|
/* Last query result */
|
|
94
122
|
lastResult?: () => Data
|
|
123
|
+
/* Last execute result with metadata */
|
|
124
|
+
lastExecuteResult?: () => Data
|
|
95
125
|
}
|
|
96
126
|
}
|
|
97
127
|
|
|
@@ -109,7 +139,7 @@ export type GeneratorSqlite = Generator &
|
|
|
109
139
|
| SwitchCondData
|
|
110
140
|
| {
|
|
111
141
|
__typename: 'SwitchCondInnerStateOutlet'
|
|
112
|
-
outlet: 'isReady' | 'dbPath' | 'error' | 'lastResult'
|
|
142
|
+
outlet: 'isReady' | 'dbPath' | 'error' | 'lastResult' | 'lastExecuteResult'
|
|
113
143
|
value: any
|
|
114
144
|
}
|
|
115
145
|
}>
|
package/types/generators/Step.ts
CHANGED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* Auto generated by build script */
|
|
2
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
|
+
import type { Data, DataLink } from '../data'
|
|
4
|
+
import type {
|
|
5
|
+
Generator,
|
|
6
|
+
EventAction,
|
|
7
|
+
ActionWithDataParams,
|
|
8
|
+
ActionWithParams,
|
|
9
|
+
Action,
|
|
10
|
+
EventProperty,
|
|
11
|
+
} from '../common'
|
|
12
|
+
|
|
13
|
+
/* Initialize STT */
|
|
14
|
+
export type GeneratorAppleSTTActionInit = Action & {
|
|
15
|
+
__actionName: 'GENERATOR_APPLE_STT_INIT'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Transcribe audio file. You can provide `File URL` property, if not provided, it will use the default `File URL` */
|
|
19
|
+
export type GeneratorAppleSTTActionTranscribeFile = ActionWithParams & {
|
|
20
|
+
__actionName: 'GENERATOR_APPLE_STT_TRANSCRIBE_FILE'
|
|
21
|
+
params?: Array<
|
|
22
|
+
| {
|
|
23
|
+
input: 'fileUrl'
|
|
24
|
+
value?: string | DataLink | EventProperty
|
|
25
|
+
mapping?: string
|
|
26
|
+
}
|
|
27
|
+
| {
|
|
28
|
+
input: 'language'
|
|
29
|
+
value?: string | DataLink | EventProperty
|
|
30
|
+
mapping?: string
|
|
31
|
+
}
|
|
32
|
+
>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Transcribe audio data (base64 encoded audio data or ArrayBuffer) */
|
|
36
|
+
export type GeneratorAppleSTTActionTranscribeData = ActionWithParams & {
|
|
37
|
+
__actionName: 'GENERATOR_APPLE_STT_TRANSCRIBE_DATA'
|
|
38
|
+
params?: Array<
|
|
39
|
+
| {
|
|
40
|
+
input: 'data'
|
|
41
|
+
value?: any | EventProperty
|
|
42
|
+
mapping?: string
|
|
43
|
+
}
|
|
44
|
+
| {
|
|
45
|
+
input: 'language'
|
|
46
|
+
value?: string | DataLink | EventProperty
|
|
47
|
+
mapping?: string
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface GeneratorAppleSTTDef {
|
|
53
|
+
/*
|
|
54
|
+
Default property:
|
|
55
|
+
{
|
|
56
|
+
"init": false,
|
|
57
|
+
"language": "en-US",
|
|
58
|
+
"enablePartialResults": true
|
|
59
|
+
}
|
|
60
|
+
*/
|
|
61
|
+
property?: {
|
|
62
|
+
/* Initialize the STT engine on generator initialization */
|
|
63
|
+
init?: boolean | DataLink
|
|
64
|
+
/* Language/locale for recognition (e.g., 'en-US') */
|
|
65
|
+
language?: string | DataLink
|
|
66
|
+
/* Enable partial results during transcription */
|
|
67
|
+
enablePartialResults?: boolean | DataLink
|
|
68
|
+
/* The file URL or path to be transcribed */
|
|
69
|
+
fileUrl?: string | DataLink
|
|
70
|
+
}
|
|
71
|
+
events?: {
|
|
72
|
+
/* Error event */
|
|
73
|
+
onError?: Array<EventAction>
|
|
74
|
+
/* Event triggered when got transcribe result */
|
|
75
|
+
onTranscribed?: Array<EventAction>
|
|
76
|
+
}
|
|
77
|
+
outlets?: {
|
|
78
|
+
/* State outlet (loading, ready, error) */
|
|
79
|
+
state?: () => Data
|
|
80
|
+
/* Is transcribing */
|
|
81
|
+
isTranscribing?: () => Data
|
|
82
|
+
/* Transcribe result */
|
|
83
|
+
transcribeResult?: () => Data
|
|
84
|
+
/* Transcribe result details (result, segments, time, startTime, endTime, duration) */
|
|
85
|
+
transcribeDetails?: () => Data
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Speech recognition on iOS 26+ (Not supported on tvOS)
|
|
90
|
+
|
|
91
|
+
## Features
|
|
92
|
+
- Native Apple speech recognition
|
|
93
|
+
- High accuracy transcription
|
|
94
|
+
- Privacy-focused on-device processing
|
|
95
|
+
- Supports file and data transcription
|
|
96
|
+
- Requires iOS 26+ (Not supported on tvOS) */
|
|
97
|
+
export type GeneratorAppleSTT = Generator &
|
|
98
|
+
GeneratorAppleSTTDef & {
|
|
99
|
+
templateKey: 'GENERATOR_APPLE_STT'
|
|
100
|
+
switches: Array<
|
|
101
|
+
SwitchDef &
|
|
102
|
+
GeneratorAppleSTTDef & {
|
|
103
|
+
conds?: Array<{
|
|
104
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
105
|
+
cond:
|
|
106
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
107
|
+
| SwitchCondData
|
|
108
|
+
| {
|
|
109
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
110
|
+
outlet: 'state' | 'isTranscribing' | 'transcribeResult' | 'transcribeDetails'
|
|
111
|
+
value: any
|
|
112
|
+
}
|
|
113
|
+
}>
|
|
114
|
+
}
|
|
115
|
+
>
|
|
116
|
+
}
|
package/types/generators/Tcp.ts
CHANGED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* Auto generated by build script */
|
|
2
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
|
+
import type { Data, DataLink } from '../data'
|
|
4
|
+
import type {
|
|
5
|
+
Generator,
|
|
6
|
+
EventAction,
|
|
7
|
+
ActionWithDataParams,
|
|
8
|
+
ActionWithParams,
|
|
9
|
+
Action,
|
|
10
|
+
EventProperty,
|
|
11
|
+
} from '../common'
|
|
12
|
+
|
|
13
|
+
/* Load the TTS model */
|
|
14
|
+
export type GeneratorAppleTTSActionLoadModel = Action & {
|
|
15
|
+
__actionName: 'GENERATOR_APPLE_TTS_LOAD_MODEL'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Generate audio */
|
|
19
|
+
export type GeneratorAppleTTSActionGenerate = ActionWithParams & {
|
|
20
|
+
__actionName: 'GENERATOR_APPLE_TTS_GENERATE'
|
|
21
|
+
params?: Array<{
|
|
22
|
+
input: 'text'
|
|
23
|
+
value?: string | DataLink | EventProperty
|
|
24
|
+
mapping?: string
|
|
25
|
+
}>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Clean cache */
|
|
29
|
+
export type GeneratorAppleTTSActionCleanCache = Action & {
|
|
30
|
+
__actionName: 'GENERATOR_APPLE_TTS_CLEAN_CACHE'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Cancel current generation and clear queue */
|
|
34
|
+
export type GeneratorAppleTTSActionCancel = Action & {
|
|
35
|
+
__actionName: 'GENERATOR_APPLE_TTS_CANCEL'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface GeneratorAppleTTSDef {
|
|
39
|
+
/*
|
|
40
|
+
Default property:
|
|
41
|
+
{
|
|
42
|
+
"language": "en-US",
|
|
43
|
+
"outputType": "play",
|
|
44
|
+
"cacheGenerated": true,
|
|
45
|
+
"autoInferEnable": false,
|
|
46
|
+
"softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
|
|
47
|
+
"hardBreakTime": 500
|
|
48
|
+
}
|
|
49
|
+
*/
|
|
50
|
+
property?: {
|
|
51
|
+
/* Initialize the TTS context on generator initialization */
|
|
52
|
+
init?: boolean | DataLink
|
|
53
|
+
/* Voice identifier */
|
|
54
|
+
voice?: string | DataLink
|
|
55
|
+
/* Language/locale (e.g., 'en-US') */
|
|
56
|
+
language?: string | DataLink
|
|
57
|
+
/* Output mode */
|
|
58
|
+
outputType?: 'play' | 'file' | DataLink
|
|
59
|
+
/* Enable cache for generated audio */
|
|
60
|
+
cacheGenerated?: boolean | DataLink
|
|
61
|
+
/* Text to generate */
|
|
62
|
+
prompt?: string | DataLink
|
|
63
|
+
/* Auto inference when prompt changes */
|
|
64
|
+
autoInferEnable?: boolean | DataLink
|
|
65
|
+
/* Segmentation rule for auto inference */
|
|
66
|
+
softBreakRegex?: string | DataLink
|
|
67
|
+
/* Time to force inference when softBreakRegex is not satisfied */
|
|
68
|
+
hardBreakTime?: number | DataLink
|
|
69
|
+
}
|
|
70
|
+
events?: {
|
|
71
|
+
/* Event triggered when state change */
|
|
72
|
+
onContextStateChange?: Array<EventAction>
|
|
73
|
+
/* Event triggered when error occurs */
|
|
74
|
+
onError?: Array<EventAction>
|
|
75
|
+
}
|
|
76
|
+
outlets?: {
|
|
77
|
+
/* Context state */
|
|
78
|
+
contextState?: () => Data
|
|
79
|
+
/* Generated audio file */
|
|
80
|
+
generatedAudio?: () => Data
|
|
81
|
+
/* Generated audio file is playing */
|
|
82
|
+
generatedAudioPlaying?: () => Data
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Text-to-speech synthesis using Apple's native speech synthesis
|
|
87
|
+
|
|
88
|
+
## Features
|
|
89
|
+
- Native Apple speech synthesis
|
|
90
|
+
- Natural sounding voices
|
|
91
|
+
- Privacy-focused on-device processing
|
|
92
|
+
- Multiple voice options
|
|
93
|
+
- Requires iOS 13+ (native speech synthesis) */
|
|
94
|
+
export type GeneratorAppleTTS = Generator &
|
|
95
|
+
GeneratorAppleTTSDef & {
|
|
96
|
+
templateKey: 'GENERATOR_APPLE_TTS'
|
|
97
|
+
switches: Array<
|
|
98
|
+
SwitchDef &
|
|
99
|
+
GeneratorAppleTTSDef & {
|
|
100
|
+
conds?: Array<{
|
|
101
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
102
|
+
cond:
|
|
103
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
104
|
+
| SwitchCondData
|
|
105
|
+
| {
|
|
106
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
107
|
+
outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
|
|
108
|
+
value: any
|
|
109
|
+
}
|
|
110
|
+
}>
|
|
111
|
+
}
|
|
112
|
+
>
|
|
113
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* Auto generated by build script */
|
|
2
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
|
+
import type { Data, DataLink } from '../data'
|
|
4
|
+
import type {
|
|
5
|
+
Generator,
|
|
6
|
+
EventAction,
|
|
7
|
+
ActionWithDataParams,
|
|
8
|
+
ActionWithParams,
|
|
9
|
+
Action,
|
|
10
|
+
EventProperty,
|
|
11
|
+
} from '../common'
|
|
12
|
+
|
|
13
|
+
/* Load the TTS model */
|
|
14
|
+
export type GeneratorAppleTTSActionLoadModel = Action & {
|
|
15
|
+
__actionName: 'GENERATOR_APPLE_TTS_LOAD_MODEL'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Generate audio */
|
|
19
|
+
export type GeneratorAppleTTSActionGenerate = ActionWithParams & {
|
|
20
|
+
__actionName: 'GENERATOR_APPLE_TTS_GENERATE'
|
|
21
|
+
params?: Array<{
|
|
22
|
+
input: 'text'
|
|
23
|
+
value?: string | DataLink | EventProperty
|
|
24
|
+
mapping?: string
|
|
25
|
+
}>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Clean cache */
|
|
29
|
+
export type GeneratorAppleTTSActionCleanCache = Action & {
|
|
30
|
+
__actionName: 'GENERATOR_APPLE_TTS_CLEAN_CACHE'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Cancel current generation and clear queue */
|
|
34
|
+
export type GeneratorAppleTTSActionCancel = Action & {
|
|
35
|
+
__actionName: 'GENERATOR_APPLE_TTS_CANCEL'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface GeneratorAppleTTSDef {
|
|
39
|
+
/*
|
|
40
|
+
Default property:
|
|
41
|
+
{
|
|
42
|
+
"language": "en-US",
|
|
43
|
+
"outputType": "play",
|
|
44
|
+
"cacheGenerated": true,
|
|
45
|
+
"autoInferEnable": false,
|
|
46
|
+
"softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
|
|
47
|
+
"hardBreakTime": 500
|
|
48
|
+
}
|
|
49
|
+
*/
|
|
50
|
+
property?: {
|
|
51
|
+
/* Initialize the TTS context on generator initialization */
|
|
52
|
+
init?: boolean | DataLink
|
|
53
|
+
/* Voice identifier */
|
|
54
|
+
voice?: string | DataLink
|
|
55
|
+
/* Language/locale (e.g., 'en-US') */
|
|
56
|
+
language?: string | DataLink
|
|
57
|
+
/* Output mode */
|
|
58
|
+
outputType?: 'play' | 'file' | DataLink
|
|
59
|
+
/* Enable cache for generated audio */
|
|
60
|
+
cacheGenerated?: boolean | DataLink
|
|
61
|
+
/* Text to generate */
|
|
62
|
+
prompt?: string | DataLink
|
|
63
|
+
/* Auto inference when prompt changes */
|
|
64
|
+
autoInferEnable?: boolean | DataLink
|
|
65
|
+
/* Segmentation rule for auto inference */
|
|
66
|
+
softBreakRegex?: string | DataLink
|
|
67
|
+
/* Time to force inference when softBreakRegex is not satisfied */
|
|
68
|
+
hardBreakTime?: number | DataLink
|
|
69
|
+
}
|
|
70
|
+
events?: {
|
|
71
|
+
/* Event triggered when state change */
|
|
72
|
+
onContextStateChange?: Array<EventAction>
|
|
73
|
+
/* Event triggered when error occurs */
|
|
74
|
+
onError?: Array<EventAction>
|
|
75
|
+
}
|
|
76
|
+
outlets?: {
|
|
77
|
+
/* Context state */
|
|
78
|
+
contextState?: () => Data
|
|
79
|
+
/* Generated audio file */
|
|
80
|
+
generatedAudio?: () => Data
|
|
81
|
+
/* Generated audio file is playing */
|
|
82
|
+
generatedAudioPlaying?: () => Data
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Text-to-speech synthesis using Apple's native speech synthesis
|
|
87
|
+
|
|
88
|
+
## Features
|
|
89
|
+
- Native Apple speech synthesis
|
|
90
|
+
- Natural sounding voices
|
|
91
|
+
- Privacy-focused on-device processing
|
|
92
|
+
- Multiple voice options
|
|
93
|
+
- Requires iOS 13+ (native speech synthesis) */
|
|
94
|
+
export type GeneratorAppleTTS = Generator &
|
|
95
|
+
GeneratorAppleTTSDef & {
|
|
96
|
+
templateKey: 'GENERATOR_APPLE_TTS'
|
|
97
|
+
switches: Array<
|
|
98
|
+
SwitchDef &
|
|
99
|
+
GeneratorAppleTTSDef & {
|
|
100
|
+
conds?: Array<{
|
|
101
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
102
|
+
cond:
|
|
103
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
104
|
+
| SwitchCondData
|
|
105
|
+
| {
|
|
106
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
107
|
+
outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
|
|
108
|
+
value: any
|
|
109
|
+
}
|
|
110
|
+
}>
|
|
111
|
+
}
|
|
112
|
+
>
|
|
113
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* Auto generated by build script */
|
|
1
2
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
3
|
import type { Data, DataLink } from '../data'
|
|
3
4
|
import type {
|
|
@@ -129,8 +130,16 @@ Default property:
|
|
|
129
130
|
/* Accelerator variant (Only for desktop)
|
|
130
131
|
`default` - CPU / Metal (macOS)
|
|
131
132
|
`vulkan` - Use Vulkan
|
|
132
|
-
`cuda` - Use CUDA
|
|
133
|
-
|
|
133
|
+
`cuda` - Use CUDA
|
|
134
|
+
`snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
|
|
135
|
+
accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
|
|
136
|
+
/* Devices. For example:
|
|
137
|
+
|
|
138
|
+
Metal or CPU for iOS/tvOS/MacOS
|
|
139
|
+
OpenCL or CPU for Android
|
|
140
|
+
- Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices)
|
|
141
|
+
For Desktop, you may want to include/exclude GPUs */
|
|
142
|
+
devices?: Array<string | DataLink> | DataLink
|
|
134
143
|
/* Main GPU index */
|
|
135
144
|
mainGpu?: number | DataLink
|
|
136
145
|
/* Number of GPU layers (NOTE: Currently not supported for Android) */
|
|
@@ -159,7 +168,18 @@ Default property:
|
|
|
159
168
|
}
|
|
160
169
|
|
|
161
170
|
/* Local Text-to-Speech (TTS) inference based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
|
|
162
|
-
You can use any converted model on HuggingFace.
|
|
171
|
+
You can use any converted model on HuggingFace.
|
|
172
|
+
|
|
173
|
+
## Notice
|
|
174
|
+
- The device RAM must be larger than 8GB
|
|
175
|
+
- iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
|
|
176
|
+
- macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
|
|
177
|
+
- Android: Recommended use Android 13+ system.
|
|
178
|
+
- Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
|
|
179
|
+
- Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs.
|
|
180
|
+
- Linux / Windows
|
|
181
|
+
- Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
|
|
182
|
+
- Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux) */
|
|
163
183
|
export type GeneratorGGMLTTS = Generator &
|
|
164
184
|
GeneratorGGMLTTSDef & {
|
|
165
185
|
templateKey: 'GENERATOR_GGML_TTS'
|