@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.
Files changed (129) hide show
  1. package/compile/action-name-map.ts +988 -0
  2. package/compile/index.ts +1245 -0
  3. package/compile/util.ts +358 -0
  4. package/index.ts +6 -0
  5. package/package.json +28 -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 +32 -0
  9. package/skills/bricks-project/rules/animation.md +159 -0
  10. package/skills/bricks-project/rules/architecture-patterns.md +69 -0
  11. package/skills/bricks-project/rules/automations.md +221 -0
  12. package/skills/bricks-project/rules/buttress.md +156 -0
  13. package/skills/bricks-project/rules/data-calculation.md +208 -0
  14. package/skills/bricks-project/rules/local-sync.md +129 -0
  15. package/skills/bricks-project/rules/media-flow.md +158 -0
  16. package/skills/bricks-project/rules/remote-data-bank.md +196 -0
  17. package/skills/bricks-project/rules/standby-transition.md +124 -0
  18. package/skills/rive-marketplace/SKILL.md +99 -0
  19. package/tools/deploy.ts +151 -0
  20. package/tools/icons/.gitattributes +1 -0
  21. package/tools/icons/fa6pro-glyphmap.json +4686 -0
  22. package/tools/icons/fa6pro-meta.json +3671 -0
  23. package/tools/mcp-server.ts +28 -0
  24. package/tools/mcp-tools/compile.ts +91 -0
  25. package/tools/mcp-tools/huggingface.ts +762 -0
  26. package/tools/mcp-tools/icons.ts +70 -0
  27. package/tools/mcp-tools/lottie.ts +102 -0
  28. package/tools/mcp-tools/media.ts +110 -0
  29. package/tools/postinstall.ts +229 -0
  30. package/tools/preview-main.mjs +293 -0
  31. package/tools/preview.ts +143 -0
  32. package/tools/pull.ts +116 -0
  33. package/tsconfig.json +16 -0
  34. package/types/animation.ts +100 -0
  35. package/types/automation.ts +235 -0
  36. package/types/brick-base.ts +80 -0
  37. package/types/bricks/Camera.ts +246 -0
  38. package/types/bricks/Chart.ts +372 -0
  39. package/types/bricks/GenerativeMedia.ts +276 -0
  40. package/types/bricks/Icon.ts +98 -0
  41. package/types/bricks/Image.ts +114 -0
  42. package/types/bricks/Items.ts +476 -0
  43. package/types/bricks/Lottie.ts +168 -0
  44. package/types/bricks/Maps.ts +262 -0
  45. package/types/bricks/QrCode.ts +117 -0
  46. package/types/bricks/Rect.ts +150 -0
  47. package/types/bricks/RichText.ts +128 -0
  48. package/types/bricks/Rive.ts +220 -0
  49. package/types/bricks/Slideshow.ts +201 -0
  50. package/types/bricks/Svg.ts +99 -0
  51. package/types/bricks/Text.ts +148 -0
  52. package/types/bricks/TextInput.ts +242 -0
  53. package/types/bricks/Video.ts +175 -0
  54. package/types/bricks/VideoStreaming.ts +112 -0
  55. package/types/bricks/WebRtcStream.ts +65 -0
  56. package/types/bricks/WebView.ts +168 -0
  57. package/types/bricks/index.ts +21 -0
  58. package/types/canvas.ts +82 -0
  59. package/types/common.ts +144 -0
  60. package/types/data-calc-command.ts +7005 -0
  61. package/types/data-calc-script.ts +21 -0
  62. package/types/data-calc.ts +11 -0
  63. package/types/data.ts +95 -0
  64. package/types/generators/AlarmClock.ts +110 -0
  65. package/types/generators/Assistant.ts +621 -0
  66. package/types/generators/BleCentral.ts +247 -0
  67. package/types/generators/BlePeripheral.ts +208 -0
  68. package/types/generators/CanvasMap.ts +74 -0
  69. package/types/generators/CastlesPay.ts +87 -0
  70. package/types/generators/DataBank.ts +160 -0
  71. package/types/generators/File.ts +432 -0
  72. package/types/generators/GraphQl.ts +132 -0
  73. package/types/generators/Http.ts +222 -0
  74. package/types/generators/HttpServer.ts +176 -0
  75. package/types/generators/Information.ts +103 -0
  76. package/types/generators/Intent.ts +168 -0
  77. package/types/generators/Iterator.ts +108 -0
  78. package/types/generators/Keyboard.ts +105 -0
  79. package/types/generators/LlmAnthropicCompat.ts +212 -0
  80. package/types/generators/LlmAppleBuiltin.ts +159 -0
  81. package/types/generators/LlmGgml.ts +861 -0
  82. package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
  83. package/types/generators/LlmMlx.ts +227 -0
  84. package/types/generators/LlmOnnx.ts +213 -0
  85. package/types/generators/LlmOpenAiCompat.ts +244 -0
  86. package/types/generators/LlmQualcommAiEngine.ts +247 -0
  87. package/types/generators/Mcp.ts +637 -0
  88. package/types/generators/McpServer.ts +289 -0
  89. package/types/generators/MediaFlow.ts +170 -0
  90. package/types/generators/MqttBroker.ts +141 -0
  91. package/types/generators/MqttClient.ts +141 -0
  92. package/types/generators/Question.ts +408 -0
  93. package/types/generators/RealtimeTranscription.ts +279 -0
  94. package/types/generators/RerankerGgml.ts +191 -0
  95. package/types/generators/SerialPort.ts +151 -0
  96. package/types/generators/SoundPlayer.ts +94 -0
  97. package/types/generators/SoundRecorder.ts +130 -0
  98. package/types/generators/SpeechToTextGgml.ts +415 -0
  99. package/types/generators/SpeechToTextOnnx.ts +236 -0
  100. package/types/generators/SpeechToTextPlatform.ts +85 -0
  101. package/types/generators/SqLite.ts +159 -0
  102. package/types/generators/Step.ts +107 -0
  103. package/types/generators/SttAppleBuiltin.ts +130 -0
  104. package/types/generators/Tcp.ts +126 -0
  105. package/types/generators/TcpServer.ts +147 -0
  106. package/types/generators/TextToSpeechAppleBuiltin.ts +127 -0
  107. package/types/generators/TextToSpeechGgml.ts +221 -0
  108. package/types/generators/TextToSpeechOnnx.ts +178 -0
  109. package/types/generators/TextToSpeechOpenAiLike.ts +121 -0
  110. package/types/generators/ThermalPrinter.ts +191 -0
  111. package/types/generators/Tick.ts +83 -0
  112. package/types/generators/Udp.ts +120 -0
  113. package/types/generators/VadGgml.ts +250 -0
  114. package/types/generators/VadOnnx.ts +231 -0
  115. package/types/generators/VadTraditional.ts +138 -0
  116. package/types/generators/VectorStore.ts +257 -0
  117. package/types/generators/Watchdog.ts +107 -0
  118. package/types/generators/WebCrawler.ts +103 -0
  119. package/types/generators/WebRtc.ts +181 -0
  120. package/types/generators/WebSocket.ts +148 -0
  121. package/types/generators/index.ts +57 -0
  122. package/types/index.ts +13 -0
  123. package/types/subspace.ts +59 -0
  124. package/types/switch.ts +51 -0
  125. package/types/system.ts +707 -0
  126. package/utils/calc.ts +126 -0
  127. package/utils/data.ts +497 -0
  128. package/utils/event-props.ts +836 -0
  129. package/utils/id.ts +80 -0
@@ -0,0 +1,21 @@
1
+ /* Auto generated by build script */
2
+ import type { Data } from './data'
3
+ import type { DataCalculation } from './data-calc'
4
+
5
+ export type DataCalculationScript = DataCalculation & {
6
+ __typename: 'DataCalculationScript'
7
+ note?: string
8
+ enableAsync: boolean
9
+ code: string
10
+ inputs: Array<{
11
+ data: () => Data
12
+ key: string
13
+ trigger?: boolean
14
+ }>
15
+ error: (() => Data) | null
16
+ output: (() => Data) | null
17
+ outputs: Array<{
18
+ key: string
19
+ data: () => Data
20
+ }>
21
+ }
@@ -0,0 +1,11 @@
1
+ /* DataCalculation has two types: DataCalculationScript and DataCalculationMap */
2
+ export interface DataCalculation {
3
+ __typename: string
4
+ id: string
5
+ title?: string
6
+ description?: string
7
+ hideShortRef?: boolean
8
+ // Auto: Run the calculation when inputs change and allow triggers. Careful with circular dependencies!
9
+ // Manual: Only run the calculation when manually triggered by System Action PROPERTY_BANK_COMMAND
10
+ triggerMode?: 'auto' | 'manual'
11
+ }
package/types/data.ts ADDED
@@ -0,0 +1,95 @@
1
+ /* Auto generated by build script */
2
+ import type { SubspaceID, EventAction, LocalSyncStrategy } from './common'
3
+
4
+ interface DataDef {
5
+ events?: {
6
+ /* Event on update */
7
+ update?: Array<EventAction>
8
+ /* Event on value change */
9
+ valueChange?: Array<EventAction>
10
+ /* Event on value change and value matched the `Hit Regex` */
11
+ valueHit?: Array<EventAction>
12
+ /* Event on value change and value `not` matched the `Hit Regex` */
13
+ valueNotHit?: Array<EventAction>
14
+ }
15
+ }
16
+
17
+ export type Data<T = any> = DataDef & {
18
+ __typename: 'Data'
19
+ id: string
20
+ alias?: string
21
+ title: string
22
+ description?: string
23
+ hideShortRef?: boolean
24
+ metadata?: {
25
+ linked?: Array<SubspaceID>
26
+ linkedFrom?: SubspaceID
27
+ [key: string]: any
28
+ }
29
+ remoteUpdate?: { type: 'auto' | 'device-specific' } | { type: 'global-data'; id: string }
30
+ // Determine how the property is changed via another subspaces.
31
+ routing?: 'default' | 'read-only'
32
+ // Persist data, so that the data will be keep after refresh.
33
+ persistData?: boolean
34
+ localSyncUpdateMode?: LocalSyncStrategy
35
+ type: 'string' | 'number' | 'bool' | 'array' | 'object' | 'any'
36
+ schema?: object
37
+ hit_equal?: any
38
+ hit_regex?: string
39
+ kind?:
40
+ | {
41
+ type: 'id'
42
+ idType?: 'brick' | 'generator' | 'canvas' | 'animation'
43
+ }
44
+ | {
45
+ type: 'auto-generated-item-id'
46
+ idType?: 'canvas'
47
+ }
48
+ | {
49
+ type: 'unit'
50
+ unit?: 'ms' | 'grid' | 'px'
51
+ max?: number
52
+ min?: number
53
+ step?: number
54
+ }
55
+ | DataAssetKind
56
+ | {
57
+ type:
58
+ | 'color'
59
+ | 'datetime'
60
+ | 'graphql'
61
+ | 'rich-text-content'
62
+ | 'sandbox-script'
63
+ | 'llm-prompt'
64
+ | 'llm-messages'
65
+ | 'llm-tools'
66
+ | 'mcp-server-resources'
67
+ | 'mcp-server-tools'
68
+ | 'mcp-server-prompts'
69
+ }
70
+ value: T
71
+ }
72
+
73
+ export type DataAssetKind = {
74
+ type:
75
+ | 'media-resource-image'
76
+ | 'media-resource-video'
77
+ | 'media-resource-audio'
78
+ | 'media-resource-file'
79
+ | 'lottie-file-uri'
80
+ | 'rive-file-uri'
81
+ | 'ggml-model-asset'
82
+ | 'gguf-model-asset'
83
+ | 'binary-asset'
84
+ preload?: {
85
+ type: 'url'
86
+ hashType: 'md5' | 'sha256' | 'sha1'
87
+ hash: string
88
+ }
89
+ metadata?: { [key: string]: any }
90
+ }
91
+
92
+ export type DataLink = {
93
+ __typename: 'DataLink'
94
+ data: () => Data
95
+ }
@@ -0,0 +1,110 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * Schedule events using cron expressions (e.g. daily, hourly)
4
+ */
5
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
+ import type { Data, DataLink } from '../data'
7
+ import type {
8
+ Brick,
9
+ Generator,
10
+ EventAction,
11
+ ActionWithDataParams,
12
+ ActionWithParams,
13
+ Action,
14
+ EventProperty,
15
+ } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
17
+
18
+ /* Start the alarm clock */
19
+ export type GeneratorAlarmClockActionStart = Action & {
20
+ __actionName: 'GENERATOR_ALARM_CLOCK_START'
21
+ }
22
+
23
+ /* Pause the alarm clock */
24
+ export type GeneratorAlarmClockActionPause = Action & {
25
+ __actionName: 'GENERATOR_ALARM_CLOCK_PAUSE'
26
+ }
27
+
28
+ interface GeneratorAlarmClockDef {
29
+ /*
30
+ Default property:
31
+ {
32
+ "init": false,
33
+ "timezone": "UTC",
34
+ "cron": "* * * * *",
35
+ "min": "",
36
+ "hour": "",
37
+ "dom": "",
38
+ "mon": "",
39
+ "dow": ""
40
+ }
41
+ */
42
+ property?: {
43
+ /* Start alarm clock on generator initialized */
44
+ init?: boolean | DataLink
45
+ /* Timezone */
46
+ timezone?: string | DataLink
47
+ /* Max count of alarm clock trigs */
48
+ maxTrigs?: number | DataLink
49
+ /* Time to start alarm clock */
50
+ startAt?: string | DataLink | string | DataLink | DataLink
51
+ /* Time to end alarm clock (Empty for not end) */
52
+ stopAt?: string | DataLink | string | DataLink | DataLink
53
+ /* Setting trigger rule by cron tab (Ref: https://crontab.guru/) */
54
+ cron?: string | DataLink
55
+ /* minute */
56
+ min?: string | DataLink
57
+ /* hour */
58
+ hour?: string | DataLink
59
+ /* day (month) */
60
+ dom?: string | DataLink
61
+ /* month */
62
+ mon?: string | DataLink
63
+ /* day (week) */
64
+ dow?: string | DataLink
65
+ }
66
+ events?: {
67
+ /* Event for cron rule is not invalid */
68
+ onRuleInvalid?: Array<
69
+ EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onRuleInvalid']>
70
+ >
71
+ /* Event for alarm clock start */
72
+ onStart?: Array<EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onStart']>>
73
+ /* Event for alarm clock trig */
74
+ onTrig?: Array<EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onTrig']>>
75
+ /* Event for alarm clock stop */
76
+ onEnd?: Array<EventAction<string & keyof TemplateEventPropsMap['AlarmClock']['onEnd']>>
77
+ }
78
+ outlets?: {
79
+ /* Current time of each alarm clock trig */
80
+ trigTime?: () => Data<string>
81
+ /* Current timestamp (unix time) of each alarm clock trig */
82
+ trigTimestamp?: () => Data<string | number>
83
+ /* Count of alarm clock trigs */
84
+ trigCount?: () => Data<string | number>
85
+ /* Is alarm clock running? */
86
+ running?: () => Data<boolean | string | number>
87
+ }
88
+ }
89
+
90
+ /* Schedule events using cron expressions (e.g. daily, hourly) */
91
+ export type GeneratorAlarmClock = Generator &
92
+ GeneratorAlarmClockDef & {
93
+ templateKey: 'GENERATOR_ALARM_CLOCK'
94
+ switches?: Array<
95
+ SwitchDef &
96
+ GeneratorAlarmClockDef & {
97
+ conds?: Array<{
98
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
99
+ cond:
100
+ | SwitchCondInnerStateCurrentCanvas
101
+ | SwitchCondData
102
+ | {
103
+ __typename: 'SwitchCondInnerStateOutlet'
104
+ outlet: 'trigTime' | 'trigTimestamp' | 'trigCount' | 'running'
105
+ value: any
106
+ }
107
+ }>
108
+ }
109
+ >
110
+ }