@fugood/bricks-project 2.23.0-beta.4 → 2.23.0-beta.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/compile/action-name-map.ts +60 -0
  2. package/compile/index.ts +52 -60
  3. package/package.json +4 -4
  4. package/tools/mcp-server.ts +3 -3
  5. package/tools/postinstall.ts +2 -5
  6. package/tools/preview.ts +1 -1
  7. package/tools/pull.ts +1 -1
  8. package/types/brick-base.ts +1 -0
  9. package/types/bricks/Camera.ts +1 -0
  10. package/types/bricks/Chart.ts +1 -0
  11. package/types/bricks/GenerativeMedia.ts +21 -3
  12. package/types/bricks/Icon.ts +1 -0
  13. package/types/bricks/Image.ts +1 -0
  14. package/types/bricks/Items.ts +1 -0
  15. package/types/bricks/Lottie.ts +1 -0
  16. package/types/bricks/QrCode.ts +1 -0
  17. package/types/bricks/Rect.ts +1 -0
  18. package/types/bricks/RichText.ts +1 -0
  19. package/types/bricks/Rive.ts +1 -0
  20. package/types/bricks/Slideshow.ts +38 -2
  21. package/types/bricks/Svg.ts +1 -0
  22. package/types/bricks/Text.ts +1 -0
  23. package/types/bricks/TextInput.ts +1 -0
  24. package/types/bricks/Video.ts +1 -0
  25. package/types/bricks/VideoStreaming.ts +1 -0
  26. package/types/bricks/WebRtcStream.ts +1 -0
  27. package/types/bricks/WebView.ts +1 -0
  28. package/types/bricks/index.ts +1 -0
  29. package/types/canvas.ts +1 -0
  30. package/types/data-calc.ts +44 -0
  31. package/types/data.ts +1 -0
  32. package/types/generators/AlarmClock.ts +1 -0
  33. package/types/generators/Assistant.ts +24 -1
  34. package/types/generators/BleCentral.ts +1 -0
  35. package/types/generators/BlePeripheral.ts +1 -0
  36. package/types/generators/CanvasMap.ts +15 -3
  37. package/types/generators/CastlesPay.ts +1 -0
  38. package/types/generators/DataBank.ts +1 -0
  39. package/types/generators/File.ts +1 -0
  40. package/types/generators/GraphQl.ts +1 -0
  41. package/types/generators/Http.ts +83 -2
  42. package/types/generators/HttpServer.ts +4 -1
  43. package/types/generators/Information.ts +1 -0
  44. package/types/generators/Intent.ts +50 -0
  45. package/types/generators/Iterator.ts +10 -2
  46. package/types/generators/Keyboard.ts +1 -0
  47. package/types/generators/LlmAnthropicCompat.ts +1 -0
  48. package/types/generators/LlmAppleBuiltin.ts +143 -0
  49. package/types/generators/LlmGgml.ts +22 -5
  50. package/types/generators/LlmOnnx.ts +8 -0
  51. package/types/generators/LlmOpenAiCompat.ts +1 -0
  52. package/types/generators/LlmQualcommAiEngine.ts +1 -0
  53. package/types/generators/Mcp.ts +1 -0
  54. package/types/generators/McpServer.ts +1 -0
  55. package/types/generators/MediaFlow.ts +1 -0
  56. package/types/generators/MqttBroker.ts +1 -0
  57. package/types/generators/MqttClient.ts +1 -0
  58. package/types/generators/Question.ts +8 -0
  59. package/types/generators/RealtimeTranscription.ts +1 -0
  60. package/types/generators/RerankerGgml.ts +22 -16
  61. package/types/generators/SerialPort.ts +1 -0
  62. package/types/generators/SoundPlayer.ts +1 -0
  63. package/types/generators/SoundRecorder.ts +1 -0
  64. package/types/generators/SpeechToTextGgml.ts +13 -4
  65. package/types/generators/SpeechToTextOnnx.ts +1 -0
  66. package/types/generators/SpeechToTextPlatform.ts +1 -0
  67. package/types/generators/SqLite.ts +31 -1
  68. package/types/generators/Step.ts +1 -0
  69. package/types/generators/SttAppleBuiltin.ts +116 -0
  70. package/types/generators/Tcp.ts +1 -0
  71. package/types/generators/TcpServer.ts +4 -1
  72. package/types/generators/TextToSpeechApple.ts +113 -0
  73. package/types/generators/TextToSpeechAppleBuiltin.ts +113 -0
  74. package/types/generators/TextToSpeechGgml.ts +23 -3
  75. package/types/generators/TextToSpeechOnnx.ts +1 -0
  76. package/types/generators/TextToSpeechOpenAiLike.ts +1 -0
  77. package/types/generators/ThermalPrinter.ts +1 -0
  78. package/types/generators/Tick.ts +4 -1
  79. package/types/generators/TtsAppleBuiltin.ts +105 -0
  80. package/types/generators/Udp.ts +1 -0
  81. package/types/generators/VadGgml.ts +3 -2
  82. package/types/generators/VectorStore.ts +14 -2
  83. package/types/generators/Watchdog.ts +1 -0
  84. package/types/generators/WebCrawler.ts +1 -0
  85. package/types/generators/WebRtc.ts +1 -0
  86. package/types/generators/WebSocket.ts +1 -0
  87. package/types/generators/index.ts +3 -0
  88. package/types/system.ts +1 -0
  89. package/utils/data.ts +1 -0
  90. package/utils/event-props.ts +79 -3
  91. 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 {
@@ -382,6 +383,11 @@ export type GeneratorLLMActionStopCompletion = Action & {
382
383
  __actionName: 'GENERATOR_LLM_STOP_COMPLETION'
383
384
  }
384
385
 
386
+ /* Clear KV cache */
387
+ export type GeneratorLLMActionClearCache = Action & {
388
+ __actionName: 'GENERATOR_LLM_CLEAR_CACHE'
389
+ }
390
+
385
391
  /* Clear downloaded models & current jobs */
386
392
  export type GeneratorLLMActionClearDownload = Action & {
387
393
  __actionName: 'GENERATOR_LLM_CLEAR_DOWNLOAD'
@@ -483,8 +489,16 @@ Default property:
483
489
  /* Accelerator variant (Only for desktop)
484
490
  `default` - CPU / Metal (macOS)
485
491
  `vulkan` - Use Vulkan
486
- `cuda` - Use CUDA */
487
- accelVariant?: 'default' | 'vulkan' | 'cuda' | DataLink
492
+ `cuda` - Use CUDA
493
+ `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
494
+ accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
495
+ /* Devices. For example:
496
+
497
+ Metal or CPU for iOS/tvOS/MacOS
498
+ OpenCL or CPU for Android
499
+ - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices)
500
+ For Desktop, you may want to include/exclude GPUs */
501
+ devices?: Array<string | DataLink> | DataLink
488
502
  /* Main GPU index */
489
503
  mainGpu?: number | DataLink
490
504
  /* Number of GPU layers */
@@ -637,8 +651,8 @@ Default property:
637
651
  buttressConnectionSettings?:
638
652
  | DataLink
639
653
  | {
654
+ enabled?: boolean | DataLink
640
655
  url?: string | DataLink
641
- trpcPath?: string | DataLink
642
656
  fallbackType?: 'use-local' | 'no-op' | DataLink
643
657
  strategy?: 'prefer-local' | 'prefer-buttress' | 'prefer-best' | DataLink
644
658
  }
@@ -691,8 +705,11 @@ Default property:
691
705
  - The device RAM must be larger than 8GB
692
706
  - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
693
707
  - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
694
- - Android: Recommended use Android 13+ system. Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
695
- - Linux / Windows: Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property */
708
+ - Android: Recommended use Android 13+ system.
709
+ - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
710
+ - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 1+ GPUs.
711
+ - Linux / Windows [@nextline - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
712
+ - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux) */
696
713
  export type GeneratorLLM = Generator &
697
714
  GeneratorLLMDef & {
698
715
  templateKey: 'GENERATOR_LLM'
@@ -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 {
@@ -33,6 +34,11 @@ export type GeneratorOnnxLLMActionInfer = ActionWithParams & {
33
34
  value?: Array<any> | DataLink | EventProperty
34
35
  mapping?: string
35
36
  }
37
+ | {
38
+ input: 'audios'
39
+ value?: Array<any> | DataLink | EventProperty
40
+ mapping?: string
41
+ }
36
42
  | {
37
43
  input: 'tools'
38
44
  value?: Array<any> | DataLink | EventProperty
@@ -99,6 +105,8 @@ Default property:
99
105
  messages?: Array<DataLink | {}> | DataLink
100
106
  /* Images with message to inference */
101
107
  images?: Array<string | DataLink> | DataLink
108
+ /* Audios with message to inference */
109
+ audios?: Array<string | DataLink> | DataLink
102
110
  /* Tool call parser */
103
111
  toolCallParser?: 'llama3_json' | 'mistral' | 'hermes' | 'internlm' | 'phi4' | DataLink
104
112
  /* Tools for chat mode using OpenAI-compatible function calling format
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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
- /* Accelerator variant (default: default) */
71
- accelVariant?:
72
- | 'default'
73
- | 'avx'
74
- | 'avx2'
75
- | 'avx512'
76
- | 'metal'
77
- | 'opencl'
78
- | 'vulkan'
79
- | 'cuda'
80
- | 'rocm'
81
- | DataLink
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: Supported GPU acceleration, recommended use M1+ / A17+ chip device
126
- - macOS: Supported GPU acceleration, recommended use M1+ chip device
127
- - Android: Currently not supported GPU acceleration (Coming soon), recommended use Android 13+ system
128
- - Linux / Windows: Supported GPU acceleration, currently only Vulkan backend available */
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 {
@@ -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 {
@@ -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 {
@@ -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-q5_1'
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-q5_0'
232
+ | 'small.en-tdrz-q5_1'
233
233
  | 'small.en-tdrz-q8_0'
234
234
  | 'distil-small.en'
235
- | 'distil-small.en-q5_0'
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 {
@@ -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 {
@@ -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
  }>
@@ -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 {
@@ -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
+ }
@@ -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 {
@@ -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 {
@@ -103,6 +104,8 @@ Default property:
103
104
  onError?: Array<EventAction>
104
105
  }
105
106
  outlets?: {
107
+ /* Server is listening */
108
+ isListening?: () => Data
106
109
  /* Is server started */
107
110
  started?: () => Data
108
111
  /* Accepted connections */
@@ -128,7 +131,7 @@ export type GeneratorTCPServer = Generator &
128
131
  | SwitchCondData
129
132
  | {
130
133
  __typename: 'SwitchCondInnerStateOutlet'
131
- outlet: 'started' | 'connections' | 'lastData' | 'errorMessage'
134
+ outlet: 'isListening' | 'started' | 'connections' | 'lastData' | 'errorMessage'
132
135
  value: any
133
136
  }
134
137
  }>
@@ -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
+ }