@fugood/bricks-ctor 2.25.0-beta.60 → 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 (190) hide show
  1. package/package.json +4 -28
  2. package/tools/deploy.ts +19 -176
  3. package/tools/mcp-server.ts +16 -33
  4. package/tools/postinstall.ts +21 -292
  5. package/tools/pull.ts +15 -195
  6. package/tools/push-config.ts +18 -113
  7. package/tools/simulator.ts +19 -148
  8. package/compile/__tests__/config-diff.test.js +0 -100
  9. package/compile/__tests__/index.test.js +0 -461
  10. package/compile/__tests__/util.test.js +0 -450
  11. package/compile/action-name-map.ts +0 -1079
  12. package/compile/config-diff.ts +0 -155
  13. package/compile/index.ts +0 -1594
  14. package/compile/util.ts +0 -482
  15. package/index.ts +0 -6
  16. package/skills/bricks-ctor/SKILL.md +0 -38
  17. package/skills/bricks-ctor/references/animation.md +0 -160
  18. package/skills/bricks-ctor/references/architecture-patterns.md +0 -88
  19. package/skills/bricks-ctor/references/automations.md +0 -232
  20. package/skills/bricks-ctor/references/buttress.md +0 -245
  21. package/skills/bricks-ctor/references/data-calculation.md +0 -252
  22. package/skills/bricks-ctor/references/local-sync.md +0 -129
  23. package/skills/bricks-ctor/references/media-flow.md +0 -165
  24. package/skills/bricks-ctor/references/remote-data-bank.md +0 -196
  25. package/skills/bricks-ctor/references/simulator.md +0 -132
  26. package/skills/bricks-ctor/references/source-editing-tools.md +0 -81
  27. package/skills/bricks-ctor/references/standby-transition.md +0 -124
  28. package/skills/bricks-ctor/references/verification-toolchain.md +0 -200
  29. package/skills/bricks-design/SKILL.md +0 -171
  30. package/skills/bricks-design/references/architecture-truths.md +0 -132
  31. package/skills/bricks-design/references/avoiding-complexity.md +0 -91
  32. package/skills/bricks-design/references/design-critique.md +0 -195
  33. package/skills/bricks-design/references/design-languages.md +0 -265
  34. package/skills/bricks-design/references/performance.md +0 -116
  35. package/skills/bricks-design/references/presentation-and-slideshow.md +0 -137
  36. package/skills/bricks-design/references/translating-inputs.md +0 -152
  37. package/skills/bricks-design/references/variations-and-tweaks.md +0 -124
  38. package/skills/bricks-design/references/when-the-brief-is-branded.md +0 -284
  39. package/skills/bricks-design/references/when-the-brief-is-vague.md +0 -85
  40. package/skills/bricks-design/references/workflow.md +0 -134
  41. package/skills/bricks-ux/SKILL.md +0 -114
  42. package/skills/bricks-ux/references/accessibility.md +0 -162
  43. package/skills/bricks-ux/references/flow-states.md +0 -175
  44. package/skills/bricks-ux/references/interaction-archetypes.md +0 -189
  45. package/skills/bricks-ux/references/monitoring-screens.md +0 -153
  46. package/skills/bricks-ux/references/pressable-composition.md +0 -126
  47. package/skills/bricks-ux/references/user-journey.md +0 -168
  48. package/skills/bricks-ux/references/ux-critique.md +0 -256
  49. package/skills/rive-marketplace/SKILL.md +0 -99
  50. package/tools/__tests__/_cli-error.test.ts +0 -35
  51. package/tools/__tests__/_mcp-config.test.ts +0 -67
  52. package/tools/__tests__/pull.test.ts +0 -108
  53. package/tools/_cli-error.ts +0 -17
  54. package/tools/_edits-log.ts +0 -41
  55. package/tools/_git-author.ts +0 -37
  56. package/tools/_last-pushed-commit.ts +0 -28
  57. package/tools/_mcp-config.ts +0 -42
  58. package/tools/_shell.ts +0 -180
  59. package/tools/icons/.gitattributes +0 -1
  60. package/tools/icons/fa6pro-glyphmap.json +0 -4686
  61. package/tools/icons/fa6pro-meta.json +0 -1
  62. package/tools/mcp-env.ts +0 -13
  63. package/tools/mcp-tools/__tests__/data-calc-editing.test.js +0 -516
  64. package/tools/mcp-tools/__tests__/entry-editing.test.js +0 -866
  65. package/tools/mcp-tools/__tests__/huggingface.test.ts +0 -49
  66. package/tools/mcp-tools/__tests__/icons.test.ts +0 -21
  67. package/tools/mcp-tools/__tests__/mcp-env.test.js +0 -19
  68. package/tools/mcp-tools/_editing-helpers.ts +0 -98
  69. package/tools/mcp-tools/_verify.ts +0 -50
  70. package/tools/mcp-tools/compile.ts +0 -104
  71. package/tools/mcp-tools/data-calc-editing.ts +0 -1311
  72. package/tools/mcp-tools/entry-editing.ts +0 -2297
  73. package/tools/mcp-tools/huggingface.ts +0 -772
  74. package/tools/mcp-tools/icons.ts +0 -97
  75. package/tools/mcp-tools/lottie.ts +0 -102
  76. package/tools/mcp-tools/media.ts +0 -113
  77. package/tools/simulator-main.mjs +0 -488
  78. package/tools/simulator-preload.cjs +0 -16
  79. package/types/animation.d.ts +0 -116
  80. package/types/automation.d.ts +0 -231
  81. package/types/brick-base.d.ts +0 -80
  82. package/types/bricks/Camera.d.ts +0 -246
  83. package/types/bricks/Chart.d.ts +0 -372
  84. package/types/bricks/GenerativeMedia.d.ts +0 -290
  85. package/types/bricks/Icon.d.ts +0 -98
  86. package/types/bricks/Image.d.ts +0 -126
  87. package/types/bricks/Items.d.ts +0 -480
  88. package/types/bricks/Lottie.d.ts +0 -168
  89. package/types/bricks/Maps.d.ts +0 -262
  90. package/types/bricks/QrCode.d.ts +0 -117
  91. package/types/bricks/Rect.d.ts +0 -150
  92. package/types/bricks/RichText.d.ts +0 -131
  93. package/types/bricks/Rive.d.ts +0 -220
  94. package/types/bricks/Scene3D.d.ts +0 -676
  95. package/types/bricks/Sketch.d.ts +0 -256
  96. package/types/bricks/Slideshow.d.ts +0 -201
  97. package/types/bricks/Svg.d.ts +0 -99
  98. package/types/bricks/Text.d.ts +0 -148
  99. package/types/bricks/TextInput.d.ts +0 -242
  100. package/types/bricks/Video.d.ts +0 -242
  101. package/types/bricks/VideoStreaming.d.ts +0 -112
  102. package/types/bricks/WebRtcStream.d.ts +0 -65
  103. package/types/bricks/WebView.d.ts +0 -168
  104. package/types/bricks/index.d.ts +0 -23
  105. package/types/canvas.d.ts +0 -82
  106. package/types/common.d.ts +0 -141
  107. package/types/data-calc-command/base.d.ts +0 -57
  108. package/types/data-calc-command/collection.d.ts +0 -418
  109. package/types/data-calc-command/color.d.ts +0 -432
  110. package/types/data-calc-command/constant.d.ts +0 -50
  111. package/types/data-calc-command/datetime.d.ts +0 -147
  112. package/types/data-calc-command/file.d.ts +0 -129
  113. package/types/data-calc-command/index.d.ts +0 -13
  114. package/types/data-calc-command/iteratee.d.ts +0 -23
  115. package/types/data-calc-command/logictype.d.ts +0 -190
  116. package/types/data-calc-command/math.d.ts +0 -275
  117. package/types/data-calc-command/object.d.ts +0 -119
  118. package/types/data-calc-command/sandbox.d.ts +0 -66
  119. package/types/data-calc-command/string.d.ts +0 -407
  120. package/types/data-calc-script.d.ts +0 -21
  121. package/types/data-calc.d.ts +0 -12
  122. package/types/data.d.ts +0 -97
  123. package/types/generators/AlarmClock.d.ts +0 -110
  124. package/types/generators/Assistant.d.ts +0 -640
  125. package/types/generators/BleCentral.d.ts +0 -247
  126. package/types/generators/BlePeripheral.d.ts +0 -208
  127. package/types/generators/CanvasMap.d.ts +0 -74
  128. package/types/generators/CastlesPay.d.ts +0 -87
  129. package/types/generators/DataBank.d.ts +0 -160
  130. package/types/generators/File.d.ts +0 -432
  131. package/types/generators/GraphQl.d.ts +0 -132
  132. package/types/generators/Http.d.ts +0 -222
  133. package/types/generators/HttpServer.d.ts +0 -230
  134. package/types/generators/Information.d.ts +0 -103
  135. package/types/generators/Intent.d.ts +0 -168
  136. package/types/generators/Iterator.d.ts +0 -108
  137. package/types/generators/Keyboard.d.ts +0 -105
  138. package/types/generators/LlmAnthropicCompat.d.ts +0 -212
  139. package/types/generators/LlmAppleBuiltin.d.ts +0 -159
  140. package/types/generators/LlmGgml.d.ts +0 -903
  141. package/types/generators/LlmMediaTekNeuroPilot.d.ts +0 -235
  142. package/types/generators/LlmMlx.d.ts +0 -228
  143. package/types/generators/LlmOnnx.d.ts +0 -213
  144. package/types/generators/LlmOpenAiCompat.d.ts +0 -312
  145. package/types/generators/LlmQualcommAiEngine.d.ts +0 -247
  146. package/types/generators/Mcp.d.ts +0 -637
  147. package/types/generators/McpServer.d.ts +0 -289
  148. package/types/generators/MediaFlow.d.ts +0 -170
  149. package/types/generators/MqttBroker.d.ts +0 -141
  150. package/types/generators/MqttClient.d.ts +0 -141
  151. package/types/generators/Question.d.ts +0 -408
  152. package/types/generators/RealtimeTranscription.d.ts +0 -287
  153. package/types/generators/RerankerGgml.d.ts +0 -195
  154. package/types/generators/SerialPort.d.ts +0 -151
  155. package/types/generators/SoundPlayer.d.ts +0 -94
  156. package/types/generators/SoundRecorder.d.ts +0 -139
  157. package/types/generators/SpeechToTextGgml.d.ts +0 -424
  158. package/types/generators/SpeechToTextOnnx.d.ts +0 -236
  159. package/types/generators/SpeechToTextPlatform.d.ts +0 -85
  160. package/types/generators/SqLite.d.ts +0 -159
  161. package/types/generators/Step.d.ts +0 -107
  162. package/types/generators/SttAppleBuiltin.d.ts +0 -153
  163. package/types/generators/Tcp.d.ts +0 -126
  164. package/types/generators/TcpServer.d.ts +0 -147
  165. package/types/generators/TextToSpeechAppleBuiltin.d.ts +0 -127
  166. package/types/generators/TextToSpeechGgml.d.ts +0 -221
  167. package/types/generators/TextToSpeechOnnx.d.ts +0 -178
  168. package/types/generators/TextToSpeechOpenAiLike.d.ts +0 -121
  169. package/types/generators/ThermalPrinter.d.ts +0 -193
  170. package/types/generators/Tick.d.ts +0 -83
  171. package/types/generators/Udp.d.ts +0 -120
  172. package/types/generators/VadGgml.d.ts +0 -260
  173. package/types/generators/VadOnnx.d.ts +0 -231
  174. package/types/generators/VadTraditional.d.ts +0 -138
  175. package/types/generators/VectorStore.d.ts +0 -257
  176. package/types/generators/Watchdog.d.ts +0 -107
  177. package/types/generators/WebCrawler.d.ts +0 -103
  178. package/types/generators/WebRtc.d.ts +0 -181
  179. package/types/generators/WebSocket.d.ts +0 -148
  180. package/types/generators/index.d.ts +0 -57
  181. package/types/index.d.ts +0 -13
  182. package/types/subspace.d.ts +0 -60
  183. package/types/switch.d.ts +0 -51
  184. package/types/system.d.ts +0 -707
  185. package/utils/__tests__/calc.test.js +0 -25
  186. package/utils/__tests__/id.test.js +0 -154
  187. package/utils/calc.ts +0 -130
  188. package/utils/data.ts +0 -495
  189. package/utils/event-props.ts +0 -912
  190. package/utils/id.ts +0 -133
@@ -1,231 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Local Voice Activity Detection (VAD) inference based on [transformers.js](https://huggingface.co/docs/transformers.js)
4
- * You can use any compatible VAD model from HuggingFace (Silero VAD, smart-turn, etc.)
5
- */
6
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
7
- import type { Data, DataLink } from '../data'
8
- import type {
9
- Brick,
10
- Generator,
11
- EventAction,
12
- ActionWithDataParams,
13
- ActionWithParams,
14
- Action,
15
- EventProperty,
16
- } from '../common'
17
- import type { TemplateEventPropsMap } from '../../utils/event-props'
18
-
19
- /* Load the model */
20
- export type GeneratorVadInferenceOnnxActionLoadModel = Action & {
21
- __actionName: 'GENERATOR_ONNX_VAD_LOAD_MODEL'
22
- }
23
-
24
- /* Detect speech in audio file */
25
- export type GeneratorVadInferenceOnnxActionDetectFile = ActionWithParams & {
26
- __actionName: 'GENERATOR_ONNX_VAD_DETECT_FILE'
27
- params?: Array<
28
- | {
29
- input: 'fileUrl'
30
- value?: string | DataLink | EventProperty
31
- mapping?: string
32
- }
33
- | {
34
- input: 'threshold'
35
- value?: number | DataLink | EventProperty
36
- mapping?: string
37
- }
38
- | {
39
- input: 'minSpeechDurationMs'
40
- value?: number | DataLink | EventProperty
41
- mapping?: string
42
- }
43
- | {
44
- input: 'minSilenceDurationMs'
45
- value?: number | DataLink | EventProperty
46
- mapping?: string
47
- }
48
- | {
49
- input: 'maxSpeechDurationS'
50
- value?: number | DataLink | EventProperty
51
- mapping?: string
52
- }
53
- | {
54
- input: 'speechPadMs'
55
- value?: number | DataLink | EventProperty
56
- mapping?: string
57
- }
58
- >
59
- }
60
-
61
- /* Detect speech in audio data */
62
- export type GeneratorVadInferenceOnnxActionDetectData = ActionWithParams & {
63
- __actionName: 'GENERATOR_ONNX_VAD_DETECT_DATA'
64
- params?: Array<
65
- | {
66
- input: 'data'
67
- value?: any | EventProperty
68
- mapping?: string
69
- }
70
- | {
71
- input: 'threshold'
72
- value?: number | DataLink | EventProperty
73
- mapping?: string
74
- }
75
- | {
76
- input: 'minSpeechDurationMs'
77
- value?: number | DataLink | EventProperty
78
- mapping?: string
79
- }
80
- | {
81
- input: 'minSilenceDurationMs'
82
- value?: number | DataLink | EventProperty
83
- mapping?: string
84
- }
85
- | {
86
- input: 'maxSpeechDurationS'
87
- value?: number | DataLink | EventProperty
88
- mapping?: string
89
- }
90
- | {
91
- input: 'speechPadMs'
92
- value?: number | DataLink | EventProperty
93
- mapping?: string
94
- }
95
- >
96
- }
97
-
98
- /* Clean cache */
99
- export type GeneratorVadInferenceOnnxActionCleanCache = Action & {
100
- __actionName: 'GENERATOR_ONNX_VAD_CLEAN_CACHE'
101
- }
102
-
103
- /* Release context */
104
- export type GeneratorVadInferenceOnnxActionReleaseContext = Action & {
105
- __actionName: 'GENERATOR_ONNX_VAD_RELEASE_CONTEXT'
106
- }
107
-
108
- interface GeneratorVadInferenceOnnxDef {
109
- /*
110
- Default property:
111
- {
112
- "modelType": "auto",
113
- "detectThreshold": 0.5,
114
- "detectMinSpeechDurationMs": 250,
115
- "detectMinSilenceDurationMs": 100,
116
- "detectMaxSpeechDurationS": 30,
117
- "detectSpeechPadMs": 30,
118
- "executionMode": "sequential"
119
- }
120
- */
121
- property?: {
122
- /* Initialize the VAD context on generator initialization */
123
- init?: boolean | DataLink
124
- /* VAD model */
125
- model?: string | DataLink
126
- /* Model type (auto-detected from config.json) */
127
- modelType?: string | DataLink
128
- /* Quantize type */
129
- quantizeType?:
130
- | 'auto'
131
- | 'none'
132
- | 'fp16'
133
- | 'q8'
134
- | 'int8'
135
- | 'uint8'
136
- | 'q4'
137
- | 'bnb4'
138
- | 'q4f16'
139
- | DataLink
140
- /* Speech probability threshold (0.0-1.0) */
141
- detectThreshold?: number | DataLink
142
- /* Minimum speech duration in milliseconds */
143
- detectMinSpeechDurationMs?: number | DataLink
144
- /* Minimum silence duration in milliseconds */
145
- detectMinSilenceDurationMs?: number | DataLink
146
- /* Maximum speech duration in seconds */
147
- detectMaxSpeechDurationS?: number | DataLink
148
- /* Padding around speech segments in milliseconds */
149
- detectSpeechPadMs?: number | DataLink
150
- /* Executor candidates, descending order of priority
151
- Default will be xnnpack, wasm, cpu */
152
- executors?:
153
- | Array<'qnn' | 'dml' | 'nnapi' | 'xnnpack' | 'coreml' | 'cpu' | 'wasm' | 'webgpu' | DataLink>
154
- | DataLink
155
- /* Execution mode
156
- Usually when the model has many branches, setting this option to `parallel` will give you better performance. */
157
- executionMode?: 'sequential' | 'parallel' | DataLink
158
- /* QNN backend */
159
- qnnBackend?: 'HTP' | 'HTA' | 'DSP' | 'GPU' | 'CPU' | DataLink
160
- /* Enable FP16 for QNN HTP */
161
- qnnHtpEnableFp16?: boolean | DataLink
162
- /* Enable QNN debug */
163
- qnnEnableDebug?: boolean | DataLink
164
- }
165
- events?: {
166
- /* Event triggered when context state changes */
167
- onContextStateChange?: Array<
168
- EventAction<string & keyof TemplateEventPropsMap['OnnxVad']['onContextStateChange']>
169
- >
170
- /* Event triggered when error occurs */
171
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['OnnxVad']['onError']>>
172
- /* Event triggered when got detection result */
173
- onDetected?: Array<EventAction<string & keyof TemplateEventPropsMap['OnnxVad']['onDetected']>>
174
- }
175
- outlets?: {
176
- /* Context state */
177
- contextState?: () => Data<string>
178
- /* Is detecting */
179
- isDetecting?: () => Data<boolean>
180
- /* Detection segments result */
181
- detectionSegments?: () => Data<
182
- Array<{
183
- start?: number
184
- end?: number
185
- confidence?: number
186
- t0?: number
187
- t1?: number
188
- [key: string]: any
189
- }>
190
- >
191
- /* Detection details */
192
- detectionDetails?: () => Data<{
193
- result?: string
194
- segments?: Array<{
195
- start?: number
196
- end?: number
197
- confidence?: number
198
- t0?: number
199
- t1?: number
200
- [key: string]: any
201
- }>
202
- time?: number
203
- startTime?: number
204
- endTime?: number
205
- [key: string]: any
206
- }>
207
- }
208
- }
209
-
210
- /* Local Voice Activity Detection (VAD) inference based on [transformers.js](https://huggingface.co/docs/transformers.js)
211
- You can use any compatible VAD model from HuggingFace (Silero VAD, smart-turn, etc.) */
212
- export type GeneratorVadInferenceOnnx = Generator &
213
- GeneratorVadInferenceOnnxDef & {
214
- templateKey: 'GENERATOR_ONNX_VAD'
215
- switches?: Array<
216
- SwitchDef &
217
- GeneratorVadInferenceOnnxDef & {
218
- conds?: Array<{
219
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
220
- cond:
221
- | SwitchCondInnerStateCurrentCanvas
222
- | SwitchCondData
223
- | {
224
- __typename: 'SwitchCondInnerStateOutlet'
225
- outlet: 'contextState' | 'isDetecting' | 'detectionSegments' | 'detectionDetails'
226
- value: any
227
- }
228
- }>
229
- }
230
- >
231
- }
@@ -1,138 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Traditional Voice Activity Detection (VAD) using pitch detection and RMS volume analysis
4
- * No model download required - pure algorithmic approach
5
- */
6
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
7
- import type { Data, DataLink } from '../data'
8
- import type {
9
- Brick,
10
- Generator,
11
- EventAction,
12
- ActionWithDataParams,
13
- ActionWithParams,
14
- Action,
15
- EventProperty,
16
- } from '../common'
17
- import type { TemplateEventPropsMap } from '../../utils/event-props'
18
-
19
- /* Detect speech in audio file */
20
- export type GeneratorVadInferenceTraditionalActionDetectFile = ActionWithParams & {
21
- __actionName: 'GENERATOR_TRADITIONAL_VAD_DETECT_FILE'
22
- params?: Array<{
23
- input: 'fileUrl'
24
- value?: string | DataLink | EventProperty
25
- mapping?: string
26
- }>
27
- }
28
-
29
- /* Detect speech in audio data stream */
30
- export type GeneratorVadInferenceTraditionalActionDetectData = ActionWithParams & {
31
- __actionName: 'GENERATOR_TRADITIONAL_VAD_DETECT_DATA'
32
- params?: Array<{
33
- input: 'data'
34
- value?: any | EventProperty
35
- mapping?: string
36
- }>
37
- }
38
-
39
- interface GeneratorVadInferenceTraditionalDef {
40
- /*
41
- Default property:
42
- {
43
- "detectVocalFreqMin": 75,
44
- "detectVocalFreqMax": 900,
45
- "detectThreshold": 0.5,
46
- "detectMinSpeechDurationMs": 250,
47
- "detectMinSilenceDurationMs": 100,
48
- "detectMaxSpeechDurationS": 30,
49
- "detectSpeechPadMs": 30
50
- }
51
- */
52
- property?: {
53
- /* Minimum vocal frequency in Hz */
54
- detectVocalFreqMin?: number | DataLink
55
- /* Maximum vocal frequency in Hz */
56
- detectVocalFreqMax?: number | DataLink
57
- /* Volume threshold in dB */
58
- detectVolumeThreshold?: number | DataLink
59
- /* Speech probability threshold (0.0-1.0) - maps to frequency clarity */
60
- detectThreshold?: number | DataLink
61
- /* Minimum speech duration in milliseconds */
62
- detectMinSpeechDurationMs?: number | DataLink
63
- /* Minimum silence duration in milliseconds */
64
- detectMinSilenceDurationMs?: number | DataLink
65
- /* Maximum speech duration in seconds */
66
- detectMaxSpeechDurationS?: number | DataLink
67
- /* Padding around speech segments in milliseconds */
68
- detectSpeechPadMs?: number | DataLink
69
- /* The file URL or path to be analyzed */
70
- detectFileUrl?: string | DataLink
71
- /* MD5 of file to be analyzed */
72
- detectFileMd5?: string | DataLink
73
- }
74
- events?: {
75
- /* Event triggered when context state changes */
76
- onContextStateChange?: Array<
77
- EventAction<string & keyof TemplateEventPropsMap['TraditionalVad']['onContextStateChange']>
78
- >
79
- /* Event triggered when detection result is available */
80
- onDetected?: Array<
81
- EventAction<string & keyof TemplateEventPropsMap['TraditionalVad']['onDetected']>
82
- >
83
- /* Event triggered when error occurs */
84
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['TraditionalVad']['onError']>>
85
- }
86
- outlets?: {
87
- /* Context state */
88
- contextState?: () => Data<string>
89
- /* Is detecting */
90
- isDetecting?: () => Data<boolean>
91
- /* Is speaking (real-time) */
92
- isSpeaking?: () => Data<boolean>
93
- /* Detection segments result */
94
- detectionSegments?: () => Data<
95
- Array<{
96
- t0?: number
97
- t1?: number
98
- [key: string]: any
99
- }>
100
- >
101
- /* Current volume in dB */
102
- currentVolume?: () => Data<number>
103
- /* Current frequency clarity (0-1) */
104
- currentClarity?: () => Data<number>
105
- /* Current detected frequency in Hz */
106
- currentFrequency?: () => Data<number>
107
- }
108
- }
109
-
110
- /* Traditional Voice Activity Detection (VAD) using pitch detection and RMS volume analysis
111
- No model download required - pure algorithmic approach */
112
- export type GeneratorVadInferenceTraditional = Generator &
113
- GeneratorVadInferenceTraditionalDef & {
114
- templateKey: 'GENERATOR_TRADITIONAL_VAD'
115
- switches?: Array<
116
- SwitchDef &
117
- GeneratorVadInferenceTraditionalDef & {
118
- conds?: Array<{
119
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
120
- cond:
121
- | SwitchCondInnerStateCurrentCanvas
122
- | SwitchCondData
123
- | {
124
- __typename: 'SwitchCondInnerStateOutlet'
125
- outlet:
126
- | 'contextState'
127
- | 'isDetecting'
128
- | 'isSpeaking'
129
- | 'detectionSegments'
130
- | 'currentVolume'
131
- | 'currentClarity'
132
- | 'currentFrequency'
133
- value: any
134
- }
135
- }>
136
- }
137
- >
138
- }
@@ -1,257 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Vector database for semantic search. Supports GGML (on-device GGUF models) and OpenAI Compatible API (OpenAI/ollama/llama.cpp) as embedding sources
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
- /* Load the model (Only if source is ggml) */
19
- export type GeneratorVectorStoreActionModelLoad = Action & {
20
- __actionName: 'GENERATOR_VECTOR_STORE_MODEL_LOAD'
21
- }
22
-
23
- /* Release the model (Only if source is ggml) */
24
- export type GeneratorVectorStoreActionModelRelease = Action & {
25
- __actionName: 'GENERATOR_VECTOR_STORE_MODEL_RELEASE'
26
- }
27
-
28
- /* Reset the embedding session */
29
- export type GeneratorVectorStoreActionReset = ActionWithParams & {
30
- __actionName: 'GENERATOR_VECTOR_STORE_RESET'
31
- params?: Array<{
32
- input: 'resetType'
33
- value?: 'session' | 'all' | DataLink | EventProperty
34
- mapping?: string
35
- }>
36
- }
37
-
38
- /* Insert file content with path or url, support Office / OpenOffice / PDF
39
-
40
- PDF is not currently supprted in iOS / Android */
41
- export type GeneratorVectorStoreActionInsertFile = ActionWithParams & {
42
- __actionName: 'GENERATOR_VECTOR_STORE_INSERT_FILE'
43
- params?: Array<
44
- | {
45
- input: 'filePath'
46
- value?: string | DataLink | EventProperty
47
- mapping?: string
48
- }
49
- | {
50
- input: 'fileName'
51
- value?: string | DataLink | EventProperty
52
- mapping?: string
53
- }
54
- | {
55
- input: 'fileExtension'
56
- value?: string | DataLink | EventProperty
57
- mapping?: string
58
- }
59
- | {
60
- input: 'chunkSize'
61
- value?: number | DataLink | EventProperty
62
- mapping?: string
63
- }
64
- >
65
- }
66
-
67
- /* Cancel the file download */
68
- export type GeneratorVectorStoreActionCancelFileDownload = Action & {
69
- __actionName: 'GENERATOR_VECTOR_STORE_CANCEL_FILE_DOWNLOAD'
70
- }
71
-
72
- /* Insert pure text content to vector store */
73
- export type GeneratorVectorStoreActionInsertContent = ActionWithParams & {
74
- __actionName: 'GENERATOR_VECTOR_STORE_INSERT_CONTENT'
75
- params?: Array<
76
- | {
77
- input: 'textContent'
78
- value?: string | DataLink | EventProperty
79
- mapping?: string
80
- }
81
- | {
82
- input: 'fileName'
83
- value?: string | DataLink | EventProperty
84
- mapping?: string
85
- }
86
- | {
87
- input: 'payload'
88
- value?: {} | DataLink | EventProperty
89
- mapping?: string
90
- }
91
- | {
92
- input: 'chunkSize'
93
- value?: number | DataLink | EventProperty
94
- mapping?: string
95
- }
96
- >
97
- }
98
-
99
- /* Remove file from vector store */
100
- export type GeneratorVectorStoreActionRemoveFile = ActionWithParams & {
101
- __actionName: 'GENERATOR_VECTOR_STORE_REMOVE_FILE'
102
- params?: Array<{
103
- input: 'fileName'
104
- value?: string | DataLink | EventProperty
105
- mapping?: string
106
- }>
107
- }
108
-
109
- /* Search similar text chunks in vector store */
110
- export type GeneratorVectorStoreActionSearch = ActionWithParams & {
111
- __actionName: 'GENERATOR_VECTOR_STORE_SEARCH'
112
- params?: Array<
113
- | {
114
- input: 'text'
115
- value?: string | DataLink | EventProperty
116
- mapping?: string
117
- }
118
- | {
119
- input: 'filename'
120
- value?: string | DataLink | EventProperty
121
- mapping?: string
122
- }
123
- | {
124
- input: 'limit'
125
- value?: number | DataLink | EventProperty
126
- mapping?: string
127
- }
128
- | {
129
- input: 'threshold'
130
- value?: number | DataLink | EventProperty
131
- mapping?: string
132
- }
133
- | {
134
- input: 'ignoreThreshold'
135
- value?: boolean | DataLink | EventProperty
136
- mapping?: string
137
- }
138
- >
139
- }
140
-
141
- interface GeneratorVectorStoreDef {
142
- /*
143
- Default property:
144
- {
145
- "source": "ggml",
146
- "ggmlContextSize": 512,
147
- "openaiBaseUrl": "https://api.openai.com/v1",
148
- "openaiModel": "text-embedding-3-small",
149
- "embedSessionId": "default-embeddings",
150
- "fileChunkSize": 256
151
- }
152
- */
153
- property?: {
154
- /* Initialize embedding model context & tokenizer context on subspace mounted */
155
- init?: boolean | DataLink
156
- /* Source of embedding model. Note that you can't use the saved embedddings data in different sources. */
157
- source?: 'ggml' | 'openai' | DataLink
158
- /* Path of ggml model */
159
- ggmlModelUrl?: string | DataLink
160
- /* Hash type of ggml model */
161
- ggmlModelHashType?: 'sha256' | 'sha1' | 'md5' | DataLink
162
- /* Hash of ggml model */
163
- ggmlModelHash?: string | DataLink
164
- /* Size of ggml context */
165
- ggmlContextSize?: number | DataLink
166
- /* Pooling type of ggml model */
167
- ggmlPoolingType?: 'none' | 'mean' | 'cls' | 'last' | 'rank' | DataLink
168
- /* GGML accelerator variant (Only for desktop)
169
- `default` - CPU / Metal (macOS)
170
- `vulkan` - Use Vulkan
171
- `cuda` - Use CUDA
172
- `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
173
- ggmlAccelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
174
- /* Devices. For example:
175
-
176
- Metal or CPU for iOS/tvOS/MacOS
177
- OpenCL or CPU for Android
178
- - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices)
179
- For Desktop, you may want to include/exclude GPUs */
180
- ggmlDevices?: Array<string | DataLink> | DataLink
181
- /* Normalize */
182
- ggmlEmbdNormalize?: number | DataLink
183
- /* API key of OpenAI Compatible API */
184
- openaiApiKey?: string | DataLink
185
- /* Base URL of OpenAI Compatible API. For example, we can use ollama / llama.cpp server instead of openai */
186
- openaiBaseUrl?: string | DataLink
187
- /* Model of OpenAI Compatible API */
188
- openaiModel?: 'text-embedding-3-small' | 'text-embedding-3-large' | DataLink
189
- /* Session ID of embedding */
190
- embedSessionId?: string | DataLink
191
- /* Storage type of embedding */
192
- embedStorageType?: 'file' | 'memory' | DataLink
193
- /* Tokenizer model URL (Recommended to use same with your LLM model, the model will just load with vocab_only mode) */
194
- tokenizerModelUrl?: string | DataLink
195
- /* Tokenizer model hash */
196
- tokenizerModelHash?: string | DataLink
197
- /* Tokenizer model hash type */
198
- tokenizerModelHashType?: 'sha256' | 'sha1' | 'md5' | DataLink
199
- /* Chunk size to handle file content (token), must be less then embedding model context size */
200
- fileChunkSize?: number | DataLink
201
- }
202
- events?: {
203
- /* Event triggered when error occurs */
204
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['VectorStore']['onError']>>
205
- }
206
- outlets?: {
207
- /* undefined */
208
- isReady?: () => Data<boolean>
209
- /* Whether the embedding is processing */
210
- processing?: () => Data<boolean>
211
- /* Progress of embedding processing */
212
- processProgress?: () => Data<{
213
- chunking?: number
214
- embedding?: number
215
- writing?: number
216
- [key: string]: any
217
- }>
218
- /* Files inserted to embedding */
219
- files?: () => Data<Array<string>>
220
- /* Search result */
221
- searchResult?: () => Data<
222
- Array<{
223
- sessionId?: string
224
- payload?: { [key: string]: any }
225
- filename?: string
226
- text?: string
227
- textTokenSize?: number
228
- fileTokenPos?: number
229
- fileTokenLength?: number
230
- distance?: number
231
- [key: string]: any
232
- }>
233
- >
234
- }
235
- }
236
-
237
- /* Vector database for semantic search. Supports GGML (on-device GGUF models) and OpenAI Compatible API (OpenAI/ollama/llama.cpp) as embedding sources */
238
- export type GeneratorVectorStore = Generator &
239
- GeneratorVectorStoreDef & {
240
- templateKey: 'GENERATOR_VECTOR_STORE'
241
- switches?: Array<
242
- SwitchDef &
243
- GeneratorVectorStoreDef & {
244
- conds?: Array<{
245
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
246
- cond:
247
- | SwitchCondInnerStateCurrentCanvas
248
- | SwitchCondData
249
- | {
250
- __typename: 'SwitchCondInnerStateOutlet'
251
- outlet: 'isReady' | 'processing' | 'processProgress' | 'files' | 'searchResult'
252
- value: any
253
- }
254
- }>
255
- }
256
- >
257
- }