@fugood/bricks-project 2.24.0-beta.4 → 2.24.0-beta.40

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 (125) hide show
  1. package/compile/action-name-map.ts +38 -0
  2. package/compile/index.ts +429 -160
  3. package/compile/util.ts +2 -0
  4. package/package.json +7 -3
  5. package/package.json.bak +27 -0
  6. package/skills/bricks-design/LICENSE.txt +180 -0
  7. package/skills/bricks-design/SKILL.md +66 -0
  8. package/skills/bricks-project/SKILL.md +2 -2
  9. package/skills/bricks-project/rules/animation.md +1 -1
  10. package/skills/bricks-project/rules/architecture-patterns.md +7 -0
  11. package/skills/bricks-project/rules/automations.md +74 -28
  12. package/skills/bricks-project/rules/buttress.md +10 -7
  13. package/skills/bricks-project/rules/data-calculation.md +1 -1
  14. package/skills/bricks-project/rules/local-sync.md +2 -2
  15. package/skills/bricks-project/rules/media-flow.md +3 -3
  16. package/skills/bricks-project/rules/remote-data-bank.md +6 -6
  17. package/skills/bricks-project/rules/standby-transition.md +1 -1
  18. package/tools/deploy.ts +66 -12
  19. package/tools/icons/fa6pro-meta.json +3669 -26125
  20. package/tools/mcp-server.ts +11 -878
  21. package/tools/mcp-tools/compile.ts +91 -0
  22. package/tools/mcp-tools/huggingface.ts +762 -0
  23. package/tools/mcp-tools/icons.ts +70 -0
  24. package/tools/mcp-tools/lottie.ts +102 -0
  25. package/tools/mcp-tools/media.ts +110 -0
  26. package/tools/postinstall.ts +137 -40
  27. package/tools/preview-main.mjs +146 -9
  28. package/tools/preview.ts +30 -2
  29. package/tools/pull.ts +37 -19
  30. package/tsconfig.json +16 -0
  31. package/types/animation.ts +4 -0
  32. package/types/automation.ts +4 -1
  33. package/types/brick-base.ts +1 -1
  34. package/types/bricks/Camera.ts +48 -13
  35. package/types/bricks/Chart.ts +10 -4
  36. package/types/bricks/GenerativeMedia.ts +30 -14
  37. package/types/bricks/Icon.ts +9 -5
  38. package/types/bricks/Image.ts +10 -6
  39. package/types/bricks/Items.ts +29 -15
  40. package/types/bricks/Lottie.ts +15 -7
  41. package/types/bricks/Maps.ts +16 -8
  42. package/types/bricks/QrCode.ts +9 -5
  43. package/types/bricks/Rect.ts +45 -6
  44. package/types/bricks/RichText.ts +9 -5
  45. package/types/bricks/Rive.ts +21 -11
  46. package/types/bricks/Slideshow.ts +20 -10
  47. package/types/bricks/Svg.ts +8 -4
  48. package/types/bricks/Text.ts +9 -5
  49. package/types/bricks/TextInput.ts +23 -13
  50. package/types/bricks/Video.ts +11 -7
  51. package/types/bricks/VideoStreaming.ts +8 -4
  52. package/types/bricks/WebRtcStream.ts +7 -3
  53. package/types/bricks/WebView.ts +12 -8
  54. package/types/canvas.ts +4 -2
  55. package/types/common.ts +19 -12
  56. package/types/data-calc-command.ts +2 -0
  57. package/types/data-calc.ts +1 -0
  58. package/types/data.ts +2 -0
  59. package/types/generators/AlarmClock.ts +17 -11
  60. package/types/generators/Assistant.ts +69 -18
  61. package/types/generators/BleCentral.ts +31 -11
  62. package/types/generators/BlePeripheral.ts +11 -7
  63. package/types/generators/CanvasMap.ts +10 -6
  64. package/types/generators/CastlesPay.ts +15 -7
  65. package/types/generators/DataBank.ts +44 -9
  66. package/types/generators/File.ts +109 -30
  67. package/types/generators/GraphQl.ts +12 -6
  68. package/types/generators/Http.ts +33 -10
  69. package/types/generators/HttpServer.ts +23 -15
  70. package/types/generators/Information.ts +9 -5
  71. package/types/generators/Intent.ts +15 -5
  72. package/types/generators/Iterator.ts +15 -11
  73. package/types/generators/Keyboard.ts +27 -13
  74. package/types/generators/LlmAnthropicCompat.ts +33 -11
  75. package/types/generators/LlmAppleBuiltin.ts +25 -10
  76. package/types/generators/LlmGgml.ts +140 -31
  77. package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
  78. package/types/generators/LlmMlx.ts +227 -0
  79. package/types/generators/LlmOnnx.ts +34 -14
  80. package/types/generators/LlmOpenAiCompat.ts +47 -11
  81. package/types/generators/LlmQualcommAiEngine.ts +45 -13
  82. package/types/generators/Mcp.ts +375 -34
  83. package/types/generators/McpServer.ts +58 -19
  84. package/types/generators/MediaFlow.ts +38 -12
  85. package/types/generators/MqttBroker.ts +29 -11
  86. package/types/generators/MqttClient.ts +19 -9
  87. package/types/generators/Question.ts +13 -9
  88. package/types/generators/RealtimeTranscription.ts +108 -19
  89. package/types/generators/RerankerGgml.ts +43 -12
  90. package/types/generators/SerialPort.ts +18 -10
  91. package/types/generators/SoundPlayer.ts +10 -4
  92. package/types/generators/SoundRecorder.ts +24 -9
  93. package/types/generators/SpeechToTextGgml.ts +52 -18
  94. package/types/generators/SpeechToTextOnnx.ts +18 -11
  95. package/types/generators/SpeechToTextPlatform.ts +15 -7
  96. package/types/generators/SqLite.ts +20 -10
  97. package/types/generators/Step.ts +9 -5
  98. package/types/generators/SttAppleBuiltin.ts +22 -9
  99. package/types/generators/Tcp.ts +13 -9
  100. package/types/generators/TcpServer.ts +20 -14
  101. package/types/generators/TextToSpeechAppleBuiltin.ts +21 -8
  102. package/types/generators/TextToSpeechGgml.ts +29 -11
  103. package/types/generators/TextToSpeechOnnx.ts +19 -12
  104. package/types/generators/TextToSpeechOpenAiLike.ts +14 -8
  105. package/types/generators/ThermalPrinter.ts +13 -9
  106. package/types/generators/Tick.ts +11 -7
  107. package/types/generators/Udp.ts +17 -8
  108. package/types/generators/VadGgml.ts +51 -14
  109. package/types/generators/VadOnnx.ts +42 -12
  110. package/types/generators/VadTraditional.ts +28 -13
  111. package/types/generators/VectorStore.ts +33 -12
  112. package/types/generators/Watchdog.ts +19 -10
  113. package/types/generators/WebCrawler.ts +11 -7
  114. package/types/generators/WebRtc.ts +30 -16
  115. package/types/generators/WebSocket.ts +11 -7
  116. package/types/generators/index.ts +2 -0
  117. package/types/subspace.ts +3 -0
  118. package/types/system.ts +1 -1
  119. package/utils/calc.ts +12 -8
  120. package/utils/event-props.ts +833 -1022
  121. package/utils/id.ts +4 -0
  122. package/api/index.ts +0 -1
  123. package/api/instance.ts +0 -213
  124. package/types/generators/TextToSpeechApple.ts +0 -113
  125. package/types/generators/TtsAppleBuiltin.ts +0 -105
package/compile/util.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { makeId } from '../utils/id'
2
2
 
3
3
  type ScriptConfig = {
4
+ title?: string
5
+ note?: string
4
6
  inputs: Record<string, string>
5
7
  enable_async: boolean
6
8
  trigger_mode?: 'auto' | 'manual'
package/package.json CHANGED
@@ -1,16 +1,18 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.24.0-beta.4",
3
+ "version": "2.24.0-beta.40",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
+ "typecheck": "tsc --noEmit",
6
7
  "build": "bun scripts/build.js"
7
8
  },
8
9
  "dependencies": {
9
- "@fugood/bricks-cli": "^2.24.0-beta.4",
10
+ "@fugood/bricks-cli": "^2.24.0-beta.40",
10
11
  "@huggingface/gguf": "^0.3.2",
11
12
  "@iarna/toml": "^3.0.0",
12
13
  "@modelcontextprotocol/sdk": "^1.15.0",
13
14
  "@toon-format/toon": "^2.1.0",
15
+ "@types/bun": "^1.3.9",
14
16
  "@types/escodegen": "^0.0.10",
15
17
  "@types/lodash": "^4.17.12",
16
18
  "acorn": "^8.13.0",
@@ -19,5 +21,7 @@
19
21
  "lodash": "^4.17.4",
20
22
  "uuid": "^8.3.1"
21
23
  },
22
- "gitHead": "f5f65204e7259449b4cf7dbc35597e5e3d0b1425"
24
+ "peerDependencies": {
25
+ "oxfmt": "^0.36.0"
26
+ }
23
27
  }
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@fugood/bricks-ctor",
3
+ "version": "2.24.0-beta.40",
4
+ "main": "index.ts",
5
+ "scripts": {
6
+ "typecheck": "tsc --noEmit",
7
+ "build": "bun scripts/build.js"
8
+ },
9
+ "dependencies": {
10
+ "@fugood/bricks-cli": "^2.24.0-beta.40",
11
+ "@huggingface/gguf": "^0.3.2",
12
+ "@iarna/toml": "^3.0.0",
13
+ "@modelcontextprotocol/sdk": "^1.15.0",
14
+ "@toon-format/toon": "^2.1.0",
15
+ "@types/bun": "^1.3.9",
16
+ "@types/escodegen": "^0.0.10",
17
+ "@types/lodash": "^4.17.12",
18
+ "acorn": "^8.13.0",
19
+ "escodegen": "2.1.0",
20
+ "fuse.js": "^7.0.0",
21
+ "lodash": "^4.17.4",
22
+ "uuid": "^8.3.1"
23
+ },
24
+ "peerDependencies": {
25
+ "oxfmt": "^0.36.0"
26
+ }
27
+ }
@@ -0,0 +1,180 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ This skill is a derivative work based on:
179
+ https://github.com/anthropics/skills/blob/main/skills/frontend-design/SKILL.md
180
+ Copyright Anthropic, PBC. Licensed under the Apache License, Version 2.0.
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: bricks-design
3
+ description: Create distinctive, production-grade BRICKS application interfaces with high design quality. Use this skill when the user asks to build BRICKS canvases, screens, layouts, or applications. Generates creative, polished BRICKS code that avoids generic aesthetics.
4
+ license: Complete terms in LICENSE.txt (Apache-2.0, based on github.com/anthropics/skills)
5
+ ---
6
+
7
+ This skill guides creation of distinctive, production-grade BRICKS application interfaces that avoid generic aesthetics. Implement working code with exceptional attention to visual design and creative choices.
8
+
9
+ The user provides interface requirements: a screen, layout, application, or component to build. They may include context about the purpose, audience, platform, or technical constraints.
10
+
11
+ ## Design Thinking
12
+
13
+ Before coding, understand the context and commit to a **bold** aesthetic direction:
14
+ - **Purpose**: What problem does this interface solve? Who uses it? What platform(s)?
15
+ - **Tone**: Pick a strong direction: brutally minimal, maximalist, retro-futuristic, organic/natural, luxury/refined, playful, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. Use these for inspiration but design one true to the aesthetic.
16
+ - **Constraints**: Target platform (mobile, TV, desktop, kiosk), screen dimensions, accessibility needs.
17
+ - **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
18
+
19
+ **CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work — the key is intentionality, not intensity.
20
+
21
+ Then implement working BRICKS TypeScript code that is:
22
+ - Production-grade and functional
23
+ - Visually striking and memorable
24
+ - Cohesive with a clear aesthetic point-of-view
25
+ - Meticulously refined in every detail
26
+
27
+ ## Aesthetics Guidelines
28
+
29
+ ### Typography
30
+ Choose fonts that are beautiful, unique, and interesting. Avoid defaulting to system fonts — opt for distinctive choices that elevate the interface. Pair a characterful display font with a refined body font. Create clear typographic hierarchy through weight, size, spacing, and alignment. Use auto-scaling (`fontSizeVector`) when text should fill its container proportionally.
31
+
32
+ ### Color & Theme
33
+ Commit to a cohesive palette. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Use gradients for rich, atmospheric surfaces — multi-stop linear gradients create far more depth than flat fills. Use Data nodes as a shared color store for consistency across bricks.
34
+
35
+ ### Motion & Animation
36
+ Focus on high-impact moments: one well-orchestrated canvas enter with staggered standby reveals creates more delight than scattered micro-interactions. Use spring animations for natural, bouncy UI elements. Use composed animations (parallel/sequence) for coordinated entrance choreography. Reserve looping animations (`breatheStart`) for attention-drawing elements — overuse dulls their impact.
37
+
38
+ ### Spatial Composition
39
+ Absolute positioning gives total control — use it creatively. Overlap bricks. Create asymmetric layouts. Use generous negative space OR controlled density. Break grid expectations. Consider rotation for diagonal flow and perspective. Vary scale dramatically between elements for visual tension.
40
+
41
+ ### Depth & Atmosphere
42
+ Create atmosphere through layered elements rather than flat solid colors:
43
+ - **Gradients** with multiple color stops for rich backgrounds
44
+ - **Shadows** for elevation and hierarchy
45
+ - **Blur effects** (blur, progressive blur, liquid glass) for glass morphism on native platforms
46
+ - **Opacity layering** — stack semi-transparent rects for texture and depth
47
+ - **Border details** — per-side colors, styles, and widths for decorative framing
48
+
49
+ ### Interactive Polish
50
+ Design interactions that feel tactile and responsive:
51
+ - Scale/opacity animations on press for physical feedback
52
+ - Focus states for TV/controller navigation
53
+ - Outlet-driven switches for state-dependent visual changes
54
+ - Deliberate long-press patterns for secondary actions
55
+
56
+ ## What to NEVER Do
57
+
58
+ - **No generic aesthetics**: Avoid the same tired palette, the same safe layout, the same system font on every screen. Each design should feel distinct and intentional.
59
+ - **No flat sameness**: Don't make every canvas look like the same template with different text. Vary spatial composition, color weight, animation timing, and typographic scale.
60
+ - **No placeholder layouts**: Don't just center everything in a grid. Use the absolute positioning system to create spatial interest — overlap, offset, scale contrast.
61
+
62
+ Vary between light and dark themes, different fonts, different aesthetics across generations. NEVER converge on common choices across designs.
63
+
64
+ **IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate animations, layered rects, and rich gradients. Minimalist designs need restraint, precision in spacing, and carefully chosen typography. Elegance comes from executing the vision well.
65
+
66
+ Remember: The agent is capable of extraordinary creative work. Don't hold back — show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
@@ -1,9 +1,9 @@
1
1
  ---
2
- name: bricks-project
2
+ name: bricks-ctor
3
3
  description: Advanced BRICKS configuration knowledge. Covers Standby Transition, Automations (E2E testing), Data Calculation (JS sandbox libraries), Local Sync, Remote Data Bank, Media Flow, and Buttress (remote inference). Triggers on multi-device sync, cloud data, media assets, AI offloading, E2E testing, or canvas transitions.
4
4
  ---
5
5
 
6
- # BRICKS Project - Advanced Features
6
+ # BRICKS Ctor - Advanced Features
7
7
 
8
8
  This skill covers advanced BRICKS features not in the main project instructions.
9
9
 
@@ -8,7 +8,7 @@ BRICKS Animation system for animating brick transforms and opacity. Animations a
8
8
  Standard duration-based animation with easing.
9
9
 
10
10
  ```typescript
11
- import { makeId } from 'bricks-project'
11
+ import { makeId } from 'bricks-ctor'
12
12
 
13
13
  const fadeIn: AnimationDef = {
14
14
  __typename: 'Animation',
@@ -37,6 +37,13 @@ Built-in commands for direct state and UI changes.
37
37
  ### Data Calculation (Priority 4)
38
38
  ONLY for deriving, formatting, or aggregating values from other data. Not for orchestration, side effects, or flow control.
39
39
 
40
+ ## Entity Aliases
41
+
42
+ Set `alias` on entities to give them a stable, human-readable name:
43
+ - Code generation uses alias as the variable name (e.g., `alias: 'submitBtn'` → `export const submitBtn`)
44
+ - At runtime, devtools MCP tools accept alias instead of short ID and selectors can match by alias. Note: bricks-ctor does not directly interact with devtools MCP — aliases here primarily affect code generation
45
+ - Aliases must be unique across the application — duplicates are excluded from resolution
46
+
40
47
  ## Flow Decomposition
41
48
 
42
49
  When the user describes a complex flow, decompose it BEFORE writing code:
@@ -4,15 +4,16 @@ E2E testing and scheduled execution for BRICKS applications. Simulates user beha
4
4
 
5
5
  ## Automation Types
6
6
 
7
- | Type | Description |
8
- |------|-------------|
9
- | `launch` | Run on application launch (restarts app when run manually) |
10
- | `anytime` | Execute anytime via manual trigger |
11
- | `cron` | Scheduled execution using crontab expressions |
7
+ | Type | Description |
8
+ | --------- | ---------------------------------------------------------- |
9
+ | `launch` | Run on application launch (restarts app when run manually) |
10
+ | `anytime` | Execute anytime via manual trigger |
11
+ | `cron` | Scheduled execution using crontab expressions |
12
12
 
13
13
  ## Simulation Actions
14
14
 
15
15
  Automations can simulate:
16
+
16
17
  - **Brick Press**: Tap/click on bricks
17
18
  - **Key Events**: Key up/down for keyboard input
18
19
  - **HTTP Request**: API calls
@@ -21,6 +22,7 @@ Automations can simulate:
21
22
  ## Assertions
22
23
 
23
24
  Automations can validate:
25
+
24
26
  - **Brick Exists**: Check if brick is rendered
25
27
  - **Event Triggered**: Verify event from Brick/Generator/Canvas
26
28
  - **Canvas Changed**: Confirm canvas navigation
@@ -33,14 +35,14 @@ Automations can validate:
33
35
  ```typescript
34
36
  const testLoginFlow: AutomationTest = {
35
37
  __typename: 'AutomationTest',
36
- id: 'test-login-flow',
38
+ id: makeId('test'),
37
39
  title: 'Test Login Flow',
38
40
  timeout: 30000,
39
41
  trigger_type: 'launch',
40
42
  cases: [
41
43
  {
42
44
  __typename: 'TestCase',
43
- id: 'wait-login-canvas',
45
+ id: makeId('test_case'),
44
46
  name: 'Wait for login canvas',
45
47
  run: ['wait_until_canvas_change', () => mainSubspace, () => loginCanvas, 5000],
46
48
  exit_on_failed: true,
@@ -51,7 +53,7 @@ const testLoginFlow: AutomationTest = {
51
53
  },
52
54
  {
53
55
  __typename: 'TestCase',
54
- id: 'press-username',
56
+ id: makeId('test_case'),
55
57
  name: 'Press username input',
56
58
  run: ['brick_press', () => mainSubspace, () => usernameInput],
57
59
  exit_on_failed: true,
@@ -62,7 +64,7 @@ const testLoginFlow: AutomationTest = {
62
64
  },
63
65
  {
64
66
  __typename: 'TestCase',
65
- id: 'assert-username',
67
+ id: makeId('test_case'),
66
68
  name: 'Assert username value',
67
69
  run: ['assert_property', () => mainSubspace, () => usernameData, 'testuser'],
68
70
  exit_on_failed: true,
@@ -73,7 +75,7 @@ const testLoginFlow: AutomationTest = {
73
75
  },
74
76
  {
75
77
  __typename: 'TestCase',
76
- id: 'press-login',
78
+ id: makeId('test_case'),
77
79
  name: 'Press login button',
78
80
  run: ['brick_press', () => mainSubspace, () => loginButton],
79
81
  exit_on_failed: true,
@@ -84,7 +86,7 @@ const testLoginFlow: AutomationTest = {
84
86
  },
85
87
  {
86
88
  __typename: 'TestCase',
87
- id: 'wait-dashboard',
89
+ id: makeId('test_case'),
88
90
  name: 'Wait for dashboard',
89
91
  run: ['wait_until_canvas_change', () => mainSubspace, () => dashboardCanvas, 10000],
90
92
  exit_on_failed: true,
@@ -100,25 +102,58 @@ const testLoginFlow: AutomationTest = {
100
102
 
101
103
  ## Test Methods
102
104
 
103
- | Method | Signature | Description |
104
- |--------|-----------|-------------|
105
- | `brick_press` | `[subspace, brick, options?]` | Simulate brick press |
106
- | `brick_exists` | `[subspace, brick, frame?]` | Check brick exists |
107
- | `wait_until_brick_exists` | `[subspace, brick, timeout?, frame?]` | Wait for brick |
108
- | `wait_until_event_trigger` | `[subspace, sender, eventKey, timeout?]` | Wait for event |
109
- | `wait_until_canvas_change` | `[subspace, canvas, timeout?]` | Wait for canvas |
110
- | `keydown` | `[keyCode, pressedKey?, flags?]` | Key down event |
111
- | `keyup` | `[keyCode, pressedKey?, flags?]` | Key up event |
112
- | `http_request` | `[url, options?]` | HTTP request |
113
- | `assert_property` | `[subspace, property, value]` | Assert data value |
114
- | `wait_until_property_change` | `[subspace, property, value, timeout?]` | Wait for value |
115
- | `execute_action` | `[subspace, handler, action, params?, options?]` | Execute action |
116
- | `match_screenshot` | `[name, threshold?, maxRetry?]` | Screenshot compare |
117
- | `delay` | `[subspace?, property?, defaultValue?]` | Delay execution |
105
+ | Method | Signature | Description |
106
+ | ---------------------------- | ------------------------------------------------ | -------------------- |
107
+ | `brick_press` | `[subspace, brick, options?]` | Simulate brick press |
108
+ | `brick_exists` | `[subspace, brick, frame?]` | Check brick exists |
109
+ | `wait_until_brick_exists` | `[subspace, brick, timeout?, frame?]` | Wait for brick |
110
+ | `wait_until_event_trigger` | `[subspace, sender, eventKey, timeout?]` | Wait for event |
111
+ | `wait_until_canvas_change` | `[subspace, canvas, timeout?]` | Wait for canvas |
112
+ | `keydown` | `[keyCode, pressedKey?, flags?]` | Key down event |
113
+ | `keyup` | `[keyCode, pressedKey?, flags?]` | Key up event |
114
+ | `http_request` | `[url, options?]` | HTTP request |
115
+ | `assert_property` | `[subspace, property, value]` | Assert data value |
116
+ | `wait_until_property_change` | `[subspace, property, value, timeout?]` | Wait for value |
117
+ | `execute_action` | `[subspace, handler, action, params?, options?]` | Execute action |
118
+ | `match_screenshot` | `[name, threshold?, maxRetry?]` | Screenshot compare |
119
+ | `delay` | `[subspace?, property?, defaultValue?]` | Delay execution |
120
+
121
+ ### execute_action Params
122
+
123
+ The `params` object in `execute_action` uses **runtime event property keys** from `event-props.ts`, NOT the action config `input` names from type definitions.
124
+
125
+ ```typescript
126
+ // CORRECT — use runtime event property key
127
+ run: ['execute_action', () => subspace0, bricks.bInput.id, 'BRICK_TEXT_INPUT_SET_TEXT',
128
+ { BRICK_TEXT_INPUT_TEXT: 'hello' }]
129
+
130
+ // WRONG — action config input name doesn't work in automation
131
+ run: ['execute_action', () => subspace0, bricks.bInput.id, 'BRICK_TEXT_INPUT_SET_TEXT',
132
+ { text: 'hello' }]
133
+ ```
134
+
135
+ Reference `event-props.ts` for the correct runtime keys (e.g., `BRICK_TEXT_INPUT_TEXT`, `GENERATOR_MQTT_PAYLOAD`).
136
+
137
+ ### Prefer UI Interactions Over Direct Generator Calls
138
+
139
+ For realistic E2E testing, prefer simulating user actions (set text input + press button) over calling generator actions directly:
140
+
141
+ ```typescript
142
+ // GOOD — simulates real user behavior
143
+ { run: ['execute_action', () => sub, bricks.bInput.id, 'BRICK_TEXT_INPUT_SET_TEXT',
144
+ { BRICK_TEXT_INPUT_TEXT: 'hello' }] },
145
+ { run: ['brick_press', () => sub, () => bricks.bSendBtn] },
146
+ { run: ['wait_until_property_change', () => sub, () => data.dPayload, 'hello', 10000] },
147
+
148
+ // AVOID — bypasses UI, doesn't test the full flow
149
+ { run: ['execute_action', () => sub, generators.gClient.id, 'GENERATOR_MQTT_PUBLISH',
150
+ { topic: 'test', payload: 'hello', qos: '0' }] },
151
+ ```
118
152
 
119
153
  ## Recording Automations
120
154
 
121
155
  In BRICKS Editor Preview mode:
156
+
122
157
  1. Perform operations normally
123
158
  2. Open menu (right-bottom corner)
124
159
  3. Select "Record Events as Automation"
@@ -127,12 +162,15 @@ In BRICKS Editor Preview mode:
127
162
  ## Running Automations
128
163
 
129
164
  ### Manual Run
165
+
130
166
  `Menu` → `Automations` → Select automation → `Run`
131
167
 
132
168
  ### On Launch
169
+
133
170
  `Bind Device` → `Select Automation` (only `launch` or `cron` types)
134
171
 
135
172
  ### Scheduled (Cron)
173
+
136
174
  `Bind Device` → `Cron Automation` (allows multi-select)
137
175
 
138
176
  Use [crontab.guru](https://crontab.guru) to build cron expressions.
@@ -144,7 +182,7 @@ Visual regression testing with screenshot comparison:
144
182
  ```typescript
145
183
  {
146
184
  __typename: 'TestCase',
147
- id: 'screenshot-dashboard',
185
+ id: makeId('test_case'),
148
186
  name: 'Match dashboard screenshot',
149
187
  run: ['match_screenshot', 'dashboard-initial-state', 0.01, 3],
150
188
  exit_on_failed: true,
@@ -156,6 +194,7 @@ Visual regression testing with screenshot comparison:
156
194
  ```
157
195
 
158
196
  Screenshots can be stored:
197
+
159
198
  - Local file system
160
199
  - Media Flow workspace
161
200
 
@@ -165,11 +204,18 @@ First run captures baseline. Use "Run with Update" to update baseline.
165
204
 
166
205
  Automations work with Modules. Use Manual Run in Preview mode for module testing.
167
206
 
207
+ ## Important Notes
208
+
209
+ - **Automation map key**: Always use `'AUTOMATION_MAP_DEFAULT'` as the automation map ID (not `makeId()`). The preview test runner reads from `automationMap['AUTOMATION_MAP_DEFAULT']?.map`.
210
+ - **Valid makeId types**: Use `'test'` for AutomationTest, `'test_case'` for TestCase, `'test_var'` for TestVariable. Do NOT use `'automation_test'` or `'automation_test_map'`.
211
+ - **handler in execute_action**: Pass the entity's `.id` string (e.g., `bricks.bInput.id`), not a getter function.
212
+
168
213
  ## Best Practices
169
214
 
170
215
  1. **Test culture**: Create automations for every significant flow
171
216
  2. **CI/CD integration**: Use `launch` automations for deployment validation
172
- 3. **Incremental waits**: Use `EXPECT_*` steps with appropriate timeouts
217
+ 3. **Incremental waits**: Use `wait_until_property_change` with appropriate timeouts
173
218
  4. **Visual testing**: Add screenshot comparisons for critical UI states
174
219
  5. **Cron monitoring**: Schedule health checks for production displays
175
220
  6. **Isolation**: Each automation should be independent and idempotent
221
+ 7. **UI-first testing**: Simulate real user interactions (text input, button press) rather than calling generators directly
@@ -14,8 +14,9 @@ When mobile devices or embedded systems lack hardware for local AI inference (LL
14
14
 
15
15
  ## Supported Generators
16
16
 
17
- - [LLM (GGML)](generator_LLM) - Local Large Language Model inference
18
- - [Speech-to-Text (GGML)](generator_SpeechInference) - Local Speech-to-Text inference
17
+ - LLM (GGML) (LlmMlx.ts) - Local Large Language Model inference with GGML
18
+ - LLM (MLX) (LlmGgml.ts) - Local Large Language Model inference with MLX
19
+ - Speech-to-Text (GGML) (SpeechToTextGgml.ts) - Local Speech-to-Text inference with GGML
19
20
 
20
21
  ## Client Configuration
21
22
 
@@ -39,7 +40,7 @@ In generator properties, configure Buttress settings:
39
40
  ## Generator Configuration Example
40
41
 
41
42
  ```typescript
42
- import { makeId } from 'bricks-project'
43
+ import { makeId } from 'bricks-ctor'
43
44
 
44
45
  const llmGenerator: GeneratorLLM = {
45
46
  __typename: 'Generator',
@@ -50,10 +51,12 @@ const llmGenerator: GeneratorLLM = {
50
51
  property: {
51
52
  modelUrl: 'https://huggingface.co/ggml-org/gemma-3-12b-it-qat-GGUF/resolve/main/gemma-3-12b-it-qat-q4_0.gguf',
52
53
  contextSize: 8192,
53
- buttressEnabled: true,
54
- buttressUrl: 'http://192.168.1.100:2080',
55
- buttressFallbackType: 'use-local',
56
- buttressStrategy: 'prefer-best',
54
+ buttressConnectionSettings: {
55
+ enabled: true,
56
+ url: 'http://192.168.1.100:2080',
57
+ fallbackType: 'use-local',
58
+ strategy: 'prefer-best',
59
+ },
57
60
  },
58
61
  events: {},
59
62
  switches: [],
@@ -7,7 +7,7 @@ Transform and compute Data Bank values using JavaScript scripts.
7
7
  JavaScript code executed in a sandbox with access to inputs and outputs.
8
8
 
9
9
  ```typescript
10
- import { makeId } from 'bricks-project'
10
+ import { makeId } from 'bricks-ctor'
11
11
 
12
12
  const calculation: DataCalculationScript = {
13
13
  __typename: 'DataCalculationScript',
@@ -49,7 +49,7 @@ const subspace: Subspace = {
49
49
  ### Data Local Sync
50
50
 
51
51
  ```typescript
52
- import { makeId } from 'bricks-project'
52
+ import { makeId } from 'bricks-ctor'
53
53
 
54
54
  const data: Data = {
55
55
  __typename: 'Data',
@@ -65,7 +65,7 @@ const data: Data = {
65
65
  ### Generator Local Sync
66
66
 
67
67
  ```typescript
68
- import { makeId } from 'bricks-project'
68
+ import { makeId } from 'bricks-ctor'
69
69
 
70
70
  const generator: GeneratorTimer = {
71
71
  __typename: 'Generator',
@@ -21,7 +21,7 @@ Use `Generator Media Flow` to:
21
21
  Quick setup: Create new Property with `As Media Resource file list?` option.
22
22
 
23
23
  ```typescript
24
- import { makeId } from 'bricks-project'
24
+ import { makeId } from 'bricks-ctor'
25
25
 
26
26
  const mediaListGenerator: GeneratorMediaFlow = {
27
27
  __typename: 'Generator',
@@ -52,7 +52,7 @@ Link Data properties to Media Flow for asset selection:
52
52
  | `lottie-file-uri` | Lottie animation selector |
53
53
 
54
54
  ```typescript
55
- import { makeId } from 'bricks-project'
55
+ import { makeId } from 'bricks-ctor'
56
56
 
57
57
  const backgroundImage: Data = {
58
58
  __typename: 'Data',
@@ -84,7 +84,7 @@ Assets with these kinds are **preloaded** during application launch.
84
84
  Connect Generator Media Flow output to Brick Slideshow:
85
85
 
86
86
  ```typescript
87
- import { makeId, linkData } from 'bricks-project'
87
+ import { makeId, linkData } from 'bricks-ctor'
88
88
 
89
89
  const slideshow: BrickSlideshow = {
90
90
  __typename: 'Brick',