@fugood/bricks-project 2.24.0-beta.3 → 2.24.0-beta.31

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 (113) hide show
  1. package/compile/action-name-map.ts +36 -0
  2. package/compile/index.ts +400 -146
  3. package/compile/util.ts +2 -0
  4. package/package.json +8 -3
  5. package/skills/bricks-project/rules/architecture-patterns.md +7 -0
  6. package/skills/bricks-project/rules/automations.md +74 -28
  7. package/skills/bricks-project/rules/buttress.md +9 -6
  8. package/tools/deploy.ts +66 -12
  9. package/tools/icons/fa6pro-meta.json +3669 -26125
  10. package/tools/mcp-server.ts +10 -877
  11. package/tools/mcp-tools/compile.ts +91 -0
  12. package/tools/mcp-tools/huggingface.ts +762 -0
  13. package/tools/mcp-tools/icons.ts +70 -0
  14. package/tools/mcp-tools/lottie.ts +102 -0
  15. package/tools/mcp-tools/media.ts +110 -0
  16. package/tools/postinstall.ts +121 -33
  17. package/tools/preview-main.mjs +12 -8
  18. package/tools/pull.ts +37 -19
  19. package/tsconfig.json +16 -0
  20. package/types/animation.ts +4 -0
  21. package/types/automation.ts +3 -0
  22. package/types/brick-base.ts +1 -1
  23. package/types/bricks/Camera.ts +34 -7
  24. package/types/bricks/Chart.ts +1 -1
  25. package/types/bricks/GenerativeMedia.ts +6 -6
  26. package/types/bricks/Icon.ts +3 -3
  27. package/types/bricks/Image.ts +4 -4
  28. package/types/bricks/Items.ts +7 -7
  29. package/types/bricks/Lottie.ts +4 -4
  30. package/types/bricks/Maps.ts +4 -4
  31. package/types/bricks/QrCode.ts +4 -4
  32. package/types/bricks/Rect.ts +4 -4
  33. package/types/bricks/RichText.ts +3 -3
  34. package/types/bricks/Rive.ts +1 -1
  35. package/types/bricks/Slideshow.ts +4 -4
  36. package/types/bricks/Svg.ts +3 -3
  37. package/types/bricks/Text.ts +4 -4
  38. package/types/bricks/TextInput.ts +11 -7
  39. package/types/bricks/Video.ts +4 -4
  40. package/types/bricks/VideoStreaming.ts +3 -3
  41. package/types/bricks/WebRtcStream.ts +1 -1
  42. package/types/bricks/WebView.ts +4 -4
  43. package/types/canvas.ts +4 -2
  44. package/types/common.ts +9 -4
  45. package/types/data-calc-command.ts +2 -0
  46. package/types/data-calc.ts +1 -0
  47. package/types/data.ts +2 -0
  48. package/types/generators/AlarmClock.ts +5 -5
  49. package/types/generators/Assistant.ts +57 -12
  50. package/types/generators/BleCentral.ts +12 -4
  51. package/types/generators/BlePeripheral.ts +5 -5
  52. package/types/generators/CanvasMap.ts +4 -4
  53. package/types/generators/CastlesPay.ts +3 -3
  54. package/types/generators/DataBank.ts +31 -4
  55. package/types/generators/File.ts +63 -14
  56. package/types/generators/GraphQl.ts +3 -3
  57. package/types/generators/Http.ts +27 -8
  58. package/types/generators/HttpServer.ts +9 -9
  59. package/types/generators/Information.ts +2 -2
  60. package/types/generators/Intent.ts +8 -2
  61. package/types/generators/Iterator.ts +6 -6
  62. package/types/generators/Keyboard.ts +18 -8
  63. package/types/generators/LlmAnthropicCompat.ts +12 -6
  64. package/types/generators/LlmAppleBuiltin.ts +6 -6
  65. package/types/generators/LlmGgml.ts +101 -25
  66. package/types/generators/LlmMediaTekNeuroPilot.ts +225 -0
  67. package/types/generators/LlmMlx.ts +210 -0
  68. package/types/generators/LlmOnnx.ts +18 -9
  69. package/types/generators/LlmOpenAiCompat.ts +22 -6
  70. package/types/generators/LlmQualcommAiEngine.ts +32 -8
  71. package/types/generators/Mcp.ts +332 -17
  72. package/types/generators/McpServer.ts +38 -11
  73. package/types/generators/MediaFlow.ts +26 -8
  74. package/types/generators/MqttBroker.ts +10 -4
  75. package/types/generators/MqttClient.ts +11 -5
  76. package/types/generators/Question.ts +6 -6
  77. package/types/generators/RealtimeTranscription.ts +82 -11
  78. package/types/generators/RerankerGgml.ts +23 -9
  79. package/types/generators/SerialPort.ts +6 -6
  80. package/types/generators/SoundPlayer.ts +2 -2
  81. package/types/generators/SoundRecorder.ts +17 -6
  82. package/types/generators/SpeechToTextGgml.ts +34 -14
  83. package/types/generators/SpeechToTextOnnx.ts +8 -8
  84. package/types/generators/SpeechToTextPlatform.ts +4 -4
  85. package/types/generators/SqLite.ts +10 -6
  86. package/types/generators/Step.ts +3 -3
  87. package/types/generators/SttAppleBuiltin.ts +6 -6
  88. package/types/generators/Tcp.ts +5 -5
  89. package/types/generators/TcpServer.ts +7 -7
  90. package/types/generators/TextToSpeechApple.ts +1 -1
  91. package/types/generators/TextToSpeechAppleBuiltin.ts +5 -5
  92. package/types/generators/TextToSpeechGgml.ts +8 -8
  93. package/types/generators/TextToSpeechOnnx.ts +9 -9
  94. package/types/generators/TextToSpeechOpenAiLike.ts +5 -5
  95. package/types/generators/ThermalPrinter.ts +6 -6
  96. package/types/generators/Tick.ts +3 -3
  97. package/types/generators/Udp.ts +9 -4
  98. package/types/generators/VadGgml.ts +39 -10
  99. package/types/generators/VadOnnx.ts +31 -8
  100. package/types/generators/VadTraditional.ts +15 -9
  101. package/types/generators/VectorStore.ts +26 -9
  102. package/types/generators/Watchdog.ts +11 -6
  103. package/types/generators/WebCrawler.ts +5 -5
  104. package/types/generators/WebRtc.ts +17 -11
  105. package/types/generators/WebSocket.ts +5 -5
  106. package/types/generators/index.ts +2 -0
  107. package/types/subspace.ts +3 -0
  108. package/types/system.ts +1 -1
  109. package/utils/calc.ts +12 -8
  110. package/utils/event-props.ts +124 -87
  111. package/utils/id.ts +4 -0
  112. package/api/index.ts +0 -1
  113. package/api/instance.ts +0 -213
@@ -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,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
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)