@fugood/bricks-project 2.24.0-beta.2 → 2.24.0-beta.21

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.
Files changed (110) hide show
  1. package/compile/action-name-map.ts +14 -0
  2. package/compile/index.ts +377 -129
  3. package/package.json +8 -3
  4. package/skills/bricks-project/rules/architecture-patterns.md +7 -0
  5. package/skills/bricks-project/rules/automations.md +74 -28
  6. package/skills/bricks-project/rules/buttress.md +9 -6
  7. package/tools/deploy.ts +39 -10
  8. package/tools/mcp-server.ts +10 -877
  9. package/tools/mcp-tools/compile.ts +91 -0
  10. package/tools/mcp-tools/huggingface.ts +762 -0
  11. package/tools/mcp-tools/icons.ts +60 -0
  12. package/tools/mcp-tools/lottie.ts +102 -0
  13. package/tools/mcp-tools/media.ts +110 -0
  14. package/tools/postinstall.ts +121 -33
  15. package/tools/preview-main.mjs +12 -8
  16. package/tools/pull.ts +37 -19
  17. package/tsconfig.json +16 -0
  18. package/types/animation.ts +4 -0
  19. package/types/automation.ts +3 -0
  20. package/types/brick-base.ts +1 -1
  21. package/types/bricks/Camera.ts +34 -7
  22. package/types/bricks/Chart.ts +1 -1
  23. package/types/bricks/GenerativeMedia.ts +6 -6
  24. package/types/bricks/Icon.ts +3 -3
  25. package/types/bricks/Image.ts +4 -4
  26. package/types/bricks/Items.ts +7 -7
  27. package/types/bricks/Lottie.ts +4 -4
  28. package/types/bricks/Maps.ts +4 -4
  29. package/types/bricks/QrCode.ts +4 -4
  30. package/types/bricks/Rect.ts +4 -4
  31. package/types/bricks/RichText.ts +3 -3
  32. package/types/bricks/Rive.ts +1 -1
  33. package/types/bricks/Slideshow.ts +4 -4
  34. package/types/bricks/Svg.ts +3 -3
  35. package/types/bricks/Text.ts +4 -4
  36. package/types/bricks/TextInput.ts +11 -7
  37. package/types/bricks/Video.ts +4 -4
  38. package/types/bricks/VideoStreaming.ts +3 -3
  39. package/types/bricks/WebRtcStream.ts +1 -1
  40. package/types/bricks/WebView.ts +4 -4
  41. package/types/canvas.ts +4 -2
  42. package/types/common.ts +9 -4
  43. package/types/data-calc-command.ts +2 -0
  44. package/types/data-calc.ts +1 -0
  45. package/types/data.ts +2 -0
  46. package/types/generators/AlarmClock.ts +5 -5
  47. package/types/generators/Assistant.ts +57 -12
  48. package/types/generators/BleCentral.ts +12 -4
  49. package/types/generators/BlePeripheral.ts +5 -5
  50. package/types/generators/CanvasMap.ts +4 -4
  51. package/types/generators/CastlesPay.ts +3 -3
  52. package/types/generators/DataBank.ts +31 -4
  53. package/types/generators/File.ts +63 -14
  54. package/types/generators/GraphQl.ts +3 -3
  55. package/types/generators/Http.ts +27 -8
  56. package/types/generators/HttpServer.ts +9 -9
  57. package/types/generators/Information.ts +2 -2
  58. package/types/generators/Intent.ts +8 -2
  59. package/types/generators/Iterator.ts +6 -6
  60. package/types/generators/Keyboard.ts +18 -8
  61. package/types/generators/LlmAnthropicCompat.ts +12 -6
  62. package/types/generators/LlmAppleBuiltin.ts +6 -6
  63. package/types/generators/LlmGgml.ts +75 -25
  64. package/types/generators/LlmMlx.ts +210 -0
  65. package/types/generators/LlmOnnx.ts +18 -9
  66. package/types/generators/LlmOpenAiCompat.ts +22 -6
  67. package/types/generators/LlmQualcommAiEngine.ts +32 -8
  68. package/types/generators/Mcp.ts +332 -17
  69. package/types/generators/McpServer.ts +38 -11
  70. package/types/generators/MediaFlow.ts +26 -8
  71. package/types/generators/MqttBroker.ts +10 -4
  72. package/types/generators/MqttClient.ts +11 -5
  73. package/types/generators/Question.ts +6 -6
  74. package/types/generators/RealtimeTranscription.ts +70 -11
  75. package/types/generators/RerankerGgml.ts +23 -9
  76. package/types/generators/SerialPort.ts +6 -6
  77. package/types/generators/SoundPlayer.ts +2 -2
  78. package/types/generators/SoundRecorder.ts +5 -5
  79. package/types/generators/SpeechToTextGgml.ts +34 -14
  80. package/types/generators/SpeechToTextOnnx.ts +8 -8
  81. package/types/generators/SpeechToTextPlatform.ts +4 -4
  82. package/types/generators/SqLite.ts +10 -6
  83. package/types/generators/Step.ts +3 -3
  84. package/types/generators/SttAppleBuiltin.ts +6 -6
  85. package/types/generators/Tcp.ts +5 -5
  86. package/types/generators/TcpServer.ts +7 -7
  87. package/types/generators/TextToSpeechApple.ts +1 -1
  88. package/types/generators/TextToSpeechAppleBuiltin.ts +5 -5
  89. package/types/generators/TextToSpeechGgml.ts +8 -8
  90. package/types/generators/TextToSpeechOnnx.ts +9 -9
  91. package/types/generators/TextToSpeechOpenAiLike.ts +5 -5
  92. package/types/generators/ThermalPrinter.ts +6 -6
  93. package/types/generators/Tick.ts +3 -3
  94. package/types/generators/Udp.ts +9 -4
  95. package/types/generators/VadGgml.ts +39 -10
  96. package/types/generators/VadOnnx.ts +31 -8
  97. package/types/generators/VadTraditional.ts +15 -9
  98. package/types/generators/VectorStore.ts +26 -9
  99. package/types/generators/Watchdog.ts +11 -6
  100. package/types/generators/WebCrawler.ts +5 -5
  101. package/types/generators/WebRtc.ts +17 -11
  102. package/types/generators/WebSocket.ts +5 -5
  103. package/types/generators/index.ts +1 -0
  104. package/types/subspace.ts +1 -0
  105. package/types/system.ts +1 -1
  106. package/utils/calc.ts +12 -8
  107. package/utils/event-props.ts +104 -87
  108. package/utils/id.ts +4 -0
  109. package/api/index.ts +0 -1
  110. package/api/instance.ts +0 -213
@@ -135,25 +135,84 @@ Default property:
135
135
  }
136
136
  outlets?: {
137
137
  /* Is realtime transcription currently active */
138
- isActive?: () => Data
138
+ isActive?: () => Data<boolean>
139
139
  /* Is currently transcribing audio */
140
- isTranscribing?: () => Data
140
+ isTranscribing?: () => Data<boolean>
141
141
  /* Current transcription results */
142
- results?: () => Data
142
+ results?: () => Data<
143
+ Array<{
144
+ transcribeEvent?: {
145
+ type?: string
146
+ sliceIndex?: number
147
+ isCapturing?: boolean
148
+ data?: {
149
+ result?: string
150
+ [key: string]: any
151
+ }
152
+ vadEvent?: {
153
+ type?: string
154
+ confidence?: number
155
+ duration?: number
156
+ sliceIndex?: number
157
+ timestamp?: number
158
+ [key: string]: any
159
+ }
160
+ [key: string]: any
161
+ }
162
+ vadEvent?: {
163
+ type?: string
164
+ confidence?: number
165
+ duration?: number
166
+ sliceIndex?: number
167
+ timestamp?: number
168
+ [key: string]: any
169
+ }
170
+ [key: string]: any
171
+ }>
172
+ >
143
173
  /* Current transcription result text */
144
- resultText?: () => Data
174
+ resultText?: () => Data<string>
145
175
  /* Last stabilized transcription result segment */
146
- lastStabilizedSegment?: () => Data
176
+ lastStabilizedSegment?: () => Data<string>
147
177
  /* Current statistics */
148
- statistics?: () => Data
178
+ statistics?: () => Data<{
179
+ type?: string
180
+ timestamp?: number
181
+ data?: { [key: string]: any }
182
+ [key: string]: any
183
+ }>
149
184
  /* Latest transcribe event */
150
- lastTranscribeEvent?: () => Data
185
+ lastTranscribeEvent?: () => Data<{
186
+ type?: string
187
+ sliceIndex?: number
188
+ isCapturing?: boolean
189
+ data?: {
190
+ result?: string
191
+ [key: string]: any
192
+ }
193
+ vadEvent?: {
194
+ type?: string
195
+ confidence?: number
196
+ duration?: number
197
+ sliceIndex?: number
198
+ timestamp?: number
199
+ [key: string]: any
200
+ }
201
+ [key: string]: any
202
+ }>
151
203
  /* Latest VAD event */
152
- lastVadEvent?: () => Data
204
+ lastVadEvent?: () => Data<{
205
+ type?: string
206
+ confidence?: number
207
+ duration?: number
208
+ sliceIndex?: number
209
+ timestamp?: number
210
+ [key: string]: any
211
+ }>
153
212
  /* Stabilized transcription text from completed slices */
154
- stabilizedText?: () => Data
213
+ stabilizedText?: () => Data<string>
155
214
  /* Audio output file path (auto-generated when saving audio) */
156
- audioOutputPath?: () => Data
215
+ audioOutputPath?: () => Data<string>
157
216
  }
158
217
  }
159
218
 
@@ -161,7 +220,7 @@ Default property:
161
220
  export type GeneratorRealtimeTranscription = Generator &
162
221
  GeneratorRealtimeTranscriptionDef & {
163
222
  templateKey: 'GENERATOR_REALTIME_TRANSCRIPTION'
164
- switches: Array<
223
+ switches?: Array<
165
224
  SwitchDef &
166
225
  GeneratorRealtimeTranscriptionDef & {
167
226
  conds?: Array<{
@@ -69,13 +69,13 @@ Default property:
69
69
  batchSize?: number | DataLink
70
70
  /* Physical maximum batch size (default: 512) */
71
71
  uBatchSize?: number | DataLink
72
- /* GGML accelerator variant (Only for desktop)
72
+ /* GGML accelerator variant (Only for desktop)
73
73
  `default` - CPU / Metal (macOS)
74
74
  `vulkan` - Use Vulkan
75
75
  `cuda` - Use CUDA
76
76
  `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
77
77
  accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
78
- /* Devices. For example:
78
+ /* Devices. For example:
79
79
 
80
80
  Metal or CPU for iOS/tvOS/MacOS
81
81
  OpenCL or CPU for Android
@@ -109,19 +109,33 @@ Default property:
109
109
  }
110
110
  outlets?: {
111
111
  /* Current state of the reranker context (loading, ready, error, released) */
112
- contextState?: () => Data
112
+ contextState?: () => Data<string>
113
113
  /* Loading progress of the reranker model (0-100) */
114
- contextLoadProgress?: () => Data
114
+ contextLoadProgress?: () => Data<number>
115
115
  /* Detailed information about the reranker context including instance ID and processing status */
116
- contextDetails?: () => Data
116
+ contextDetails?: () => Data<{
117
+ state?: string
118
+ contextId?: string
119
+ gpu?: string
120
+ reasonNoGPU?: string
121
+ [key: string]: any
122
+ }>
117
123
  /* Result of the reranking operation containing scored and ranked documents */
118
- rerankResult?: () => Data
124
+ rerankResult?: () => Data<
125
+ Array<{
126
+ index?: number
127
+ score?: number
128
+ text?: string
129
+ payload?: { [key: string]: any }
130
+ [key: string]: any
131
+ }>
132
+ >
119
133
  /* Boolean indicating whether the reranker is currently processing a request */
120
- isProcessing?: () => Data
134
+ isProcessing?: () => Data<boolean>
121
135
  }
122
136
  }
123
137
 
124
- /* Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
138
+ /* Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
125
139
 
126
140
  ## Notice
127
141
  - The device RAM must be larger than 8GB
@@ -136,7 +150,7 @@ Default property:
136
150
  export type GeneratorReranker = Generator &
137
151
  GeneratorRerankerDef & {
138
152
  templateKey: 'GENERATOR_RERANKER'
139
- switches: Array<
153
+ switches?: Array<
140
154
  SwitchDef &
141
155
  GeneratorRerankerDef & {
142
156
  conds?: Array<{
@@ -103,15 +103,15 @@ Default property:
103
103
  }
104
104
  outlets?: {
105
105
  /* Available serial devices */
106
- generatorSerialDeviceList?: () => Data
106
+ generatorSerialDeviceList?: () => Data<Array<{ [key: string]: any }>>
107
107
  /* Is serial open */
108
- generatorSerialIsOpen?: () => Data
108
+ generatorSerialIsOpen?: () => Data<boolean>
109
109
  /* Last rerceive data (Base64) */
110
- generatorSerialLastDataBase64?: () => Data
110
+ generatorSerialLastDataBase64?: () => Data<string>
111
111
  /* Last rerceive plain text */
112
- generatorSerialLastDataString?: () => Data
112
+ generatorSerialLastDataString?: () => Data<string>
113
113
  /* Error message */
114
- generatorSerialErrorMessage?: () => Data
114
+ generatorSerialErrorMessage?: () => Data<string>
115
115
  }
116
116
  }
117
117
 
@@ -119,7 +119,7 @@ Default property:
119
119
  export type GeneratorSerialPort = Generator &
120
120
  GeneratorSerialPortDef & {
121
121
  templateKey: 'GENERATOR_SERIAL_PORT'
122
- switches: Array<
122
+ switches?: Array<
123
123
  SwitchDef &
124
124
  GeneratorSerialPortDef & {
125
125
  conds?: Array<{
@@ -61,7 +61,7 @@ Default property:
61
61
  }
62
62
  outlets?: {
63
63
  /* Whether the sound is playing */
64
- isPlaying?: () => Data
64
+ isPlaying?: () => Data<any>
65
65
  }
66
66
  }
67
67
 
@@ -69,7 +69,7 @@ Default property:
69
69
  export type GeneratorSoundPlayer = Generator &
70
70
  GeneratorSoundPlayerDef & {
71
71
  templateKey: 'GENERATOR_SOUND_PLAYER'
72
- switches: Array<
72
+ switches?: Array<
73
73
  SwitchDef &
74
74
  GeneratorSoundPlayerDef & {
75
75
  conds?: Array<{
@@ -82,13 +82,13 @@ Default property:
82
82
  }
83
83
  outlets?: {
84
84
  /* Is recording */
85
- isRecording?: () => Data
85
+ isRecording?: () => Data<boolean>
86
86
  /* Recorded file path */
87
- recordedPath?: () => Data
87
+ recordedPath?: () => Data<string>
88
88
  /* Current auto-cutting detected volume */
89
- volume?: () => Data
89
+ volume?: () => Data<number>
90
90
  /* Error message */
91
- errorMessage?: () => Data
91
+ errorMessage?: () => Data<string>
92
92
  }
93
93
  }
94
94
 
@@ -96,7 +96,7 @@ Default property:
96
96
  export type GeneratorSoundRecorder = Generator &
97
97
  GeneratorSoundRecorderDef & {
98
98
  templateKey: 'GENERATOR_SOUND_RECORDER'
99
- switches: Array<
99
+ switches?: Array<
100
100
  SwitchDef &
101
101
  GeneratorSoundRecorderDef & {
102
102
  conds?: Array<{
@@ -109,15 +109,15 @@ Default property:
109
109
  }
110
110
  */
111
111
  property?: {
112
- /* Initialize the Whisper context on generator initialization
112
+ /* Initialize the Whisper context on generator initialization
113
113
  Please note that it will take some RAM depending on the model size */
114
114
  init?: boolean | DataLink
115
- /* Accelerator variant (Only for desktop)
115
+ /* Accelerator variant (Only for desktop)
116
116
  `default` - CPU / Metal (macOS)
117
117
  `vulkan` - Use Vulkan
118
118
  `cuda` - Use CUDA */
119
119
  accelVariant?: 'default' | 'vulkan' | 'cuda' | DataLink
120
- /* Use model name, the model download progress will be done in preload stage or the generator initialization stage.
120
+ /* Use model name, the model download progress will be done in preload stage or the generator initialization stage.
121
121
  We used `ggml` format model, please refer to https://huggingface.co/BricksDisplay/whisper-ggml
122
122
  You can also choose `custom` option and set `Model URL` and `Model MD5` to use your own model */
123
123
  modelName?:
@@ -168,7 +168,7 @@ Default property:
168
168
  | 'distil-large-v3-q5_0'
169
169
  | 'distil-large-v3-q8_0'
170
170
  | DataLink
171
- /* The URL or path of model
171
+ /* The URL or path of model
172
172
  We used `ggml` format model, please refer to https://github.com/ggerganov/whisper.cpp/tree/master/models */
173
173
  modelUrl?: string | DataLink
174
174
  /* Hash type of model */
@@ -302,7 +302,7 @@ Default property:
302
302
  inferOffset?: number | DataLink
303
303
  /* Audio duration of audio to process in milliseconds */
304
304
  inferDuration?: number | DataLink
305
- /* The file URL or path to be inferred.
305
+ /* The file URL or path to be inferred.
306
306
  It only supported `wav` format with 16kHz sample rate & single (mono) channel */
307
307
  inferFileUrl?: string | DataLink
308
308
  /* MD5 of file to be inferred */
@@ -329,23 +329,43 @@ Default property:
329
329
  }
330
330
  outlets?: {
331
331
  /* Context state */
332
- contextState?: () => Data
332
+ contextState?: () => Data<string>
333
333
  /* Context details */
334
- contextDetails?: () => Data
334
+ contextDetails?: () => Data<{
335
+ state?: string
336
+ contextId?: string
337
+ gpu?: string
338
+ reasonNoGPU?: string
339
+ [key: string]: any
340
+ }>
335
341
  /* Is transcribing */
336
- isTranscribing?: () => Data
342
+ isTranscribing?: () => Data<boolean>
337
343
  /* Progress of transcribe audio (0-100) */
338
- transcribeProgress?: () => Data
344
+ transcribeProgress?: () => Data<number>
339
345
  /* Inference result */
340
- transcribeResult?: () => Data
346
+ transcribeResult?: () => Data<string>
341
347
  /* Inference result details */
342
- transcribeDetails?: () => Data
348
+ transcribeDetails?: () => Data<{
349
+ result?: string
350
+ segments?: Array<{
351
+ start?: number
352
+ end?: number
353
+ confidence?: number
354
+ t0?: number
355
+ t1?: number
356
+ [key: string]: any
357
+ }>
358
+ time?: number
359
+ startTime?: number
360
+ endTime?: number
361
+ [key: string]: any
362
+ }>
343
363
  /* Recorded audio file path of transcribe realtime (if `Save Audio` is enabled) */
344
- recordedPath?: () => Data
364
+ recordedPath?: () => Data<string>
345
365
  }
346
366
  }
347
367
 
348
- /* Local Speech-to-Text (STT) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)
368
+ /* Local Speech-to-Text (STT) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)
349
369
 
350
370
  ## Notice
351
371
  - iOS: Supported GPU acceleration, recommended use M1+ / A17+ chip device
@@ -355,7 +375,7 @@ Default property:
355
375
  export type GeneratorSpeechInference = Generator &
356
376
  GeneratorSpeechInferenceDef & {
357
377
  templateKey: 'GENERATOR_SPEECH_INFERENCE'
358
- switches: Array<
378
+ switches?: Array<
359
379
  SwitchDef &
360
380
  GeneratorSpeechInferenceDef & {
361
381
  conds?: Array<{
@@ -67,7 +67,7 @@ Default property:
67
67
  | DataLink
68
68
  /* Return timestamps */
69
69
  returnTimestamps?: 'none' | 'enable' | 'word' | DataLink
70
- /* Transcription language
70
+ /* Transcription language
71
71
  Not specifying the language will auto detect the language. */
72
72
  language?:
73
73
  | 'English'
@@ -174,12 +174,12 @@ Default property:
174
174
  task?: 'transcribe' | 'translate' | DataLink
175
175
  /* Inferencing chunk length */
176
176
  chunkLength?: number | DataLink
177
- /* Executor candidates, descending order of priority
177
+ /* Executor candidates, descending order of priority
178
178
  Default will be xnnpack, wasm, cpu */
179
179
  executors?:
180
180
  | Array<'qnn' | 'dml' | 'nnapi' | 'xnnpack' | 'coreml' | 'cpu' | 'wasm' | 'webgpu' | DataLink>
181
181
  | DataLink
182
- /* Execution mode
182
+ /* Execution mode
183
183
  Usually when the model has many branches, setting this option to `parallel` will give you better performance. */
184
184
  executionMode?: 'sequential' | 'parallel' | DataLink
185
185
  /* QNN backend */
@@ -197,20 +197,20 @@ Default property:
197
197
  }
198
198
  outlets?: {
199
199
  /* Context state */
200
- contextState?: () => Data
200
+ contextState?: () => Data<string>
201
201
  /* Inference result */
202
- result?: () => Data
202
+ result?: () => Data<string>
203
203
  /* Inference result detail */
204
- resultDetail?: () => Data
204
+ resultDetail?: () => Data<{ [key: string]: any }>
205
205
  }
206
206
  }
207
207
 
208
- /* Local STT inference based on [transformers.js](https://huggingface.co/docs/transformers.js)
208
+ /* Local STT inference based on [transformers.js](https://huggingface.co/docs/transformers.js)
209
209
  You can use any converted model on HuggingFace. */
210
210
  export type GeneratorOnnxSTT = Generator &
211
211
  GeneratorOnnxSTTDef & {
212
212
  templateKey: 'GENERATOR_ONNX_STT'
213
- switches: Array<
213
+ switches?: Array<
214
214
  SwitchDef &
215
215
  GeneratorOnnxSTTDef & {
216
216
  conds?: Array<{
@@ -46,11 +46,11 @@ Default property:
46
46
  }
47
47
  outlets?: {
48
48
  /* Recognized speech text */
49
- recognizedText?: () => Data
49
+ recognizedText?: () => Data<string>
50
50
  /* Error message */
51
- errorMessage?: () => Data
51
+ errorMessage?: () => Data<string>
52
52
  /* Listening status */
53
- listening?: () => Data
53
+ listening?: () => Data<boolean>
54
54
  }
55
55
  }
56
56
 
@@ -58,7 +58,7 @@ Default property:
58
58
  export type GeneratorPlatformSTT = Generator &
59
59
  GeneratorPlatformSTTDef & {
60
60
  templateKey: 'GENERATOR_PLATFORM_STT'
61
- switches: Array<
61
+ switches?: Array<
62
62
  SwitchDef &
63
63
  GeneratorPlatformSTTDef & {
64
64
  conds?: Array<{
@@ -114,15 +114,19 @@ Default property:
114
114
  }
115
115
  outlets?: {
116
116
  /* Whether the database is ready */
117
- isReady?: () => Data
117
+ isReady?: () => Data<boolean>
118
118
  /* Database path */
119
- dbPath?: () => Data
119
+ dbPath?: () => Data<string>
120
120
  /* Error message */
121
- error?: () => Data
121
+ error?: () => Data<string>
122
122
  /* Last query result */
123
- lastResult?: () => Data
123
+ lastResult?: () => Data<Array<{ [key: string]: any }>>
124
124
  /* Last execute result with metadata */
125
- lastExecuteResult?: () => Data
125
+ lastExecuteResult?: () => Data<{
126
+ rowsAffected?: number
127
+ insertId?: number
128
+ [key: string]: any
129
+ }>
126
130
  }
127
131
  }
128
132
 
@@ -130,7 +134,7 @@ Default property:
130
134
  export type GeneratorSqlite = Generator &
131
135
  GeneratorSqliteDef & {
132
136
  templateKey: 'GENERATOR_SQLITE'
133
- switches: Array<
137
+ switches?: Array<
134
138
  SwitchDef &
135
139
  GeneratorSqliteDef & {
136
140
  conds?: Array<{
@@ -74,9 +74,9 @@ Default property:
74
74
  }
75
75
  outlets?: {
76
76
  /* Result of step payload (If action is `outlet`) */
77
- payload?: () => Data
77
+ payload?: () => Data<string>
78
78
  /* Result of step index (If action is `outlet`) */
79
- index?: () => Data
79
+ index?: () => Data<number>
80
80
  }
81
81
  }
82
82
 
@@ -84,7 +84,7 @@ Default property:
84
84
  export type GeneratorStep = Generator &
85
85
  GeneratorStepDef & {
86
86
  templateKey: 'GENERATOR_STEP'
87
- switches: Array<
87
+ switches?: Array<
88
88
  SwitchDef &
89
89
  GeneratorStepDef & {
90
90
  conds?: Array<{
@@ -77,17 +77,17 @@ Default property:
77
77
  }
78
78
  outlets?: {
79
79
  /* State outlet (loading, ready, error) */
80
- state?: () => Data
80
+ state?: () => Data<string>
81
81
  /* Is transcribing */
82
- isTranscribing?: () => Data
82
+ isTranscribing?: () => Data<boolean>
83
83
  /* Transcribe result */
84
- transcribeResult?: () => Data
84
+ transcribeResult?: () => Data<string>
85
85
  /* Transcribe result details (result, segments, time, startTime, endTime, duration) */
86
- transcribeDetails?: () => Data
86
+ transcribeDetails?: () => Data<{ [key: string]: any }>
87
87
  }
88
88
  }
89
89
 
90
- /* Speech recognition on iOS 26+ (Not supported on tvOS)
90
+ /* Speech recognition on iOS 26+ (Not supported on tvOS)
91
91
 
92
92
  ## Features
93
93
  - Native Apple speech recognition
@@ -98,7 +98,7 @@ Default property:
98
98
  export type GeneratorAppleSTT = Generator &
99
99
  GeneratorAppleSTTDef & {
100
100
  templateKey: 'GENERATOR_APPLE_STT'
101
- switches: Array<
101
+ switches?: Array<
102
102
  SwitchDef &
103
103
  GeneratorAppleSTTDef & {
104
104
  conds?: Array<{
@@ -57,7 +57,7 @@ Default property:
57
57
  host?: string | DataLink
58
58
  /* Connection target port */
59
59
  port?: number | DataLink
60
- /* Data mode
60
+ /* Data mode
61
61
  CRLF: Receive until CRLF
62
62
  LF: Receive until LF
63
63
  raw: Raw packet */
@@ -91,11 +91,11 @@ Default property:
91
91
  }
92
92
  outlets?: {
93
93
  /* Connection status */
94
- status?: () => Data
94
+ status?: () => Data<string>
95
95
  /* Last received data */
96
- lastData?: () => Data
96
+ lastData?: () => Data<string>
97
97
  /* Error message */
98
- errorMessage?: () => Data
98
+ errorMessage?: () => Data<string>
99
99
  }
100
100
  }
101
101
 
@@ -103,7 +103,7 @@ Default property:
103
103
  export type GeneratorTCP = Generator &
104
104
  GeneratorTCPDef & {
105
105
  templateKey: 'GENERATOR_TCP'
106
- switches: Array<
106
+ switches?: Array<
107
107
  SwitchDef &
108
108
  GeneratorTCPDef & {
109
109
  conds?: Array<{
@@ -72,7 +72,7 @@ Default property:
72
72
  init?: boolean | DataLink
73
73
  /* Bind port of TCP server */
74
74
  port?: number | DataLink
75
- /* Data mode
75
+ /* Data mode
76
76
  CRLF: Receive until CRLF
77
77
  LF: Receive until LF
78
78
  raw: Raw packet */
@@ -106,15 +106,15 @@ Default property:
106
106
  }
107
107
  outlets?: {
108
108
  /* Server is listening */
109
- isListening?: () => Data
109
+ isListening?: () => Data<boolean>
110
110
  /* Is server started */
111
- started?: () => Data
111
+ started?: () => Data<boolean>
112
112
  /* Accepted connections */
113
- connections?: () => Data
113
+ connections?: () => Data<Array<string>>
114
114
  /* Last received data */
115
- lastData?: () => Data
115
+ lastData?: () => Data<string>
116
116
  /* Error message */
117
- errorMessage?: () => Data
117
+ errorMessage?: () => Data<string>
118
118
  }
119
119
  }
120
120
 
@@ -122,7 +122,7 @@ Default property:
122
122
  export type GeneratorTCPServer = Generator &
123
123
  GeneratorTCPServerDef & {
124
124
  templateKey: 'GENERATOR_TCP_SERVER'
125
- switches: Array<
125
+ switches?: Array<
126
126
  SwitchDef &
127
127
  GeneratorTCPServerDef & {
128
128
  conds?: Array<{
@@ -83,7 +83,7 @@ Default property:
83
83
  }
84
84
  }
85
85
 
86
- /* Text-to-speech synthesis using Apple's native speech synthesis
86
+ /* Text-to-speech synthesis using Apple's native speech synthesis
87
87
 
88
88
  ## Features
89
89
  - Native Apple speech synthesis
@@ -76,15 +76,15 @@ Default property:
76
76
  }
77
77
  outlets?: {
78
78
  /* Context state */
79
- contextState?: () => Data
79
+ contextState?: () => Data<string>
80
80
  /* Generated audio file */
81
- generatedAudio?: () => Data
81
+ generatedAudio?: () => Data<string>
82
82
  /* Generated audio file is playing */
83
- generatedAudioPlaying?: () => Data
83
+ generatedAudioPlaying?: () => Data<boolean>
84
84
  }
85
85
  }
86
86
 
87
- /* Text-to-speech synthesis using Apple's native speech synthesis
87
+ /* Text-to-speech synthesis using Apple's native speech synthesis
88
88
 
89
89
  ## Features
90
90
  - Native Apple speech synthesis
@@ -95,7 +95,7 @@ Default property:
95
95
  export type GeneratorAppleTTS = Generator &
96
96
  GeneratorAppleTTSDef & {
97
97
  templateKey: 'GENERATOR_APPLE_TTS'
98
- switches: Array<
98
+ switches?: Array<
99
99
  SwitchDef &
100
100
  GeneratorAppleTTSDef & {
101
101
  conds?: Array<{
@@ -75,7 +75,7 @@ Default property:
75
75
  property?: {
76
76
  /* Initialize the TTS context on generator initialization */
77
77
  init?: boolean | DataLink
78
- /* The URL or path of model
78
+ /* The URL or path of model
79
79
  We used GGUF format model, please refer to https://github.com/ggerganov/llama.cpp/tree/master#description */
80
80
  modelUrl?: string | DataLink
81
81
  /* Hash type of model */
@@ -128,13 +128,13 @@ Default property:
128
128
  microBatchSize?: number | DataLink
129
129
  /* Number of threads */
130
130
  maxThreads?: number | DataLink
131
- /* Accelerator variant (Only for desktop)
131
+ /* Accelerator variant (Only for desktop)
132
132
  `default` - CPU / Metal (macOS)
133
133
  `vulkan` - Use Vulkan
134
134
  `cuda` - Use CUDA
135
135
  `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
136
136
  accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
137
- /* Devices. For example:
137
+ /* Devices. For example:
138
138
 
139
139
  Metal or CPU for iOS/tvOS/MacOS
140
140
  OpenCL or CPU for Android
@@ -160,15 +160,15 @@ Default property:
160
160
  }
161
161
  outlets?: {
162
162
  /* Context state */
163
- contextState?: () => Data
163
+ contextState?: () => Data<string>
164
164
  /* Generated audio file */
165
- generatedAudio?: () => Data
165
+ generatedAudio?: () => Data<string>
166
166
  /* Generated audio file is playing */
167
- generatedAudioPlaying?: () => Data
167
+ generatedAudioPlaying?: () => Data<boolean>
168
168
  }
169
169
  }
170
170
 
171
- /* Local Text-to-Speech (TTS) inference based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
171
+ /* Local Text-to-Speech (TTS) inference based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
172
172
  You can use any converted model on HuggingFace.
173
173
 
174
174
  ## Notice
@@ -184,7 +184,7 @@ Default property:
184
184
  export type GeneratorGGMLTTS = Generator &
185
185
  GeneratorGGMLTTSDef & {
186
186
  templateKey: 'GENERATOR_GGML_TTS'
187
- switches: Array<
187
+ switches?: Array<
188
188
  SwitchDef &
189
189
  GeneratorGGMLTTSDef & {
190
190
  conds?: Array<{