@fugood/bricks-ctor 2.25.0-beta.6 → 2.25.0-beta.61

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 (133) hide show
  1. package/package.json +4 -24
  2. package/tools/deploy.ts +19 -165
  3. package/tools/mcp-server.ts +17 -26
  4. package/tools/postinstall.ts +21 -235
  5. package/tools/pull.ts +18 -121
  6. package/tools/push-config.ts +19 -0
  7. package/tools/simulator.ts +21 -0
  8. package/compile/action-name-map.ts +0 -1015
  9. package/compile/index.ts +0 -1278
  10. package/compile/util.ts +0 -358
  11. package/index.ts +0 -6
  12. package/skills/bricks-ctor/SKILL.md +0 -32
  13. package/skills/bricks-ctor/rules/animation.md +0 -159
  14. package/skills/bricks-ctor/rules/architecture-patterns.md +0 -69
  15. package/skills/bricks-ctor/rules/automations.md +0 -221
  16. package/skills/bricks-ctor/rules/buttress.md +0 -156
  17. package/skills/bricks-ctor/rules/data-calculation.md +0 -209
  18. package/skills/bricks-ctor/rules/local-sync.md +0 -129
  19. package/skills/bricks-ctor/rules/media-flow.md +0 -158
  20. package/skills/bricks-ctor/rules/remote-data-bank.md +0 -196
  21. package/skills/bricks-ctor/rules/standby-transition.md +0 -124
  22. package/skills/bricks-design/LICENSE.txt +0 -180
  23. package/skills/bricks-design/SKILL.md +0 -66
  24. package/skills/rive-marketplace/SKILL.md +0 -99
  25. package/tools/_git-author.ts +0 -29
  26. package/tools/_shell.ts +0 -173
  27. package/tools/icons/.gitattributes +0 -1
  28. package/tools/icons/fa6pro-glyphmap.json +0 -4686
  29. package/tools/icons/fa6pro-meta.json +0 -1
  30. package/tools/mcp-tools/compile.ts +0 -92
  31. package/tools/mcp-tools/huggingface.ts +0 -762
  32. package/tools/mcp-tools/icons.ts +0 -81
  33. package/tools/mcp-tools/lottie.ts +0 -102
  34. package/tools/mcp-tools/media.ts +0 -110
  35. package/tools/preview-main.mjs +0 -293
  36. package/tools/preview.ts +0 -150
  37. package/types/animation.ts +0 -100
  38. package/types/automation.ts +0 -235
  39. package/types/brick-base.ts +0 -80
  40. package/types/bricks/Camera.ts +0 -246
  41. package/types/bricks/Chart.ts +0 -372
  42. package/types/bricks/GenerativeMedia.ts +0 -290
  43. package/types/bricks/Icon.ts +0 -98
  44. package/types/bricks/Image.ts +0 -114
  45. package/types/bricks/Items.ts +0 -476
  46. package/types/bricks/Lottie.ts +0 -168
  47. package/types/bricks/Maps.ts +0 -262
  48. package/types/bricks/QrCode.ts +0 -117
  49. package/types/bricks/Rect.ts +0 -150
  50. package/types/bricks/RichText.ts +0 -128
  51. package/types/bricks/Rive.ts +0 -220
  52. package/types/bricks/Sketch.ts +0 -254
  53. package/types/bricks/Slideshow.ts +0 -201
  54. package/types/bricks/Svg.ts +0 -99
  55. package/types/bricks/Text.ts +0 -148
  56. package/types/bricks/TextInput.ts +0 -242
  57. package/types/bricks/Video.ts +0 -175
  58. package/types/bricks/VideoStreaming.ts +0 -112
  59. package/types/bricks/WebRtcStream.ts +0 -65
  60. package/types/bricks/WebView.ts +0 -168
  61. package/types/bricks/index.ts +0 -22
  62. package/types/canvas.ts +0 -82
  63. package/types/common.ts +0 -144
  64. package/types/data-calc-command.ts +0 -7005
  65. package/types/data-calc-script.ts +0 -21
  66. package/types/data-calc.ts +0 -11
  67. package/types/data.ts +0 -95
  68. package/types/generators/AlarmClock.ts +0 -110
  69. package/types/generators/Assistant.ts +0 -621
  70. package/types/generators/BleCentral.ts +0 -247
  71. package/types/generators/BlePeripheral.ts +0 -208
  72. package/types/generators/CanvasMap.ts +0 -74
  73. package/types/generators/CastlesPay.ts +0 -87
  74. package/types/generators/DataBank.ts +0 -160
  75. package/types/generators/File.ts +0 -432
  76. package/types/generators/GraphQl.ts +0 -132
  77. package/types/generators/Http.ts +0 -222
  78. package/types/generators/HttpServer.ts +0 -176
  79. package/types/generators/Information.ts +0 -103
  80. package/types/generators/Intent.ts +0 -168
  81. package/types/generators/Iterator.ts +0 -108
  82. package/types/generators/Keyboard.ts +0 -105
  83. package/types/generators/LlmAnthropicCompat.ts +0 -212
  84. package/types/generators/LlmAppleBuiltin.ts +0 -159
  85. package/types/generators/LlmGgml.ts +0 -861
  86. package/types/generators/LlmMediaTekNeuroPilot.ts +0 -235
  87. package/types/generators/LlmMlx.ts +0 -227
  88. package/types/generators/LlmOnnx.ts +0 -213
  89. package/types/generators/LlmOpenAiCompat.ts +0 -312
  90. package/types/generators/LlmQualcommAiEngine.ts +0 -247
  91. package/types/generators/Mcp.ts +0 -637
  92. package/types/generators/McpServer.ts +0 -289
  93. package/types/generators/MediaFlow.ts +0 -170
  94. package/types/generators/MqttBroker.ts +0 -141
  95. package/types/generators/MqttClient.ts +0 -141
  96. package/types/generators/Question.ts +0 -408
  97. package/types/generators/RealtimeTranscription.ts +0 -287
  98. package/types/generators/RerankerGgml.ts +0 -191
  99. package/types/generators/SerialPort.ts +0 -151
  100. package/types/generators/SoundPlayer.ts +0 -94
  101. package/types/generators/SoundRecorder.ts +0 -130
  102. package/types/generators/SpeechToTextGgml.ts +0 -419
  103. package/types/generators/SpeechToTextOnnx.ts +0 -236
  104. package/types/generators/SpeechToTextPlatform.ts +0 -85
  105. package/types/generators/SqLite.ts +0 -159
  106. package/types/generators/Step.ts +0 -107
  107. package/types/generators/SttAppleBuiltin.ts +0 -130
  108. package/types/generators/Tcp.ts +0 -126
  109. package/types/generators/TcpServer.ts +0 -147
  110. package/types/generators/TextToSpeechAppleBuiltin.ts +0 -127
  111. package/types/generators/TextToSpeechGgml.ts +0 -221
  112. package/types/generators/TextToSpeechOnnx.ts +0 -178
  113. package/types/generators/TextToSpeechOpenAiLike.ts +0 -121
  114. package/types/generators/ThermalPrinter.ts +0 -191
  115. package/types/generators/Tick.ts +0 -83
  116. package/types/generators/Udp.ts +0 -120
  117. package/types/generators/VadGgml.ts +0 -250
  118. package/types/generators/VadOnnx.ts +0 -231
  119. package/types/generators/VadTraditional.ts +0 -138
  120. package/types/generators/VectorStore.ts +0 -257
  121. package/types/generators/Watchdog.ts +0 -107
  122. package/types/generators/WebCrawler.ts +0 -103
  123. package/types/generators/WebRtc.ts +0 -181
  124. package/types/generators/WebSocket.ts +0 -148
  125. package/types/generators/index.ts +0 -57
  126. package/types/index.ts +0 -13
  127. package/types/subspace.ts +0 -60
  128. package/types/switch.ts +0 -51
  129. package/types/system.ts +0 -707
  130. package/utils/calc.ts +0 -126
  131. package/utils/data.ts +0 -497
  132. package/utils/event-props.ts +0 -886
  133. package/utils/id.ts +0 -80
@@ -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,191 +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
- */
16
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
17
- import type { Data, DataLink } from '../data'
18
- import type {
19
- Brick,
20
- Generator,
21
- EventAction,
22
- ActionWithDataParams,
23
- ActionWithParams,
24
- Action,
25
- EventProperty,
26
- } from '../common'
27
- import type { TemplateEventPropsMap } from '../../utils/event-props'
28
-
29
- /* Load the model */
30
- export type GeneratorRerankerActionLoadModel = Action & {
31
- __actionName: 'GENERATOR_RERANKER_LOAD_MODEL'
32
- }
33
-
34
- /* Rerank documents based on query relevance */
35
- export type GeneratorRerankerActionRerank = ActionWithParams & {
36
- __actionName: 'GENERATOR_RERANKER_RERANK'
37
- params?: Array<
38
- | {
39
- input: 'query'
40
- value?: string | DataLink | EventProperty
41
- mapping?: string
42
- }
43
- | {
44
- input: 'documents'
45
- value?: Array<any> | DataLink | EventProperty
46
- mapping?: string
47
- }
48
- >
49
- }
50
-
51
- /* Release context */
52
- export type GeneratorRerankerActionReleaseContext = Action & {
53
- __actionName: 'GENERATOR_RERANKER_RELEASE_CONTEXT'
54
- }
55
-
56
- interface GeneratorRerankerDef {
57
- /*
58
- Default property:
59
- {
60
- "init": false,
61
- "contextSize": 512,
62
- "batchSize": 512,
63
- "uBatchSize": 512,
64
- "accelVariant": "default",
65
- "mainGpu": 0,
66
- "gpuLayers": 0,
67
- "useMlock": true,
68
- "useMmap": true,
69
- "normalize": 1
70
- }
71
- */
72
- property?: {
73
- /* Initialize the Reranker context on generator initialization */
74
- init?: boolean | DataLink
75
- /* The URL or path of reranker model (GGUF format) */
76
- modelUrl?: string | DataLink
77
- /* Hash of reranker model */
78
- modelHash?: string | DataLink
79
- /* Hash type of reranker model */
80
- modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
81
- /* Context size (0 ~ 4096) (Default to 512) */
82
- contextSize?: number | DataLink
83
- /* Logical batch size for processing (default: 512) */
84
- batchSize?: number | DataLink
85
- /* Physical maximum batch size (default: 512) */
86
- uBatchSize?: number | DataLink
87
- /* GGML accelerator variant (Only for desktop)
88
- `default` - CPU / Metal (macOS)
89
- `vulkan` - Use Vulkan
90
- `cuda` - Use CUDA
91
- `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
92
- accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
93
- /* Devices. For example:
94
-
95
- Metal or CPU for iOS/tvOS/MacOS
96
- OpenCL or CPU for Android
97
- - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices)
98
- For Desktop, you may want to include/exclude GPUs */
99
- devices?: Array<string | DataLink> | DataLink
100
- /* Main GPU index (default: 0) */
101
- mainGpu?: number | DataLink
102
- /* Number of layers to store in VRAM (default: 0) */
103
- gpuLayers?: number | DataLink
104
- /* Maximum number of threads to use (default: auto) */
105
- maxThreads?: number | DataLink
106
- /* Use mlock to keep model in memory (default: true) */
107
- useMlock?: boolean | DataLink
108
- /* Use mmap for model loading (default: true) */
109
- useMmap?: boolean | DataLink
110
- /* Query text for reranking */
111
- query?: string | DataLink
112
- /* Array of documents to rerank */
113
- documents?: Array<string | DataLink> | DataLink
114
- /* Normalize reranking scores (default: from model config) */
115
- normalize?: number | DataLink | boolean | DataLink | DataLink
116
- /* Maximum number of documents to return (default: unlimited) */
117
- topK?: number | DataLink
118
- }
119
- events?: {
120
- /* Event triggered when the reranker context state changes (loading, ready, error, released) */
121
- onContextStateChange?: Array<
122
- EventAction<string & keyof TemplateEventPropsMap['Reranker']['onContextStateChange']>
123
- >
124
- /* Event triggered when an error occurs during reranker operations */
125
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Reranker']['onError']>>
126
- }
127
- outlets?: {
128
- /* Current state of the reranker context (loading, ready, error, released) */
129
- contextState?: () => Data<string>
130
- /* Loading progress of the reranker model (0-100) */
131
- contextLoadProgress?: () => Data<number>
132
- /* Detailed information about the reranker context including instance ID and processing status */
133
- contextDetails?: () => Data<{
134
- state?: string
135
- contextId?: string
136
- gpu?: string
137
- reasonNoGPU?: string
138
- [key: string]: any
139
- }>
140
- /* Result of the reranking operation containing scored and ranked documents */
141
- rerankResult?: () => Data<
142
- Array<{
143
- index?: number
144
- score?: number
145
- text?: string
146
- payload?: { [key: string]: any }
147
- [key: string]: any
148
- }>
149
- >
150
- /* Boolean indicating whether the reranker is currently processing a request */
151
- isProcessing?: () => Data<boolean>
152
- }
153
- }
154
-
155
- /* Local rerank based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
156
-
157
- ## Notice
158
- - The device RAM must be larger than 8GB
159
- - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
160
- - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
161
- - Android: Recommended use Android 13+ system.
162
- - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
163
- - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 2+ GPUs.
164
- - Linux / Windows
165
- - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
166
- - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux) */
167
- export type GeneratorReranker = Generator &
168
- GeneratorRerankerDef & {
169
- templateKey: 'GENERATOR_RERANKER'
170
- switches?: Array<
171
- SwitchDef &
172
- GeneratorRerankerDef & {
173
- conds?: Array<{
174
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
175
- cond:
176
- | SwitchCondInnerStateCurrentCanvas
177
- | SwitchCondData
178
- | {
179
- __typename: 'SwitchCondInnerStateOutlet'
180
- outlet:
181
- | 'contextState'
182
- | 'contextLoadProgress'
183
- | 'contextDetails'
184
- | 'rerankResult'
185
- | 'isProcessing'
186
- value: any
187
- }
188
- }>
189
- }
190
- >
191
- }
@@ -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
- }