@fugood/bricks-project 2.24.0-beta.4 → 2.24.0-beta.40

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 (125) hide show
  1. package/compile/action-name-map.ts +38 -0
  2. package/compile/index.ts +429 -160
  3. package/compile/util.ts +2 -0
  4. package/package.json +7 -3
  5. package/package.json.bak +27 -0
  6. package/skills/bricks-design/LICENSE.txt +180 -0
  7. package/skills/bricks-design/SKILL.md +66 -0
  8. package/skills/bricks-project/SKILL.md +2 -2
  9. package/skills/bricks-project/rules/animation.md +1 -1
  10. package/skills/bricks-project/rules/architecture-patterns.md +7 -0
  11. package/skills/bricks-project/rules/automations.md +74 -28
  12. package/skills/bricks-project/rules/buttress.md +10 -7
  13. package/skills/bricks-project/rules/data-calculation.md +1 -1
  14. package/skills/bricks-project/rules/local-sync.md +2 -2
  15. package/skills/bricks-project/rules/media-flow.md +3 -3
  16. package/skills/bricks-project/rules/remote-data-bank.md +6 -6
  17. package/skills/bricks-project/rules/standby-transition.md +1 -1
  18. package/tools/deploy.ts +66 -12
  19. package/tools/icons/fa6pro-meta.json +3669 -26125
  20. package/tools/mcp-server.ts +11 -878
  21. package/tools/mcp-tools/compile.ts +91 -0
  22. package/tools/mcp-tools/huggingface.ts +762 -0
  23. package/tools/mcp-tools/icons.ts +70 -0
  24. package/tools/mcp-tools/lottie.ts +102 -0
  25. package/tools/mcp-tools/media.ts +110 -0
  26. package/tools/postinstall.ts +137 -40
  27. package/tools/preview-main.mjs +146 -9
  28. package/tools/preview.ts +30 -2
  29. package/tools/pull.ts +37 -19
  30. package/tsconfig.json +16 -0
  31. package/types/animation.ts +4 -0
  32. package/types/automation.ts +4 -1
  33. package/types/brick-base.ts +1 -1
  34. package/types/bricks/Camera.ts +48 -13
  35. package/types/bricks/Chart.ts +10 -4
  36. package/types/bricks/GenerativeMedia.ts +30 -14
  37. package/types/bricks/Icon.ts +9 -5
  38. package/types/bricks/Image.ts +10 -6
  39. package/types/bricks/Items.ts +29 -15
  40. package/types/bricks/Lottie.ts +15 -7
  41. package/types/bricks/Maps.ts +16 -8
  42. package/types/bricks/QrCode.ts +9 -5
  43. package/types/bricks/Rect.ts +45 -6
  44. package/types/bricks/RichText.ts +9 -5
  45. package/types/bricks/Rive.ts +21 -11
  46. package/types/bricks/Slideshow.ts +20 -10
  47. package/types/bricks/Svg.ts +8 -4
  48. package/types/bricks/Text.ts +9 -5
  49. package/types/bricks/TextInput.ts +23 -13
  50. package/types/bricks/Video.ts +11 -7
  51. package/types/bricks/VideoStreaming.ts +8 -4
  52. package/types/bricks/WebRtcStream.ts +7 -3
  53. package/types/bricks/WebView.ts +12 -8
  54. package/types/canvas.ts +4 -2
  55. package/types/common.ts +19 -12
  56. package/types/data-calc-command.ts +2 -0
  57. package/types/data-calc.ts +1 -0
  58. package/types/data.ts +2 -0
  59. package/types/generators/AlarmClock.ts +17 -11
  60. package/types/generators/Assistant.ts +69 -18
  61. package/types/generators/BleCentral.ts +31 -11
  62. package/types/generators/BlePeripheral.ts +11 -7
  63. package/types/generators/CanvasMap.ts +10 -6
  64. package/types/generators/CastlesPay.ts +15 -7
  65. package/types/generators/DataBank.ts +44 -9
  66. package/types/generators/File.ts +109 -30
  67. package/types/generators/GraphQl.ts +12 -6
  68. package/types/generators/Http.ts +33 -10
  69. package/types/generators/HttpServer.ts +23 -15
  70. package/types/generators/Information.ts +9 -5
  71. package/types/generators/Intent.ts +15 -5
  72. package/types/generators/Iterator.ts +15 -11
  73. package/types/generators/Keyboard.ts +27 -13
  74. package/types/generators/LlmAnthropicCompat.ts +33 -11
  75. package/types/generators/LlmAppleBuiltin.ts +25 -10
  76. package/types/generators/LlmGgml.ts +140 -31
  77. package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
  78. package/types/generators/LlmMlx.ts +227 -0
  79. package/types/generators/LlmOnnx.ts +34 -14
  80. package/types/generators/LlmOpenAiCompat.ts +47 -11
  81. package/types/generators/LlmQualcommAiEngine.ts +45 -13
  82. package/types/generators/Mcp.ts +375 -34
  83. package/types/generators/McpServer.ts +58 -19
  84. package/types/generators/MediaFlow.ts +38 -12
  85. package/types/generators/MqttBroker.ts +29 -11
  86. package/types/generators/MqttClient.ts +19 -9
  87. package/types/generators/Question.ts +13 -9
  88. package/types/generators/RealtimeTranscription.ts +108 -19
  89. package/types/generators/RerankerGgml.ts +43 -12
  90. package/types/generators/SerialPort.ts +18 -10
  91. package/types/generators/SoundPlayer.ts +10 -4
  92. package/types/generators/SoundRecorder.ts +24 -9
  93. package/types/generators/SpeechToTextGgml.ts +52 -18
  94. package/types/generators/SpeechToTextOnnx.ts +18 -11
  95. package/types/generators/SpeechToTextPlatform.ts +15 -7
  96. package/types/generators/SqLite.ts +20 -10
  97. package/types/generators/Step.ts +9 -5
  98. package/types/generators/SttAppleBuiltin.ts +22 -9
  99. package/types/generators/Tcp.ts +13 -9
  100. package/types/generators/TcpServer.ts +20 -14
  101. package/types/generators/TextToSpeechAppleBuiltin.ts +21 -8
  102. package/types/generators/TextToSpeechGgml.ts +29 -11
  103. package/types/generators/TextToSpeechOnnx.ts +19 -12
  104. package/types/generators/TextToSpeechOpenAiLike.ts +14 -8
  105. package/types/generators/ThermalPrinter.ts +13 -9
  106. package/types/generators/Tick.ts +11 -7
  107. package/types/generators/Udp.ts +17 -8
  108. package/types/generators/VadGgml.ts +51 -14
  109. package/types/generators/VadOnnx.ts +42 -12
  110. package/types/generators/VadTraditional.ts +28 -13
  111. package/types/generators/VectorStore.ts +33 -12
  112. package/types/generators/Watchdog.ts +19 -10
  113. package/types/generators/WebCrawler.ts +11 -7
  114. package/types/generators/WebRtc.ts +30 -16
  115. package/types/generators/WebSocket.ts +11 -7
  116. package/types/generators/index.ts +2 -0
  117. package/types/subspace.ts +3 -0
  118. package/types/system.ts +1 -1
  119. package/utils/calc.ts +12 -8
  120. package/utils/event-props.ts +833 -1022
  121. package/utils/id.ts +4 -0
  122. package/api/index.ts +0 -1
  123. package/api/instance.ts +0 -213
  124. package/types/generators/TextToSpeechApple.ts +0 -113
  125. package/types/generators/TtsAppleBuiltin.ts +0 -105
@@ -1,4 +1,13 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Local Speech-to-Text (STT) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)
4
+ *
5
+ * ## Notice
6
+ * - iOS: Supported GPU acceleration, recommended use M1+ / A17+ chip device
7
+ * - macOS: Supported GPU acceleration, recommended use M1+ chip device
8
+ * - Android: Currently not supported GPU acceleration (Coming soon), recommended use Android 13+ system
9
+ * - Linux / Windows: Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
10
+ */
2
11
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
12
  import type { Data, DataLink } from '../data'
4
13
  import type {
@@ -10,6 +19,7 @@ import type {
10
19
  Action,
11
20
  EventProperty,
12
21
  } from '../common'
22
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
23
 
14
24
  /* Load the model */
15
25
  export type GeneratorSpeechInferenceActionLoadModel = Action & {
@@ -109,15 +119,15 @@ Default property:
109
119
  }
110
120
  */
111
121
  property?: {
112
- /* Initialize the Whisper context on generator initialization
122
+ /* Initialize the Whisper context on generator initialization
113
123
  Please note that it will take some RAM depending on the model size */
114
124
  init?: boolean | DataLink
115
- /* Accelerator variant (Only for desktop)
125
+ /* Accelerator variant (Only for desktop)
116
126
  `default` - CPU / Metal (macOS)
117
127
  `vulkan` - Use Vulkan
118
128
  `cuda` - Use CUDA */
119
129
  accelVariant?: 'default' | 'vulkan' | 'cuda' | DataLink
120
- /* Use model name, the model download progress will be done in preload stage or the generator initialization stage.
130
+ /* Use model name, the model download progress will be done in preload stage or the generator initialization stage.
121
131
  We used `ggml` format model, please refer to https://huggingface.co/BricksDisplay/whisper-ggml
122
132
  You can also choose `custom` option and set `Model URL` and `Model MD5` to use your own model */
123
133
  modelName?:
@@ -168,7 +178,7 @@ Default property:
168
178
  | 'distil-large-v3-q5_0'
169
179
  | 'distil-large-v3-q8_0'
170
180
  | DataLink
171
- /* The URL or path of model
181
+ /* The URL or path of model
172
182
  We used `ggml` format model, please refer to https://github.com/ggerganov/whisper.cpp/tree/master/models */
173
183
  modelUrl?: string | DataLink
174
184
  /* Hash type of model */
@@ -302,7 +312,7 @@ Default property:
302
312
  inferOffset?: number | DataLink
303
313
  /* Audio duration of audio to process in milliseconds */
304
314
  inferDuration?: number | DataLink
305
- /* The file URL or path to be inferred.
315
+ /* The file URL or path to be inferred.
306
316
  It only supported `wav` format with 16kHz sample rate & single (mono) channel */
307
317
  inferFileUrl?: string | DataLink
308
318
  /* MD5 of file to be inferred */
@@ -319,33 +329,57 @@ Default property:
319
329
  }
320
330
  events?: {
321
331
  /* Event triggered when context state changes */
322
- onContextStateChange?: Array<EventAction>
332
+ onContextStateChange?: Array<
333
+ EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onContextStateChange']>
334
+ >
323
335
  /* Event triggered when error occurs */
324
- onError?: Array<EventAction>
336
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onError']>>
325
337
  /* Event triggered when got transcribe result */
326
- onTranscribed?: Array<EventAction>
338
+ onTranscribed?: Array<
339
+ EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onTranscribed']>
340
+ >
327
341
  /* Event triggered when transcribe realtime done */
328
342
  onRealtimeStop?: Array<EventAction>
329
343
  }
330
344
  outlets?: {
331
345
  /* Context state */
332
- contextState?: () => Data
346
+ contextState?: () => Data<string>
333
347
  /* Context details */
334
- contextDetails?: () => Data
348
+ contextDetails?: () => Data<{
349
+ state?: string
350
+ contextId?: string
351
+ gpu?: string
352
+ reasonNoGPU?: string
353
+ [key: string]: any
354
+ }>
335
355
  /* Is transcribing */
336
- isTranscribing?: () => Data
356
+ isTranscribing?: () => Data<boolean>
337
357
  /* Progress of transcribe audio (0-100) */
338
- transcribeProgress?: () => Data
358
+ transcribeProgress?: () => Data<number>
339
359
  /* Inference result */
340
- transcribeResult?: () => Data
360
+ transcribeResult?: () => Data<string>
341
361
  /* Inference result details */
342
- transcribeDetails?: () => Data
362
+ transcribeDetails?: () => Data<{
363
+ result?: string
364
+ segments?: Array<{
365
+ start?: number
366
+ end?: number
367
+ confidence?: number
368
+ t0?: number
369
+ t1?: number
370
+ [key: string]: any
371
+ }>
372
+ time?: number
373
+ startTime?: number
374
+ endTime?: number
375
+ [key: string]: any
376
+ }>
343
377
  /* Recorded audio file path of transcribe realtime (if `Save Audio` is enabled) */
344
- recordedPath?: () => Data
378
+ recordedPath?: () => Data<string>
345
379
  }
346
380
  }
347
381
 
348
- /* Local Speech-to-Text (STT) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)
382
+ /* Local Speech-to-Text (STT) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)
349
383
 
350
384
  ## Notice
351
385
  - iOS: Supported GPU acceleration, recommended use M1+ / A17+ chip device
@@ -355,7 +389,7 @@ Default property:
355
389
  export type GeneratorSpeechInference = Generator &
356
390
  GeneratorSpeechInferenceDef & {
357
391
  templateKey: 'GENERATOR_SPEECH_INFERENCE'
358
- switches: Array<
392
+ switches?: Array<
359
393
  SwitchDef &
360
394
  GeneratorSpeechInferenceDef & {
361
395
  conds?: Array<{
@@ -1,4 +1,8 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Local STT inference based on [transformers.js](https://huggingface.co/docs/transformers.js)
4
+ * You can use any converted model on HuggingFace.
5
+ */
2
6
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
7
  import type { Data, DataLink } from '../data'
4
8
  import type {
@@ -10,6 +14,7 @@ import type {
10
14
  Action,
11
15
  EventProperty,
12
16
  } from '../common'
17
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
18
 
14
19
  /* Load the model */
15
20
  export type GeneratorOnnxSTTActionLoadModel = Action & {
@@ -67,7 +72,7 @@ Default property:
67
72
  | DataLink
68
73
  /* Return timestamps */
69
74
  returnTimestamps?: 'none' | 'enable' | 'word' | DataLink
70
- /* Transcription language
75
+ /* Transcription language
71
76
  Not specifying the language will auto detect the language. */
72
77
  language?:
73
78
  | 'English'
@@ -174,12 +179,12 @@ Default property:
174
179
  task?: 'transcribe' | 'translate' | DataLink
175
180
  /* Inferencing chunk length */
176
181
  chunkLength?: number | DataLink
177
- /* Executor candidates, descending order of priority
182
+ /* Executor candidates, descending order of priority
178
183
  Default will be xnnpack, wasm, cpu */
179
184
  executors?:
180
185
  | Array<'qnn' | 'dml' | 'nnapi' | 'xnnpack' | 'coreml' | 'cpu' | 'wasm' | 'webgpu' | DataLink>
181
186
  | DataLink
182
- /* Execution mode
187
+ /* Execution mode
183
188
  Usually when the model has many branches, setting this option to `parallel` will give you better performance. */
184
189
  executionMode?: 'sequential' | 'parallel' | DataLink
185
190
  /* QNN backend */
@@ -191,26 +196,28 @@ Default property:
191
196
  }
192
197
  events?: {
193
198
  /* Event triggered when state change */
194
- onContextStateChange?: Array<EventAction>
199
+ onContextStateChange?: Array<
200
+ EventAction<string & keyof TemplateEventPropsMap['OnnxStt']['onContextStateChange']>
201
+ >
195
202
  /* Event triggered when error occurs */
196
- onError?: Array<EventAction>
203
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['OnnxStt']['onError']>>
197
204
  }
198
205
  outlets?: {
199
206
  /* Context state */
200
- contextState?: () => Data
207
+ contextState?: () => Data<string>
201
208
  /* Inference result */
202
- result?: () => Data
209
+ result?: () => Data<string>
203
210
  /* Inference result detail */
204
- resultDetail?: () => Data
211
+ resultDetail?: () => Data<{ [key: string]: any }>
205
212
  }
206
213
  }
207
214
 
208
- /* Local STT inference based on [transformers.js](https://huggingface.co/docs/transformers.js)
215
+ /* Local STT inference based on [transformers.js](https://huggingface.co/docs/transformers.js)
209
216
  You can use any converted model on HuggingFace. */
210
217
  export type GeneratorOnnxSTT = Generator &
211
218
  GeneratorOnnxSTTDef & {
212
219
  templateKey: 'GENERATOR_ONNX_STT'
213
- switches: Array<
220
+ switches?: Array<
214
221
  SwitchDef &
215
222
  GeneratorOnnxSTTDef & {
216
223
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Speech-to-Text using platform's native capabilities
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 speech recognition */
15
19
  export type GeneratorPlatformSTTActionStart = Action & {
@@ -40,17 +44,21 @@ Default property:
40
44
  /* Event for speech recognition end */
41
45
  onSpeechEnd?: Array<EventAction>
42
46
  /* Event for speech recognition results */
43
- onSpeechResults?: Array<EventAction>
47
+ onSpeechResults?: Array<
48
+ EventAction<string & keyof TemplateEventPropsMap['PlatformStt']['onSpeechResults']>
49
+ >
44
50
  /* Event for speech recognition error */
45
- onSpeechError?: Array<EventAction>
51
+ onSpeechError?: Array<
52
+ EventAction<string & keyof TemplateEventPropsMap['PlatformStt']['onSpeechError']>
53
+ >
46
54
  }
47
55
  outlets?: {
48
56
  /* Recognized speech text */
49
- recognizedText?: () => Data
57
+ recognizedText?: () => Data<string>
50
58
  /* Error message */
51
- errorMessage?: () => Data
59
+ errorMessage?: () => Data<string>
52
60
  /* Listening status */
53
- listening?: () => Data
61
+ listening?: () => Data<boolean>
54
62
  }
55
63
  }
56
64
 
@@ -58,7 +66,7 @@ Default property:
58
66
  export type GeneratorPlatformSTT = Generator &
59
67
  GeneratorPlatformSTTDef & {
60
68
  templateKey: 'GENERATOR_PLATFORM_STT'
61
- switches: Array<
69
+ switches?: Array<
62
70
  SwitchDef &
63
71
  GeneratorPlatformSTTDef & {
64
72
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * SQLite database: create tables, query, insert, update, and delete with SQL
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
  /* Execute SQL statement */
15
19
  export type GeneratorSqliteActionExecute = ActionWithParams & {
@@ -108,29 +112,35 @@ Default property:
108
112
  }
109
113
  events?: {
110
114
  /* Event triggered when error occurs */
111
- onError?: Array<EventAction>
115
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Sqlite']['onError']>>
112
116
  /* Event triggered when query result is ready */
113
- onQueryResult?: Array<EventAction>
117
+ onQueryResult?: Array<
118
+ EventAction<string & keyof TemplateEventPropsMap['Sqlite']['onQueryResult']>
119
+ >
114
120
  }
115
121
  outlets?: {
116
122
  /* Whether the database is ready */
117
- isReady?: () => Data
123
+ isReady?: () => Data<boolean>
118
124
  /* Database path */
119
- dbPath?: () => Data
125
+ dbPath?: () => Data<string>
120
126
  /* Error message */
121
- error?: () => Data
127
+ error?: () => Data<string>
122
128
  /* Last query result */
123
- lastResult?: () => Data
129
+ lastResult?: () => Data<Array<{ [key: string]: any }>>
124
130
  /* Last execute result with metadata */
125
- lastExecuteResult?: () => Data
131
+ lastExecuteResult?: () => Data<{
132
+ rowsAffected?: number
133
+ insertId?: number
134
+ [key: string]: any
135
+ }>
126
136
  }
127
137
  }
128
138
 
129
- /* SQLite - General database operations */
139
+ /* SQLite database: create tables, query, insert, update, and delete with SQL */
130
140
  export type GeneratorSqlite = Generator &
131
141
  GeneratorSqliteDef & {
132
142
  templateKey: 'GENERATOR_SQLITE'
133
- switches: Array<
143
+ switches?: Array<
134
144
  SwitchDef &
135
145
  GeneratorSqliteDef & {
136
146
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Trigger change canvas / outlet / event by setup rules
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 execute the step */
15
19
  export type GeneratorStepActionStart = Action & {
@@ -70,13 +74,13 @@ Default property:
70
74
  }
71
75
  events?: {
72
76
  /* Event on step (If action is `event`) */
73
- onStep?: Array<EventAction>
77
+ onStep?: Array<EventAction<string & keyof TemplateEventPropsMap['Step']['onStep']>>
74
78
  }
75
79
  outlets?: {
76
80
  /* Result of step payload (If action is `outlet`) */
77
- payload?: () => Data
81
+ payload?: () => Data<string>
78
82
  /* Result of step index (If action is `outlet`) */
79
- index?: () => Data
83
+ index?: () => Data<number>
80
84
  }
81
85
  }
82
86
 
@@ -84,7 +88,7 @@ Default property:
84
88
  export type GeneratorStep = Generator &
85
89
  GeneratorStepDef & {
86
90
  templateKey: 'GENERATOR_STEP'
87
- switches: Array<
91
+ switches?: Array<
88
92
  SwitchDef &
89
93
  GeneratorStepDef & {
90
94
  conds?: Array<{
@@ -1,4 +1,14 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Speech recognition on iOS 26+ (Not supported on tvOS)
4
+ *
5
+ * ## Features
6
+ * - Native Apple speech recognition
7
+ * - High accuracy transcription
8
+ * - Privacy-focused on-device processing
9
+ * - Supports file and data transcription
10
+ * - Requires iOS 26+ (Not supported on tvOS)
11
+ */
2
12
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
13
  import type { Data, DataLink } from '../data'
4
14
  import type {
@@ -10,6 +20,7 @@ import type {
10
20
  Action,
11
21
  EventProperty,
12
22
  } from '../common'
23
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
24
 
14
25
  /* Initialize STT */
15
26
  export type GeneratorAppleSTTActionInit = Action & {
@@ -71,23 +82,25 @@ Default property:
71
82
  }
72
83
  events?: {
73
84
  /* Error event */
74
- onError?: Array<EventAction>
85
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AppleStt']['onError']>>
75
86
  /* Event triggered when got transcribe result */
76
- onTranscribed?: Array<EventAction>
87
+ onTranscribed?: Array<
88
+ EventAction<string & keyof TemplateEventPropsMap['AppleStt']['onTranscribed']>
89
+ >
77
90
  }
78
91
  outlets?: {
79
92
  /* State outlet (loading, ready, error) */
80
- state?: () => Data
93
+ state?: () => Data<string>
81
94
  /* Is transcribing */
82
- isTranscribing?: () => Data
95
+ isTranscribing?: () => Data<boolean>
83
96
  /* Transcribe result */
84
- transcribeResult?: () => Data
97
+ transcribeResult?: () => Data<string>
85
98
  /* Transcribe result details (result, segments, time, startTime, endTime, duration) */
86
- transcribeDetails?: () => Data
99
+ transcribeDetails?: () => Data<{ [key: string]: any }>
87
100
  }
88
101
  }
89
102
 
90
- /* Speech recognition on iOS 26+ (Not supported on tvOS)
103
+ /* Speech recognition on iOS 26+ (Not supported on tvOS)
91
104
 
92
105
  ## Features
93
106
  - Native Apple speech recognition
@@ -98,7 +111,7 @@ Default property:
98
111
  export type GeneratorAppleSTT = Generator &
99
112
  GeneratorAppleSTTDef & {
100
113
  templateKey: 'GENERATOR_APPLE_STT'
101
- switches: Array<
114
+ switches?: Array<
102
115
  SwitchDef &
103
116
  GeneratorAppleSTTDef & {
104
117
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * TCP socket client with data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), TLS, and keepalive 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 connect */
15
19
  export type GeneratorTCPActionConnect = Action & {
@@ -57,7 +61,7 @@ Default property:
57
61
  host?: string | DataLink
58
62
  /* Connection target port */
59
63
  port?: number | DataLink
60
- /* Data mode
64
+ /* Data mode
61
65
  CRLF: Receive until CRLF
62
66
  LF: Receive until LF
63
67
  raw: Raw packet */
@@ -81,29 +85,29 @@ Default property:
81
85
  /* Event of connect successful */
82
86
  onConnected?: Array<EventAction>
83
87
  /* Event of receive data */
84
- onData?: Array<EventAction>
88
+ onData?: Array<EventAction<string & keyof TemplateEventPropsMap['Tcp']['onData']>>
85
89
  /* Event of connection idle timeout */
86
90
  onTimeout?: Array<EventAction>
87
91
  /* Event of connection close */
88
92
  onClose?: Array<EventAction>
89
93
  /* Event of connection error */
90
- onError?: Array<EventAction>
94
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Tcp']['onError']>>
91
95
  }
92
96
  outlets?: {
93
97
  /* Connection status */
94
- status?: () => Data
98
+ status?: () => Data<string>
95
99
  /* Last received data */
96
- lastData?: () => Data
100
+ lastData?: () => Data<string>
97
101
  /* Error message */
98
- errorMessage?: () => Data
102
+ errorMessage?: () => Data<string>
99
103
  }
100
104
  }
101
105
 
102
- /* TCP */
106
+ /* TCP socket client with data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), TLS, and keepalive support */
103
107
  export type GeneratorTCP = Generator &
104
108
  GeneratorTCPDef & {
105
109
  templateKey: 'GENERATOR_TCP'
106
- switches: Array<
110
+ switches?: Array<
107
111
  SwitchDef &
108
112
  GeneratorTCPDef & {
109
113
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * TCP server with multi-client support, data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), concurrent connection limit, and TLS
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 TCP server */
15
19
  export type GeneratorTCPServerActionStart = Action & {
@@ -72,7 +76,7 @@ Default property:
72
76
  init?: boolean | DataLink
73
77
  /* Bind port of TCP server */
74
78
  port?: number | DataLink
75
- /* Data mode
79
+ /* Data mode
76
80
  CRLF: Receive until CRLF
77
81
  LF: Receive until LF
78
82
  raw: Raw packet */
@@ -94,35 +98,37 @@ Default property:
94
98
  /* Event of TCP server is ready */
95
99
  onReady?: Array<EventAction>
96
100
  /* Event of TCP server accept the connection */
97
- onAcceptConnection?: Array<EventAction>
101
+ onAcceptConnection?: Array<
102
+ EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onAcceptConnection']>
103
+ >
98
104
  /* Event of receive data */
99
- onData?: Array<EventAction>
105
+ onData?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onData']>>
100
106
  /* Event of connection idle timeout */
101
- onTimeout?: Array<EventAction>
107
+ onTimeout?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onTimeout']>>
102
108
  /* Event of connection close */
103
- onClose?: Array<EventAction>
109
+ onClose?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onClose']>>
104
110
  /* Event of server or connection error */
105
- onError?: Array<EventAction>
111
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onError']>>
106
112
  }
107
113
  outlets?: {
108
114
  /* Server is listening */
109
- isListening?: () => Data
115
+ isListening?: () => Data<boolean>
110
116
  /* Is server started */
111
- started?: () => Data
117
+ started?: () => Data<boolean>
112
118
  /* Accepted connections */
113
- connections?: () => Data
119
+ connections?: () => Data<Array<string>>
114
120
  /* Last received data */
115
- lastData?: () => Data
121
+ lastData?: () => Data<string>
116
122
  /* Error message */
117
- errorMessage?: () => Data
123
+ errorMessage?: () => Data<string>
118
124
  }
119
125
  }
120
126
 
121
- /* TCP Server */
127
+ /* TCP server with multi-client support, data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), concurrent connection limit, and TLS */
122
128
  export type GeneratorTCPServer = Generator &
123
129
  GeneratorTCPServerDef & {
124
130
  templateKey: 'GENERATOR_TCP_SERVER'
125
- switches: Array<
131
+ switches?: Array<
126
132
  SwitchDef &
127
133
  GeneratorTCPServerDef & {
128
134
  conds?: Array<{
@@ -1,4 +1,14 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Text-to-speech synthesis using Apple's native speech synthesis
4
+ *
5
+ * ## Features
6
+ * - Native Apple speech synthesis
7
+ * - Natural sounding voices
8
+ * - Privacy-focused on-device processing
9
+ * - Multiple voice options
10
+ * - Requires iOS 13+ (native speech synthesis)
11
+ */
2
12
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
13
  import type { Data, DataLink } from '../data'
4
14
  import type {
@@ -10,6 +20,7 @@ import type {
10
20
  Action,
11
21
  EventProperty,
12
22
  } from '../common'
23
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
24
 
14
25
  /* Load the TTS model */
15
26
  export type GeneratorAppleTTSActionLoadModel = Action & {
@@ -70,21 +81,23 @@ Default property:
70
81
  }
71
82
  events?: {
72
83
  /* Event triggered when state change */
73
- onContextStateChange?: Array<EventAction>
84
+ onContextStateChange?: Array<
85
+ EventAction<string & keyof TemplateEventPropsMap['AppleTts']['onContextStateChange']>
86
+ >
74
87
  /* Event triggered when error occurs */
75
- onError?: Array<EventAction>
88
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AppleTts']['onError']>>
76
89
  }
77
90
  outlets?: {
78
91
  /* Context state */
79
- contextState?: () => Data
92
+ contextState?: () => Data<string>
80
93
  /* Generated audio file */
81
- generatedAudio?: () => Data
94
+ generatedAudio?: () => Data<string>
82
95
  /* Generated audio file is playing */
83
- generatedAudioPlaying?: () => Data
96
+ generatedAudioPlaying?: () => Data<boolean>
84
97
  }
85
98
  }
86
99
 
87
- /* Text-to-speech synthesis using Apple's native speech synthesis
100
+ /* Text-to-speech synthesis using Apple's native speech synthesis
88
101
 
89
102
  ## Features
90
103
  - Native Apple speech synthesis
@@ -95,7 +108,7 @@ Default property:
95
108
  export type GeneratorAppleTTS = Generator &
96
109
  GeneratorAppleTTSDef & {
97
110
  templateKey: 'GENERATOR_APPLE_TTS'
98
- switches: Array<
111
+ switches?: Array<
99
112
  SwitchDef &
100
113
  GeneratorAppleTTSDef & {
101
114
  conds?: Array<{