@fugood/bricks-project 2.23.0-beta.9 → 2.23.2

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 (118) hide show
  1. package/api/instance.ts +37 -5
  2. package/compile/action-name-map.ts +107 -0
  3. package/compile/index.ts +172 -66
  4. package/compile/util.ts +13 -4
  5. package/package.json +9 -5
  6. package/skills/bricks-project/SKILL.md +32 -0
  7. package/skills/bricks-project/rules/animation.md +159 -0
  8. package/skills/bricks-project/rules/architecture-patterns.md +62 -0
  9. package/skills/bricks-project/rules/automations.md +221 -0
  10. package/skills/bricks-project/rules/buttress.md +153 -0
  11. package/skills/bricks-project/rules/data-calculation.md +208 -0
  12. package/skills/bricks-project/rules/local-sync.md +129 -0
  13. package/skills/bricks-project/rules/media-flow.md +158 -0
  14. package/skills/bricks-project/rules/remote-data-bank.md +196 -0
  15. package/skills/bricks-project/rules/standby-transition.md +124 -0
  16. package/skills/rive-marketplace/SKILL.md +99 -0
  17. package/tools/deploy.ts +74 -12
  18. package/tools/icons/.gitattributes +1 -0
  19. package/tools/icons/fa6pro-glyphmap.json +4686 -0
  20. package/tools/icons/fa6pro-meta.json +26127 -0
  21. package/tools/mcp-server.ts +818 -9
  22. package/tools/postinstall.ts +75 -13
  23. package/tools/preview-main.mjs +54 -4
  24. package/tools/preview.ts +54 -7
  25. package/tools/pull.ts +37 -16
  26. package/types/automation.ts +232 -0
  27. package/types/brick-base.ts +1 -0
  28. package/types/bricks/Camera.ts +26 -10
  29. package/types/bricks/Chart.ts +1 -0
  30. package/types/bricks/GenerativeMedia.ts +21 -3
  31. package/types/bricks/Icon.ts +1 -0
  32. package/types/bricks/Image.ts +6 -0
  33. package/types/bricks/Items.ts +1 -0
  34. package/types/bricks/Lottie.ts +1 -0
  35. package/types/bricks/Maps.ts +254 -0
  36. package/types/bricks/QrCode.ts +1 -0
  37. package/types/bricks/Rect.ts +1 -0
  38. package/types/bricks/RichText.ts +1 -0
  39. package/types/bricks/Rive.ts +1 -0
  40. package/types/bricks/Slideshow.ts +1 -0
  41. package/types/bricks/Svg.ts +1 -0
  42. package/types/bricks/Text.ts +1 -0
  43. package/types/bricks/TextInput.ts +1 -0
  44. package/types/bricks/Video.ts +1 -0
  45. package/types/bricks/VideoStreaming.ts +1 -0
  46. package/types/bricks/WebRtcStream.ts +1 -0
  47. package/types/bricks/WebView.ts +8 -1
  48. package/types/bricks/index.ts +2 -0
  49. package/types/canvas.ts +1 -0
  50. package/types/common.ts +2 -0
  51. package/types/data-calc-command.ts +7003 -0
  52. package/types/data-calc-script.ts +21 -0
  53. package/types/data-calc.ts +3 -6977
  54. package/types/data.ts +3 -0
  55. package/types/generators/AlarmClock.ts +2 -0
  56. package/types/generators/Assistant.ts +30 -6
  57. package/types/generators/BleCentral.ts +2 -0
  58. package/types/generators/BlePeripheral.ts +2 -0
  59. package/types/generators/CanvasMap.ts +2 -0
  60. package/types/generators/CastlesPay.ts +2 -0
  61. package/types/generators/DataBank.ts +2 -0
  62. package/types/generators/File.ts +2 -0
  63. package/types/generators/GraphQl.ts +2 -0
  64. package/types/generators/Http.ts +84 -2
  65. package/types/generators/HttpServer.ts +5 -1
  66. package/types/generators/Information.ts +2 -0
  67. package/types/generators/Intent.ts +51 -0
  68. package/types/generators/Iterator.ts +11 -2
  69. package/types/generators/Keyboard.ts +2 -0
  70. package/types/generators/LlmAnthropicCompat.ts +2 -0
  71. package/types/generators/LlmAppleBuiltin.ts +144 -0
  72. package/types/generators/LlmGgml.ts +28 -4
  73. package/types/generators/LlmOnnx.ts +2 -0
  74. package/types/generators/LlmOpenAiCompat.ts +2 -0
  75. package/types/generators/LlmQualcommAiEngine.ts +2 -0
  76. package/types/generators/Mcp.ts +6 -4
  77. package/types/generators/McpServer.ts +8 -6
  78. package/types/generators/MediaFlow.ts +2 -0
  79. package/types/generators/MqttBroker.ts +2 -0
  80. package/types/generators/MqttClient.ts +2 -0
  81. package/types/generators/Question.ts +9 -0
  82. package/types/generators/RealtimeTranscription.ts +18 -8
  83. package/types/generators/RerankerGgml.ts +23 -16
  84. package/types/generators/SerialPort.ts +2 -0
  85. package/types/generators/SoundPlayer.ts +2 -0
  86. package/types/generators/SoundRecorder.ts +2 -0
  87. package/types/generators/SpeechToTextGgml.ts +19 -4
  88. package/types/generators/SpeechToTextOnnx.ts +2 -0
  89. package/types/generators/SpeechToTextPlatform.ts +2 -0
  90. package/types/generators/SqLite.ts +32 -1
  91. package/types/generators/Step.ts +2 -0
  92. package/types/generators/SttAppleBuiltin.ts +117 -0
  93. package/types/generators/Tcp.ts +2 -0
  94. package/types/generators/TcpServer.ts +5 -1
  95. package/types/generators/TextToSpeechApple.ts +113 -0
  96. package/types/generators/TextToSpeechAppleBuiltin.ts +114 -0
  97. package/types/generators/TextToSpeechGgml.ts +24 -3
  98. package/types/generators/TextToSpeechOnnx.ts +2 -0
  99. package/types/generators/TextToSpeechOpenAiLike.ts +2 -0
  100. package/types/generators/ThermalPrinter.ts +2 -0
  101. package/types/generators/Tick.ts +5 -1
  102. package/types/generators/TtsAppleBuiltin.ts +105 -0
  103. package/types/generators/Udp.ts +2 -0
  104. package/types/generators/VadGgml.ts +4 -2
  105. package/types/generators/VadOnnx.ts +201 -0
  106. package/types/generators/VadTraditional.ts +123 -0
  107. package/types/generators/VectorStore.ts +15 -2
  108. package/types/generators/Watchdog.ts +2 -0
  109. package/types/generators/WebCrawler.ts +2 -0
  110. package/types/generators/WebRtc.ts +4 -2
  111. package/types/generators/WebSocket.ts +2 -0
  112. package/types/generators/index.ts +5 -0
  113. package/types/index.ts +3 -0
  114. package/types/system.ts +48 -6
  115. package/utils/calc.ts +15 -9
  116. package/utils/data.ts +1 -0
  117. package/utils/event-props.ts +112 -2
  118. package/utils/id.ts +3 -1
@@ -0,0 +1,117 @@
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
+ Brick,
6
+ Generator,
7
+ EventAction,
8
+ ActionWithDataParams,
9
+ ActionWithParams,
10
+ Action,
11
+ EventProperty,
12
+ } from '../common'
13
+
14
+ /* Initialize STT */
15
+ export type GeneratorAppleSTTActionInit = Action & {
16
+ __actionName: 'GENERATOR_APPLE_STT_INIT'
17
+ }
18
+
19
+ /* Transcribe audio file. You can provide `File URL` property, if not provided, it will use the default `File URL` */
20
+ export type GeneratorAppleSTTActionTranscribeFile = ActionWithParams & {
21
+ __actionName: 'GENERATOR_APPLE_STT_TRANSCRIBE_FILE'
22
+ params?: Array<
23
+ | {
24
+ input: 'fileUrl'
25
+ value?: string | DataLink | EventProperty
26
+ mapping?: string
27
+ }
28
+ | {
29
+ input: 'language'
30
+ value?: string | DataLink | EventProperty
31
+ mapping?: string
32
+ }
33
+ >
34
+ }
35
+
36
+ /* Transcribe audio data (base64 encoded audio data or ArrayBuffer) */
37
+ export type GeneratorAppleSTTActionTranscribeData = ActionWithParams & {
38
+ __actionName: 'GENERATOR_APPLE_STT_TRANSCRIBE_DATA'
39
+ params?: Array<
40
+ | {
41
+ input: 'data'
42
+ value?: any | EventProperty
43
+ mapping?: string
44
+ }
45
+ | {
46
+ input: 'language'
47
+ value?: string | DataLink | EventProperty
48
+ mapping?: string
49
+ }
50
+ >
51
+ }
52
+
53
+ interface GeneratorAppleSTTDef {
54
+ /*
55
+ Default property:
56
+ {
57
+ "init": false,
58
+ "language": "en-US",
59
+ "enablePartialResults": true
60
+ }
61
+ */
62
+ property?: {
63
+ /* Initialize the STT engine on generator initialization */
64
+ init?: boolean | DataLink
65
+ /* Language/locale for recognition (e.g., 'en-US') */
66
+ language?: string | DataLink
67
+ /* Enable partial results during transcription */
68
+ enablePartialResults?: boolean | DataLink
69
+ /* The file URL or path to be transcribed */
70
+ fileUrl?: string | DataLink
71
+ }
72
+ events?: {
73
+ /* Error event */
74
+ onError?: Array<EventAction>
75
+ /* Event triggered when got transcribe result */
76
+ onTranscribed?: Array<EventAction>
77
+ }
78
+ outlets?: {
79
+ /* State outlet (loading, ready, error) */
80
+ state?: () => Data
81
+ /* Is transcribing */
82
+ isTranscribing?: () => Data
83
+ /* Transcribe result */
84
+ transcribeResult?: () => Data
85
+ /* Transcribe result details (result, segments, time, startTime, endTime, duration) */
86
+ transcribeDetails?: () => Data
87
+ }
88
+ }
89
+
90
+ /* Speech recognition on iOS 26+ (Not supported on tvOS)
91
+
92
+ ## Features
93
+ - Native Apple speech recognition
94
+ - High accuracy transcription
95
+ - Privacy-focused on-device processing
96
+ - Supports file and data transcription
97
+ - Requires iOS 26+ (Not supported on tvOS) */
98
+ export type GeneratorAppleSTT = Generator &
99
+ GeneratorAppleSTTDef & {
100
+ templateKey: 'GENERATOR_APPLE_STT'
101
+ switches: Array<
102
+ SwitchDef &
103
+ GeneratorAppleSTTDef & {
104
+ conds?: Array<{
105
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
106
+ cond:
107
+ | SwitchCondInnerStateCurrentCanvas
108
+ | SwitchCondData
109
+ | {
110
+ __typename: 'SwitchCondInnerStateOutlet'
111
+ outlet: 'state' | 'isTranscribing' | 'transcribeResult' | 'transcribeDetails'
112
+ value: any
113
+ }
114
+ }>
115
+ }
116
+ >
117
+ }
@@ -1,6 +1,8 @@
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 {
5
+ Brick,
4
6
  Generator,
5
7
  EventAction,
6
8
  ActionWithDataParams,
@@ -1,6 +1,8 @@
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 {
5
+ Brick,
4
6
  Generator,
5
7
  EventAction,
6
8
  ActionWithDataParams,
@@ -103,6 +105,8 @@ Default property:
103
105
  onError?: Array<EventAction>
104
106
  }
105
107
  outlets?: {
108
+ /* Server is listening */
109
+ isListening?: () => Data
106
110
  /* Is server started */
107
111
  started?: () => Data
108
112
  /* Accepted connections */
@@ -128,7 +132,7 @@ export type GeneratorTCPServer = Generator &
128
132
  | SwitchCondData
129
133
  | {
130
134
  __typename: 'SwitchCondInnerStateOutlet'
131
- outlet: 'started' | 'connections' | 'lastData' | 'errorMessage'
135
+ outlet: 'isListening' | 'started' | 'connections' | 'lastData' | 'errorMessage'
132
136
  value: any
133
137
  }
134
138
  }>
@@ -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,114 @@
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
+ Brick,
6
+ Generator,
7
+ EventAction,
8
+ ActionWithDataParams,
9
+ ActionWithParams,
10
+ Action,
11
+ EventProperty,
12
+ } from '../common'
13
+
14
+ /* Load the TTS model */
15
+ export type GeneratorAppleTTSActionLoadModel = Action & {
16
+ __actionName: 'GENERATOR_APPLE_TTS_LOAD_MODEL'
17
+ }
18
+
19
+ /* Generate audio */
20
+ export type GeneratorAppleTTSActionGenerate = ActionWithParams & {
21
+ __actionName: 'GENERATOR_APPLE_TTS_GENERATE'
22
+ params?: Array<{
23
+ input: 'text'
24
+ value?: string | DataLink | EventProperty
25
+ mapping?: string
26
+ }>
27
+ }
28
+
29
+ /* Clean cache */
30
+ export type GeneratorAppleTTSActionCleanCache = Action & {
31
+ __actionName: 'GENERATOR_APPLE_TTS_CLEAN_CACHE'
32
+ }
33
+
34
+ /* Cancel current generation and clear queue */
35
+ export type GeneratorAppleTTSActionCancel = Action & {
36
+ __actionName: 'GENERATOR_APPLE_TTS_CANCEL'
37
+ }
38
+
39
+ interface GeneratorAppleTTSDef {
40
+ /*
41
+ Default property:
42
+ {
43
+ "language": "en-US",
44
+ "outputType": "play",
45
+ "cacheGenerated": true,
46
+ "autoInferEnable": false,
47
+ "softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
48
+ "hardBreakTime": 500
49
+ }
50
+ */
51
+ property?: {
52
+ /* Initialize the TTS context on generator initialization */
53
+ init?: boolean | DataLink
54
+ /* Voice identifier */
55
+ voice?: string | DataLink
56
+ /* Language/locale (e.g., 'en-US') */
57
+ language?: string | DataLink
58
+ /* Output mode */
59
+ outputType?: 'play' | 'file' | DataLink
60
+ /* Enable cache for generated audio */
61
+ cacheGenerated?: boolean | DataLink
62
+ /* Text to generate */
63
+ prompt?: string | DataLink
64
+ /* Auto inference when prompt changes */
65
+ autoInferEnable?: boolean | DataLink
66
+ /* Segmentation rule for auto inference */
67
+ softBreakRegex?: string | DataLink
68
+ /* Time to force inference when softBreakRegex is not satisfied */
69
+ hardBreakTime?: number | DataLink
70
+ }
71
+ events?: {
72
+ /* Event triggered when state change */
73
+ onContextStateChange?: Array<EventAction>
74
+ /* Event triggered when error occurs */
75
+ onError?: Array<EventAction>
76
+ }
77
+ outlets?: {
78
+ /* Context state */
79
+ contextState?: () => Data
80
+ /* Generated audio file */
81
+ generatedAudio?: () => Data
82
+ /* Generated audio file is playing */
83
+ generatedAudioPlaying?: () => Data
84
+ }
85
+ }
86
+
87
+ /* Text-to-speech synthesis using Apple's native speech synthesis
88
+
89
+ ## Features
90
+ - Native Apple speech synthesis
91
+ - Natural sounding voices
92
+ - Privacy-focused on-device processing
93
+ - Multiple voice options
94
+ - Requires iOS 13+ (native speech synthesis) */
95
+ export type GeneratorAppleTTS = Generator &
96
+ GeneratorAppleTTSDef & {
97
+ templateKey: 'GENERATOR_APPLE_TTS'
98
+ switches: Array<
99
+ SwitchDef &
100
+ GeneratorAppleTTSDef & {
101
+ conds?: Array<{
102
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
103
+ cond:
104
+ | SwitchCondInnerStateCurrentCanvas
105
+ | SwitchCondData
106
+ | {
107
+ __typename: 'SwitchCondInnerStateOutlet'
108
+ outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
109
+ value: any
110
+ }
111
+ }>
112
+ }
113
+ >
114
+ }
@@ -1,6 +1,8 @@
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 {
5
+ Brick,
4
6
  Generator,
5
7
  EventAction,
6
8
  ActionWithDataParams,
@@ -129,8 +131,16 @@ Default property:
129
131
  /* Accelerator variant (Only for desktop)
130
132
  `default` - CPU / Metal (macOS)
131
133
  `vulkan` - Use Vulkan
132
- `cuda` - Use CUDA */
133
- accelVariant?: 'default' | 'vulkan' | 'cuda' | DataLink
134
+ `cuda` - Use CUDA
135
+ `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
136
+ accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
137
+ /* Devices. For example:
138
+
139
+ Metal or CPU for iOS/tvOS/MacOS
140
+ OpenCL or CPU for Android
141
+ - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices)
142
+ For Desktop, you may want to include/exclude GPUs */
143
+ devices?: Array<string | DataLink> | DataLink
134
144
  /* Main GPU index */
135
145
  mainGpu?: number | DataLink
136
146
  /* Number of GPU layers (NOTE: Currently not supported for Android) */
@@ -159,7 +169,18 @@ Default property:
159
169
  }
160
170
 
161
171
  /* 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. */
172
+ You can use any converted model on HuggingFace.
173
+
174
+ ## Notice
175
+ - The device RAM must be larger than 8GB
176
+ - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
177
+ - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
178
+ - Android: Recommended use Android 13+ system.
179
+ - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
180
+ - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs.
181
+ - Linux / Windows
182
+ - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
183
+ - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux) */
163
184
  export type GeneratorGGMLTTS = Generator &
164
185
  GeneratorGGMLTTSDef & {
165
186
  templateKey: 'GENERATOR_GGML_TTS'
@@ -1,6 +1,8 @@
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 {
5
+ Brick,
4
6
  Generator,
5
7
  EventAction,
6
8
  ActionWithDataParams,
@@ -1,6 +1,8 @@
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 {
5
+ Brick,
4
6
  Generator,
5
7
  EventAction,
6
8
  ActionWithDataParams,
@@ -1,6 +1,8 @@
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 {
5
+ Brick,
4
6
  Generator,
5
7
  EventAction,
6
8
  ActionWithDataParams,
@@ -1,6 +1,8 @@
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 {
5
+ Brick,
4
6
  Generator,
5
7
  EventAction,
6
8
  ActionWithDataParams,
@@ -49,6 +51,8 @@ Default property:
49
51
  outlets?: {
50
52
  /* Countdown step value */
51
53
  countdown?: () => Data
54
+ /* Is tick running? */
55
+ running?: () => Data
52
56
  }
53
57
  }
54
58
 
@@ -66,7 +70,7 @@ export type GeneratorTick = Generator &
66
70
  | SwitchCondData
67
71
  | {
68
72
  __typename: 'SwitchCondInnerStateOutlet'
69
- outlet: 'countdown'
73
+ outlet: 'countdown' | 'running'
70
74
  value: any
71
75
  }
72
76
  }>
@@ -0,0 +1,105 @@
1
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
+ import type { Data, DataLink } from '../data'
3
+ import type { Generator, EventAction, ActionWithParams, Action, EventProperty } from '../common'
4
+
5
+ /* Load the TTS model */
6
+ export type GeneratorAppleTTSActionLoadModel = Action & {
7
+ __actionName: 'GENERATOR_APPLE_TTS_LOAD_MODEL'
8
+ }
9
+
10
+ /* Generate audio */
11
+ export type GeneratorAppleTTSActionGenerate = ActionWithParams & {
12
+ __actionName: 'GENERATOR_APPLE_TTS_GENERATE'
13
+ params?: Array<{
14
+ input: 'text'
15
+ value?: string | DataLink | EventProperty
16
+ mapping?: string
17
+ }>
18
+ }
19
+
20
+ /* Clean cache */
21
+ export type GeneratorAppleTTSActionCleanCache = Action & {
22
+ __actionName: 'GENERATOR_APPLE_TTS_CLEAN_CACHE'
23
+ }
24
+
25
+ /* Cancel current generation and clear queue */
26
+ export type GeneratorAppleTTSActionCancel = Action & {
27
+ __actionName: 'GENERATOR_APPLE_TTS_CANCEL'
28
+ }
29
+
30
+ interface GeneratorAppleTTSDef {
31
+ /*
32
+ Default property:
33
+ {
34
+ "language": "en-US",
35
+ "outputType": "play",
36
+ "cacheGenerated": true,
37
+ "autoInferEnable": false,
38
+ "softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
39
+ "hardBreakTime": 500
40
+ }
41
+ */
42
+ property?: {
43
+ /* Initialize the TTS context on generator initialization */
44
+ init?: boolean | DataLink
45
+ /* Voice identifier */
46
+ voice?: string | DataLink
47
+ /* Language/locale (e.g., 'en-US') */
48
+ language?: string | DataLink
49
+ /* Output mode */
50
+ outputType?: 'play' | 'file' | DataLink
51
+ /* Enable cache for generated audio */
52
+ cacheGenerated?: boolean | DataLink
53
+ /* Text to generate */
54
+ prompt?: string | DataLink
55
+ /* Auto inference when prompt changes */
56
+ autoInferEnable?: boolean | DataLink
57
+ /* Segmentation rule for auto inference */
58
+ softBreakRegex?: string | DataLink
59
+ /* Time to force inference when softBreakRegex is not satisfied */
60
+ hardBreakTime?: number | DataLink
61
+ }
62
+ events?: {
63
+ /* Event triggered when state change */
64
+ onContextStateChange?: Array<EventAction>
65
+ /* Event triggered when error occurs */
66
+ onError?: Array<EventAction>
67
+ }
68
+ outlets?: {
69
+ /* Context state */
70
+ contextState?: () => Data
71
+ /* Generated audio file */
72
+ generatedAudio?: () => Data
73
+ /* Generated audio file is playing */
74
+ generatedAudioPlaying?: () => Data
75
+ }
76
+ }
77
+
78
+ /* Text-to-speech synthesis using Apple's native speech synthesis
79
+
80
+ ## Features
81
+ - Native Apple speech synthesis
82
+ - Natural sounding voices
83
+ - Privacy-focused on-device processing
84
+ - Multiple voice options
85
+ - Requires iOS 13+ (native speech synthesis) */
86
+ export type GeneratorAppleTTS = Generator &
87
+ GeneratorAppleTTSDef & {
88
+ templateKey: 'GENERATOR_APPLE_TTS'
89
+ switches: Array<
90
+ SwitchDef &
91
+ GeneratorAppleTTSDef & {
92
+ conds?: Array<{
93
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
94
+ cond:
95
+ | SwitchCondInnerStateCurrentCanvas
96
+ | SwitchCondData
97
+ | {
98
+ __typename: 'SwitchCondInnerStateOutlet'
99
+ outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
100
+ value: any
101
+ }
102
+ }>
103
+ }
104
+ >
105
+ }
@@ -1,6 +1,8 @@
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 {
5
+ Brick,
4
6
  Generator,
5
7
  EventAction,
6
8
  ActionWithDataParams,
@@ -1,6 +1,8 @@
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 {
5
+ Brick,
4
6
  Generator,
5
7
  EventAction,
6
8
  ActionWithDataParams,
@@ -113,7 +115,7 @@ interface GeneratorVadInferenceDef {
113
115
  Default property:
114
116
  {
115
117
  "init": false,
116
- "modelName": "silero-v5.1.2",
118
+ "modelName": "silero-v6.2.0",
117
119
  "modelUseGPU": true,
118
120
  "modelThreads": 4,
119
121
  "detectThreshold": 0.5,
@@ -131,7 +133,7 @@ Default property:
131
133
  /* Use model name, currently only supports the Silero VAD model.
132
134
  The model download progress will be done in preload stage or the generator initialization stage.
133
135
  You can also choose `custom` option and set `Model URL` and `Model SHA1` to use your own model */
134
- modelName?: 'custom' | 'silero-v5.1.2' | DataLink
136
+ modelName?: 'custom' | 'silero-v6.2.0' | 'silero-v5.1.2' | DataLink
135
137
  /* The URL or path of model
136
138
  We used `ggml` format model, please refer to https://huggingface.co/ggml-org/whisper-vad */
137
139
  modelUrl?: string | DataLink