@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,287 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Realtime speech-to-text transcription using Whisper and VAD with live audio streaming
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 realtime transcription */
19
- export type GeneratorRealtimeTranscriptionActionStart = Action & {
20
- __actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_START'
21
- }
22
-
23
- /* Stop realtime transcription */
24
- export type GeneratorRealtimeTranscriptionActionStop = Action & {
25
- __actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_STOP'
26
- }
27
-
28
- /* Force move to next slice */
29
- export type GeneratorRealtimeTranscriptionActionNextSlice = Action & {
30
- __actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_NEXT_SLICE'
31
- }
32
-
33
- /* Reset transcriber state */
34
- export type GeneratorRealtimeTranscriptionActionReset = Action & {
35
- __actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_RESET'
36
- }
37
-
38
- /* List available microphone devices (Web / Desktop only) */
39
- export type GeneratorRealtimeTranscriptionActionListDevices = Action & {
40
- __actionName: 'GENERATOR_REALTIME_TRANSCRIPTION_LIST_DEVICES'
41
- }
42
-
43
- interface GeneratorRealtimeTranscriptionDef {
44
- /*
45
- Default property:
46
- {
47
- "sttLivePolicy": "only-in-use",
48
- "vadInferenceLivePolicy": "only-in-use",
49
- "vadEnabled": true,
50
- "audioSliceSec": 30,
51
- "audioMinSec": 1,
52
- "maxSlicesInMemory": 5,
53
- "transcribeProcessingPauseMs": 500,
54
- "initTranscribeAfterMs": 500,
55
- "vadStrategy": "use-preset",
56
- "vadPreset": "default",
57
- "initialPrompt": "",
58
- "promptPreviousSlices": false,
59
- "saveAudio": true,
60
- "testMode": false,
61
- "testPlaybackSpeed": 1,
62
- "testChunkDurationMs": 100,
63
- "testLoop": false,
64
- "beginTranscribeEnabled": false,
65
- "beginTranscribeScript": "\/\* Global variable: inputs = { sliceIndex, duration, vadEvent, variables } \*\/\nreturn true"
66
- }
67
- */
68
- property?: {
69
- /* Specifies the device ID to use for audio input.
70
- Web / Desktop: device ID string from enumerateDevices
71
- Android: audio source name - DEFAULT, MIC, VOICE_UPLINK, VOICE_DOWNLINK, VOICE_CALL, CAMCORDER, VOICE_RECOGNITION, VOICE_COMMUNICATION, UNPROCESSED */
72
- deviceId?: string | DataLink
73
- /* STT Generator for Whisper context */
74
- sttGeneratorId?: string | DataLink | (() => Generator)
75
- /* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when not in use. */
76
- sttLivePolicy?: 'only-in-use' | 'manual' | DataLink
77
- /* VAD Inference Generator for voice activity detection */
78
- vadInferenceGeneratorId?: string | DataLink | (() => Generator)
79
- /* VAD Inference Live Policy. If the policy is `only-in-use`, the VAD Inference context will be released when not in use. */
80
- vadInferenceLivePolicy?: 'only-in-use' | 'manual' | DataLink
81
- /* Enable VAD (Voice Activity Detection) */
82
- vadEnabled?: boolean | DataLink
83
- /* Audio slice duration in seconds */
84
- audioSliceSec?: number | DataLink
85
- /* Minimum audio duration to start transcription in seconds */
86
- audioMinSec?: number | DataLink
87
- /* Maximum number of slices to keep in memory */
88
- maxSlicesInMemory?: number | DataLink
89
- /* Transcribe processing interval in milliseconds */
90
- transcribeProcessingPauseMs?: number | DataLink
91
- /* Transcribe processing init after pause in milliseconds */
92
- initTranscribeAfterMs?: number | DataLink
93
- /* VAD Strategy */
94
- vadStrategy?: 'use-preset' | 'use-generator-options' | DataLink
95
- /* VAD preset configuration */
96
- vadPreset?:
97
- | 'default'
98
- | 'sensitive'
99
- | 'very-sensitive'
100
- | 'conservative'
101
- | 'very-conservative'
102
- | 'continuous-speech'
103
- | 'meeting'
104
- | 'noisy-environment'
105
- | DataLink
106
- /* Initial prompt for transcription */
107
- initialPrompt?: string | DataLink
108
- /* Include previous slices in prompt */
109
- promptPreviousSlices?: boolean | DataLink
110
- /* Enable audio output saving (auto-generates file path) */
111
- saveAudio?: boolean | DataLink
112
- /* Use test mode with file simulation */
113
- testMode?: boolean | DataLink
114
- /* Test audio file path for simulation */
115
- testFilePath?: string | DataLink
116
- /* Test audio file hash */
117
- testFileHash?: string | DataLink
118
- /* Test audio file hash type */
119
- testFileHashType?: string | DataLink
120
- /* Test playback speed */
121
- testPlaybackSpeed?: number | DataLink
122
- /* Test chunk duration in milliseconds */
123
- testChunkDurationMs?: number | DataLink
124
- /* Loop test audio file */
125
- testLoop?: boolean | DataLink
126
- /* Enable Begin Transcribe Script to determine transcription */
127
- beginTranscribeEnabled?: boolean | DataLink
128
- /* Script to determine whether to proceed with transcription */
129
- beginTranscribeScript?: string | DataLink
130
- /* Data to be used in Begin Transcribe Script (object) */
131
- beginTranscribeScriptData?: {} | DataLink
132
- }
133
- events?: {
134
- /* Event triggered when transcription starts, processes, or ends */
135
- onTranscribe?: Array<
136
- EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onTranscribe']>
137
- >
138
- /* Event triggered on VAD (Voice Activity Detection) events */
139
- onVad?: Array<
140
- EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onVad']>
141
- >
142
- /* Event triggered when error occurs */
143
- onError?: Array<
144
- EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onError']>
145
- >
146
- /* Event triggered when status changes */
147
- onStatusChange?: Array<
148
- EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStatusChange']>
149
- >
150
- /* Event triggered when statistics update */
151
- onStatsUpdate?: Array<
152
- EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStatsUpdate']>
153
- >
154
- /* Event triggered when slice transcription is stabilized */
155
- onStabilized?: Array<
156
- EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onStabilized']>
157
- >
158
- /* Event triggered when transcription ends */
159
- onEnd?: Array<
160
- EventAction<string & keyof TemplateEventPropsMap['RealtimeTranscription']['onEnd']>
161
- >
162
- }
163
- outlets?: {
164
- /* Is realtime transcription currently active */
165
- isActive?: () => Data<boolean>
166
- /* Is currently transcribing audio */
167
- isTranscribing?: () => Data<boolean>
168
- /* Current transcription results */
169
- results?: () => Data<
170
- Array<{
171
- transcribeEvent?: {
172
- type?: string
173
- sliceIndex?: number
174
- isCapturing?: boolean
175
- data?: {
176
- result?: string
177
- language?: string
178
- [key: string]: any
179
- }
180
- vadEvent?: {
181
- type?: string
182
- confidence?: number
183
- duration?: number
184
- sliceIndex?: number
185
- timestamp?: number
186
- [key: string]: any
187
- }
188
- [key: string]: any
189
- }
190
- vadEvent?: {
191
- type?: string
192
- confidence?: number
193
- duration?: number
194
- sliceIndex?: number
195
- timestamp?: number
196
- [key: string]: any
197
- }
198
- [key: string]: any
199
- }>
200
- >
201
- /* Current transcription result text */
202
- resultText?: () => Data<string>
203
- /* Last stabilized transcription result segment */
204
- lastStabilizedSegment?: () => Data<string>
205
- /* Current statistics */
206
- statistics?: () => Data<{
207
- type?: string
208
- timestamp?: number
209
- data?: { [key: string]: any }
210
- [key: string]: any
211
- }>
212
- /* Latest transcribe event */
213
- lastTranscribeEvent?: () => Data<{
214
- type?: string
215
- sliceIndex?: number
216
- isCapturing?: boolean
217
- data?: {
218
- result?: string
219
- language?: string
220
- [key: string]: any
221
- }
222
- vadEvent?: {
223
- type?: string
224
- confidence?: number
225
- duration?: number
226
- sliceIndex?: number
227
- timestamp?: number
228
- [key: string]: any
229
- }
230
- [key: string]: any
231
- }>
232
- /* Latest VAD event */
233
- lastVadEvent?: () => Data<{
234
- type?: string
235
- confidence?: number
236
- duration?: number
237
- sliceIndex?: number
238
- timestamp?: number
239
- [key: string]: any
240
- }>
241
- /* Stabilized transcription text from completed slices */
242
- stabilizedText?: () => Data<string>
243
- /* Latest detected language code (e.g. `en`, `zh`, `ja`) from any transcribe slice (best-effort, may flicker on short slices) */
244
- detectedLanguage?: () => Data<string>
245
- /* Detected language code of the most recently stabilized (finalized) slice */
246
- stabilizedLanguage?: () => Data<string>
247
- /* Audio output file path (auto-generated when saving audio) */
248
- audioOutputPath?: () => Data<string>
249
- /* Available microphone devices (Web / Desktop only) */
250
- devices?: () => Data<Array<any>>
251
- }
252
- }
253
-
254
- /* Realtime speech-to-text transcription using Whisper and VAD with live audio streaming */
255
- export type GeneratorRealtimeTranscription = Generator &
256
- GeneratorRealtimeTranscriptionDef & {
257
- templateKey: 'GENERATOR_REALTIME_TRANSCRIPTION'
258
- switches?: Array<
259
- SwitchDef &
260
- GeneratorRealtimeTranscriptionDef & {
261
- conds?: Array<{
262
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
263
- cond:
264
- | SwitchCondInnerStateCurrentCanvas
265
- | SwitchCondData
266
- | {
267
- __typename: 'SwitchCondInnerStateOutlet'
268
- outlet:
269
- | 'isActive'
270
- | 'isTranscribing'
271
- | 'results'
272
- | 'resultText'
273
- | 'lastStabilizedSegment'
274
- | 'statistics'
275
- | 'lastTranscribeEvent'
276
- | 'lastVadEvent'
277
- | 'stabilizedText'
278
- | 'detectedLanguage'
279
- | 'stabilizedLanguage'
280
- | 'audioOutputPath'
281
- | 'devices'
282
- value: any
283
- }
284
- }>
285
- }
286
- >
287
- }
@@ -1,195 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
4
- *
5
- * ## Notice
6
- * - The device RAM must be larger than 8GB
7
- * - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
8
- * - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
9
- * - Android: Recommended use Android 13+ system.
10
- * - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
11
- * - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs.
12
- * - Linux / Windows
13
- * - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
14
- * - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux)
15
- * - Web: Supported with CPU and WebGPU acceleration.
16
- * - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable.
17
- */
18
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
19
- import type { Data, DataLink } from '../data'
20
- import type {
21
- Brick,
22
- Generator,
23
- EventAction,
24
- ActionWithDataParams,
25
- ActionWithParams,
26
- Action,
27
- EventProperty,
28
- } from '../common'
29
- import type { TemplateEventPropsMap } from '../../utils/event-props'
30
-
31
- /* Load the model */
32
- export type GeneratorRerankerActionLoadModel = Action & {
33
- __actionName: 'GENERATOR_RERANKER_LOAD_MODEL'
34
- }
35
-
36
- /* Rerank documents based on query relevance */
37
- export type GeneratorRerankerActionRerank = ActionWithParams & {
38
- __actionName: 'GENERATOR_RERANKER_RERANK'
39
- params?: Array<
40
- | {
41
- input: 'query'
42
- value?: string | DataLink | EventProperty
43
- mapping?: string
44
- }
45
- | {
46
- input: 'documents'
47
- value?: Array<any> | DataLink | EventProperty
48
- mapping?: string
49
- }
50
- >
51
- }
52
-
53
- /* Release context */
54
- export type GeneratorRerankerActionReleaseContext = Action & {
55
- __actionName: 'GENERATOR_RERANKER_RELEASE_CONTEXT'
56
- }
57
-
58
- interface GeneratorRerankerDef {
59
- /*
60
- Default property:
61
- {
62
- "init": false,
63
- "contextSize": 512,
64
- "batchSize": 512,
65
- "uBatchSize": 512,
66
- "accelVariant": "default",
67
- "mainGpu": 0,
68
- "gpuLayers": 0,
69
- "useMlock": true,
70
- "useMmap": true,
71
- "normalize": 1
72
- }
73
- */
74
- property?: {
75
- /* Initialize the Reranker context on generator initialization */
76
- init?: boolean | DataLink
77
- /* The URL or path of reranker model (GGUF format) */
78
- modelUrl?: string | DataLink
79
- /* Hash of reranker model */
80
- modelHash?: string | DataLink
81
- /* Hash type of reranker model */
82
- modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
83
- /* Context size (0 ~ 4096) (Default to 512) */
84
- contextSize?: number | DataLink
85
- /* Logical batch size for processing (default: 512) */
86
- batchSize?: number | DataLink
87
- /* Physical maximum batch size (default: 512) */
88
- uBatchSize?: number | DataLink
89
- /* GGML accelerator variant (Only for desktop)
90
- `default` - CPU / Metal (macOS)
91
- `vulkan` - Use Vulkan
92
- `cuda` - Use CUDA
93
- `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
94
- accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
95
- /* Devices. For example:
96
-
97
- Metal or CPU for iOS/tvOS/MacOS
98
- OpenCL or CPU for Android
99
- - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices)
100
- For Desktop, you may want to include/exclude GPUs */
101
- devices?: Array<string | DataLink> | DataLink
102
- /* Main GPU index (default: 0) */
103
- mainGpu?: number | DataLink
104
- /* Number of layers to store in VRAM (default: 0) */
105
- gpuLayers?: number | DataLink
106
- /* Maximum number of threads to use (default: auto) */
107
- maxThreads?: number | DataLink
108
- /* Use mlock to keep model in memory (default: true) */
109
- useMlock?: boolean | DataLink
110
- /* Use mmap for model loading (default: true) */
111
- useMmap?: boolean | DataLink
112
- /* Query text for reranking */
113
- query?: string | DataLink
114
- /* Array of documents to rerank */
115
- documents?: Array<string | DataLink> | DataLink
116
- /* Normalize reranking scores (default: from model config) */
117
- normalize?: number | DataLink | boolean | DataLink | DataLink
118
- /* Maximum number of documents to return (default: unlimited) */
119
- topK?: number | DataLink
120
- }
121
- events?: {
122
- /* Event triggered when the reranker context state changes (loading, ready, error, released) */
123
- onContextStateChange?: Array<
124
- EventAction<string & keyof TemplateEventPropsMap['Reranker']['onContextStateChange']>
125
- >
126
- /* Event triggered when an error occurs during reranker operations */
127
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Reranker']['onError']>>
128
- }
129
- outlets?: {
130
- /* Current state of the reranker context (loading, ready, error, released) */
131
- contextState?: () => Data<string>
132
- /* Loading progress of the reranker model (0-100) */
133
- contextLoadProgress?: () => Data<number>
134
- /* Detailed information about the reranker context including instance ID and processing status */
135
- contextDetails?: () => Data<{
136
- state?: string
137
- contextId?: string
138
- gpu?: string
139
- reasonNoGPU?: string
140
- [key: string]: any
141
- }>
142
- /* Result of the reranking operation containing scored and ranked documents */
143
- rerankResult?: () => Data<
144
- Array<{
145
- index?: number
146
- score?: number
147
- text?: string
148
- payload?: { [key: string]: any }
149
- [key: string]: any
150
- }>
151
- >
152
- /* Boolean indicating whether the reranker is currently processing a request */
153
- isProcessing?: () => Data<boolean>
154
- }
155
- }
156
-
157
- /* Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
158
-
159
- ## Notice
160
- - The device RAM must be larger than 8GB
161
- - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
162
- - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
163
- - Android: Recommended use Android 13+ system.
164
- - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
165
- - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs.
166
- - Linux / Windows
167
- - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
168
- - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux)
169
- - Web: Supported with CPU and WebGPU acceleration.
170
- - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable. */
171
- export type GeneratorReranker = Generator &
172
- GeneratorRerankerDef & {
173
- templateKey: 'GENERATOR_RERANKER'
174
- switches?: Array<
175
- SwitchDef &
176
- GeneratorRerankerDef & {
177
- conds?: Array<{
178
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
179
- cond:
180
- | SwitchCondInnerStateCurrentCanvas
181
- | SwitchCondData
182
- | {
183
- __typename: 'SwitchCondInnerStateOutlet'
184
- outlet:
185
- | 'contextState'
186
- | 'contextLoadProgress'
187
- | 'contextDetails'
188
- | 'rerankResult'
189
- | 'isProcessing'
190
- value: any
191
- }
192
- }>
193
- }
194
- >
195
- }
@@ -1,151 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Serial port communication for USB/UART devices (Android, Desktop only)
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
- /* Get available serial devices */
19
- export type GeneratorSerialPortActionGeneratorSerialGetDeviceList = Action & {
20
- __actionName: 'GENERATOR_SERIAL_GET_DEVICE_LIST'
21
- }
22
-
23
- /* Attach device */
24
- export type GeneratorSerialPortActionGeneratorSerialAttach = Action & {
25
- __actionName: 'GENERATOR_SERIAL_ATTACH'
26
- }
27
-
28
- /* Dettach device */
29
- export type GeneratorSerialPortActionGeneratorSerialDetach = Action & {
30
- __actionName: 'GENERATOR_SERIAL_DETACH'
31
- }
32
-
33
- /* Send string data (ASCII) */
34
- export type GeneratorSerialPortActionGeneratorSerialSendString = ActionWithParams & {
35
- __actionName: 'GENERATOR_SERIAL_SEND_STRING'
36
- params?: Array<
37
- | {
38
- input: 'generatorSerialStringValue'
39
- value?: string | DataLink | EventProperty
40
- mapping?: string
41
- }
42
- | {
43
- input: 'generatorSerialStringEncoding'
44
- value?: string | DataLink | EventProperty
45
- mapping?: string
46
- }
47
- >
48
- }
49
-
50
- /* Send hex string (e.g. 0123456789ABCDEF) */
51
- export type GeneratorSerialPortActionGeneratorSerialSendHex = ActionWithParams & {
52
- __actionName: 'GENERATOR_SERIAL_SEND_HEX'
53
- params?: Array<{
54
- input: 'generatorSerialHexValue'
55
- value?: string | DataLink | EventProperty
56
- mapping?: string
57
- }>
58
- }
59
-
60
- interface GeneratorSerialPortDef {
61
- /*
62
- Default property:
63
- {
64
- "attachOnInit": false,
65
- "driver": "fd",
66
- "parityBit": "none",
67
- "dataBits": 8,
68
- "stopBits": 1,
69
- "commMode": "raw"
70
- }
71
- */
72
- property?: {
73
- /* Try attach on generator initialized On web require user activation to attach device */
74
- attachOnInit?: boolean | DataLink
75
- /* The serial device driver */
76
- driver?: 'fd' | 'usb' | DataLink
77
- /* The serial device path e.g. /dev/ttyS0 or /dev/bus/usb/001/001 For desktop and web is device index number */
78
- path?: string | DataLink
79
- /* The serial USB vendor id (autoconnect first) */
80
- vendorId?: number | DataLink
81
- /* The serial USB product id */
82
- productId?: number | DataLink
83
- /* The super user binary path (For Android root permission) */
84
- suPath?: string | DataLink
85
- /* The serial device baud rate */
86
- baudRate?: number | DataLink
87
- /* The serial device parity bit */
88
- parityBit?: 'none' | 'odd' | 'even' | DataLink
89
- /* The serial device data bits */
90
- dataBits?: number | DataLink
91
- /* The serial device stop bits */
92
- stopBits?: number | DataLink
93
- /* The serial device communication mode */
94
- commMode?: 'raw' | 'EDC' | 'Regex Match' | DataLink
95
- /* The regex match pattern for packets */
96
- regexMatch?: string | DataLink
97
- }
98
- events?: {
99
- /* Event for attach the device */
100
- generatorSerialOnAttach?: Array<EventAction>
101
- /* Event for detach the device */
102
- generatorSerialOnDetach?: Array<EventAction>
103
- /* Event on error */
104
- generatorSerialOnError?: Array<
105
- EventAction<string & keyof TemplateEventPropsMap['SerialPort']['generatorSerialOnError']>
106
- >
107
- /* Event for receive data */
108
- generatorSerialOnData?: Array<
109
- EventAction<string & keyof TemplateEventPropsMap['SerialPort']['generatorSerialOnData']>
110
- >
111
- }
112
- outlets?: {
113
- /* Available serial devices */
114
- generatorSerialDeviceList?: () => Data<Array<{ [key: string]: any }>>
115
- /* Is serial open */
116
- generatorSerialIsOpen?: () => Data<boolean>
117
- /* Last rerceive data (Base64) */
118
- generatorSerialLastDataBase64?: () => Data<string>
119
- /* Last rerceive plain text */
120
- generatorSerialLastDataString?: () => Data<string>
121
- /* Error message */
122
- generatorSerialErrorMessage?: () => Data<string>
123
- }
124
- }
125
-
126
- /* Serial port communication for USB/UART devices (Android, Desktop only) */
127
- export type GeneratorSerialPort = Generator &
128
- GeneratorSerialPortDef & {
129
- templateKey: 'GENERATOR_SERIAL_PORT'
130
- switches?: Array<
131
- SwitchDef &
132
- GeneratorSerialPortDef & {
133
- conds?: Array<{
134
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
135
- cond:
136
- | SwitchCondInnerStateCurrentCanvas
137
- | SwitchCondData
138
- | {
139
- __typename: 'SwitchCondInnerStateOutlet'
140
- outlet:
141
- | 'generatorSerialDeviceList'
142
- | 'generatorSerialIsOpen'
143
- | 'generatorSerialLastDataBase64'
144
- | 'generatorSerialLastDataString'
145
- | 'generatorSerialErrorMessage'
146
- value: any
147
- }
148
- }>
149
- }
150
- >
151
- }