@fugood/bricks-ctor 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.
- package/compile/action-name-map.ts +988 -0
- package/compile/index.ts +1245 -0
- package/compile/util.ts +358 -0
- package/index.ts +6 -0
- package/package.json +28 -0
- package/skills/bricks-design/LICENSE.txt +180 -0
- package/skills/bricks-design/SKILL.md +66 -0
- package/skills/bricks-project/SKILL.md +32 -0
- package/skills/bricks-project/rules/animation.md +159 -0
- package/skills/bricks-project/rules/architecture-patterns.md +69 -0
- package/skills/bricks-project/rules/automations.md +221 -0
- package/skills/bricks-project/rules/buttress.md +156 -0
- package/skills/bricks-project/rules/data-calculation.md +208 -0
- package/skills/bricks-project/rules/local-sync.md +129 -0
- package/skills/bricks-project/rules/media-flow.md +158 -0
- package/skills/bricks-project/rules/remote-data-bank.md +196 -0
- package/skills/bricks-project/rules/standby-transition.md +124 -0
- package/skills/rive-marketplace/SKILL.md +99 -0
- package/tools/deploy.ts +151 -0
- package/tools/icons/.gitattributes +1 -0
- package/tools/icons/fa6pro-glyphmap.json +4686 -0
- package/tools/icons/fa6pro-meta.json +3671 -0
- package/tools/mcp-server.ts +28 -0
- package/tools/mcp-tools/compile.ts +91 -0
- package/tools/mcp-tools/huggingface.ts +762 -0
- package/tools/mcp-tools/icons.ts +70 -0
- package/tools/mcp-tools/lottie.ts +102 -0
- package/tools/mcp-tools/media.ts +110 -0
- package/tools/postinstall.ts +229 -0
- package/tools/preview-main.mjs +293 -0
- package/tools/preview.ts +143 -0
- package/tools/pull.ts +116 -0
- package/tsconfig.json +16 -0
- package/types/animation.ts +100 -0
- package/types/automation.ts +235 -0
- package/types/brick-base.ts +80 -0
- package/types/bricks/Camera.ts +246 -0
- package/types/bricks/Chart.ts +372 -0
- package/types/bricks/GenerativeMedia.ts +276 -0
- package/types/bricks/Icon.ts +98 -0
- package/types/bricks/Image.ts +114 -0
- package/types/bricks/Items.ts +476 -0
- package/types/bricks/Lottie.ts +168 -0
- package/types/bricks/Maps.ts +262 -0
- package/types/bricks/QrCode.ts +117 -0
- package/types/bricks/Rect.ts +150 -0
- package/types/bricks/RichText.ts +128 -0
- package/types/bricks/Rive.ts +220 -0
- package/types/bricks/Slideshow.ts +201 -0
- package/types/bricks/Svg.ts +99 -0
- package/types/bricks/Text.ts +148 -0
- package/types/bricks/TextInput.ts +242 -0
- package/types/bricks/Video.ts +175 -0
- package/types/bricks/VideoStreaming.ts +112 -0
- package/types/bricks/WebRtcStream.ts +65 -0
- package/types/bricks/WebView.ts +168 -0
- package/types/bricks/index.ts +21 -0
- package/types/canvas.ts +82 -0
- package/types/common.ts +144 -0
- package/types/data-calc-command.ts +7005 -0
- package/types/data-calc-script.ts +21 -0
- package/types/data-calc.ts +11 -0
- package/types/data.ts +95 -0
- package/types/generators/AlarmClock.ts +110 -0
- package/types/generators/Assistant.ts +621 -0
- package/types/generators/BleCentral.ts +247 -0
- package/types/generators/BlePeripheral.ts +208 -0
- package/types/generators/CanvasMap.ts +74 -0
- package/types/generators/CastlesPay.ts +87 -0
- package/types/generators/DataBank.ts +160 -0
- package/types/generators/File.ts +432 -0
- package/types/generators/GraphQl.ts +132 -0
- package/types/generators/Http.ts +222 -0
- package/types/generators/HttpServer.ts +176 -0
- package/types/generators/Information.ts +103 -0
- package/types/generators/Intent.ts +168 -0
- package/types/generators/Iterator.ts +108 -0
- package/types/generators/Keyboard.ts +105 -0
- package/types/generators/LlmAnthropicCompat.ts +212 -0
- package/types/generators/LlmAppleBuiltin.ts +159 -0
- package/types/generators/LlmGgml.ts +861 -0
- package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
- package/types/generators/LlmMlx.ts +227 -0
- package/types/generators/LlmOnnx.ts +213 -0
- package/types/generators/LlmOpenAiCompat.ts +244 -0
- package/types/generators/LlmQualcommAiEngine.ts +247 -0
- package/types/generators/Mcp.ts +637 -0
- package/types/generators/McpServer.ts +289 -0
- package/types/generators/MediaFlow.ts +170 -0
- package/types/generators/MqttBroker.ts +141 -0
- package/types/generators/MqttClient.ts +141 -0
- package/types/generators/Question.ts +408 -0
- package/types/generators/RealtimeTranscription.ts +279 -0
- package/types/generators/RerankerGgml.ts +191 -0
- package/types/generators/SerialPort.ts +151 -0
- package/types/generators/SoundPlayer.ts +94 -0
- package/types/generators/SoundRecorder.ts +130 -0
- package/types/generators/SpeechToTextGgml.ts +415 -0
- package/types/generators/SpeechToTextOnnx.ts +236 -0
- package/types/generators/SpeechToTextPlatform.ts +85 -0
- package/types/generators/SqLite.ts +159 -0
- package/types/generators/Step.ts +107 -0
- package/types/generators/SttAppleBuiltin.ts +130 -0
- package/types/generators/Tcp.ts +126 -0
- package/types/generators/TcpServer.ts +147 -0
- package/types/generators/TextToSpeechAppleBuiltin.ts +127 -0
- package/types/generators/TextToSpeechGgml.ts +221 -0
- package/types/generators/TextToSpeechOnnx.ts +178 -0
- package/types/generators/TextToSpeechOpenAiLike.ts +121 -0
- package/types/generators/ThermalPrinter.ts +191 -0
- package/types/generators/Tick.ts +83 -0
- package/types/generators/Udp.ts +120 -0
- package/types/generators/VadGgml.ts +250 -0
- package/types/generators/VadOnnx.ts +231 -0
- package/types/generators/VadTraditional.ts +138 -0
- package/types/generators/VectorStore.ts +257 -0
- package/types/generators/Watchdog.ts +107 -0
- package/types/generators/WebCrawler.ts +103 -0
- package/types/generators/WebRtc.ts +181 -0
- package/types/generators/WebSocket.ts +148 -0
- package/types/generators/index.ts +57 -0
- package/types/index.ts +13 -0
- package/types/subspace.ts +59 -0
- package/types/switch.ts +51 -0
- package/types/system.ts +707 -0
- package/utils/calc.ts +126 -0
- package/utils/data.ts +497 -0
- package/utils/event-props.ts +836 -0
- package/utils/id.ts +80 -0
package/utils/id.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { v4 as uuid } from 'uuid'
|
|
2
|
+
|
|
3
|
+
let count = 0
|
|
4
|
+
|
|
5
|
+
// Used for snapshot mode
|
|
6
|
+
const countUUID = () => {
|
|
7
|
+
const current = count
|
|
8
|
+
count += 1
|
|
9
|
+
return `00000000-0000-0000-0000-${current.toString().padStart(12, '0')}`
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Make a random id if not want to use fixed id
|
|
13
|
+
export const makeId = (
|
|
14
|
+
type:
|
|
15
|
+
| 'animation'
|
|
16
|
+
| 'brick'
|
|
17
|
+
| 'canvas'
|
|
18
|
+
| 'generator'
|
|
19
|
+
| 'data'
|
|
20
|
+
| 'switch'
|
|
21
|
+
| 'property_bank_command'
|
|
22
|
+
| 'property_bank_calc'
|
|
23
|
+
| 'dynamic-brick'
|
|
24
|
+
| 'automation_map'
|
|
25
|
+
| 'test'
|
|
26
|
+
| 'test_case'
|
|
27
|
+
| 'test_var'
|
|
28
|
+
| 'subspace',
|
|
29
|
+
opts?: {
|
|
30
|
+
snapshotMode?: boolean
|
|
31
|
+
},
|
|
32
|
+
) => {
|
|
33
|
+
if (type === 'subspace') {
|
|
34
|
+
throw new Error('Currently subspace is not supported for ID generation, please use a fixed ID')
|
|
35
|
+
}
|
|
36
|
+
let prefix = ''
|
|
37
|
+
switch (type) {
|
|
38
|
+
case 'animation':
|
|
39
|
+
prefix = 'ANIMATION_'
|
|
40
|
+
break
|
|
41
|
+
case 'brick':
|
|
42
|
+
prefix = 'BRICK_'
|
|
43
|
+
break
|
|
44
|
+
case 'dynamic-brick':
|
|
45
|
+
prefix = 'DYNAMIC_BRICK_'
|
|
46
|
+
break
|
|
47
|
+
case 'canvas':
|
|
48
|
+
prefix = 'CANVAS_'
|
|
49
|
+
break
|
|
50
|
+
case 'generator':
|
|
51
|
+
prefix = 'GENERATOR_'
|
|
52
|
+
break
|
|
53
|
+
case 'data':
|
|
54
|
+
prefix = 'PROPERTY_BANK_DATA_NODE_'
|
|
55
|
+
break
|
|
56
|
+
case 'switch':
|
|
57
|
+
prefix = 'BRICK_STATE_GROUP_'
|
|
58
|
+
break
|
|
59
|
+
case 'property_bank_command':
|
|
60
|
+
prefix = 'PROPERTY_BANK_COMMAND_NODE_'
|
|
61
|
+
break
|
|
62
|
+
case 'property_bank_calc':
|
|
63
|
+
prefix = 'PROPERTY_BANK_COMMAND_MAP_'
|
|
64
|
+
break
|
|
65
|
+
case 'automation_map':
|
|
66
|
+
prefix = 'AUTOMATION_MAP_'
|
|
67
|
+
break
|
|
68
|
+
case 'test':
|
|
69
|
+
prefix = 'TEST_'
|
|
70
|
+
break
|
|
71
|
+
case 'test_case':
|
|
72
|
+
prefix = 'TEST_CASE_'
|
|
73
|
+
break
|
|
74
|
+
case 'test_var':
|
|
75
|
+
prefix = 'TEST_VAR_'
|
|
76
|
+
break
|
|
77
|
+
default:
|
|
78
|
+
}
|
|
79
|
+
return `${prefix}${opts?.snapshotMode ? countUUID() : uuid()}`
|
|
80
|
+
}
|