@fugood/bricks-ctor 2.25.0-beta.7 → 2.25.0-beta.70

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 (135) hide show
  1. package/package.json +4 -24
  2. package/tools/__tests__/legacy-forwarder.test.js +91 -0
  3. package/tools/_forward.ts +26 -0
  4. package/tools/deploy.ts +3 -164
  5. package/tools/mcp-server.ts +3 -27
  6. package/tools/postinstall.ts +3 -234
  7. package/tools/pull.ts +3 -121
  8. package/tools/push-config.ts +4 -0
  9. package/tools/simulator.ts +4 -0
  10. package/compile/action-name-map.ts +0 -1015
  11. package/compile/index.ts +0 -1278
  12. package/compile/util.ts +0 -358
  13. package/index.ts +0 -6
  14. package/skills/bricks-ctor/SKILL.md +0 -32
  15. package/skills/bricks-ctor/rules/animation.md +0 -159
  16. package/skills/bricks-ctor/rules/architecture-patterns.md +0 -69
  17. package/skills/bricks-ctor/rules/automations.md +0 -221
  18. package/skills/bricks-ctor/rules/buttress.md +0 -156
  19. package/skills/bricks-ctor/rules/data-calculation.md +0 -209
  20. package/skills/bricks-ctor/rules/local-sync.md +0 -129
  21. package/skills/bricks-ctor/rules/media-flow.md +0 -158
  22. package/skills/bricks-ctor/rules/remote-data-bank.md +0 -196
  23. package/skills/bricks-ctor/rules/standby-transition.md +0 -124
  24. package/skills/bricks-design/LICENSE.txt +0 -180
  25. package/skills/bricks-design/SKILL.md +0 -66
  26. package/skills/rive-marketplace/SKILL.md +0 -99
  27. package/tools/_git-author.ts +0 -29
  28. package/tools/_shell.ts +0 -173
  29. package/tools/icons/.gitattributes +0 -1
  30. package/tools/icons/fa6pro-glyphmap.json +0 -4686
  31. package/tools/icons/fa6pro-meta.json +0 -1
  32. package/tools/mcp-tools/compile.ts +0 -92
  33. package/tools/mcp-tools/huggingface.ts +0 -762
  34. package/tools/mcp-tools/icons.ts +0 -81
  35. package/tools/mcp-tools/lottie.ts +0 -102
  36. package/tools/mcp-tools/media.ts +0 -110
  37. package/tools/preview-main.mjs +0 -293
  38. package/tools/preview.ts +0 -150
  39. package/types/animation.ts +0 -100
  40. package/types/automation.ts +0 -235
  41. package/types/brick-base.ts +0 -80
  42. package/types/bricks/Camera.ts +0 -246
  43. package/types/bricks/Chart.ts +0 -372
  44. package/types/bricks/GenerativeMedia.ts +0 -290
  45. package/types/bricks/Icon.ts +0 -98
  46. package/types/bricks/Image.ts +0 -126
  47. package/types/bricks/Items.ts +0 -476
  48. package/types/bricks/Lottie.ts +0 -168
  49. package/types/bricks/Maps.ts +0 -262
  50. package/types/bricks/QrCode.ts +0 -117
  51. package/types/bricks/Rect.ts +0 -150
  52. package/types/bricks/RichText.ts +0 -128
  53. package/types/bricks/Rive.ts +0 -220
  54. package/types/bricks/Sketch.ts +0 -254
  55. package/types/bricks/Slideshow.ts +0 -201
  56. package/types/bricks/Svg.ts +0 -99
  57. package/types/bricks/Text.ts +0 -148
  58. package/types/bricks/TextInput.ts +0 -242
  59. package/types/bricks/Video.ts +0 -175
  60. package/types/bricks/VideoStreaming.ts +0 -112
  61. package/types/bricks/WebRtcStream.ts +0 -65
  62. package/types/bricks/WebView.ts +0 -168
  63. package/types/bricks/index.ts +0 -22
  64. package/types/canvas.ts +0 -82
  65. package/types/common.ts +0 -144
  66. package/types/data-calc-command.ts +0 -7005
  67. package/types/data-calc-script.ts +0 -21
  68. package/types/data-calc.ts +0 -11
  69. package/types/data.ts +0 -95
  70. package/types/generators/AlarmClock.ts +0 -110
  71. package/types/generators/Assistant.ts +0 -621
  72. package/types/generators/BleCentral.ts +0 -247
  73. package/types/generators/BlePeripheral.ts +0 -208
  74. package/types/generators/CanvasMap.ts +0 -74
  75. package/types/generators/CastlesPay.ts +0 -87
  76. package/types/generators/DataBank.ts +0 -160
  77. package/types/generators/File.ts +0 -432
  78. package/types/generators/GraphQl.ts +0 -132
  79. package/types/generators/Http.ts +0 -222
  80. package/types/generators/HttpServer.ts +0 -176
  81. package/types/generators/Information.ts +0 -103
  82. package/types/generators/Intent.ts +0 -168
  83. package/types/generators/Iterator.ts +0 -108
  84. package/types/generators/Keyboard.ts +0 -105
  85. package/types/generators/LlmAnthropicCompat.ts +0 -212
  86. package/types/generators/LlmAppleBuiltin.ts +0 -159
  87. package/types/generators/LlmGgml.ts +0 -861
  88. package/types/generators/LlmMediaTekNeuroPilot.ts +0 -235
  89. package/types/generators/LlmMlx.ts +0 -227
  90. package/types/generators/LlmOnnx.ts +0 -213
  91. package/types/generators/LlmOpenAiCompat.ts +0 -312
  92. package/types/generators/LlmQualcommAiEngine.ts +0 -247
  93. package/types/generators/Mcp.ts +0 -637
  94. package/types/generators/McpServer.ts +0 -289
  95. package/types/generators/MediaFlow.ts +0 -170
  96. package/types/generators/MqttBroker.ts +0 -141
  97. package/types/generators/MqttClient.ts +0 -141
  98. package/types/generators/Question.ts +0 -408
  99. package/types/generators/RealtimeTranscription.ts +0 -287
  100. package/types/generators/RerankerGgml.ts +0 -191
  101. package/types/generators/SerialPort.ts +0 -151
  102. package/types/generators/SoundPlayer.ts +0 -94
  103. package/types/generators/SoundRecorder.ts +0 -130
  104. package/types/generators/SpeechToTextGgml.ts +0 -419
  105. package/types/generators/SpeechToTextOnnx.ts +0 -236
  106. package/types/generators/SpeechToTextPlatform.ts +0 -85
  107. package/types/generators/SqLite.ts +0 -159
  108. package/types/generators/Step.ts +0 -107
  109. package/types/generators/SttAppleBuiltin.ts +0 -130
  110. package/types/generators/Tcp.ts +0 -126
  111. package/types/generators/TcpServer.ts +0 -147
  112. package/types/generators/TextToSpeechAppleBuiltin.ts +0 -127
  113. package/types/generators/TextToSpeechGgml.ts +0 -221
  114. package/types/generators/TextToSpeechOnnx.ts +0 -178
  115. package/types/generators/TextToSpeechOpenAiLike.ts +0 -121
  116. package/types/generators/ThermalPrinter.ts +0 -191
  117. package/types/generators/Tick.ts +0 -83
  118. package/types/generators/Udp.ts +0 -120
  119. package/types/generators/VadGgml.ts +0 -250
  120. package/types/generators/VadOnnx.ts +0 -231
  121. package/types/generators/VadTraditional.ts +0 -138
  122. package/types/generators/VectorStore.ts +0 -257
  123. package/types/generators/Watchdog.ts +0 -107
  124. package/types/generators/WebCrawler.ts +0 -103
  125. package/types/generators/WebRtc.ts +0 -181
  126. package/types/generators/WebSocket.ts +0 -148
  127. package/types/generators/index.ts +0 -57
  128. package/types/index.ts +0 -13
  129. package/types/subspace.ts +0 -60
  130. package/types/switch.ts +0 -51
  131. package/types/system.ts +0 -707
  132. package/utils/calc.ts +0 -126
  133. package/utils/data.ts +0 -497
  134. package/utils/event-props.ts +0 -886
  135. package/utils/id.ts +0 -80
@@ -1,94 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Play sound, see supported formats at https://developer.android.com/guide/topics/media/media-formats
4
- */
5
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
- import type { Data, DataLink } from '../data'
7
- import type {
8
- Brick,
9
- Generator,
10
- EventAction,
11
- ActionWithDataParams,
12
- ActionWithParams,
13
- Action,
14
- EventProperty,
15
- } from '../common'
16
- import type { TemplateEventPropsMap } from '../../utils/event-props'
17
-
18
- /* Start playing sound */
19
- export type GeneratorSoundPlayerActionPlay = Action & {
20
- __actionName: 'GENERATOR_SOUND_PLAYER_PLAY'
21
- }
22
-
23
- /* Pause playing sound */
24
- export type GeneratorSoundPlayerActionPause = Action & {
25
- __actionName: 'GENERATOR_SOUND_PLAYER_PAUSE'
26
- }
27
-
28
- /* Resume playing sound from pause */
29
- export type GeneratorSoundPlayerActionResume = Action & {
30
- __actionName: 'GENERATOR_SOUND_PLAYER_RESUME'
31
- }
32
-
33
- /* Stop playing sound */
34
- export type GeneratorSoundPlayerActionRelease = Action & {
35
- __actionName: 'GENERATOR_SOUND_PLAYER_RELEASE'
36
- }
37
-
38
- interface GeneratorSoundPlayerDef {
39
- /*
40
- Default property:
41
- {
42
- "loop": false,
43
- "volume": 100
44
- }
45
- */
46
- property?: {
47
- /* Sound file path */
48
- filePath?: string | DataLink
49
- /* MD5 */
50
- md5?: string | DataLink
51
- /* Repeat playback */
52
- loop?: boolean | DataLink
53
- /* Sound volume (0 - 100) */
54
- volume?: number | DataLink
55
- }
56
- events?: {
57
- /* Sound file loaded successfully */
58
- onLoad?: Array<EventAction>
59
- /* Sound file load error */
60
- onLoadError?: Array<
61
- EventAction<string & keyof TemplateEventPropsMap['SoundPlayer']['onLoadError']>
62
- >
63
- /* Sound playback complete */
64
- onPlay?: Array<EventAction>
65
- /* Sound file playback end */
66
- onEnd?: Array<EventAction>
67
- }
68
- outlets?: {
69
- /* Whether the sound is playing */
70
- isPlaying?: () => Data<any>
71
- }
72
- }
73
-
74
- /* Play sound, see supported formats at https://developer.android.com/guide/topics/media/media-formats */
75
- export type GeneratorSoundPlayer = Generator &
76
- GeneratorSoundPlayerDef & {
77
- templateKey: 'GENERATOR_SOUND_PLAYER'
78
- switches?: Array<
79
- SwitchDef &
80
- GeneratorSoundPlayerDef & {
81
- conds?: Array<{
82
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
83
- cond:
84
- | SwitchCondInnerStateCurrentCanvas
85
- | SwitchCondData
86
- | {
87
- __typename: 'SwitchCondInnerStateOutlet'
88
- outlet: 'isPlaying'
89
- value: any
90
- }
91
- }>
92
- }
93
- >
94
- }
@@ -1,130 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Record audio (Microphone)
4
- */
5
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
- import type { Data, DataLink } from '../data'
7
- import type {
8
- Brick,
9
- Generator,
10
- EventAction,
11
- ActionWithDataParams,
12
- ActionWithParams,
13
- Action,
14
- EventProperty,
15
- } from '../common'
16
- import type { TemplateEventPropsMap } from '../../utils/event-props'
17
-
18
- /* Start record */
19
- export type GeneratorSoundRecorderActionStart = Action & {
20
- __actionName: 'GENERATOR_SOUND_RECORDER_START'
21
- }
22
-
23
- /* Pause record */
24
- export type GeneratorSoundRecorderActionPause = Action & {
25
- __actionName: 'GENERATOR_SOUND_RECORDER_PAUSE'
26
- }
27
-
28
- /* Resume record */
29
- export type GeneratorSoundRecorderActionResume = Action & {
30
- __actionName: 'GENERATOR_SOUND_RECORDER_RESUME'
31
- }
32
-
33
- /* Stop record */
34
- export type GeneratorSoundRecorderActionStop = Action & {
35
- __actionName: 'GENERATOR_SOUND_RECORDER_STOP'
36
- }
37
-
38
- /* List available microphone devices (Web / Desktop only) */
39
- export type GeneratorSoundRecorderActionListDevices = Action & {
40
- __actionName: 'GENERATOR_SOUND_RECORDER_LIST_DEVICES'
41
- }
42
-
43
- interface GeneratorSoundRecorderDef {
44
- /*
45
- Default property:
46
- {
47
- "init": false,
48
- "sampleRate": 32000,
49
- "bitDepth": "16bit",
50
- "channels": "stereo",
51
- "fileRetainTime": 10000,
52
- "autoCuttingEnable": false,
53
- "autoCuttingTimeLimit": 0,
54
- "autoCuttingVocalFreqMin": 75,
55
- "autoCuttingVocalFreqMax": 900,
56
- "autoCuttingFreqClarity": 0.5,
57
- "autoCuttingSpeakSpacing": 0.5
58
- }
59
- */
60
- property?: {
61
- /* Start record on init (Need user trigger on Web) */
62
- init?: boolean | DataLink
63
- /* Specifies the device ID to use for audio input.
64
- Web / Desktop: device ID string from enumerateDevices
65
- Android: audio source name - DEFAULT, MIC, VOICE_UPLINK, VOICE_DOWNLINK, VOICE_CALL, CAMCORDER, VOICE_RECOGNITION, VOICE_COMMUNICATION, UNPROCESSED */
66
- deviceId?: string | DataLink
67
- /* Record sample rate */
68
- sampleRate?: number | DataLink
69
- /* PCM bit depth */
70
- bitDepth?: '8bit' | '16bit' | DataLink
71
- /* Audio channels */
72
- channels?: 'mono' | 'stereo' | DataLink
73
- /* Record file retain time, avoid memory exhausted */
74
- fileRetainTime?: number | DataLink
75
- /* Enable record auto cutting */
76
- autoCuttingEnable?: boolean | DataLink
77
- /* Fragment time limit */
78
- autoCuttingTimeLimit?: number | DataLink
79
- /* Minimal vocal frequency of cutting fragments */
80
- autoCuttingVocalFreqMin?: number | DataLink
81
- /* Maximal vocal frequency of cutting fragments */
82
- autoCuttingVocalFreqMax?: number | DataLink
83
- /* Minimum frequency clarity threshold on speaking (0 ~ 1) */
84
- autoCuttingFreqClarity?: number | DataLink
85
- /* Minimum volume threshold on speaking */
86
- autoCuttingVolumeThreshold?: number | DataLink
87
- /* Speak spacing of cutting fragments */
88
- autoCuttingSpeakSpacing?: number | DataLink
89
- }
90
- events?: {
91
- /* Event for chunk data (Base64 encoded PCM) */
92
- chunk?: Array<EventAction<string & keyof TemplateEventPropsMap['SoundRecorder']['chunk']>>
93
- /* Event for recorded file */
94
- recorded?: Array<EventAction<string & keyof TemplateEventPropsMap['SoundRecorder']['recorded']>>
95
- }
96
- outlets?: {
97
- /* Is recording */
98
- isRecording?: () => Data<boolean>
99
- /* Recorded file path */
100
- recordedPath?: () => Data<string>
101
- /* Current auto-cutting detected volume */
102
- volume?: () => Data<number>
103
- /* Error message */
104
- errorMessage?: () => Data<string>
105
- /* Available microphone devices (Web / Desktop only) */
106
- devices?: () => Data<Array<any>>
107
- }
108
- }
109
-
110
- /* Record audio (Microphone) */
111
- export type GeneratorSoundRecorder = Generator &
112
- GeneratorSoundRecorderDef & {
113
- templateKey: 'GENERATOR_SOUND_RECORDER'
114
- switches?: Array<
115
- SwitchDef &
116
- GeneratorSoundRecorderDef & {
117
- conds?: Array<{
118
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
119
- cond:
120
- | SwitchCondInnerStateCurrentCanvas
121
- | SwitchCondData
122
- | {
123
- __typename: 'SwitchCondInnerStateOutlet'
124
- outlet: 'isRecording' | 'recordedPath' | 'volume' | 'errorMessage' | 'devices'
125
- value: any
126
- }
127
- }>
128
- }
129
- >
130
- }
@@ -1,419 +0,0 @@
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
- */
11
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
12
- import type { Data, DataLink } from '../data'
13
- import type {
14
- Brick,
15
- Generator,
16
- EventAction,
17
- ActionWithDataParams,
18
- ActionWithParams,
19
- Action,
20
- EventProperty,
21
- } from '../common'
22
- import type { TemplateEventPropsMap } from '../../utils/event-props'
23
-
24
- /* Load the model */
25
- export type GeneratorSpeechInferenceActionLoadModel = Action & {
26
- __actionName: 'GENERATOR_SPEECH_INFERENCE_LOAD_MODEL'
27
- }
28
-
29
- /* Transcribe audio file. You can provide `File URL` property, if not provided, it will use the default `File URL` */
30
- export type GeneratorSpeechInferenceActionTranscribeFile = ActionWithParams & {
31
- __actionName: 'GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_FILE'
32
- params?: Array<
33
- | {
34
- input: 'fileUrl'
35
- value?: string | DataLink | EventProperty
36
- mapping?: string
37
- }
38
- | {
39
- input: 'prompt'
40
- value?: string | DataLink | EventProperty
41
- mapping?: string
42
- }
43
- | {
44
- input: 'beamSize'
45
- value?: number | DataLink | EventProperty
46
- mapping?: string
47
- }
48
- | {
49
- input: 'language'
50
- value?: string | DataLink | EventProperty
51
- mapping?: string
52
- }
53
- | {
54
- input: 'translate'
55
- value?: boolean | DataLink | EventProperty
56
- mapping?: string
57
- }
58
- >
59
- }
60
-
61
- /* Transcribe audio data. Currently only support base64 encoded audio data (16-bit PCM, mono, 16kHz) */
62
- export type GeneratorSpeechInferenceActionTranscribeData = ActionWithParams & {
63
- __actionName: 'GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_DATA'
64
- params?: Array<
65
- | {
66
- input: 'data'
67
- value?: any | EventProperty
68
- mapping?: string
69
- }
70
- | {
71
- input: 'prompt'
72
- value?: string | DataLink | EventProperty
73
- mapping?: string
74
- }
75
- | {
76
- input: 'beamSize'
77
- value?: number | DataLink | EventProperty
78
- mapping?: string
79
- }
80
- | {
81
- input: 'language'
82
- value?: string | DataLink | EventProperty
83
- mapping?: string
84
- }
85
- | {
86
- input: 'translate'
87
- value?: boolean | DataLink | EventProperty
88
- mapping?: string
89
- }
90
- >
91
- }
92
-
93
- /* Stop current transcription */
94
- export type GeneratorSpeechInferenceActionTranscribeStop = Action & {
95
- __actionName: 'GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_STOP'
96
- }
97
-
98
- /* Clear downloaded files (model, audio) & current jobs */
99
- export type GeneratorSpeechInferenceActionClearDownload = Action & {
100
- __actionName: 'GENERATOR_SPEECH_INFERENCE_CLEAR_DOWNLOAD'
101
- }
102
-
103
- /* Release context */
104
- export type GeneratorSpeechInferenceActionReleaseContext = Action & {
105
- __actionName: 'GENERATOR_SPEECH_INFERENCE_RELEASE_CONTEXT'
106
- }
107
-
108
- interface GeneratorSpeechInferenceDef {
109
- /*
110
- Default property:
111
- {
112
- "init": false,
113
- "accelVariant": "default",
114
- "modelName": "base-q8_0",
115
- "modelUseCoreML": false,
116
- "modelUseGPU": true,
117
- "modelUseFlashAttn": false,
118
- "inferLanguage": "Auto"
119
- }
120
- */
121
- property?: {
122
- /* Initialize the Whisper context on generator initialization
123
- Please note that it will take some RAM depending on the model size */
124
- init?: boolean | DataLink
125
- /* Accelerator variant (Only for desktop)
126
- `default` - CPU / Metal (macOS)
127
- `vulkan` - Use Vulkan
128
- `cuda` - Use CUDA */
129
- accelVariant?: 'default' | 'vulkan' | 'cuda' | DataLink
130
- /* Use model name, the model download progress will be done in preload stage or the generator initialization stage.
131
- We used `ggml` format model, please refer to https://huggingface.co/BricksDisplay/whisper-ggml
132
- You can also choose `custom` option and set `Model URL` and `Model MD5` to use your own model */
133
- modelName?:
134
- | 'custom'
135
- | 'tiny'
136
- | 'tiny-q5_1'
137
- | 'tiny-q8_0'
138
- | 'tiny.en'
139
- | 'tiny.en-q5_1'
140
- | 'tiny.en-q8_0'
141
- | 'base'
142
- | 'base-q5_1'
143
- | 'base-q8_0'
144
- | 'base.en'
145
- | 'base.en-q5_1'
146
- | 'base.en-q8_0'
147
- | 'small'
148
- | 'small-q5_1'
149
- | 'small-q8_0'
150
- | 'small.en'
151
- | 'small.en-q5_1'
152
- | 'small.en-q8_0'
153
- | 'medium'
154
- | 'medium-q5_0'
155
- | 'medium-q8_0'
156
- | 'medium.en'
157
- | 'medium.en-q5_0'
158
- | 'medium.en-q8_0'
159
- | 'large-v1'
160
- | 'large-v2'
161
- | 'large-v2-q5_0'
162
- | 'large-v2-q8_0'
163
- | 'large-v3'
164
- | 'large-v3-q5_0'
165
- | 'large-v3-turbo'
166
- | 'large-v3-turbo-q5_0'
167
- | 'large-v3-turbo-q8_0'
168
- | 'small.en-tdrz'
169
- | 'small.en-tdrz-q5_1'
170
- | 'small.en-tdrz-q8_0'
171
- | 'distil-small.en'
172
- | 'distil-small.en-q5_1'
173
- | 'distil-small.en-q8_0'
174
- | 'distil-medium.en'
175
- | 'distil-medium.en-q5_0'
176
- | 'distil-medium.en-q8_0'
177
- | 'distil-large-v3'
178
- | 'distil-large-v3-q5_0'
179
- | 'distil-large-v3-q8_0'
180
- | DataLink
181
- /* The URL or path of model
182
- We used `ggml` format model, please refer to https://github.com/ggerganov/whisper.cpp/tree/master/models */
183
- modelUrl?: string | DataLink
184
- /* Hash type of model */
185
- modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
186
- /* Hash of model */
187
- modelHash?: string | DataLink
188
- /* [Unstable] iOS: Use CoreML model for inference */
189
- modelUseCoreML?: boolean | DataLink
190
- /* Use GPU Acceleration for inference. Currently iOS only, if it's enabled, Core ML option will be ignored. */
191
- modelUseGPU?: boolean | DataLink
192
- /* Use Flash Attention for inference (Recommended with GPU enabled) */
193
- modelUseFlashAttn?: boolean | DataLink
194
- /* The language of the file to be inferred */
195
- inferLanguage?:
196
- | 'Auto'
197
- | 'English (en)'
198
- | 'Chinese (zh)'
199
- | 'German (de)'
200
- | 'Spanish (es)'
201
- | 'Russian (ru)'
202
- | 'Korean (ko)'
203
- | 'French (fr)'
204
- | 'Japanese (ja)'
205
- | 'Portuguese (pt)'
206
- | 'Turkish (tr)'
207
- | 'Polish (pl)'
208
- | 'Catalan (ca)'
209
- | 'Dutch (nl)'
210
- | 'Arabic (ar)'
211
- | 'Swedish (sv)'
212
- | 'Italian (it)'
213
- | 'Indonesian (id)'
214
- | 'Hindi (hi)'
215
- | 'Finnish (fi)'
216
- | 'Vietnamese (vi)'
217
- | 'Hebrew (he)'
218
- | 'Ukrainian (uk)'
219
- | 'Greek (el)'
220
- | 'Malay (ms)'
221
- | 'Czech (cs)'
222
- | 'Romanian (ro)'
223
- | 'Danish (da)'
224
- | 'Hungarian (hu)'
225
- | 'Tamil (ta)'
226
- | 'Norwegian (no)'
227
- | 'Thai (th)'
228
- | 'Urdu (ur)'
229
- | 'Croatian (hr)'
230
- | 'Bulgarian (bg)'
231
- | 'Lithuanian (lt)'
232
- | 'Latin (la)'
233
- | 'Maori (mi)'
234
- | 'Malayalam (ml)'
235
- | 'Welsh (cy)'
236
- | 'Slovak (sk)'
237
- | 'Telugu (te)'
238
- | 'Persian (fa)'
239
- | 'Latvian (lv)'
240
- | 'Bengali (bn)'
241
- | 'Serbian (sr)'
242
- | 'Azerbaijani (az)'
243
- | 'Slovenian (sl)'
244
- | 'Kannada (kn)'
245
- | 'Estonian (et)'
246
- | 'Macedonian (mk)'
247
- | 'Breton (br)'
248
- | 'Basque (eu)'
249
- | 'Icelandic (is)'
250
- | 'Armenian (hy)'
251
- | 'Nepali (ne)'
252
- | 'Mongolian (mn)'
253
- | 'Bosnian (bs)'
254
- | 'Kazakh (kk)'
255
- | 'Albanian (sq)'
256
- | 'Swahili (sw)'
257
- | 'Galician (gl)'
258
- | 'Marathi (mr)'
259
- | 'Punjabi (pa)'
260
- | 'Sinhala (si)'
261
- | 'Khmer (km)'
262
- | 'Shona (sn)'
263
- | 'Yoruba (yo)'
264
- | 'Somali (so)'
265
- | 'Afrikaans (af)'
266
- | 'Occitan (oc)'
267
- | 'Georgian (ka)'
268
- | 'Belarusian (be)'
269
- | 'Tajik (tg)'
270
- | 'Sindhi (sd)'
271
- | 'Gujarati (gu)'
272
- | 'Amharic (am)'
273
- | 'Yiddish (yi)'
274
- | 'Lao (lo)'
275
- | 'Uzbek (uz)'
276
- | 'Faroese (fo)'
277
- | 'Haitian Creole (ht)'
278
- | 'Pashto (ps)'
279
- | 'Turkmen (tk)'
280
- | 'Nynorsk (nn)'
281
- | 'Maltese (mt)'
282
- | 'Sanskrit (sa)'
283
- | 'Luxembourgish (lb)'
284
- | 'Myanmar (my)'
285
- | 'Tibetan (bo)'
286
- | 'Tagalog (tl)'
287
- | 'Malagasy (mg)'
288
- | 'Assamese (as)'
289
- | 'Tatar (tt)'
290
- | 'Hawaiian (haw)'
291
- | 'Lingala (ln)'
292
- | 'Hausa (ha)'
293
- | 'Bashkir (ba)'
294
- | 'Javanese (jw)'
295
- | 'Sundanese (su)'
296
- | DataLink
297
- /* Initial prompt text to guide the model's style or continue a previous audio segment. The prompt should match the audio language. */
298
- inferPrompt?: string | DataLink
299
- /* Beam size to use for beam search (enables beam search if set) */
300
- inferBeamSize?: number | DataLink
301
- /* Translate the result to English */
302
- inferTranslate?: boolean | DataLink
303
- /* Max threads to use for inference */
304
- inferMaxThreads?: number | DataLink
305
- /* Output token-level timestamps in details outlet */
306
- inferTokenTimestamps?: boolean | DataLink
307
- /* Speaker diarization (Please use small.en-tdrz model) */
308
- inferTdrz?: boolean | DataLink
309
- /* Maximum segment length in characters */
310
- inferMaxLength?: number | DataLink
311
- /* Audio time offset in milliseconds */
312
- inferOffset?: number | DataLink
313
- /* Audio duration of audio to process in milliseconds */
314
- inferDuration?: number | DataLink
315
- /* The file URL or path to be inferred.
316
- It only supported `wav` format with 16kHz sample rate & single (mono) channel */
317
- inferFileUrl?: string | DataLink
318
- /* MD5 of file to be inferred */
319
- inferFileMd5?: string | DataLink
320
- /* Buttress connection settings for remote inference */
321
- buttressConnectionSettings?:
322
- | DataLink
323
- | {
324
- enabled?: boolean | DataLink
325
- url?: string | DataLink
326
- fallbackType?: 'use-local' | 'no-op' | DataLink
327
- strategy?: 'prefer-local' | 'prefer-buttress' | 'prefer-best' | DataLink
328
- }
329
- }
330
- events?: {
331
- /* Event triggered when context state changes */
332
- onContextStateChange?: Array<
333
- EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onContextStateChange']>
334
- >
335
- /* Event triggered when error occurs */
336
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onError']>>
337
- /* Event triggered when got transcribe result */
338
- onTranscribed?: Array<
339
- EventAction<string & keyof TemplateEventPropsMap['SpeechInference']['onTranscribed']>
340
- >
341
- /* Event triggered when transcribe realtime done */
342
- onRealtimeStop?: Array<EventAction>
343
- }
344
- outlets?: {
345
- /* Context state */
346
- contextState?: () => Data<string>
347
- /* Context details */
348
- contextDetails?: () => Data<{
349
- state?: string
350
- contextId?: string
351
- gpu?: string
352
- reasonNoGPU?: string
353
- [key: string]: any
354
- }>
355
- /* Is transcribing */
356
- isTranscribing?: () => Data<boolean>
357
- /* Progress of transcribe audio (0-100) */
358
- transcribeProgress?: () => Data<number>
359
- /* Inference result */
360
- transcribeResult?: () => Data<string>
361
- /* Detected language code of the latest transcription (e.g. `en`, `zh`, `ja`) */
362
- detectedLanguage?: () => Data<string>
363
- /* Inference result details */
364
- transcribeDetails?: () => Data<{
365
- result?: string
366
- language?: string
367
- segments?: Array<{
368
- start?: number
369
- end?: number
370
- confidence?: number
371
- t0?: number
372
- t1?: number
373
- [key: string]: any
374
- }>
375
- time?: number
376
- startTime?: number
377
- endTime?: number
378
- [key: string]: any
379
- }>
380
- /* Recorded audio file path of transcribe realtime (if `Save Audio` is enabled) */
381
- recordedPath?: () => Data<string>
382
- }
383
- }
384
-
385
- /* Local Speech-to-Text (STT) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)
386
-
387
- ## Notice
388
- - iOS: Supported GPU acceleration, recommended use M1+ / A17+ chip device
389
- - macOS: Supported GPU acceleration, recommended use M1+ chip device
390
- - Android: Currently not supported GPU acceleration (Coming soon), recommended use Android 13+ system
391
- - Linux / Windows: Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property */
392
- export type GeneratorSpeechInference = Generator &
393
- GeneratorSpeechInferenceDef & {
394
- templateKey: 'GENERATOR_SPEECH_INFERENCE'
395
- switches?: Array<
396
- SwitchDef &
397
- GeneratorSpeechInferenceDef & {
398
- conds?: Array<{
399
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
400
- cond:
401
- | SwitchCondInnerStateCurrentCanvas
402
- | SwitchCondData
403
- | {
404
- __typename: 'SwitchCondInnerStateOutlet'
405
- outlet:
406
- | 'contextState'
407
- | 'contextDetails'
408
- | 'isTranscribing'
409
- | 'transcribeProgress'
410
- | 'transcribeResult'
411
- | 'detectedLanguage'
412
- | 'transcribeDetails'
413
- | 'recordedPath'
414
- value: any
415
- }
416
- }>
417
- }
418
- >
419
- }