@fugood/bricks-project 2.24.0-beta.2 → 2.24.0-beta.21

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 (110) hide show
  1. package/compile/action-name-map.ts +14 -0
  2. package/compile/index.ts +377 -129
  3. package/package.json +8 -3
  4. package/skills/bricks-project/rules/architecture-patterns.md +7 -0
  5. package/skills/bricks-project/rules/automations.md +74 -28
  6. package/skills/bricks-project/rules/buttress.md +9 -6
  7. package/tools/deploy.ts +39 -10
  8. package/tools/mcp-server.ts +10 -877
  9. package/tools/mcp-tools/compile.ts +91 -0
  10. package/tools/mcp-tools/huggingface.ts +762 -0
  11. package/tools/mcp-tools/icons.ts +60 -0
  12. package/tools/mcp-tools/lottie.ts +102 -0
  13. package/tools/mcp-tools/media.ts +110 -0
  14. package/tools/postinstall.ts +121 -33
  15. package/tools/preview-main.mjs +12 -8
  16. package/tools/pull.ts +37 -19
  17. package/tsconfig.json +16 -0
  18. package/types/animation.ts +4 -0
  19. package/types/automation.ts +3 -0
  20. package/types/brick-base.ts +1 -1
  21. package/types/bricks/Camera.ts +34 -7
  22. package/types/bricks/Chart.ts +1 -1
  23. package/types/bricks/GenerativeMedia.ts +6 -6
  24. package/types/bricks/Icon.ts +3 -3
  25. package/types/bricks/Image.ts +4 -4
  26. package/types/bricks/Items.ts +7 -7
  27. package/types/bricks/Lottie.ts +4 -4
  28. package/types/bricks/Maps.ts +4 -4
  29. package/types/bricks/QrCode.ts +4 -4
  30. package/types/bricks/Rect.ts +4 -4
  31. package/types/bricks/RichText.ts +3 -3
  32. package/types/bricks/Rive.ts +1 -1
  33. package/types/bricks/Slideshow.ts +4 -4
  34. package/types/bricks/Svg.ts +3 -3
  35. package/types/bricks/Text.ts +4 -4
  36. package/types/bricks/TextInput.ts +11 -7
  37. package/types/bricks/Video.ts +4 -4
  38. package/types/bricks/VideoStreaming.ts +3 -3
  39. package/types/bricks/WebRtcStream.ts +1 -1
  40. package/types/bricks/WebView.ts +4 -4
  41. package/types/canvas.ts +4 -2
  42. package/types/common.ts +9 -4
  43. package/types/data-calc-command.ts +2 -0
  44. package/types/data-calc.ts +1 -0
  45. package/types/data.ts +2 -0
  46. package/types/generators/AlarmClock.ts +5 -5
  47. package/types/generators/Assistant.ts +57 -12
  48. package/types/generators/BleCentral.ts +12 -4
  49. package/types/generators/BlePeripheral.ts +5 -5
  50. package/types/generators/CanvasMap.ts +4 -4
  51. package/types/generators/CastlesPay.ts +3 -3
  52. package/types/generators/DataBank.ts +31 -4
  53. package/types/generators/File.ts +63 -14
  54. package/types/generators/GraphQl.ts +3 -3
  55. package/types/generators/Http.ts +27 -8
  56. package/types/generators/HttpServer.ts +9 -9
  57. package/types/generators/Information.ts +2 -2
  58. package/types/generators/Intent.ts +8 -2
  59. package/types/generators/Iterator.ts +6 -6
  60. package/types/generators/Keyboard.ts +18 -8
  61. package/types/generators/LlmAnthropicCompat.ts +12 -6
  62. package/types/generators/LlmAppleBuiltin.ts +6 -6
  63. package/types/generators/LlmGgml.ts +75 -25
  64. package/types/generators/LlmMlx.ts +210 -0
  65. package/types/generators/LlmOnnx.ts +18 -9
  66. package/types/generators/LlmOpenAiCompat.ts +22 -6
  67. package/types/generators/LlmQualcommAiEngine.ts +32 -8
  68. package/types/generators/Mcp.ts +332 -17
  69. package/types/generators/McpServer.ts +38 -11
  70. package/types/generators/MediaFlow.ts +26 -8
  71. package/types/generators/MqttBroker.ts +10 -4
  72. package/types/generators/MqttClient.ts +11 -5
  73. package/types/generators/Question.ts +6 -6
  74. package/types/generators/RealtimeTranscription.ts +70 -11
  75. package/types/generators/RerankerGgml.ts +23 -9
  76. package/types/generators/SerialPort.ts +6 -6
  77. package/types/generators/SoundPlayer.ts +2 -2
  78. package/types/generators/SoundRecorder.ts +5 -5
  79. package/types/generators/SpeechToTextGgml.ts +34 -14
  80. package/types/generators/SpeechToTextOnnx.ts +8 -8
  81. package/types/generators/SpeechToTextPlatform.ts +4 -4
  82. package/types/generators/SqLite.ts +10 -6
  83. package/types/generators/Step.ts +3 -3
  84. package/types/generators/SttAppleBuiltin.ts +6 -6
  85. package/types/generators/Tcp.ts +5 -5
  86. package/types/generators/TcpServer.ts +7 -7
  87. package/types/generators/TextToSpeechApple.ts +1 -1
  88. package/types/generators/TextToSpeechAppleBuiltin.ts +5 -5
  89. package/types/generators/TextToSpeechGgml.ts +8 -8
  90. package/types/generators/TextToSpeechOnnx.ts +9 -9
  91. package/types/generators/TextToSpeechOpenAiLike.ts +5 -5
  92. package/types/generators/ThermalPrinter.ts +6 -6
  93. package/types/generators/Tick.ts +3 -3
  94. package/types/generators/Udp.ts +9 -4
  95. package/types/generators/VadGgml.ts +39 -10
  96. package/types/generators/VadOnnx.ts +31 -8
  97. package/types/generators/VadTraditional.ts +15 -9
  98. package/types/generators/VectorStore.ts +26 -9
  99. package/types/generators/Watchdog.ts +11 -6
  100. package/types/generators/WebCrawler.ts +5 -5
  101. package/types/generators/WebRtc.ts +17 -11
  102. package/types/generators/WebSocket.ts +5 -5
  103. package/types/generators/index.ts +1 -0
  104. package/types/subspace.ts +1 -0
  105. package/types/system.ts +1 -1
  106. package/utils/calc.ts +12 -8
  107. package/utils/event-props.ts +104 -87
  108. package/utils/id.ts +4 -0
  109. package/api/index.ts +0 -1
  110. package/api/instance.ts +0 -213
@@ -64,7 +64,7 @@ Default property:
64
64
  property?: {
65
65
  /* Initialize the TTS context on generator initialization */
66
66
  init?: boolean | DataLink
67
- /* TTS model
67
+ /* TTS model
68
68
  The mms-tts models are licensed under CC-BY-NC-4.0 */
69
69
  model?: string | DataLink
70
70
  /* Model type */
@@ -83,7 +83,7 @@ Default property:
83
83
  | DataLink
84
84
  /* Vocoder model for SpeechT5 */
85
85
  vocoderModel?: 'Custom' | 'speecht5_hifigan' | DataLink
86
- /* Custom vocoder model
86
+ /* Custom vocoder model
87
87
  Choose model from https://huggingface.co/models?library=transformers.js&other=hifigan */
88
88
  customVocoderModel?: string | DataLink
89
89
  /* Speaker embedding, for SpeechT5 or StyleTTS (Kokoro) */
@@ -116,12 +116,12 @@ Default property:
116
116
  softBreakRegex?: string | DataLink
117
117
  /* Time to force inference when softBreakRegex is not satisfied */
118
118
  hardBreakTime?: number | DataLink
119
- /* Executor candidates, descending order of priority
119
+ /* Executor candidates, descending order of priority
120
120
  Default will be xnnpack, wasm, cpu */
121
121
  executors?:
122
122
  | Array<'qnn' | 'dml' | 'nnapi' | 'xnnpack' | 'coreml' | 'cpu' | 'wasm' | 'webgpu' | DataLink>
123
123
  | DataLink
124
- /* Execution mode
124
+ /* Execution mode
125
125
  Usually when the model has many branches, setting this option to `parallel` will give you better performance. */
126
126
  executionMode?: 'sequential' | 'parallel' | DataLink
127
127
  /* QNN backend */
@@ -139,20 +139,20 @@ Default property:
139
139
  }
140
140
  outlets?: {
141
141
  /* Context state */
142
- contextState?: () => Data
142
+ contextState?: () => Data<string>
143
143
  /* Generated audio file */
144
- generatedAudio?: () => Data
144
+ generatedAudio?: () => Data<string>
145
145
  /* Generated audio file is playing */
146
- generatedAudioPlaying?: () => Data
146
+ generatedAudioPlaying?: () => Data<boolean>
147
147
  }
148
148
  }
149
149
 
150
- /* Local Text-to-Speech (TTS) inference based on ONNX Runtime and [transformers.js](https://huggingface.co/docs/transformers.js)
150
+ /* Local Text-to-Speech (TTS) inference based on ONNX Runtime and [transformers.js](https://huggingface.co/docs/transformers.js)
151
151
  You can use any converted model on HuggingFace. */
152
152
  export type GeneratorTTS = Generator &
153
153
  GeneratorTTSDef & {
154
154
  templateKey: 'GENERATOR_TTS'
155
- switches: Array<
155
+ switches?: Array<
156
156
  SwitchDef &
157
157
  GeneratorTTSDef & {
158
158
  conds?: Array<{
@@ -54,7 +54,7 @@ Default property:
54
54
  apiKey?: string | DataLink
55
55
  /* OpenAI TTS model */
56
56
  model?: string | DataLink
57
- /* Voice to use
57
+ /* Voice to use
58
58
  Select voice from https://openai.fm , default alloy */
59
59
  voice?: string | DataLink
60
60
  /* Additional instructions for the speech generation */
@@ -84,11 +84,11 @@ Default property:
84
84
  }
85
85
  outlets?: {
86
86
  /* Context state */
87
- contextState?: () => Data
87
+ contextState?: () => Data<string>
88
88
  /* Generated audio file */
89
- generatedAudio?: () => Data
89
+ generatedAudio?: () => Data<string>
90
90
  /* Generated audio file is playing */
91
- generatedAudioPlaying?: () => Data
91
+ generatedAudioPlaying?: () => Data<boolean>
92
92
  }
93
93
  }
94
94
 
@@ -96,7 +96,7 @@ Default property:
96
96
  export type GeneratorOpenAiTTS = Generator &
97
97
  GeneratorOpenAiTTSDef & {
98
98
  templateKey: 'GENERATOR_OPENAI_TTS'
99
- switches: Array<
99
+ switches?: Array<
100
100
  SwitchDef &
101
101
  GeneratorOpenAiTTSDef & {
102
102
  conds?: Array<{
@@ -85,7 +85,7 @@ Default property:
85
85
  pageHeight?: number | DataLink
86
86
  /* Cut mode at the end of printing */
87
87
  cutMode?: 'NONE' | 'FULL' | 'PARTIAL' | DataLink
88
- /* Print payload
88
+ /* Print payload
89
89
  example:
90
90
  { type: 'text', content: 'Hello, World!' }
91
91
  { type: 'feed', feedLines: 1 }
@@ -154,13 +154,13 @@ Default property:
154
154
  }
155
155
  outlets?: {
156
156
  /* Is thermal printer initialized */
157
- initialized?: () => Data
157
+ initialized?: () => Data<boolean>
158
158
  /* Thermal printer status */
159
- status?: () => Data
159
+ status?: () => Data<{ [key: string]: any }>
160
160
  /* Discovered devices */
161
- discoveredDevices?: () => Data
161
+ discoveredDevices?: () => Data<Array<{ [key: string]: any }>>
162
162
  /* Last error message */
163
- lastError?: () => Data
163
+ lastError?: () => Data<string>
164
164
  }
165
165
  }
166
166
 
@@ -168,7 +168,7 @@ Default property:
168
168
  export type GeneratorThermalPrinter = Generator &
169
169
  GeneratorThermalPrinterDef & {
170
170
  templateKey: 'GENERATOR_THERMAL_PRINTER'
171
- switches: Array<
171
+ switches?: Array<
172
172
  SwitchDef &
173
173
  GeneratorThermalPrinterDef & {
174
174
  conds?: Array<{
@@ -50,9 +50,9 @@ Default property:
50
50
  }
51
51
  outlets?: {
52
52
  /* Countdown step value */
53
- countdown?: () => Data
53
+ countdown?: () => Data<string | number>
54
54
  /* Is tick running? */
55
- running?: () => Data
55
+ running?: () => Data<boolean | string | number>
56
56
  }
57
57
  }
58
58
 
@@ -60,7 +60,7 @@ Default property:
60
60
  export type GeneratorTick = Generator &
61
61
  GeneratorTickDef & {
62
62
  templateKey: 'GENERATOR_TICK'
63
- switches: Array<
63
+ switches?: Array<
64
64
  SwitchDef &
65
65
  GeneratorTickDef & {
66
66
  conds?: Array<{
@@ -80,11 +80,16 @@ Default property:
80
80
  }
81
81
  outlets?: {
82
82
  /* Local UDP binded port */
83
- port?: () => Data
83
+ port?: () => Data<number>
84
84
  /* Last received packet */
85
- lastReceive?: () => Data
85
+ lastReceive?: () => Data<{
86
+ address?: string
87
+ port?: number
88
+ data?: any
89
+ [key: string]: any
90
+ }>
86
91
  /* Error message */
87
- errorMessage?: () => Data
92
+ errorMessage?: () => Data<string>
88
93
  }
89
94
  }
90
95
 
@@ -92,7 +97,7 @@ Default property:
92
97
  export type GeneratorUDP = Generator &
93
98
  GeneratorUDPDef & {
94
99
  templateKey: 'GENERATOR_UDP'
95
- switches: Array<
100
+ switches?: Array<
96
101
  SwitchDef &
97
102
  GeneratorUDPDef & {
98
103
  conds?: Array<{
@@ -127,14 +127,14 @@ Default property:
127
127
  }
128
128
  */
129
129
  property?: {
130
- /* Initialize the VAD context on generator initialization
130
+ /* Initialize the VAD context on generator initialization
131
131
  Please note that it will take some RAM depending on the model size */
132
132
  init?: boolean | DataLink
133
- /* Use model name, currently only supports the Silero VAD model.
133
+ /* Use model name, currently only supports the Silero VAD model.
134
134
  The model download progress will be done in preload stage or the generator initialization stage.
135
135
  You can also choose `custom` option and set `Model URL` and `Model SHA1` to use your own model */
136
136
  modelName?: 'custom' | 'silero-v6.2.0' | 'silero-v5.1.2' | DataLink
137
- /* The URL or path of model
137
+ /* The URL or path of model
138
138
  We used `ggml` format model, please refer to https://huggingface.co/ggml-org/whisper-vad */
139
139
  modelUrl?: string | DataLink
140
140
  /* Hash type of model */
@@ -157,7 +157,7 @@ Default property:
157
157
  detectSpeechPadMs?: number | DataLink
158
158
  /* Overlap between analysis windows (0.0-1.0) */
159
159
  detectSamplesOverlap?: number | DataLink
160
- /* The file URL or path to be analyzed.
160
+ /* The file URL or path to be analyzed.
161
161
  It only supported `wav` format with 16kHz sample rate & single (mono) channel */
162
162
  detectFileUrl?: string | DataLink
163
163
  /* MD5 of file to be analyzed */
@@ -173,15 +173,44 @@ Default property:
173
173
  }
174
174
  outlets?: {
175
175
  /* Context state */
176
- contextState?: () => Data
176
+ contextState?: () => Data<string>
177
177
  /* Context details */
178
- contextDetails?: () => Data
178
+ contextDetails?: () => Data<{
179
+ state?: string
180
+ contextId?: string
181
+ gpu?: string
182
+ reasonNoGPU?: string
183
+ [key: string]: any
184
+ }>
179
185
  /* Is detecting */
180
- isDetecting?: () => Data
186
+ isDetecting?: () => Data<boolean>
181
187
  /* Detection segments result */
182
- detectionSegments?: () => Data
188
+ detectionSegments?: () => Data<
189
+ Array<{
190
+ start?: number
191
+ end?: number
192
+ confidence?: number
193
+ t0?: number
194
+ t1?: number
195
+ [key: string]: any
196
+ }>
197
+ >
183
198
  /* Detection details */
184
- detectionDetails?: () => Data
199
+ detectionDetails?: () => Data<{
200
+ result?: string
201
+ segments?: Array<{
202
+ start?: number
203
+ end?: number
204
+ confidence?: number
205
+ t0?: number
206
+ t1?: number
207
+ [key: string]: any
208
+ }>
209
+ time?: number
210
+ startTime?: number
211
+ endTime?: number
212
+ [key: string]: any
213
+ }>
185
214
  }
186
215
  }
187
216
 
@@ -189,7 +218,7 @@ Default property:
189
218
  export type GeneratorVadInference = Generator &
190
219
  GeneratorVadInferenceDef & {
191
220
  templateKey: 'GENERATOR_VAD_INFERENCE'
192
- switches: Array<
221
+ switches?: Array<
193
222
  SwitchDef &
194
223
  GeneratorVadInferenceDef & {
195
224
  conds?: Array<{
@@ -142,12 +142,12 @@ Default property:
142
142
  detectMaxSpeechDurationS?: number | DataLink
143
143
  /* Padding around speech segments in milliseconds */
144
144
  detectSpeechPadMs?: number | DataLink
145
- /* Executor candidates, descending order of priority
145
+ /* Executor candidates, descending order of priority
146
146
  Default will be xnnpack, wasm, cpu */
147
147
  executors?:
148
148
  | Array<'qnn' | 'dml' | 'nnapi' | 'xnnpack' | 'coreml' | 'cpu' | 'wasm' | 'webgpu' | DataLink>
149
149
  | DataLink
150
- /* Execution mode
150
+ /* Execution mode
151
151
  Usually when the model has many branches, setting this option to `parallel` will give you better performance. */
152
152
  executionMode?: 'sequential' | 'parallel' | DataLink
153
153
  /* QNN backend */
@@ -167,22 +167,45 @@ Default property:
167
167
  }
168
168
  outlets?: {
169
169
  /* Context state */
170
- contextState?: () => Data
170
+ contextState?: () => Data<string>
171
171
  /* Is detecting */
172
- isDetecting?: () => Data
172
+ isDetecting?: () => Data<boolean>
173
173
  /* Detection segments result */
174
- detectionSegments?: () => Data
174
+ detectionSegments?: () => Data<
175
+ Array<{
176
+ start?: number
177
+ end?: number
178
+ confidence?: number
179
+ t0?: number
180
+ t1?: number
181
+ [key: string]: any
182
+ }>
183
+ >
175
184
  /* Detection details */
176
- detectionDetails?: () => Data
185
+ detectionDetails?: () => Data<{
186
+ result?: string
187
+ segments?: Array<{
188
+ start?: number
189
+ end?: number
190
+ confidence?: number
191
+ t0?: number
192
+ t1?: number
193
+ [key: string]: any
194
+ }>
195
+ time?: number
196
+ startTime?: number
197
+ endTime?: number
198
+ [key: string]: any
199
+ }>
177
200
  }
178
201
  }
179
202
 
180
- /* Local Voice Activity Detection (VAD) inference based on [transformers.js](https://huggingface.co/docs/transformers.js)
203
+ /* Local Voice Activity Detection (VAD) inference based on [transformers.js](https://huggingface.co/docs/transformers.js)
181
204
  You can use any compatible VAD model from HuggingFace (Silero VAD, smart-turn, etc.) */
182
205
  export type GeneratorVadInferenceOnnx = Generator &
183
206
  GeneratorVadInferenceOnnxDef & {
184
207
  templateKey: 'GENERATOR_ONNX_VAD'
185
- switches: Array<
208
+ switches?: Array<
186
209
  SwitchDef &
187
210
  GeneratorVadInferenceOnnxDef & {
188
211
  conds?: Array<{
@@ -76,28 +76,34 @@ Default property:
76
76
  }
77
77
  outlets?: {
78
78
  /* Context state */
79
- contextState?: () => Data
79
+ contextState?: () => Data<string>
80
80
  /* Is detecting */
81
- isDetecting?: () => Data
81
+ isDetecting?: () => Data<boolean>
82
82
  /* Is speaking (real-time) */
83
- isSpeaking?: () => Data
83
+ isSpeaking?: () => Data<boolean>
84
84
  /* Detection segments result */
85
- detectionSegments?: () => Data
85
+ detectionSegments?: () => Data<
86
+ Array<{
87
+ t0?: number
88
+ t1?: number
89
+ [key: string]: any
90
+ }>
91
+ >
86
92
  /* Current volume in dB */
87
- currentVolume?: () => Data
93
+ currentVolume?: () => Data<number>
88
94
  /* Current frequency clarity (0-1) */
89
- currentClarity?: () => Data
95
+ currentClarity?: () => Data<number>
90
96
  /* Current detected frequency in Hz */
91
- currentFrequency?: () => Data
97
+ currentFrequency?: () => Data<number>
92
98
  }
93
99
  }
94
100
 
95
- /* Traditional Voice Activity Detection (VAD) using pitch detection and RMS volume analysis
101
+ /* Traditional Voice Activity Detection (VAD) using pitch detection and RMS volume analysis
96
102
  No model download required - pure algorithmic approach */
97
103
  export type GeneratorVadInferenceTraditional = Generator &
98
104
  GeneratorVadInferenceTraditionalDef & {
99
105
  templateKey: 'GENERATOR_TRADITIONAL_VAD'
100
- switches: Array<
106
+ switches?: Array<
101
107
  SwitchDef &
102
108
  GeneratorVadInferenceTraditionalDef & {
103
109
  conds?: Array<{
@@ -31,7 +31,7 @@ export type GeneratorVectorStoreActionReset = ActionWithParams & {
31
31
  }>
32
32
  }
33
33
 
34
- /* Insert file content with path or url, support Office / OpenOffice / PDF
34
+ /* Insert file content with path or url, support Office / OpenOffice / PDF
35
35
 
36
36
  PDF is not currently supprted in iOS / Android */
37
37
  export type GeneratorVectorStoreActionInsertFile = ActionWithParams & {
@@ -161,13 +161,13 @@ Default property:
161
161
  ggmlContextSize?: number | DataLink
162
162
  /* Pooling type of ggml model */
163
163
  ggmlPoolingType?: 'none' | 'mean' | 'cls' | 'last' | 'rank' | DataLink
164
- /* GGML accelerator variant (Only for desktop)
164
+ /* GGML accelerator variant (Only for desktop)
165
165
  `default` - CPU / Metal (macOS)
166
166
  `vulkan` - Use Vulkan
167
167
  `cuda` - Use CUDA
168
168
  `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
169
169
  ggmlAccelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
170
- /* Devices. For example:
170
+ /* Devices. For example:
171
171
 
172
172
  Metal or CPU for iOS/tvOS/MacOS
173
173
  OpenCL or CPU for Android
@@ -201,15 +201,32 @@ Default property:
201
201
  }
202
202
  outlets?: {
203
203
  /* undefined */
204
- isReady?: () => Data
204
+ isReady?: () => Data<boolean>
205
205
  /* Whether the embedding is processing */
206
- processing?: () => Data
206
+ processing?: () => Data<boolean>
207
207
  /* Progress of embedding processing */
208
- processProgress?: () => Data
208
+ processProgress?: () => Data<{
209
+ chunking?: number
210
+ embedding?: number
211
+ writing?: number
212
+ [key: string]: any
213
+ }>
209
214
  /* Files inserted to embedding */
210
- files?: () => Data
215
+ files?: () => Data<Array<string>>
211
216
  /* Search result */
212
- searchResult?: () => Data
217
+ searchResult?: () => Data<
218
+ Array<{
219
+ sessionId?: string
220
+ payload?: { [key: string]: any }
221
+ filename?: string
222
+ text?: string
223
+ textTokenSize?: number
224
+ fileTokenPos?: number
225
+ fileTokenLength?: number
226
+ distance?: number
227
+ [key: string]: any
228
+ }>
229
+ >
213
230
  }
214
231
  }
215
232
 
@@ -217,7 +234,7 @@ Default property:
217
234
  export type GeneratorVectorStore = Generator &
218
235
  GeneratorVectorStoreDef & {
219
236
  templateKey: 'GENERATOR_VECTOR_STORE'
220
- switches: Array<
237
+ switches?: Array<
221
238
  SwitchDef &
222
239
  GeneratorVectorStoreDef & {
223
240
  conds?: Array<{
@@ -58,15 +58,20 @@ Default property:
58
58
  }
59
59
  outlets?: {
60
60
  /* The last event */
61
- lastEvent?: () => Data
61
+ lastEvent?: () => Data<{
62
+ id?: string
63
+ type?: string
64
+ triggerType?: string
65
+ timeout?: number
66
+ }>
62
67
  /* The type fo last event */
63
- lastEventType?: () => Data
68
+ lastEventType?: () => Data<string>
64
69
  /* The trigger type of last event */
65
- lastEventTriggerType?: () => Data
70
+ lastEventTriggerType?: () => Data<string>
66
71
  /* The sender id of last event */
67
- lastEventSenderId?: () => Data
72
+ lastEventSenderId?: () => Data<string>
68
73
  /* Is timed out */
69
- isTimedOut?: () => Data
74
+ isTimedOut?: () => Data<boolean>
70
75
  }
71
76
  }
72
77
 
@@ -74,7 +79,7 @@ Default property:
74
79
  export type GeneratorWatchdog = Generator &
75
80
  GeneratorWatchdogDef & {
76
81
  templateKey: 'GENERATOR_WATCHDOG'
77
- switches: Array<
82
+ switches?: Array<
78
83
  SwitchDef &
79
84
  GeneratorWatchdogDef & {
80
85
  conds?: Array<{
@@ -31,7 +31,7 @@ Default property:
31
31
  init?: boolean | DataLink
32
32
  /* URL of crawler request */
33
33
  url?: string | DataLink
34
- /* Method of crawler request
34
+ /* Method of crawler request
35
35
 
36
36
  Platform not supported for `webview`: tvOS, Desktop, Web */
37
37
  method?: 'webview' | 'http' | DataLink
@@ -68,11 +68,11 @@ Default property:
68
68
  }
69
69
  outlets?: {
70
70
  /* Response for CRAWLER request (selector) */
71
- response?: () => Data
71
+ response?: () => Data<string>
72
72
  /* Responses for CRAWLER request (selectorList) */
73
- responseList?: () => Data
73
+ responseList?: () => Data<Array<any>>
74
74
  /* The error response of CRAWLER request, it will save to property bank */
75
- error?: () => Data
75
+ error?: () => Data<string>
76
76
  }
77
77
  }
78
78
 
@@ -80,7 +80,7 @@ Default property:
80
80
  export type GeneratorWebCrawler = Generator &
81
81
  GeneratorWebCrawlerDef & {
82
82
  templateKey: 'GENERATOR_WEB_CRAWLER'
83
- switches: Array<
83
+ switches?: Array<
84
84
  SwitchDef &
85
85
  GeneratorWebCrawlerDef & {
86
86
  conds?: Array<{
@@ -63,7 +63,7 @@ Default property:
63
63
  localVideoTarget?: string | DataLink | (() => Brick)
64
64
  /* Target remote WebRTC stream brick ID */
65
65
  remoteVideoTarget?: string | DataLink | (() => Brick)
66
- /* ICE Server list
66
+ /* ICE Server list
67
67
  Default use Google public STUN servers if not setted. */
68
68
  iceServers?:
69
69
  | Array<
@@ -89,7 +89,7 @@ Default property:
89
89
  videoWidth?: number | DataLink
90
90
  /* Label of data channel */
91
91
  dataChannelLabel?: string | DataLink
92
- /* Input signal for create peer connection
92
+ /* Input signal for create peer connection
93
93
  Signal Types:
94
94
  `initiate`: Initiate a WebRTC call
95
95
  `offer`: WebRTC SDP offer
@@ -118,21 +118,27 @@ Default property:
118
118
  }
119
119
  outlets?: {
120
120
  /* Signal to create peer connection */
121
- signal?: () => Data
121
+ signal?: () => Data<any>
122
122
  /* Local SDP offer */
123
- sdpOffer?: () => Data
123
+ sdpOffer?: () => Data<{
124
+ type?: string
125
+ sdp?: string
126
+ }>
124
127
  /* Local SDP answer */
125
- sdpAnswer?: () => Data
128
+ sdpAnswer?: () => Data<{
129
+ type?: string
130
+ sdp?: string
131
+ }>
126
132
  /* Peer connection state */
127
- connectionState?: () => Data
133
+ connectionState?: () => Data<string>
128
134
  /* ICE connection state */
129
- iceConnectionState?: () => Data
135
+ iceConnectionState?: () => Data<string>
130
136
  /* Signaling state */
131
- signalingState?: () => Data
137
+ signalingState?: () => Data<string>
132
138
  /* Last message from data channel */
133
- lastChannelMessage?: () => Data
139
+ lastChannelMessage?: () => Data<string>
134
140
  /* Error message */
135
- errorMessage?: () => Data
141
+ errorMessage?: () => Data<string>
136
142
  }
137
143
  }
138
144
 
@@ -140,7 +146,7 @@ Default property:
140
146
  export type GeneratorWebRTC = Generator &
141
147
  GeneratorWebRTCDef & {
142
148
  templateKey: 'GENERATOR_WEBRTC'
143
- switches: Array<
149
+ switches?: Array<
144
150
  SwitchDef &
145
151
  GeneratorWebRTCDef & {
146
152
  conds?: Array<{
@@ -111,13 +111,13 @@ Default property:
111
111
  }
112
112
  outlets?: {
113
113
  /* Show socket.io connected or not */
114
- readyState?: () => Data
114
+ readyState?: () => Data<string>
115
115
  /* Results of each countdown change, it will save to Data */
116
- message?: () => Data
116
+ message?: () => Data<any>
117
117
  /* When Socket.IO mode server can response acknowledgemnt with data to client */
118
- acknowledgeData?: () => Data
118
+ acknowledgeData?: () => Data<{ [key: string]: any }>
119
119
  /* Error message */
120
- errorMessage?: () => Data
120
+ errorMessage?: () => Data<string>
121
121
  }
122
122
  }
123
123
 
@@ -125,7 +125,7 @@ Default property:
125
125
  export type GeneratorWebSocket = Generator &
126
126
  GeneratorWebSocketDef & {
127
127
  templateKey: 'GENERATOR_WEB_SOCKET'
128
- switches: Array<
128
+ switches?: Array<
129
129
  SwitchDef &
130
130
  GeneratorWebSocketDef & {
131
131
  conds?: Array<{
@@ -44,6 +44,7 @@ export * from './RealtimeTranscription'
44
44
  export * from './LlmGgml'
45
45
  export * from './TextToSpeechGgml'
46
46
  export * from './RerankerGgml'
47
+ export * from './LlmMlx'
47
48
  export * from './LlmQualcommAiEngine'
48
49
  export * from './LlmOpenAiCompat'
49
50
  export * from './TextToSpeechOpenAiLike'
package/types/subspace.ts CHANGED
@@ -9,6 +9,7 @@ export type Subspace = {
9
9
  id: string
10
10
  title: string
11
11
  description?: string
12
+ hideShortRef?: boolean
12
13
  // Unexpanded information in Editor
13
14
  unexpanded?: {
14
15
  data?: boolean
package/types/system.ts CHANGED
@@ -276,7 +276,7 @@ export type SystemActionPopupReset = ActionWithParams & {
276
276
  >
277
277
  }
278
278
 
279
- /* Take screenshot for current subspace */
279
+ /* Take screenshot for current subspace or the full viewport (including portal subspaces) */
280
280
  export type SystemActionTakeScreenshot = ActionWithParams & {
281
281
  __actionName: 'TAKE_SCREENSHOT'
282
282
  params?: Array<
package/utils/calc.ts CHANGED
@@ -33,10 +33,12 @@ export const generateDataCalculationMapEditorInfo = (
33
33
  nodes.forEach((node) => {
34
34
  // Count and track inputs
35
35
  if ('inputs' in node) {
36
- const inputs = node.inputs
37
- .filter((input) => input !== null)
38
- .map((input) => (Array.isArray(input) ? input.length : 1))
39
- .reduce((sum, count) => sum + count, 0)
36
+ let inputs = 0
37
+ for (const input of node.inputs) {
38
+ if (input === null) continue
39
+ if (Array.isArray(input)) inputs += input.length
40
+ else inputs += 1
41
+ }
40
42
  inputCounts.set(node, inputs)
41
43
 
42
44
  // Track connections
@@ -59,10 +61,12 @@ export const generateDataCalculationMapEditorInfo = (
59
61
 
60
62
  // Count outputs
61
63
  if ('outputs' in node) {
62
- const outputs = node.outputs
63
- .filter((output) => output !== null)
64
- .map((output) => (Array.isArray(output) ? output.length : 1))
65
- .reduce((sum, count) => sum + count, 0)
64
+ let outputs = 0
65
+ for (const output of node.outputs) {
66
+ if (output === null) continue
67
+ if (Array.isArray(output)) outputs += output.length
68
+ else outputs += 1
69
+ }
66
70
  outputCounts.set(node, outputs)
67
71
  } else {
68
72
  outputCounts.set(node, 0)