@fugood/bricks-project 2.23.3 → 2.23.5-1

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 (97) hide show
  1. package/compile/action-name-map.ts +14 -0
  2. package/compile/index.ts +29 -0
  3. package/package.json +3 -3
  4. package/skills/bricks-project/rules/architecture-patterns.md +7 -0
  5. package/skills/bricks-project/rules/buttress.md +9 -6
  6. package/tools/mcp-server.ts +10 -880
  7. package/tools/mcp-tools/compile.ts +91 -0
  8. package/tools/mcp-tools/huggingface.ts +763 -0
  9. package/tools/mcp-tools/icons.ts +60 -0
  10. package/tools/mcp-tools/lottie.ts +102 -0
  11. package/tools/mcp-tools/media.ts +110 -0
  12. package/tools/postinstall.ts +113 -28
  13. package/tools/pull.ts +25 -9
  14. package/types/animation.ts +4 -0
  15. package/types/automation.ts +3 -0
  16. package/types/bricks/Camera.ts +33 -6
  17. package/types/bricks/GenerativeMedia.ts +5 -5
  18. package/types/bricks/Icon.ts +2 -2
  19. package/types/bricks/Image.ts +3 -3
  20. package/types/bricks/Items.ts +6 -6
  21. package/types/bricks/Lottie.ts +3 -3
  22. package/types/bricks/Maps.ts +3 -3
  23. package/types/bricks/QrCode.ts +3 -3
  24. package/types/bricks/Rect.ts +3 -3
  25. package/types/bricks/RichText.ts +2 -2
  26. package/types/bricks/Slideshow.ts +1 -1
  27. package/types/bricks/Svg.ts +2 -2
  28. package/types/bricks/Text.ts +3 -3
  29. package/types/bricks/TextInput.ts +10 -6
  30. package/types/bricks/Video.ts +3 -3
  31. package/types/bricks/VideoStreaming.ts +2 -2
  32. package/types/bricks/WebView.ts +3 -3
  33. package/types/canvas.ts +2 -0
  34. package/types/common.ts +5 -0
  35. package/types/data-calc-command.ts +2 -0
  36. package/types/data-calc.ts +1 -0
  37. package/types/data.ts +2 -0
  38. package/types/generators/AlarmClock.ts +4 -4
  39. package/types/generators/Assistant.ts +53 -8
  40. package/types/generators/BleCentral.ts +11 -3
  41. package/types/generators/BlePeripheral.ts +3 -3
  42. package/types/generators/CanvasMap.ts +3 -3
  43. package/types/generators/CastlesPay.ts +2 -2
  44. package/types/generators/DataBank.ts +29 -2
  45. package/types/generators/File.ts +62 -13
  46. package/types/generators/GraphQl.ts +2 -2
  47. package/types/generators/Http.ts +25 -6
  48. package/types/generators/HttpServer.ts +4 -4
  49. package/types/generators/Information.ts +1 -1
  50. package/types/generators/Intent.ts +7 -1
  51. package/types/generators/Iterator.ts +5 -5
  52. package/types/generators/Keyboard.ts +15 -5
  53. package/types/generators/LlmAnthropicCompat.ts +9 -3
  54. package/types/generators/LlmAppleBuiltin.ts +4 -4
  55. package/types/generators/LlmGgml.ts +63 -13
  56. package/types/generators/LlmMlx.ts +210 -0
  57. package/types/generators/LlmOnnx.ts +13 -4
  58. package/types/generators/LlmOpenAiCompat.ts +19 -3
  59. package/types/generators/LlmQualcommAiEngine.ts +29 -5
  60. package/types/generators/Mcp.ts +331 -16
  61. package/types/generators/McpServer.ts +34 -7
  62. package/types/generators/MediaFlow.ts +24 -6
  63. package/types/generators/MqttBroker.ts +9 -3
  64. package/types/generators/MqttClient.ts +10 -4
  65. package/types/generators/Question.ts +4 -4
  66. package/types/generators/RealtimeTranscription.ts +81 -10
  67. package/types/generators/RerankerGgml.ts +19 -5
  68. package/types/generators/SerialPort.ts +5 -5
  69. package/types/generators/SoundPlayer.ts +1 -1
  70. package/types/generators/SoundRecorder.ts +16 -5
  71. package/types/generators/SpeechToTextGgml.ts +27 -7
  72. package/types/generators/SpeechToTextOnnx.ts +3 -3
  73. package/types/generators/SpeechToTextPlatform.ts +3 -3
  74. package/types/generators/SqLite.ts +9 -5
  75. package/types/generators/Step.ts +2 -2
  76. package/types/generators/SttAppleBuiltin.ts +4 -4
  77. package/types/generators/Tcp.ts +3 -3
  78. package/types/generators/TcpServer.ts +5 -5
  79. package/types/generators/TextToSpeechAppleBuiltin.ts +3 -3
  80. package/types/generators/TextToSpeechGgml.ts +3 -3
  81. package/types/generators/TextToSpeechOnnx.ts +3 -3
  82. package/types/generators/TextToSpeechOpenAiLike.ts +3 -3
  83. package/types/generators/ThermalPrinter.ts +4 -4
  84. package/types/generators/Tick.ts +2 -2
  85. package/types/generators/Udp.ts +8 -3
  86. package/types/generators/VadGgml.ts +34 -5
  87. package/types/generators/VadOnnx.ts +27 -4
  88. package/types/generators/VadTraditional.ts +13 -7
  89. package/types/generators/VectorStore.ts +22 -5
  90. package/types/generators/Watchdog.ts +10 -5
  91. package/types/generators/WebCrawler.ts +3 -3
  92. package/types/generators/WebRtc.ts +14 -8
  93. package/types/generators/WebSocket.ts +4 -4
  94. package/types/generators/index.ts +1 -0
  95. package/types/subspace.ts +1 -0
  96. package/types/system.ts +1 -1
  97. package/utils/event-props.ts +104 -87
@@ -786,6 +786,20 @@ export const templateActionNameMap = {
786
786
  documents: 'GENERATOR_RERANKER_DOCUMENTS',
787
787
  },
788
788
  },
789
+ GENERATOR_MLX_LLM: {
790
+ GENERATOR_MLX_LLM_LOAD_MODEL: {
791
+ modelId: 'GENERATOR_MLX_LLM_MODEL_ID',
792
+ vlm: 'GENERATOR_MLX_LLM_VLM',
793
+ },
794
+ GENERATOR_MLX_LLM_COMPLETION: {
795
+ messages: 'GENERATOR_MLX_LLM_MESSAGES',
796
+ tools: 'GENERATOR_MLX_LLM_TOOLS',
797
+ maxTokens: 'GENERATOR_MLX_LLM_MAX_TOKENS',
798
+ temperature: 'GENERATOR_MLX_LLM_TEMPERATURE',
799
+ topP: 'GENERATOR_MLX_LLM_TOP_P',
800
+ repetitionPenalty: 'GENERATOR_MLX_LLM_REPETITION_PENALTY',
801
+ },
802
+ },
789
803
  GENERATOR_QNN_LLM: {
790
804
  GENERATOR_QNN_LLM_PROCESS: {
791
805
  prompt: 'GENERATOR_QNN_LLM_PROMPT',
package/compile/index.ts CHANGED
@@ -266,6 +266,7 @@ const compileApplicationSettings = (settings: Application['settings']) => ({
266
266
  use_gemini_api_key_system_data: settings.ai.useGeminiApiKeySystemData,
267
267
  }
268
268
  : undefined,
269
+ hide_short_refs: settings?.hideShortRefs,
269
270
  })
270
271
 
271
272
  const animationTypeMap = {
@@ -385,6 +386,7 @@ function compileRunArray(run: unknown[]): unknown[] {
385
386
  const compileTestCase = (testCase: TestCase) => ({
386
387
  id: testCase.id,
387
388
  name: testCase.name,
389
+ hide_short_ref: testCase.hideShortRef,
388
390
  run: compileRunArray(testCase.run),
389
391
  exit_on_failed: testCase.exit_on_failed,
390
392
  commented: testCase.commented,
@@ -449,6 +451,7 @@ const compileAutomationTest = (
449
451
  return {
450
452
  id: testId,
451
453
  title: test.title,
454
+ hide_short_ref: test.hideShortRef,
452
455
  timeout: test.timeout,
453
456
  trigger_type: test.trigger_type,
454
457
  cron: test.cron,
@@ -476,6 +479,7 @@ const compileAutomationTestMap = (testMap: AutomationTestMap, mapId: string) =>
476
479
 
477
480
  return {
478
481
  title: testMap.title,
482
+ hide_short_ref: testMap.hideShortRef,
479
483
  createdAt: testMap.createdAt,
480
484
  map: arrayToIdMap(
481
485
  testMap.tests,
@@ -519,6 +523,7 @@ export const compile = async (app: Application) => {
519
523
  subspaceMap[subspaceId] = {
520
524
  title: subspace.title,
521
525
  description: subspace.description,
526
+ hide_short_ref: subspace.hideShortRef,
522
527
  _expanded: subspace.unexpanded
523
528
  ? {
524
529
  brick: !subspace.unexpanded.brick,
@@ -556,8 +561,10 @@ export const compile = async (app: Application) => {
556
561
  if (animation.__typename === 'Animation') {
557
562
  const animationDef = animation as AnimationDef
558
563
  map[animationId] = {
564
+ alias: animationDef.alias,
559
565
  title: animationDef.title,
560
566
  description: animationDef.description,
567
+ hide_short_ref: animationDef.hideShortRef,
561
568
  animationRunType: animationDef.runType,
562
569
  property: animationDef.property,
563
570
  type: animationTypeMap[animationDef.config.__type],
@@ -569,8 +576,10 @@ export const compile = async (app: Application) => {
569
576
  } else if (animation.__typename === 'AnimationCompose') {
570
577
  const animationDef = animation as AnimationComposeDef
571
578
  map[animationId] = {
579
+ alias: animationDef.alias,
572
580
  title: animationDef.title,
573
581
  description: animationDef.description,
582
+ hide_short_ref: animationDef.hideShortRef,
574
583
  animationRunType: animationDef.runType,
575
584
  compose_type: animationDef.composeType,
576
585
  item_list: animationDef.items.map((item, index) => {
@@ -670,6 +679,8 @@ export const compile = async (app: Application) => {
670
679
  buildList(item, index, 'brickList'),
671
680
  )
672
681
  property.brickList = brickList
682
+ } else if (!brickItems.brickList) {
683
+ property.brickList = []
673
684
  } else {
674
685
  // Not supported Data for brickList
675
686
  throw new TypeError('Not supported Data for brickList directly')
@@ -679,6 +690,8 @@ export const compile = async (app: Application) => {
679
690
  buildList(item, index, 'brickDetails'),
680
691
  )
681
692
  property.brickDetails = brickDetails
693
+ } else if (!brickItems.brickDetails) {
694
+ property.brickDetails = []
682
695
  } else {
683
696
  // Not supported Data for brickList
684
697
  throw new TypeError('Not supported Data for brickList directly')
@@ -686,8 +699,10 @@ export const compile = async (app: Application) => {
686
699
  }
687
700
  map[brickId] = {
688
701
  template_key: brick.templateKey,
702
+ alias: brick.alias,
689
703
  title: brick.title,
690
704
  description: brick.description,
705
+ hide_short_ref: brick.hideShortRef,
691
706
  property,
692
707
  animation: compileAnimations(
693
708
  brick.templateKey,
@@ -754,8 +769,10 @@ export const compile = async (app: Application) => {
754
769
  )
755
770
 
756
771
  map[canvasId] = {
772
+ alias: canvas.alias,
757
773
  title: canvas.title,
758
774
  description: canvas.description,
775
+ hide_short_ref: canvas.hideShortRef,
759
776
  property: compileProperty(
760
777
  canvas.property,
761
778
  `(canvas: ${canvasId}, subspace ${subspaceId})`,
@@ -834,8 +851,10 @@ export const compile = async (app: Application) => {
834
851
 
835
852
  map[generatorId] = {
836
853
  template_key: generator.templateKey,
854
+ alias: generator.alias,
837
855
  title: generator.title,
838
856
  description: generator.description,
857
+ hide_short_ref: generator.hideShortRef,
839
858
  local_sync: generator.localSyncRunMode
840
859
  ? {
841
860
  run_mode: generator.localSyncRunMode,
@@ -904,8 +923,10 @@ export const compile = async (app: Application) => {
904
923
  )
905
924
 
906
925
  map[dataId] = {
926
+ alias: data.alias,
907
927
  title: data.title,
908
928
  description: data.description,
929
+ hide_short_ref: data.hideShortRef,
909
930
  linked: data.metadata?.linked,
910
931
  linkedFrom: data.metadata?.linkedFrom,
911
932
  local_sync: data.localSyncUpdateMode
@@ -939,6 +960,7 @@ export const compile = async (app: Application) => {
939
960
  const calc: any = {
940
961
  title: dataCalc.title,
941
962
  description: dataCalc.description,
963
+ hide_short_ref: dataCalc.hideShortRef,
942
964
  }
943
965
  if (dataCalc.triggerMode) calc.trigger_type = dataCalc.triggerMode
944
966
  if (dataCalc.__typename === 'DataCalculationMap') {
@@ -1025,6 +1047,7 @@ export const compile = async (app: Application) => {
1025
1047
  acc[getNodeId(dataNode, 'data node', nodeIndex)] = {
1026
1048
  title: dataNode.title,
1027
1049
  description: dataNode.description,
1050
+ hide_short_ref: dataNode.hideShortRef,
1028
1051
  type: 'data-node',
1029
1052
  properties: {},
1030
1053
  in: generateInputPorts(dataNode.inputs),
@@ -1050,6 +1073,7 @@ export const compile = async (app: Application) => {
1050
1073
  acc[getNodeId(commandNode, 'command node', nodeIndex)] = {
1051
1074
  title: commandNode.title,
1052
1075
  description: commandNode.description,
1076
+ hide_short_ref: commandNode.hideShortRef,
1053
1077
  type: `command-node-${type}`,
1054
1078
  properties: {
1055
1079
  command: commandNode.__commandName,
@@ -1193,3 +1217,8 @@ export const compile = async (app: Application) => {
1193
1217
  }
1194
1218
  return config
1195
1219
  }
1220
+
1221
+ export const checkConfig = async (configPath: string) => {
1222
+ const { $ } = await import('bun')
1223
+ await $`bricks app check-config ${configPath}`
1224
+ }
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.23.3",
3
+ "version": "2.23.5-1",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "typecheck": "tsc --noEmit",
7
7
  "build": "bun scripts/build.js"
8
8
  },
9
9
  "dependencies": {
10
- "@fugood/bricks-cli": "^2.23.2",
10
+ "@fugood/bricks-cli": "^2.23.5-1",
11
11
  "@huggingface/gguf": "^0.3.2",
12
12
  "@iarna/toml": "^3.0.0",
13
13
  "@modelcontextprotocol/sdk": "^1.15.0",
14
14
  "@toon-format/toon": "^2.1.0",
15
- "@types/escodegen": "^0.0.10",
16
15
  "@types/bun": "^1.3.9",
16
+ "@types/escodegen": "^0.0.10",
17
17
  "@types/lodash": "^4.17.12",
18
18
  "acorn": "^8.13.0",
19
19
  "escodegen": "2.1.0",
@@ -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-project 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:
@@ -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
 
@@ -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: [],