@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,193 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * ESC/POS thermal receipt printer control via Bluetooth or USB
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
- /* Init thermal printer connection */
19
- export type GeneratorThermalPrinterActionInit = Action & {
20
- __actionName: 'GENERATOR_THERMAL_PRINTER_INIT'
21
- }
22
-
23
- /* Scan thermal printer */
24
- export type GeneratorThermalPrinterActionScan = Action & {
25
- __actionName: 'GENERATOR_THERMAL_PRINTER_SCAN'
26
- }
27
-
28
- /* Dispose thermal printer connection */
29
- export type GeneratorThermalPrinterActionDispose = Action & {
30
- __actionName: 'GENERATOR_THERMAL_PRINTER_DISPOSE'
31
- }
32
-
33
- /* Start print */
34
- export type GeneratorThermalPrinterActionPrint = ActionWithParams & {
35
- __actionName: 'GENERATOR_THERMAL_PRINTER_PRINT'
36
- params?: Array<
37
- | {
38
- input: 'options'
39
- value?: {} | DataLink | EventProperty
40
- mapping?: string
41
- }
42
- | {
43
- input: 'payload'
44
- value?: Array<any> | DataLink | EventProperty
45
- mapping?: string
46
- }
47
- | {
48
- input: 'rawCommands'
49
- value?: string | DataLink | EventProperty
50
- mapping?: string
51
- }
52
- >
53
- }
54
-
55
- /* Check thermal printer status */
56
- export type GeneratorThermalPrinterActionCheckStatus = Action & {
57
- __actionName: 'GENERATOR_THERMAL_PRINTER_CHECK_STATUS'
58
- }
59
-
60
- interface GeneratorThermalPrinterDef {
61
- /*
62
- Default property:
63
- {
64
- "init": false,
65
- "lang": "ANK",
66
- "scanTimeout": 5000,
67
- "stateUpdateInterval": 5000,
68
- "cutMode": "PARTIAL"
69
- }
70
- */
71
- property?: {
72
- /* Connect printer on generator initialized */
73
- init?: boolean | DataLink
74
- /* Connection driver (`castles` driver: built-in or WiFi printer on Castles Saturn PDA) */
75
- driver?: 'escpos' | 'star' | 'tsc' | 'castles' | DataLink
76
- /* The address of the printer (For castles driver: `mode=builtin` (Saturn 1000) or `mode=wifi` (Saturn 7000); optional `heatLevel=1-5`, default 3) */
77
- connectString?: string | DataLink
78
- /* The language of the printer (only for EPSON and TSC drivers) */
79
- lang?: 'ANK' | 'CHINESE' | 'TAIWAN' | 'KOREAN' | 'THAI' | 'SOUTHASIA' | DataLink
80
- /* The timeout of scanning */
81
- scanTimeout?: number | DataLink
82
- /* State update interval, 0 means no update automatically */
83
- stateUpdateInterval?: number | DataLink
84
- /* Enable page mode on printing */
85
- pageMode?: boolean | DataLink
86
- /* Printable page area width */
87
- pageWidth?: number | DataLink
88
- /* Printable page area height */
89
- pageHeight?: number | DataLink
90
- /* Cut mode at the end of printing */
91
- cutMode?: 'NONE' | 'FULL' | 'PARTIAL' | DataLink
92
- /* Print payload
93
- example:
94
- { type: 'text', content: 'Hello, World!' }
95
- { type: 'feed', feedLines: 1 }
96
- { type: 'reverse-feed', feedLines: 1 }
97
- { type: 'image', content: '/path/to/file' }
98
- { type: 'line-space', lineSpace: 1 }
99
- { type: 'barcode', content: '1234567890', barcodeType: 'CODE128' }
100
- { type: 'symbol', content: '1234567890', symbolType: 'QRCODE' }
101
- Notes:
102
- - `reverse-feed` works on ESC/POS driver and castles driver (line mode only)
103
- - `width` and `height` in Star driver is magnification factor
104
- - `y` position in ESC/POS is use feed lines to offset
105
- - `textFont` only works on TSC driver
106
- - castles driver: `image` requires `height` in line mode
107
- - castles driver: `UPC_A`, `UPC_E`, `ITF` barcode types are not supported */
108
- payload?:
109
- | Array<
110
- | DataLink
111
- | {
112
- type?:
113
- | 'text'
114
- | 'image'
115
- | 'barcode'
116
- | 'qrcode'
117
- | 'line-space'
118
- | 'feed'
119
- | 'reverse-feed'
120
- | DataLink
121
- content?: string | DataLink
122
- width?: number | DataLink
123
- height?: number | DataLink
124
- x?: number | DataLink
125
- y?: number | DataLink
126
- align?: 'LEFT' | 'CENTER' | 'RIGHT' | DataLink
127
- textSmooth?: boolean | DataLink
128
- textEmphasize?: boolean | DataLink
129
- textUnderline?: boolean | DataLink
130
- textLang?: 'EN' | 'JA' | 'ZH_CN' | 'ZH_TW' | 'KO' | 'TH' | 'VI' | 'MULTI' | DataLink
131
- textFont?: string | DataLink
132
- barcodeType?:
133
- | 'CODE39'
134
- | 'CODE93'
135
- | 'CODE128'
136
- | 'EAN13'
137
- | 'JAN13'
138
- | 'EAN8'
139
- | 'JAN8'
140
- | 'UPC_A'
141
- | 'UPC_E'
142
- | 'ITF'
143
- | DataLink
144
- barcodeHRI?: 'OFF' | 'ABOVE' | 'BELOW' | 'BOTH' | DataLink
145
- qrcodeModel?: '1' | '2' | DataLink
146
- qrcodeSize?: number | DataLink
147
- qrcodeLevel?: 'L' | 'M' | 'Q' | 'H' | DataLink
148
- qrcodeMask?: 'S0' | 'S1' | 'S2' | 'S3' | 'S4' | 'S5' | 'S6' | 'S7' | DataLink
149
- feedLines?: number | DataLink
150
- lineSpace?: number | DataLink
151
- }
152
- >
153
- | DataLink
154
- /* Raw ASCII commands to print (not supported on castles driver) */
155
- rawCommands?: string | DataLink
156
- }
157
- events?: {
158
- /* Event of connection error */
159
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['ThermalPrinter']['onError']>>
160
- }
161
- outlets?: {
162
- /* Is thermal printer initialized */
163
- initialized?: () => Data<boolean>
164
- /* Thermal printer status */
165
- status?: () => Data<{ [key: string]: any }>
166
- /* Discovered devices */
167
- discoveredDevices?: () => Data<Array<{ [key: string]: any }>>
168
- /* Last error message */
169
- lastError?: () => Data<string>
170
- }
171
- }
172
-
173
- /* ESC/POS thermal receipt printer control via Bluetooth or USB */
174
- export type GeneratorThermalPrinter = Generator &
175
- GeneratorThermalPrinterDef & {
176
- templateKey: 'GENERATOR_THERMAL_PRINTER'
177
- switches?: Array<
178
- SwitchDef &
179
- GeneratorThermalPrinterDef & {
180
- conds?: Array<{
181
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
182
- cond:
183
- | SwitchCondInnerStateCurrentCanvas
184
- | SwitchCondData
185
- | {
186
- __typename: 'SwitchCondInnerStateOutlet'
187
- outlet: 'initialized' | 'status' | 'discoveredDevices' | 'lastError'
188
- value: any
189
- }
190
- }>
191
- }
192
- >
193
- }
@@ -1,83 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Periodic timer that triggers events at a configurable interval
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 the tick */
19
- export type GeneratorTickAction_ = Action & {
20
- __actionName: 'GENERATOR_TICK'
21
- }
22
-
23
- /* Cancel the tick */
24
- export type GeneratorTickActionCancel = Action & {
25
- __actionName: 'GENERATOR_TICK_CANCEL'
26
- }
27
-
28
- interface GeneratorTickDef {
29
- /*
30
- Default property:
31
- {}
32
- */
33
- property?: {
34
- /* Start tick on generator initialized */
35
- init?: boolean | DataLink
36
- /* Tick interval in milliseconds for countdown */
37
- interval?: number | DataLink
38
- /* Initial value of countdown */
39
- countdownStartValue?: number | DataLink
40
- /* Interval of value for countdown */
41
- countdownInterval?: number | DataLink
42
- /* Make countdown repeatable */
43
- repeat?: boolean | DataLink
44
- /* Map for PROPERTY_BANK_RESULT */
45
- map?: {} | DataLink
46
- /* Fallback of MAP_OBJECT */
47
- mapFallback?: any
48
- }
49
- events?: {
50
- /* Event for each tick start */
51
- ticking?: Array<EventAction<string & keyof TemplateEventPropsMap['Tick']['ticking']>>
52
- /* Event for tick completed */
53
- completed?: Array<EventAction<string & keyof TemplateEventPropsMap['Tick']['completed']>>
54
- }
55
- outlets?: {
56
- /* Countdown step value */
57
- countdown?: () => Data<string | number>
58
- /* Is tick running? */
59
- running?: () => Data<boolean | string | number>
60
- }
61
- }
62
-
63
- /* Periodic timer that triggers events at a configurable interval */
64
- export type GeneratorTick = Generator &
65
- GeneratorTickDef & {
66
- templateKey: 'GENERATOR_TICK'
67
- switches?: Array<
68
- SwitchDef &
69
- GeneratorTickDef & {
70
- conds?: Array<{
71
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
72
- cond:
73
- | SwitchCondInnerStateCurrentCanvas
74
- | SwitchCondData
75
- | {
76
- __typename: 'SwitchCondInnerStateOutlet'
77
- outlet: 'countdown' | 'running'
78
- value: any
79
- }
80
- }>
81
- }
82
- >
83
- }
@@ -1,120 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * UDP socket communication
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
- /* Bind UDP port */
19
- export type GeneratorUDPActionBind = Action & {
20
- __actionName: 'GENERATOR_UDP_BIND'
21
- }
22
-
23
- /* Send data to target */
24
- export type GeneratorUDPActionSend = ActionWithParams & {
25
- __actionName: 'GENERATOR_UDP_SEND'
26
- params?: Array<
27
- | {
28
- input: 'targetHost'
29
- value?: string | DataLink | EventProperty
30
- mapping?: string
31
- }
32
- | {
33
- input: 'targetPort'
34
- value?: number | DataLink | EventProperty
35
- mapping?: string
36
- }
37
- | {
38
- input: 'sendData'
39
- value?: string | DataLink | EventProperty
40
- mapping?: string
41
- }
42
- >
43
- }
44
-
45
- /* Close UDP */
46
- export type GeneratorUDPActionClose = Action & {
47
- __actionName: 'GENERATOR_UDP_CLOSE'
48
- }
49
-
50
- interface GeneratorUDPDef {
51
- /*
52
- Default property:
53
- {
54
- "init": false,
55
- "type": "udp4",
56
- "encoding": "base64",
57
- "broadcast": false,
58
- "multicast": ""
59
- }
60
- */
61
- property?: {
62
- /* Bind port on generator initialized */
63
- init?: boolean | DataLink
64
- /* The family of socket */
65
- type?: 'udp4' | 'udp6' | DataLink
66
- /* Encoding of data */
67
- encoding?: 'base64' | 'utf8' | 'ascii' | DataLink
68
- /* Local bind port of UDP (0 or empty is random) */
69
- localPort?: number | DataLink
70
- /* Enable receive broadcast packets */
71
- broadcast?: boolean | DataLink
72
- /* Join multicast group (Multicast address) */
73
- multicast?: string | DataLink
74
- }
75
- events?: {
76
- /* Event of UDP port is binded */
77
- onReady?: Array<EventAction>
78
- /* Event of receive data */
79
- onData?: Array<EventAction<string & keyof TemplateEventPropsMap['Udp']['onData']>>
80
- /* Event of socket closeed */
81
- onClose?: Array<EventAction>
82
- /* Event of socket error */
83
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Udp']['onError']>>
84
- }
85
- outlets?: {
86
- /* Local UDP binded port */
87
- port?: () => Data<number>
88
- /* Last received packet */
89
- lastReceive?: () => Data<{
90
- address?: string
91
- port?: number
92
- data?: any
93
- [key: string]: any
94
- }>
95
- /* Error message */
96
- errorMessage?: () => Data<string>
97
- }
98
- }
99
-
100
- /* UDP socket communication */
101
- export type GeneratorUDP = Generator &
102
- GeneratorUDPDef & {
103
- templateKey: 'GENERATOR_UDP'
104
- switches?: Array<
105
- SwitchDef &
106
- GeneratorUDPDef & {
107
- conds?: Array<{
108
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
109
- cond:
110
- | SwitchCondInnerStateCurrentCanvas
111
- | SwitchCondData
112
- | {
113
- __typename: 'SwitchCondInnerStateOutlet'
114
- outlet: 'port' | 'lastReceive' | 'errorMessage'
115
- value: any
116
- }
117
- }>
118
- }
119
- >
120
- }
@@ -1,260 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Local Voice Activity Detection (VAD) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)
4
- *
5
- * ## Notice
6
- * - Web: Supported with WASM CPU in Web Preview.
7
- * - WebGPU is not used for browser VAD; the wasm package falls back to CPU for the VAD graph.
8
- * - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable.
9
- */
10
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
11
- import type { Data, DataLink } from '../data'
12
- import type {
13
- Brick,
14
- Generator,
15
- EventAction,
16
- ActionWithDataParams,
17
- ActionWithParams,
18
- Action,
19
- EventProperty,
20
- } from '../common'
21
- import type { TemplateEventPropsMap } from '../../utils/event-props'
22
-
23
- /* Load the model */
24
- export type GeneratorVadInferenceActionLoadModel = Action & {
25
- __actionName: 'GENERATOR_VAD_INFERENCE_LOAD_MODEL'
26
- }
27
-
28
- /* Detect speech in audio file. You can provide `File URL` property, if not provided, it will use the default `File URL` */
29
- export type GeneratorVadInferenceActionDetectFile = ActionWithParams & {
30
- __actionName: 'GENERATOR_VAD_INFERENCE_DETECT_FILE'
31
- params?: Array<
32
- | {
33
- input: 'fileUrl'
34
- value?: string | DataLink | EventProperty
35
- mapping?: string
36
- }
37
- | {
38
- input: 'threshold'
39
- value?: number | DataLink | EventProperty
40
- mapping?: string
41
- }
42
- | {
43
- input: 'minSpeechDurationMs'
44
- value?: number | DataLink | EventProperty
45
- mapping?: string
46
- }
47
- | {
48
- input: 'minSilenceDurationMs'
49
- value?: number | DataLink | EventProperty
50
- mapping?: string
51
- }
52
- | {
53
- input: 'maxSpeechDurationS'
54
- value?: number | DataLink | EventProperty
55
- mapping?: string
56
- }
57
- | {
58
- input: 'speechPadMs'
59
- value?: number | DataLink | EventProperty
60
- mapping?: string
61
- }
62
- | {
63
- input: 'samplesOverlap'
64
- value?: number | DataLink | EventProperty
65
- mapping?: string
66
- }
67
- >
68
- }
69
-
70
- /* Detect speech in audio data. Currently only support base64 encoded audio data (16-bit PCM, mono, 16kHz) */
71
- export type GeneratorVadInferenceActionDetectData = ActionWithParams & {
72
- __actionName: 'GENERATOR_VAD_INFERENCE_DETECT_DATA'
73
- params?: Array<
74
- | {
75
- input: 'data'
76
- value?: any | EventProperty
77
- mapping?: string
78
- }
79
- | {
80
- input: 'threshold'
81
- value?: number | DataLink | EventProperty
82
- mapping?: string
83
- }
84
- | {
85
- input: 'minSpeechDurationMs'
86
- value?: number | DataLink | EventProperty
87
- mapping?: string
88
- }
89
- | {
90
- input: 'minSilenceDurationMs'
91
- value?: number | DataLink | EventProperty
92
- mapping?: string
93
- }
94
- | {
95
- input: 'maxSpeechDurationS'
96
- value?: number | DataLink | EventProperty
97
- mapping?: string
98
- }
99
- | {
100
- input: 'speechPadMs'
101
- value?: number | DataLink | EventProperty
102
- mapping?: string
103
- }
104
- | {
105
- input: 'samplesOverlap'
106
- value?: number | DataLink | EventProperty
107
- mapping?: string
108
- }
109
- >
110
- }
111
-
112
- /* Clear downloaded files (model, audio) & current jobs */
113
- export type GeneratorVadInferenceActionClearDownload = Action & {
114
- __actionName: 'GENERATOR_VAD_INFERENCE_CLEAR_DOWNLOAD'
115
- }
116
-
117
- /* Release context */
118
- export type GeneratorVadInferenceActionReleaseContext = Action & {
119
- __actionName: 'GENERATOR_VAD_INFERENCE_RELEASE_CONTEXT'
120
- }
121
-
122
- interface GeneratorVadInferenceDef {
123
- /*
124
- Default property:
125
- {
126
- "init": false,
127
- "modelName": "silero-v6.2.0",
128
- "modelUseGPU": true,
129
- "modelThreads": 4,
130
- "detectThreshold": 0.5,
131
- "detectMinSpeechDurationMs": 250,
132
- "detectMinSilenceDurationMs": 100,
133
- "detectMaxSpeechDurationS": 30,
134
- "detectSpeechPadMs": 30,
135
- "detectSamplesOverlap": 0.1
136
- }
137
- */
138
- property?: {
139
- /* Initialize the VAD context on generator initialization
140
- Please note that it will take some RAM depending on the model size */
141
- init?: boolean | DataLink
142
- /* Use model name, currently only supports the Silero VAD model.
143
- The model download progress will be done in preload stage or the generator initialization stage.
144
- You can also choose `custom` option and set `Model URL` and `Model SHA1` to use your own model */
145
- modelName?: 'custom' | 'silero-v6.2.0' | 'silero-v5.1.2' | DataLink
146
- /* The URL or path of model
147
- We used `ggml` format model, please refer to https://huggingface.co/ggml-org/whisper-vad */
148
- modelUrl?: string | DataLink
149
- /* Hash type of model */
150
- modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
151
- /* Hash of model */
152
- modelHash?: string | DataLink
153
- /* Use GPU Acceleration for inference. Currently iOS only. */
154
- modelUseGPU?: boolean | DataLink
155
- /* Number of threads to use for processing */
156
- modelThreads?: number | DataLink
157
- /* Speech probability threshold (0.0-1.0) */
158
- detectThreshold?: number | DataLink
159
- /* Minimum speech duration in milliseconds */
160
- detectMinSpeechDurationMs?: number | DataLink
161
- /* Minimum silence duration in milliseconds */
162
- detectMinSilenceDurationMs?: number | DataLink
163
- /* Maximum speech duration in seconds */
164
- detectMaxSpeechDurationS?: number | DataLink
165
- /* Padding around speech segments in milliseconds */
166
- detectSpeechPadMs?: number | DataLink
167
- /* Overlap between analysis windows (0.0-1.0) */
168
- detectSamplesOverlap?: number | DataLink
169
- /* The file URL or path to be analyzed.
170
- It only supported `wav` format with 16kHz sample rate & single (mono) channel */
171
- detectFileUrl?: string | DataLink
172
- /* MD5 of file to be analyzed */
173
- detectFileMd5?: string | DataLink
174
- }
175
- events?: {
176
- /* Event triggered when context state changes */
177
- onContextStateChange?: Array<
178
- EventAction<string & keyof TemplateEventPropsMap['VadInference']['onContextStateChange']>
179
- >
180
- /* Event triggered when error occurs */
181
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['VadInference']['onError']>>
182
- /* Event triggered when got detection result */
183
- onDetected?: Array<
184
- EventAction<string & keyof TemplateEventPropsMap['VadInference']['onDetected']>
185
- >
186
- }
187
- outlets?: {
188
- /* Context state */
189
- contextState?: () => Data<string>
190
- /* Context details */
191
- contextDetails?: () => Data<{
192
- state?: string
193
- contextId?: string
194
- gpu?: string
195
- reasonNoGPU?: string
196
- [key: string]: any
197
- }>
198
- /* Is detecting */
199
- isDetecting?: () => Data<boolean>
200
- /* Detection segments result */
201
- detectionSegments?: () => Data<
202
- Array<{
203
- start?: number
204
- end?: number
205
- confidence?: number
206
- t0?: number
207
- t1?: number
208
- [key: string]: any
209
- }>
210
- >
211
- /* Detection details */
212
- detectionDetails?: () => Data<{
213
- result?: string
214
- segments?: Array<{
215
- start?: number
216
- end?: number
217
- confidence?: number
218
- t0?: number
219
- t1?: number
220
- [key: string]: any
221
- }>
222
- time?: number
223
- startTime?: number
224
- endTime?: number
225
- [key: string]: any
226
- }>
227
- }
228
- }
229
-
230
- /* Local Voice Activity Detection (VAD) inference based on GGML and [whisper.cpp](https://github.com/ggerganov/whisper.cpp)
231
-
232
- ## Notice
233
- - Web: Supported with WASM CPU in Web Preview.
234
- - WebGPU is not used for browser VAD; the wasm package falls back to CPU for the VAD graph.
235
- - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable. */
236
- export type GeneratorVadInference = Generator &
237
- GeneratorVadInferenceDef & {
238
- templateKey: 'GENERATOR_VAD_INFERENCE'
239
- switches?: Array<
240
- SwitchDef &
241
- GeneratorVadInferenceDef & {
242
- conds?: Array<{
243
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
244
- cond:
245
- | SwitchCondInnerStateCurrentCanvas
246
- | SwitchCondData
247
- | {
248
- __typename: 'SwitchCondInnerStateOutlet'
249
- outlet:
250
- | 'contextState'
251
- | 'contextDetails'
252
- | 'isDetecting'
253
- | 'detectionSegments'
254
- | 'detectionDetails'
255
- value: any
256
- }
257
- }>
258
- }
259
- >
260
- }