@fugood/bricks-project 2.24.0-beta.9 → 2.24.0

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 (123) hide show
  1. package/compile/action-name-map.ts +38 -0
  2. package/compile/index.ts +460 -158
  3. package/compile/util.ts +2 -0
  4. package/package.json +7 -3
  5. package/package.json.bak +27 -0
  6. package/skills/{bricks-project → bricks-ctor}/SKILL.md +2 -2
  7. package/skills/{bricks-project → bricks-ctor}/rules/animation.md +1 -1
  8. package/skills/{bricks-project → bricks-ctor}/rules/architecture-patterns.md +7 -0
  9. package/skills/{bricks-project → bricks-ctor}/rules/buttress.md +10 -7
  10. package/skills/{bricks-project → bricks-ctor}/rules/data-calculation.md +1 -1
  11. package/skills/{bricks-project → bricks-ctor}/rules/local-sync.md +2 -2
  12. package/skills/{bricks-project → bricks-ctor}/rules/media-flow.md +3 -3
  13. package/skills/{bricks-project → bricks-ctor}/rules/remote-data-bank.md +6 -6
  14. package/skills/{bricks-project → bricks-ctor}/rules/standby-transition.md +1 -1
  15. package/skills/bricks-design/LICENSE.txt +180 -0
  16. package/skills/bricks-design/SKILL.md +66 -0
  17. package/tools/deploy.ts +66 -12
  18. package/tools/icons/fa6pro-meta.json +3669 -26125
  19. package/tools/mcp-server.ts +11 -878
  20. package/tools/mcp-tools/compile.ts +91 -0
  21. package/tools/mcp-tools/huggingface.ts +762 -0
  22. package/tools/mcp-tools/icons.ts +70 -0
  23. package/tools/mcp-tools/lottie.ts +102 -0
  24. package/tools/mcp-tools/media.ts +110 -0
  25. package/tools/postinstall.ts +137 -40
  26. package/tools/preview-main.mjs +135 -2
  27. package/tools/preview.ts +41 -2
  28. package/tools/pull.ts +37 -19
  29. package/tsconfig.json +16 -0
  30. package/types/animation.ts +4 -0
  31. package/types/automation.ts +4 -1
  32. package/types/brick-base.ts +1 -1
  33. package/types/bricks/Camera.ts +47 -12
  34. package/types/bricks/Chart.ts +9 -3
  35. package/types/bricks/GenerativeMedia.ts +29 -13
  36. package/types/bricks/Icon.ts +8 -4
  37. package/types/bricks/Image.ts +9 -5
  38. package/types/bricks/Items.ts +28 -14
  39. package/types/bricks/Lottie.ts +14 -6
  40. package/types/bricks/Maps.ts +15 -7
  41. package/types/bricks/QrCode.ts +8 -4
  42. package/types/bricks/Rect.ts +44 -5
  43. package/types/bricks/RichText.ts +8 -4
  44. package/types/bricks/Rive.ts +20 -10
  45. package/types/bricks/Slideshow.ts +19 -9
  46. package/types/bricks/Svg.ts +7 -3
  47. package/types/bricks/Text.ts +8 -4
  48. package/types/bricks/TextInput.ts +22 -12
  49. package/types/bricks/Video.ts +10 -6
  50. package/types/bricks/VideoStreaming.ts +7 -3
  51. package/types/bricks/WebRtcStream.ts +6 -2
  52. package/types/bricks/WebView.ts +11 -7
  53. package/types/canvas.ts +2 -0
  54. package/types/common.ts +15 -8
  55. package/types/data-calc-command.ts +2 -0
  56. package/types/data-calc.ts +1 -0
  57. package/types/data.ts +2 -0
  58. package/types/generators/AlarmClock.ts +16 -10
  59. package/types/generators/Assistant.ts +68 -17
  60. package/types/generators/BleCentral.ts +30 -10
  61. package/types/generators/BlePeripheral.ts +10 -6
  62. package/types/generators/CanvasMap.ts +9 -5
  63. package/types/generators/CastlesPay.ts +14 -6
  64. package/types/generators/DataBank.ts +43 -8
  65. package/types/generators/File.ts +108 -29
  66. package/types/generators/GraphQl.ts +11 -5
  67. package/types/generators/Http.ts +32 -9
  68. package/types/generators/HttpServer.ts +22 -14
  69. package/types/generators/Information.ts +8 -4
  70. package/types/generators/Intent.ts +14 -4
  71. package/types/generators/Iterator.ts +14 -10
  72. package/types/generators/Keyboard.ts +26 -12
  73. package/types/generators/LlmAnthropicCompat.ts +32 -10
  74. package/types/generators/LlmAppleBuiltin.ts +24 -9
  75. package/types/generators/LlmGgml.ts +139 -30
  76. package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
  77. package/types/generators/LlmMlx.ts +227 -0
  78. package/types/generators/LlmOnnx.ts +33 -13
  79. package/types/generators/LlmOpenAiCompat.ts +46 -10
  80. package/types/generators/LlmQualcommAiEngine.ts +44 -12
  81. package/types/generators/Mcp.ts +374 -33
  82. package/types/generators/McpServer.ts +57 -18
  83. package/types/generators/MediaFlow.ts +37 -11
  84. package/types/generators/MqttBroker.ts +28 -10
  85. package/types/generators/MqttClient.ts +18 -8
  86. package/types/generators/Question.ts +12 -8
  87. package/types/generators/RealtimeTranscription.ts +107 -18
  88. package/types/generators/RerankerGgml.ts +42 -11
  89. package/types/generators/SerialPort.ts +17 -9
  90. package/types/generators/SoundPlayer.ts +9 -3
  91. package/types/generators/SoundRecorder.ts +23 -8
  92. package/types/generators/SpeechToTextGgml.ts +51 -17
  93. package/types/generators/SpeechToTextOnnx.ts +17 -10
  94. package/types/generators/SpeechToTextPlatform.ts +14 -6
  95. package/types/generators/SqLite.ts +19 -9
  96. package/types/generators/Step.ts +8 -4
  97. package/types/generators/SttAppleBuiltin.ts +21 -8
  98. package/types/generators/Tcp.ts +12 -8
  99. package/types/generators/TcpServer.ts +19 -13
  100. package/types/generators/TextToSpeechAppleBuiltin.ts +20 -7
  101. package/types/generators/TextToSpeechGgml.ts +28 -10
  102. package/types/generators/TextToSpeechOnnx.ts +18 -11
  103. package/types/generators/TextToSpeechOpenAiLike.ts +13 -7
  104. package/types/generators/ThermalPrinter.ts +12 -8
  105. package/types/generators/Tick.ts +10 -6
  106. package/types/generators/Udp.ts +16 -7
  107. package/types/generators/VadGgml.ts +50 -13
  108. package/types/generators/VadOnnx.ts +41 -11
  109. package/types/generators/VadTraditional.ts +27 -12
  110. package/types/generators/VectorStore.ts +32 -11
  111. package/types/generators/Watchdog.ts +18 -9
  112. package/types/generators/WebCrawler.ts +10 -6
  113. package/types/generators/WebRtc.ts +29 -15
  114. package/types/generators/WebSocket.ts +10 -6
  115. package/types/generators/index.ts +2 -0
  116. package/types/subspace.ts +4 -0
  117. package/types/system.ts +1 -1
  118. package/utils/event-props.ts +833 -1022
  119. package/api/index.ts +0 -1
  120. package/api/instance.ts +0 -213
  121. package/types/generators/TextToSpeechApple.ts +0 -113
  122. package/types/generators/TtsAppleBuiltin.ts +0 -105
  123. /package/skills/{bricks-project → bricks-ctor}/rules/automations.md +0 -0
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
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
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Load the model (Only if source is ggml) */
15
19
  export type GeneratorVectorStoreActionModelLoad = Action & {
@@ -31,7 +35,7 @@ export type GeneratorVectorStoreActionReset = ActionWithParams & {
31
35
  }>
32
36
  }
33
37
 
34
- /* Insert file content with path or url, support Office / OpenOffice / PDF
38
+ /* Insert file content with path or url, support Office / OpenOffice / PDF
35
39
 
36
40
  PDF is not currently supprted in iOS / Android */
37
41
  export type GeneratorVectorStoreActionInsertFile = ActionWithParams & {
@@ -161,13 +165,13 @@ Default property:
161
165
  ggmlContextSize?: number | DataLink
162
166
  /* Pooling type of ggml model */
163
167
  ggmlPoolingType?: 'none' | 'mean' | 'cls' | 'last' | 'rank' | DataLink
164
- /* GGML accelerator variant (Only for desktop)
168
+ /* GGML accelerator variant (Only for desktop)
165
169
  `default` - CPU / Metal (macOS)
166
170
  `vulkan` - Use Vulkan
167
171
  `cuda` - Use CUDA
168
172
  `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
169
173
  ggmlAccelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
170
- /* Devices. For example:
174
+ /* Devices. For example:
171
175
 
172
176
  Metal or CPU for iOS/tvOS/MacOS
173
177
  OpenCL or CPU for Android
@@ -197,23 +201,40 @@ Default property:
197
201
  }
198
202
  events?: {
199
203
  /* Event triggered when error occurs */
200
- onError?: Array<EventAction>
204
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['VectorStore']['onError']>>
201
205
  }
202
206
  outlets?: {
203
207
  /* undefined */
204
- isReady?: () => Data
208
+ isReady?: () => Data<boolean>
205
209
  /* Whether the embedding is processing */
206
- processing?: () => Data
210
+ processing?: () => Data<boolean>
207
211
  /* Progress of embedding processing */
208
- processProgress?: () => Data
212
+ processProgress?: () => Data<{
213
+ chunking?: number
214
+ embedding?: number
215
+ writing?: number
216
+ [key: string]: any
217
+ }>
209
218
  /* Files inserted to embedding */
210
- files?: () => Data
219
+ files?: () => Data<Array<string>>
211
220
  /* Search result */
212
- searchResult?: () => Data
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
+ >
213
234
  }
214
235
  }
215
236
 
216
- /* Vector Store - File embeddings & search */
237
+ /* Vector database for semantic search. Supports GGML (on-device GGUF models) and OpenAI Compatible API (OpenAI/ollama/llama.cpp) as embedding sources */
217
238
  export type GeneratorVectorStore = Generator &
218
239
  GeneratorVectorStoreDef & {
219
240
  templateKey: 'GENERATOR_VECTOR_STORE'
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Trigger event with timeout by listening to specified events
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Reset watch */
15
19
  export type GeneratorWatchdogActionResetWatch = Action & {
@@ -52,25 +56,30 @@ Default property:
52
56
  }
53
57
  events?: {
54
58
  /* Event on specific sender id trigger event */
55
- onEvent?: Array<EventAction>
59
+ onEvent?: Array<EventAction<string & keyof TemplateEventPropsMap['Watchdog']['onEvent']>>
56
60
  /* Event on timeout */
57
- onTimeout?: Array<EventAction>
61
+ onTimeout?: Array<EventAction<string & keyof TemplateEventPropsMap['Watchdog']['onTimeout']>>
58
62
  }
59
63
  outlets?: {
60
64
  /* The last event */
61
- lastEvent?: () => Data
65
+ lastEvent?: () => Data<{
66
+ id?: string
67
+ type?: string
68
+ triggerType?: string
69
+ timeout?: number
70
+ }>
62
71
  /* The type fo last event */
63
- lastEventType?: () => Data
72
+ lastEventType?: () => Data<string>
64
73
  /* The trigger type of last event */
65
- lastEventTriggerType?: () => Data
74
+ lastEventTriggerType?: () => Data<string>
66
75
  /* The sender id of last event */
67
- lastEventSenderId?: () => Data
76
+ lastEventSenderId?: () => Data<string>
68
77
  /* Is timed out */
69
- isTimedOut?: () => Data
78
+ isTimedOut?: () => Data<boolean>
70
79
  }
71
80
  }
72
81
 
73
- /* Triger event with timeout by listen specified events */
82
+ /* Trigger event with timeout by listening to specified events */
74
83
  export type GeneratorWatchdog = Generator &
75
84
  GeneratorWatchdogDef & {
76
85
  templateKey: 'GENERATOR_WATCHDOG'
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Extract web content via CSS selectors. Supports WebView method (iOS/Android, renders JS) and HTTP method (all platforms, direct request)
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Run Crawler request with defined properties */
15
19
  export type GeneratorWebCrawlerActionRunRequest = Action & {
@@ -31,7 +35,7 @@ Default property:
31
35
  init?: boolean | DataLink
32
36
  /* URL of crawler request */
33
37
  url?: string | DataLink
34
- /* Method of crawler request
38
+ /* Method of crawler request
35
39
 
36
40
  Platform not supported for `webview`: tvOS, Desktop, Web */
37
41
  method?: 'webview' | 'http' | DataLink
@@ -68,15 +72,15 @@ Default property:
68
72
  }
69
73
  outlets?: {
70
74
  /* Response for CRAWLER request (selector) */
71
- response?: () => Data
75
+ response?: () => Data<string>
72
76
  /* Responses for CRAWLER request (selectorList) */
73
- responseList?: () => Data
77
+ responseList?: () => Data<Array<any>>
74
78
  /* The error response of CRAWLER request, it will save to property bank */
75
- error?: () => Data
79
+ error?: () => Data<string>
76
80
  }
77
81
  }
78
82
 
79
- /* Web crawler to get specific value */
83
+ /* Extract web content via CSS selectors. Supports WebView method (iOS/Android, renders JS) and HTTP method (all platforms, direct request) */
80
84
  export type GeneratorWebCrawler = Generator &
81
85
  GeneratorWebCrawlerDef & {
82
86
  templateKey: 'GENERATOR_WEB_CRAWLER'
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * WebRTC peer connection for real-time audio/video/data communication
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Initiate WebRTC request */
15
19
  export type GeneratorWebRTCActionInitiate = Action & {
@@ -63,7 +67,7 @@ Default property:
63
67
  localVideoTarget?: string | DataLink | (() => Brick)
64
68
  /* Target remote WebRTC stream brick ID */
65
69
  remoteVideoTarget?: string | DataLink | (() => Brick)
66
- /* ICE Server list
70
+ /* ICE Server list
67
71
  Default use Google public STUN servers if not setted. */
68
72
  iceServers?:
69
73
  | Array<
@@ -89,7 +93,7 @@ Default property:
89
93
  videoWidth?: number | DataLink
90
94
  /* Label of data channel */
91
95
  dataChannelLabel?: string | DataLink
92
- /* Input signal for create peer connection
96
+ /* Input signal for create peer connection
93
97
  Signal Types:
94
98
  `initiate`: Initiate a WebRTC call
95
99
  `offer`: WebRTC SDP offer
@@ -102,41 +106,51 @@ Default property:
102
106
  }
103
107
  events?: {
104
108
  /* Event of signal update */
105
- onSignalUpdate?: Array<EventAction>
109
+ onSignalUpdate?: Array<
110
+ EventAction<string & keyof TemplateEventPropsMap['Webrtc']['onSignalUpdate']>
111
+ >
106
112
  /* Event of peer connected */
107
113
  onConnected?: Array<EventAction>
108
114
  /* Event of peer disconnected */
109
115
  onDisconnected?: Array<EventAction>
110
116
  /* Event of handshake error */
111
- onError?: Array<EventAction>
117
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Webrtc']['onError']>>
112
118
  /* Event of data channel open */
113
119
  onChannelOpen?: Array<EventAction>
114
120
  /* Event of data channel close */
115
121
  onChannelClose?: Array<EventAction>
116
122
  /* Event of received message on data channel */
117
- onChannelMessage?: Array<EventAction>
123
+ onChannelMessage?: Array<
124
+ EventAction<string & keyof TemplateEventPropsMap['Webrtc']['onChannelMessage']>
125
+ >
118
126
  }
119
127
  outlets?: {
120
128
  /* Signal to create peer connection */
121
- signal?: () => Data
129
+ signal?: () => Data<any>
122
130
  /* Local SDP offer */
123
- sdpOffer?: () => Data
131
+ sdpOffer?: () => Data<{
132
+ type?: string
133
+ sdp?: string
134
+ }>
124
135
  /* Local SDP answer */
125
- sdpAnswer?: () => Data
136
+ sdpAnswer?: () => Data<{
137
+ type?: string
138
+ sdp?: string
139
+ }>
126
140
  /* Peer connection state */
127
- connectionState?: () => Data
141
+ connectionState?: () => Data<string>
128
142
  /* ICE connection state */
129
- iceConnectionState?: () => Data
143
+ iceConnectionState?: () => Data<string>
130
144
  /* Signaling state */
131
- signalingState?: () => Data
145
+ signalingState?: () => Data<string>
132
146
  /* Last message from data channel */
133
- lastChannelMessage?: () => Data
147
+ lastChannelMessage?: () => Data<string>
134
148
  /* Error message */
135
- errorMessage?: () => Data
149
+ errorMessage?: () => Data<string>
136
150
  }
137
151
  }
138
152
 
139
- /* WebRTC */
153
+ /* WebRTC peer connection for real-time audio/video/data communication */
140
154
  export type GeneratorWebRTC = Generator &
141
155
  GeneratorWebRTCDef & {
142
156
  templateKey: 'GENERATOR_WEBRTC'
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * WebSocket or Socket.IO Generator
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Connect */
15
19
  export type GeneratorWebSocketActionConnect = Action & {
@@ -105,19 +109,19 @@ Default property:
105
109
  /* Event for disconnect from server */
106
110
  onClose?: Array<EventAction>
107
111
  /* Event for receive message */
108
- onMessage?: Array<EventAction>
112
+ onMessage?: Array<EventAction<string & keyof TemplateEventPropsMap['WebSocket']['onMessage']>>
109
113
  /* Event for error occurred */
110
114
  onError?: Array<EventAction>
111
115
  }
112
116
  outlets?: {
113
117
  /* Show socket.io connected or not */
114
- readyState?: () => Data
118
+ readyState?: () => Data<string>
115
119
  /* Results of each countdown change, it will save to Data */
116
- message?: () => Data
120
+ message?: () => Data<any>
117
121
  /* When Socket.IO mode server can response acknowledgemnt with data to client */
118
- acknowledgeData?: () => Data
122
+ acknowledgeData?: () => Data<{ [key: string]: any }>
119
123
  /* Error message */
120
- errorMessage?: () => Data
124
+ errorMessage?: () => Data<string>
121
125
  }
122
126
  }
123
127
 
@@ -44,7 +44,9 @@ 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'
49
+ export * from './LlmMediaTekNeuroPilot'
48
50
  export * from './LlmOpenAiCompat'
49
51
  export * from './TextToSpeechOpenAiLike'
50
52
  export * from './LlmAnthropicCompat'
package/types/subspace.ts CHANGED
@@ -9,6 +9,9 @@ export type Subspace = {
9
9
  id: string
10
10
  title: string
11
11
  description?: string
12
+ hideShortRef?: boolean
13
+ unused?: boolean
14
+ portal?: 'top' | 'left' | 'bottom' | 'right'
12
15
  // Unexpanded information in Editor
13
16
  unexpanded?: {
14
17
  data?: boolean
@@ -20,6 +23,7 @@ export type Subspace = {
20
23
  module?: {
21
24
  id: string
22
25
  version: string
26
+ link?: boolean
23
27
  selectedRequirements?: Array<{
24
28
  subspace: SubspaceID
25
29
  id: string
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<