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

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 (126) 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-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-ctor/rules/automations.md +221 -0
  10. package/skills/{bricks-project → bricks-ctor}/rules/buttress.md +10 -7
  11. package/skills/{bricks-project → bricks-ctor}/rules/data-calculation.md +1 -1
  12. package/skills/{bricks-project → bricks-ctor}/rules/local-sync.md +2 -2
  13. package/skills/{bricks-project → bricks-ctor}/rules/media-flow.md +3 -3
  14. package/skills/{bricks-project → bricks-ctor}/rules/remote-data-bank.md +6 -6
  15. package/skills/{bricks-project → bricks-ctor}/rules/standby-transition.md +1 -1
  16. package/skills/bricks-design/LICENSE.txt +180 -0
  17. package/skills/bricks-design/SKILL.md +66 -0
  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/skills/bricks-project/rules/automations.md +0 -175
  125. package/types/generators/TextToSpeechApple.ts +0 -113
  126. package/types/generators/TtsAppleBuiltin.ts +0 -105
@@ -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.
package/tools/deploy.ts CHANGED
@@ -4,29 +4,46 @@ import { parseArgs } from 'util'
4
4
  const cwd = process.cwd()
5
5
 
6
6
  const {
7
- values: { changelogs: changelogsArg, 'changelogs-file': changelogsFile, yes },
7
+ values: {
8
+ changelogs: changelogsArg,
9
+ 'changelogs-file': changelogsFile,
10
+ 'auto-commit': autoCommit,
11
+ 'auto-version': autoVersion,
12
+ version: versionArg,
13
+ yes,
14
+ help,
15
+ },
8
16
  } = parseArgs({
9
17
  args: Bun.argv.slice(2),
10
18
  options: {
11
19
  changelogs: { type: 'string' },
12
20
  'changelogs-file': { type: 'string' },
21
+ 'auto-commit': { type: 'boolean' },
22
+ 'auto-version': { type: 'boolean' },
23
+ version: { type: 'string' },
13
24
  yes: { type: 'boolean', short: 'y' },
25
+ help: { type: 'boolean', short: 'h' },
14
26
  },
15
27
  allowPositionals: true,
16
28
  })
17
29
 
30
+ if (help) {
31
+ console.log(`Options:
32
+ --changelogs <text> Changelogs text for the release
33
+ --changelogs-file <path> Read changelogs from a file
34
+ --auto-commit Auto-commit unstaged changes before deploying
35
+ --auto-version Auto-bump patch version before deploying
36
+ --version <version> Set explicit version for the release
37
+ -y, --yes Skip all prompts
38
+ -h, --help Show this help message`)
39
+ process.exit(0)
40
+ }
41
+
18
42
  // Check git status
19
- const { exitCode } = await $`cd ${cwd} && git status`.nothrow()
43
+ const { exitCode } = await $`cd ${cwd} && git status`.quiet().nothrow()
20
44
  const isGitRepo = exitCode === 0
21
45
 
22
- let commitId = ''
23
- if (isGitRepo) {
24
- const unstagedChanges = await $`cd ${cwd} && git diff --name-only --diff-filter=ACMR`.text()
25
- if (unstagedChanges)
26
- throw new Error('Unstaged changes found, please commit or stash your changes before deploying')
27
-
28
- commitId = (await $`cd ${cwd} && git rev-parse HEAD`.text()).trim()
29
- } else if (!yes) {
46
+ if (!isGitRepo && !yes) {
30
47
  const confirmContinue = prompt('No git repository found, continue? (y/n)')
31
48
  if (confirmContinue !== 'y') throw new Error('Deployment cancelled')
32
49
  }
@@ -35,9 +52,28 @@ if (isGitRepo) {
35
52
  const app = await Bun.file(`${cwd}/application.json`).json()
36
53
  const config = await Bun.file(`${cwd}/.bricks/build/application-config.json`).json()
37
54
 
38
- // Get version from project's package.json
55
+ // Resolve version: explicit flag > auto-bump > package.json
39
56
  const pkgFile = Bun.file(`${cwd}/package.json`)
40
- const version = (await pkgFile.exists()) ? (await pkgFile.json()).version : undefined
57
+ const pkgExists = await pkgFile.exists()
58
+ let version: string | undefined
59
+
60
+ if (versionArg) {
61
+ version = versionArg
62
+ if (pkgExists) {
63
+ const pkg = await pkgFile.json()
64
+ pkg.version = version
65
+ await Bun.write(`${cwd}/package.json`, JSON.stringify(pkg, null, 2) + '\n')
66
+ }
67
+ } else if (autoVersion && pkgExists) {
68
+ const pkg = await pkgFile.json()
69
+ const parts = (pkg.version || '0.0.0').split('.')
70
+ parts[2] = String(Number(parts[2] || 0) + 1)
71
+ version = parts.join('.')
72
+ pkg.version = version
73
+ await Bun.write(`${cwd}/package.json`, JSON.stringify(pkg, null, 2) + '\n')
74
+ } else {
75
+ version = pkgExists ? (await pkgFile.json()).version : undefined
76
+ }
41
77
 
42
78
  // Get changelog from flag or file
43
79
  let changelogs = ''
@@ -53,6 +89,24 @@ if (changelogsArg) {
53
89
  changelogs = prompt('Enter changelogs (optional, press Enter to skip):') || ''
54
90
  }
55
91
 
92
+ // Handle unstaged changes
93
+ let commitId = ''
94
+ if (isGitRepo) {
95
+ const unstagedChanges = await $`cd ${cwd} && git diff --name-only --diff-filter=ACMR`.text()
96
+ if (unstagedChanges) {
97
+ if (autoCommit) {
98
+ const commitMsg = `chore: release ${version || 'new version'}`
99
+ const commitBody = changelogs || '[no changelogs]'
100
+ await $`cd ${cwd} && git add -A && git commit -m ${commitMsg} -m ${commitBody}`
101
+ } else {
102
+ throw new Error(
103
+ 'Unstaged changes found, please commit or stash your changes before deploying',
104
+ )
105
+ }
106
+ }
107
+ commitId = (await $`cd ${cwd} && git rev-parse HEAD`.text()).trim()
108
+ }
109
+
56
110
  // Ask for confirmation
57
111
  if (!yes) {
58
112
  const confirm = prompt('Are you sure you want to deploy? (y/n)')