@fugood/bricks-ctor 2.25.0-beta.60 → 2.25.0-beta.62

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