@fugood/bricks-project 2.22.0-beta.9 → 2.22.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.
- package/compile/action-name-map.ts +108 -17
- package/compile/index.ts +10 -1
- package/package.json +3 -4
- package/tools/postinstall.ts +16 -9
- package/types/animation.ts +2 -1
- package/types/brick-base.ts +79 -0
- package/types/bricks/3DViewer.ts +200 -0
- package/types/bricks/Camera.ts +195 -0
- package/types/bricks/Chart.ts +362 -0
- package/types/bricks/GenerativeMedia.ts +240 -0
- package/types/bricks/Icon.ts +93 -0
- package/types/bricks/Image.ts +104 -0
- package/types/bricks/Items.ts +461 -0
- package/types/bricks/Lottie.ts +159 -0
- package/types/bricks/QrCode.ts +112 -0
- package/types/bricks/Rect.ts +110 -0
- package/types/bricks/RichText.ts +123 -0
- package/types/bricks/Rive.ts +209 -0
- package/types/bricks/Slideshow.ts +155 -0
- package/types/bricks/Svg.ts +94 -0
- package/types/bricks/Text.ts +143 -0
- package/types/bricks/TextInput.ts +231 -0
- package/types/bricks/Video.ts +170 -0
- package/types/bricks/VideoStreaming.ts +107 -0
- package/types/bricks/WebRtcStream.ts +60 -0
- package/types/bricks/WebView.ts +157 -0
- package/types/bricks/index.ts +19 -0
- package/types/common.ts +8 -3
- package/types/data.ts +6 -0
- package/types/generators/AlarmClock.ts +102 -0
- package/types/generators/Assistant.ts +546 -0
- package/types/generators/BleCentral.ts +225 -0
- package/types/generators/BlePeripheral.ts +202 -0
- package/types/generators/CanvasMap.ts +57 -0
- package/types/generators/CastlesPay.ts +77 -0
- package/types/generators/DataBank.ts +123 -0
- package/types/generators/File.ts +351 -0
- package/types/generators/GraphQl.ts +124 -0
- package/types/generators/Http.ts +117 -0
- package/types/generators/HttpServer.ts +164 -0
- package/types/generators/Information.ts +97 -0
- package/types/generators/Intent.ts +107 -0
- package/types/generators/Iterator.ts +95 -0
- package/types/generators/Keyboard.ts +85 -0
- package/types/generators/LlmAnthropicCompat.ts +188 -0
- package/types/generators/LlmGgml.ts +719 -0
- package/types/generators/LlmOnnx.ts +184 -0
- package/types/generators/LlmOpenAiCompat.ts +206 -0
- package/types/generators/LlmQualcommAiEngine.ts +213 -0
- package/types/generators/Mcp.ts +294 -0
- package/types/generators/McpServer.ts +248 -0
- package/types/generators/MediaFlow.ts +142 -0
- package/types/generators/MqttBroker.ts +121 -0
- package/types/generators/MqttClient.ts +129 -0
- package/types/generators/Question.ts +395 -0
- package/types/generators/RealtimeTranscription.ts +180 -0
- package/types/generators/RerankerGgml.ts +153 -0
- package/types/generators/SerialPort.ts +141 -0
- package/types/generators/SoundPlayer.ts +86 -0
- package/types/generators/SoundRecorder.ts +113 -0
- package/types/generators/SpeechToTextGgml.ts +462 -0
- package/types/generators/SpeechToTextOnnx.ts +227 -0
- package/types/generators/SpeechToTextPlatform.ts +75 -0
- package/types/generators/SqLite.ts +118 -0
- package/types/generators/Step.ts +101 -0
- package/types/generators/Tcp.ts +120 -0
- package/types/generators/TcpServer.ts +137 -0
- package/types/generators/TextToSpeechGgml.ts +182 -0
- package/types/generators/TextToSpeechOnnx.ts +169 -0
- package/types/generators/TextToSpeechOpenAiLike.ts +113 -0
- package/types/generators/ThermalPrinter.ts +185 -0
- package/types/generators/Tick.ts +75 -0
- package/types/generators/Udp.ts +109 -0
- package/types/generators/VadGgml.ts +211 -0
- package/types/generators/VectorStore.ts +223 -0
- package/types/generators/Watchdog.ts +96 -0
- package/types/generators/WebCrawler.ts +97 -0
- package/types/generators/WebRtc.ts +165 -0
- package/types/generators/WebSocket.ts +142 -0
- package/types/generators/index.ts +50 -0
- package/types/system.ts +64 -0
- package/utils/data.ts +45 -0
- package/utils/event-props.ts +89 -13
- package/types/bricks.ts +0 -3168
- package/types/generators.ts +0 -7633
|
@@ -100,6 +100,9 @@ export const templateActionNameMap = {
|
|
|
100
100
|
payloadType: 'CHANNEL_PUBLISH_PAYLOAD_TYPE',
|
|
101
101
|
payload: 'CHANNEL_PUBLISH_PAYLOAD',
|
|
102
102
|
},
|
|
103
|
+
DELAY: {
|
|
104
|
+
time: 'DELAY_TIME',
|
|
105
|
+
},
|
|
103
106
|
USE_SHARE_APPLICATION: {
|
|
104
107
|
applicationId: 'APPLICATION_ID',
|
|
105
108
|
releaseVersion: 'RELEASE_VERSION',
|
|
@@ -126,6 +129,17 @@ export const templateActionNameMap = {
|
|
|
126
129
|
behavior: 'BEHAVIOR',
|
|
127
130
|
exceptionMessage: 'EXCEPTION_MESSAGE',
|
|
128
131
|
},
|
|
132
|
+
TRIGGER_APPLICATION_FILTER: {
|
|
133
|
+
name: 'NAME',
|
|
134
|
+
variables: 'VARIABLES',
|
|
135
|
+
result: 'RESULT',
|
|
136
|
+
error: 'ERROR',
|
|
137
|
+
},
|
|
138
|
+
SAVE_UPDATE_SNAPSHOT: {
|
|
139
|
+
snapshotFileIndentifier: 'SNAPSHOT_FILE_INDENTIFIER',
|
|
140
|
+
snapshotSaveResult: 'SNAPSHOT_SAVE_RESULT',
|
|
141
|
+
snapshotErrorResult: 'SNAPSHOT_ERROR_RESULT',
|
|
142
|
+
},
|
|
129
143
|
},
|
|
130
144
|
|
|
131
145
|
BRICK_TEXT_INPUT: {
|
|
@@ -142,6 +156,13 @@ export const templateActionNameMap = {
|
|
|
142
156
|
},
|
|
143
157
|
},
|
|
144
158
|
|
|
159
|
+
BRICK_VIDEO: {
|
|
160
|
+
BRICK_VIDEO_SEEK: {
|
|
161
|
+
seekTime: 'BRICK_VIDEO_SEEK_TIME',
|
|
162
|
+
play: 'BRICK_VIDEO_PLAY',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
|
|
145
166
|
BRICK_SLIDESHOW: {
|
|
146
167
|
BRICK_SLIDESHOW_JUMP_TO_INDEX: {
|
|
147
168
|
index: 'BRICK_SLIDESHOW_INDEX',
|
|
@@ -231,7 +252,12 @@ export const templateActionNameMap = {
|
|
|
231
252
|
index: 'BRICK_ITEMS_INDEX',
|
|
232
253
|
},
|
|
233
254
|
},
|
|
234
|
-
|
|
255
|
+
BRICK_LOTTIE: {
|
|
256
|
+
BRICK_LOTTIE_PLAY: {
|
|
257
|
+
startFrame: 'BRICK_LOTTIE_START_FRAME',
|
|
258
|
+
endFrame: 'BRICK_LOTTIE_END_FRAME',
|
|
259
|
+
},
|
|
260
|
+
},
|
|
235
261
|
BRICK_RIVE: {
|
|
236
262
|
BRICK_RIVE_PLAY: {
|
|
237
263
|
animationName: 'BRICK_RIVE_ANIMATION_NAME',
|
|
@@ -257,6 +283,10 @@ export const templateActionNameMap = {
|
|
|
257
283
|
BRICK_WEBVIEW_INJECT_JAVASCRIPT: {
|
|
258
284
|
javascriptCode: 'BRICK_WEBVIEW_JAVASCRIPT_CODE',
|
|
259
285
|
},
|
|
286
|
+
BRICK_WEBVIEW_QUERY_SELECTOR: {
|
|
287
|
+
querySelector: 'BRICK_WEBVIEW_QUERY_SELECTOR',
|
|
288
|
+
expression: 'BRICK_WEBVIEW_EXPRESSION',
|
|
289
|
+
},
|
|
260
290
|
},
|
|
261
291
|
BRICK_CAMERA: {
|
|
262
292
|
BRICK_CAMERA_TAKE_PICTURE: {
|
|
@@ -468,22 +498,6 @@ export const templateActionNameMap = {
|
|
|
468
498
|
category: 'GENERATOR_INTENT_CATEGORY',
|
|
469
499
|
},
|
|
470
500
|
},
|
|
471
|
-
GENERATOR_TAPPAY_T2P_IOS: {
|
|
472
|
-
GENERATOR_TAPPAY_T2P_IOS_BIND: {
|
|
473
|
-
bindId: 'GENERATOR_TAPPAY_T2P_IOS_BIND_ID',
|
|
474
|
-
bindDescription: 'GENERATOR_TAPPAY_T2P_IOS_BIND_DESCRIPTION',
|
|
475
|
-
},
|
|
476
|
-
GENERATOR_TAPPAY_T2P_IOS_READ_CARD_AND_AUTHORIZATION: {
|
|
477
|
-
amount: 'GENERATOR_TAPPAY_T2P_IOS_AMOUNT',
|
|
478
|
-
orderNumber: 'GENERATOR_TAPPAY_T2P_IOS_ORDER_NUMBER',
|
|
479
|
-
bankTransactionId: 'GENERATOR_TAPPAY_T2P_IOS_BANK_TRANSACTION_ID',
|
|
480
|
-
},
|
|
481
|
-
GENERATOR_TAPPAY_T2P_IOS_GET_RECEIPT: {
|
|
482
|
-
receiptIdentifier: 'GENERATOR_TAPPAY_T2P_IOS_RECEIPT_IDENTIFIER',
|
|
483
|
-
type: 'GENERATOR_TAPPAY_T2P_IOS_TYPE',
|
|
484
|
-
email: 'GENERATOR_TAPPAY_T2P_IOS_EMAIL',
|
|
485
|
-
},
|
|
486
|
-
},
|
|
487
501
|
GENERATOR_CASTLES_PAY: {
|
|
488
502
|
GENERATOR_CASTLES_PAY_SALE: {
|
|
489
503
|
amount: 'GENERATOR_CASTLES_PAY_AMOUNT',
|
|
@@ -552,6 +566,8 @@ export const templateActionNameMap = {
|
|
|
552
566
|
prompt: 'GENERATOR_ONNX_LLM_PROMPT',
|
|
553
567
|
chat: 'GENERATOR_ONNX_LLM_CHAT',
|
|
554
568
|
images: 'GENERATOR_ONNX_LLM_IMAGES',
|
|
569
|
+
tools: 'GENERATOR_ONNX_LLM_TOOLS',
|
|
570
|
+
toolChoice: 'GENERATOR_ONNX_LLM_TOOL_CHOICE',
|
|
555
571
|
},
|
|
556
572
|
},
|
|
557
573
|
GENERATOR_ONNX_STT: {
|
|
@@ -589,7 +605,37 @@ export const templateActionNameMap = {
|
|
|
589
605
|
realtimeVadFreqThold: 'GENERATOR_SPEECH_INFERENCE_REALTIME_VAD_FREQ_THOLD',
|
|
590
606
|
},
|
|
591
607
|
},
|
|
608
|
+
GENERATOR_VAD_INFERENCE: {
|
|
609
|
+
GENERATOR_VAD_INFERENCE_DETECT_FILE: {
|
|
610
|
+
fileUrl: 'GENERATOR_VAD_INFERENCE_FILE_URL',
|
|
611
|
+
threshold: 'GENERATOR_VAD_INFERENCE_THRESHOLD',
|
|
612
|
+
minSpeechDurationMs: 'GENERATOR_VAD_INFERENCE_MIN_SPEECH_DURATION_MS',
|
|
613
|
+
minSilenceDurationMs: 'GENERATOR_VAD_INFERENCE_MIN_SILENCE_DURATION_MS',
|
|
614
|
+
maxSpeechDurationS: 'GENERATOR_VAD_INFERENCE_MAX_SPEECH_DURATION_S',
|
|
615
|
+
speechPadMs: 'GENERATOR_VAD_INFERENCE_SPEECH_PAD_MS',
|
|
616
|
+
samplesOverlap: 'GENERATOR_VAD_INFERENCE_SAMPLES_OVERLAP',
|
|
617
|
+
},
|
|
618
|
+
GENERATOR_VAD_INFERENCE_DETECT_DATA: {
|
|
619
|
+
data: 'GENERATOR_VAD_INFERENCE_DATA',
|
|
620
|
+
threshold: 'GENERATOR_VAD_INFERENCE_THRESHOLD',
|
|
621
|
+
minSpeechDurationMs: 'GENERATOR_VAD_INFERENCE_MIN_SPEECH_DURATION_MS',
|
|
622
|
+
minSilenceDurationMs: 'GENERATOR_VAD_INFERENCE_MIN_SILENCE_DURATION_MS',
|
|
623
|
+
maxSpeechDurationS: 'GENERATOR_VAD_INFERENCE_MAX_SPEECH_DURATION_S',
|
|
624
|
+
speechPadMs: 'GENERATOR_VAD_INFERENCE_SPEECH_PAD_MS',
|
|
625
|
+
samplesOverlap: 'GENERATOR_VAD_INFERENCE_SAMPLES_OVERLAP',
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
|
|
592
629
|
GENERATOR_LLM: {
|
|
630
|
+
GENERATOR_LLM_TOKENIZE: {
|
|
631
|
+
mode: 'GENERATOR_LLM_MODE',
|
|
632
|
+
prompt: 'GENERATOR_LLM_PROMPT',
|
|
633
|
+
promptMediaPaths: 'GENERATOR_LLM_PROMPT_MEDIA_PATHS',
|
|
634
|
+
messages: 'GENERATOR_LLM_MESSAGES',
|
|
635
|
+
},
|
|
636
|
+
GENERATOR_LLM_DETOKENIZE: {
|
|
637
|
+
tokens: 'GENERATOR_LLM_TOKENS',
|
|
638
|
+
},
|
|
593
639
|
GENERATOR_LLM_PROCESS_PROMPT: {
|
|
594
640
|
sessionKey: 'GENERATOR_LLM_SESSION_KEY',
|
|
595
641
|
mode: 'GENERATOR_LLM_MODE',
|
|
@@ -597,10 +643,15 @@ export const templateActionNameMap = {
|
|
|
597
643
|
tools: 'GENERATOR_LLM_TOOLS',
|
|
598
644
|
parallelToolCalls: 'GENERATOR_LLM_PARALLEL_TOOL_CALLS',
|
|
599
645
|
toolChoice: 'GENERATOR_LLM_TOOL_CHOICE',
|
|
646
|
+
enableThinking: 'GENERATOR_LLM_ENABLE_THINKING',
|
|
600
647
|
prompt: 'GENERATOR_LLM_PROMPT',
|
|
648
|
+
promptMediaPaths: 'GENERATOR_LLM_PROMPT_MEDIA_PATHS',
|
|
601
649
|
promptTemplateData: 'GENERATOR_LLM_PROMPT_TEMPLATE_DATA',
|
|
602
650
|
promptTemplateType: 'GENERATOR_LLM_PROMPT_TEMPLATE_TYPE',
|
|
603
651
|
responseFormat: 'GENERATOR_LLM_RESPONSE_FORMAT',
|
|
652
|
+
chatTemplateKwargs: 'GENERATOR_LLM_CHAT_TEMPLATE_KWARGS',
|
|
653
|
+
addGenerationPrompt: 'GENERATOR_LLM_ADD_GENERATION_PROMPT',
|
|
654
|
+
now: 'GENERATOR_LLM_NOW',
|
|
604
655
|
},
|
|
605
656
|
GENERATOR_LLM_COMPLETION: {
|
|
606
657
|
sessionKey: 'GENERATOR_LLM_SESSION_KEY',
|
|
@@ -609,10 +660,16 @@ export const templateActionNameMap = {
|
|
|
609
660
|
tools: 'GENERATOR_LLM_TOOLS',
|
|
610
661
|
parallelToolCalls: 'GENERATOR_LLM_PARALLEL_TOOL_CALLS',
|
|
611
662
|
toolChoice: 'GENERATOR_LLM_TOOL_CHOICE',
|
|
663
|
+
enableThinking: 'GENERATOR_LLM_ENABLE_THINKING',
|
|
664
|
+
useReasoningFormat: 'GENERATOR_LLM_USE_REASONING_FORMAT',
|
|
612
665
|
prompt: 'GENERATOR_LLM_PROMPT',
|
|
666
|
+
promptMediaPaths: 'GENERATOR_LLM_PROMPT_MEDIA_PATHS',
|
|
613
667
|
promptTemplateData: 'GENERATOR_LLM_PROMPT_TEMPLATE_DATA',
|
|
614
668
|
promptTemplateType: 'GENERATOR_LLM_PROMPT_TEMPLATE_TYPE',
|
|
615
669
|
responseFormat: 'GENERATOR_LLM_RESPONSE_FORMAT',
|
|
670
|
+
chatTemplateKwargs: 'GENERATOR_LLM_CHAT_TEMPLATE_KWARGS',
|
|
671
|
+
addGenerationPrompt: 'GENERATOR_LLM_ADD_GENERATION_PROMPT',
|
|
672
|
+
now: 'GENERATOR_LLM_NOW',
|
|
616
673
|
grammar: 'GENERATOR_LLM_GRAMMAR',
|
|
617
674
|
stopWords: 'GENERATOR_LLM_STOP_WORDS',
|
|
618
675
|
predict: 'GENERATOR_LLM_PREDICT',
|
|
@@ -646,10 +703,27 @@ export const templateActionNameMap = {
|
|
|
646
703
|
sessionCustomKey: 'GENERATOR_LLM_SESSION_CUSTOM_KEY',
|
|
647
704
|
},
|
|
648
705
|
},
|
|
706
|
+
GENERATOR_GGML_TTS: {
|
|
707
|
+
GENERATOR_GGML_TTS_GENERATE: {
|
|
708
|
+
text: 'GENERATOR_GGML_TTS_TEXT',
|
|
709
|
+
},
|
|
710
|
+
},
|
|
711
|
+
GENERATOR_RERANKER: {
|
|
712
|
+
GENERATOR_RERANKER_RERANK: {
|
|
713
|
+
query: 'GENERATOR_RERANKER_QUERY',
|
|
714
|
+
documents: 'GENERATOR_RERANKER_DOCUMENTS',
|
|
715
|
+
},
|
|
716
|
+
},
|
|
649
717
|
GENERATOR_QNN_LLM: {
|
|
718
|
+
GENERATOR_QNN_LLM_PROCESS: {
|
|
719
|
+
prompt: 'GENERATOR_QNN_LLM_PROMPT',
|
|
720
|
+
messages: 'GENERATOR_QNN_LLM_MESSAGES',
|
|
721
|
+
tools: 'GENERATOR_QNN_LLM_TOOLS',
|
|
722
|
+
},
|
|
650
723
|
GENERATOR_QNN_LLM_GENERATE: {
|
|
651
724
|
prompt: 'GENERATOR_QNN_LLM_PROMPT',
|
|
652
725
|
messages: 'GENERATOR_QNN_LLM_MESSAGES',
|
|
726
|
+
tools: 'GENERATOR_QNN_LLM_TOOLS',
|
|
653
727
|
},
|
|
654
728
|
},
|
|
655
729
|
GENERATOR_OPENAI_LLM: {
|
|
@@ -672,10 +746,24 @@ export const templateActionNameMap = {
|
|
|
672
746
|
text: 'GENERATOR_OPENAI_TTS_TEXT',
|
|
673
747
|
},
|
|
674
748
|
},
|
|
749
|
+
GENERATOR_ANTHROPIC_LLM: {
|
|
750
|
+
GENERATOR_ANTHROPIC_LLM_COMPLETION: {
|
|
751
|
+
systemMessage: 'GENERATOR_ANTHROPIC_LLM_SYSTEM_MESSAGE',
|
|
752
|
+
messages: 'GENERATOR_ANTHROPIC_LLM_MESSAGES',
|
|
753
|
+
maxTokens: 'GENERATOR_ANTHROPIC_LLM_MAX_TOKENS',
|
|
754
|
+
temperature: 'GENERATOR_ANTHROPIC_LLM_TEMPERATURE',
|
|
755
|
+
topP: 'GENERATOR_ANTHROPIC_LLM_TOP_P',
|
|
756
|
+
topK: 'GENERATOR_ANTHROPIC_LLM_TOP_K',
|
|
757
|
+
stopSequences: 'GENERATOR_ANTHROPIC_LLM_STOP_SEQUENCES',
|
|
758
|
+
tools: 'GENERATOR_ANTHROPIC_LLM_TOOLS',
|
|
759
|
+
toolChoice: 'GENERATOR_ANTHROPIC_LLM_TOOL_CHOICE',
|
|
760
|
+
},
|
|
761
|
+
},
|
|
675
762
|
GENERATOR_ASSISTANT: {
|
|
676
763
|
GENERATOR_ASSISTANT_ADD_MESSAGE: {
|
|
677
764
|
role: 'GENERATOR_ASSISTANT_ROLE',
|
|
678
765
|
content: 'GENERATOR_ASSISTANT_CONTENT',
|
|
766
|
+
image: 'GENERATOR_ASSISTANT_IMAGE',
|
|
679
767
|
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
680
768
|
useFileSearch: 'GENERATOR_ASSISTANT_USE_FILE_SEARCH',
|
|
681
769
|
filePath: 'GENERATOR_ASSISTANT_FILE_PATH',
|
|
@@ -699,12 +787,14 @@ export const templateActionNameMap = {
|
|
|
699
787
|
GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX: {
|
|
700
788
|
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
701
789
|
content: 'GENERATOR_ASSISTANT_CONTENT',
|
|
790
|
+
image: 'GENERATOR_ASSISTANT_IMAGE',
|
|
702
791
|
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
703
792
|
},
|
|
704
793
|
GENERATOR_ASSISTANT_ADD_AUDIO_MESSAGE: {
|
|
705
794
|
role: 'GENERATOR_ASSISTANT_ROLE',
|
|
706
795
|
contentFile: 'GENERATOR_ASSISTANT_CONTENT_FILE',
|
|
707
796
|
contentBase64: 'GENERATOR_ASSISTANT_CONTENT_BASE64',
|
|
797
|
+
image: 'GENERATOR_ASSISTANT_IMAGE',
|
|
708
798
|
useFileSearch: 'GENERATOR_ASSISTANT_USE_FILE_SEARCH',
|
|
709
799
|
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
710
800
|
filePath: 'GENERATOR_ASSISTANT_FILE_PATH',
|
|
@@ -727,6 +817,7 @@ export const templateActionNameMap = {
|
|
|
727
817
|
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
728
818
|
contentFile: 'GENERATOR_ASSISTANT_CONTENT_FILE',
|
|
729
819
|
contentBase64: 'GENERATOR_ASSISTANT_CONTENT_BASE64',
|
|
820
|
+
image: 'GENERATOR_ASSISTANT_IMAGE',
|
|
730
821
|
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
731
822
|
},
|
|
732
823
|
GENERATOR_ASSISTANT_REMOVE_MESSAGE_AT_INDEX: {
|
package/compile/index.ts
CHANGED
|
@@ -59,7 +59,9 @@ const compileEventActionValue = (templateKey, eventKey, value, errorReference) =
|
|
|
59
59
|
if (!props) return compileProperty(value, errorReference)
|
|
60
60
|
if (props.includes(value)) return value
|
|
61
61
|
if (value?.startsWith(templateKey)) {
|
|
62
|
-
console.warn(
|
|
62
|
+
console.warn(
|
|
63
|
+
`[Warning] Value start with template key but there is no event property: ${value} ${errorReference}`,
|
|
64
|
+
)
|
|
63
65
|
}
|
|
64
66
|
return compileProperty(value, errorReference)
|
|
65
67
|
}
|
|
@@ -223,6 +225,13 @@ const compileApplicationSettings = (settings: Application['settings']) => {
|
|
|
223
225
|
selectable_border: settings.tvOptions.selectableBorder,
|
|
224
226
|
}
|
|
225
227
|
: undefined,
|
|
228
|
+
ai: settings?.ai
|
|
229
|
+
? {
|
|
230
|
+
use_anthropic_api_key_system_data: settings.ai.useAnthropicApiKeySystemData,
|
|
231
|
+
use_openai_api_key_system_data: settings.ai.useOpenAiApiKeySystemData,
|
|
232
|
+
use_gemini_api_key_system_data: settings.ai.useGeminiApiKeySystemData,
|
|
233
|
+
}
|
|
234
|
+
: undefined,
|
|
226
235
|
}
|
|
227
236
|
}
|
|
228
237
|
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugood/bricks-project",
|
|
3
|
-
"version": "2.22.
|
|
3
|
+
"version": "2.22.1",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node scripts/build.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
9
|
+
"@modelcontextprotocol/sdk": "^1.15.0",
|
|
10
10
|
"@types/escodegen": "^0.0.10",
|
|
11
11
|
"@types/lodash": "^4.17.12",
|
|
12
12
|
"acorn": "^8.13.0",
|
|
13
13
|
"escodegen": "^2.1.0",
|
|
14
14
|
"lodash": "^4.17.4",
|
|
15
15
|
"uuid": "^8.3.1"
|
|
16
|
-
}
|
|
17
|
-
"gitHead": "286abe17fdd111c728fd74e3d98822d7e11d718e"
|
|
16
|
+
}
|
|
18
17
|
}
|
package/tools/postinstall.ts
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { $ } from 'bun'
|
|
2
2
|
import { stat, readFile, writeFile } from 'fs/promises'
|
|
3
|
-
const cwd = process.cwd()
|
|
4
|
-
|
|
5
|
-
const libFiles = ['types', 'utils', 'index.ts']
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
for (const file of libFiles) {
|
|
9
|
-
await $`cp -r ${__dirname}/../${file} ${cwd}/project`
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
console.log('Copied files to project/')
|
|
4
|
+
const cwd = process.cwd()
|
|
13
5
|
|
|
14
6
|
async function exists(f: string) {
|
|
15
7
|
try {
|
|
@@ -20,6 +12,21 @@ async function exists(f: string) {
|
|
|
20
12
|
}
|
|
21
13
|
}
|
|
22
14
|
|
|
15
|
+
// handle flag --skip-copy
|
|
16
|
+
const skipCopyProject = process.argv.includes('--skip-copy-project')
|
|
17
|
+
if (skipCopyProject) {
|
|
18
|
+
console.log('Skipping copy of files to project/')
|
|
19
|
+
} else {
|
|
20
|
+
|
|
21
|
+
const libFiles = ['types', 'utils', 'index.ts']
|
|
22
|
+
|
|
23
|
+
await $`mkdir -p ${cwd}/project`
|
|
24
|
+
for (const file of libFiles) {
|
|
25
|
+
await $`cp -r ${__dirname}/../${file} ${cwd}/project`
|
|
26
|
+
}
|
|
27
|
+
console.log('Copied files to project/')
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
const projectMcpServer = {
|
|
24
31
|
command: 'bun',
|
|
25
32
|
args: [`${cwd}/node_modules/@fugood/bricks-project/tools/mcp-server.ts`],
|
package/types/animation.ts
CHANGED
|
@@ -30,6 +30,7 @@ export type Easing =
|
|
|
30
30
|
| 'easeInBounce'
|
|
31
31
|
| 'easeOutBounce'
|
|
32
32
|
| 'easeInOutBounce'
|
|
33
|
+
| string // Support format like 'cubic-bezier(x1, y1, x2, y2)'
|
|
33
34
|
|
|
34
35
|
export interface AnimationTimingConfig {
|
|
35
36
|
__type: 'AnimationTimingConfig'
|
|
@@ -89,7 +90,7 @@ export interface AnimationComposeDef {
|
|
|
89
90
|
export type Animation = AnimationDef | AnimationComposeDef
|
|
90
91
|
|
|
91
92
|
export interface AnimationBasicEvents {
|
|
92
|
-
|
|
93
|
+
showStart?: Animation
|
|
93
94
|
standby?: Animation
|
|
94
95
|
breatheStart?: Animation
|
|
95
96
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from './switch'
|
|
2
|
+
import type { Data, DataLink } from './data'
|
|
3
|
+
import type { Animation, AnimationBasicEvents } from './animation'
|
|
4
|
+
import type {
|
|
5
|
+
Brick,
|
|
6
|
+
EventAction,
|
|
7
|
+
EventActionForItem,
|
|
8
|
+
ActionWithDataParams,
|
|
9
|
+
ActionWithParams,
|
|
10
|
+
Action,
|
|
11
|
+
EventProperty,
|
|
12
|
+
} from './common'
|
|
13
|
+
|
|
14
|
+
export interface BrickBasicProperty {
|
|
15
|
+
/* The brick opacity (0 ~ 1) */
|
|
16
|
+
opacity?: number | DataLink
|
|
17
|
+
/* The brick background color */
|
|
18
|
+
backgroundColor?: string | DataLink
|
|
19
|
+
/* The brick border style */
|
|
20
|
+
borderStyle?: 'solid' | 'dotted' | 'dashed' | DataLink
|
|
21
|
+
/* The brick border width (top) */
|
|
22
|
+
borderTopSize?: number | DataLink
|
|
23
|
+
/* The brick border color (top) */
|
|
24
|
+
borderTopColor?: string | DataLink
|
|
25
|
+
/* The brick border radius (top left) */
|
|
26
|
+
borderTopLeftRadius?: number | DataLink
|
|
27
|
+
/* The brick border radius (top right) */
|
|
28
|
+
borderTopRightRadius?: number | DataLink
|
|
29
|
+
/* The brick border width (bottom) */
|
|
30
|
+
borderBottomSize?: number | DataLink
|
|
31
|
+
/* The brick border color (bottom) */
|
|
32
|
+
borderBottomColor?: string | DataLink
|
|
33
|
+
/* The brick border radius (bottom left) */
|
|
34
|
+
borderBottomLeftRadius?: number | DataLink
|
|
35
|
+
/* The brick border radius (bottom right) */
|
|
36
|
+
borderBottomRightRadius?: number | DataLink
|
|
37
|
+
/* The brick border width (left) */
|
|
38
|
+
borderLeftSize?: number | DataLink
|
|
39
|
+
/* The brick border color (bottom) */
|
|
40
|
+
borderLeftColor?: string | DataLink
|
|
41
|
+
/* The brick border width (right) */
|
|
42
|
+
borderRightSize?: number | DataLink
|
|
43
|
+
/* The brick border color (right) */
|
|
44
|
+
borderRightColor?: string | DataLink
|
|
45
|
+
/* The brick rotate (deg) */
|
|
46
|
+
rotate?: number | DataLink
|
|
47
|
+
/* The brick rotateX (deg) */
|
|
48
|
+
rotateX?: number | DataLink
|
|
49
|
+
/* The brick rotateY (deg) */
|
|
50
|
+
rotateY?: number | DataLink
|
|
51
|
+
/* The brick shadow color */
|
|
52
|
+
shadowColor?: string | DataLink
|
|
53
|
+
/* The brick shadow opacity (0 ~ 1) */
|
|
54
|
+
shadowOpacity?: number | DataLink
|
|
55
|
+
/* The brick shadow radius */
|
|
56
|
+
shadowRadius?: number | DataLink
|
|
57
|
+
/* The brick shadow offset width */
|
|
58
|
+
shadowOffsetWidth?: number | DataLink
|
|
59
|
+
/* The brick shadow offset height */
|
|
60
|
+
shadowOffsetHeight?: number | DataLink
|
|
61
|
+
/* Brick pressable.
|
|
62
|
+
Disabled: Disabled even if event or animation is set.
|
|
63
|
+
Bypass: Disable and bypass the touch event on the brick. */
|
|
64
|
+
pressable?: 'enabled' | 'disabled' | 'bypass' | DataLink
|
|
65
|
+
/* Delay in milliseconds before long press is triggered */
|
|
66
|
+
delayLongPress?: number | DataLink
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface BrickBasicEvents {
|
|
70
|
+
showStart?: Array<EventAction>
|
|
71
|
+
switchUpdate?: Array<EventAction>
|
|
72
|
+
standby?: Array<EventAction>
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface BrickBasicEventsForItem {
|
|
76
|
+
showStart?: Array<EventActionForItem>
|
|
77
|
+
switchUpdate?: Array<EventActionForItem>
|
|
78
|
+
standby?: Array<EventActionForItem>
|
|
79
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
2
|
+
import type { Data, DataLink } from '../data'
|
|
3
|
+
import type { Animation, AnimationBasicEvents } from '../animation'
|
|
4
|
+
import type {
|
|
5
|
+
Brick,
|
|
6
|
+
EventAction,
|
|
7
|
+
EventActionForItem,
|
|
8
|
+
ActionWithDataParams,
|
|
9
|
+
ActionWithParams,
|
|
10
|
+
Action,
|
|
11
|
+
EventProperty,
|
|
12
|
+
} from '../common'
|
|
13
|
+
import type { BrickBasicProperty, BrickBasicEvents, BrickBasicEventsForItem } from '../brick-base'
|
|
14
|
+
|
|
15
|
+
/* Play object animation */
|
|
16
|
+
export type Brick3DViewerActionAnimationPlay = ActionWithParams & {
|
|
17
|
+
__actionName: 'BRICK_3D_VIEWER_ANIMATION_PLAY'
|
|
18
|
+
params?: Array<{
|
|
19
|
+
input: 'objectIndex'
|
|
20
|
+
value?: number | DataLink | EventProperty
|
|
21
|
+
mapping?: string
|
|
22
|
+
}>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Pause object animation */
|
|
26
|
+
export type Brick3DViewerActionAnimationPause = ActionWithParams & {
|
|
27
|
+
__actionName: 'BRICK_3D_VIEWER_ANIMATION_PAUSE'
|
|
28
|
+
params?: Array<{
|
|
29
|
+
input: 'objectIndex'
|
|
30
|
+
value?: number | DataLink | EventProperty
|
|
31
|
+
mapping?: string
|
|
32
|
+
}>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Goto object animation progress */
|
|
36
|
+
export type Brick3DViewerActionAnimationGoto = ActionWithParams & {
|
|
37
|
+
__actionName: 'BRICK_3D_VIEWER_ANIMATION_GOTO'
|
|
38
|
+
params?: Array<
|
|
39
|
+
| {
|
|
40
|
+
input: 'objectIndex'
|
|
41
|
+
value?: number | DataLink | EventProperty
|
|
42
|
+
mapping?: string
|
|
43
|
+
}
|
|
44
|
+
| {
|
|
45
|
+
input: 'animationProgress'
|
|
46
|
+
value?: number | DataLink | EventProperty
|
|
47
|
+
mapping?: string
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface Brick3DViewerDef {
|
|
53
|
+
/*
|
|
54
|
+
Default property:
|
|
55
|
+
{
|
|
56
|
+
"showLoadingBox": true,
|
|
57
|
+
"enableOrbitControls": true
|
|
58
|
+
}
|
|
59
|
+
*/
|
|
60
|
+
property?: BrickBasicProperty & {
|
|
61
|
+
/* 3D model list */
|
|
62
|
+
objects?:
|
|
63
|
+
| Array<
|
|
64
|
+
| DataLink
|
|
65
|
+
| {
|
|
66
|
+
url?: string | DataLink
|
|
67
|
+
md5?: string | DataLink
|
|
68
|
+
type?: 'USDZ' | 'glTF' | DataLink
|
|
69
|
+
rotation?: number | DataLink | Array<number | DataLink> | DataLink | DataLink
|
|
70
|
+
scale?: number | DataLink | Array<number | DataLink> | DataLink | DataLink
|
|
71
|
+
x?: number | DataLink
|
|
72
|
+
y?: number | DataLink
|
|
73
|
+
z?: number | DataLink
|
|
74
|
+
moveable?: boolean | DataLink
|
|
75
|
+
rotateable?: boolean | DataLink
|
|
76
|
+
selectable?: boolean | DataLink
|
|
77
|
+
enableCollision?: boolean | DataLink
|
|
78
|
+
animationLoopMode?: 'once' | 'repeat' | 'pingpong' | DataLink
|
|
79
|
+
animationProgress?: number | DataLink
|
|
80
|
+
animationPaused?: boolean | DataLink
|
|
81
|
+
boundingBox?:
|
|
82
|
+
| DataLink
|
|
83
|
+
| {
|
|
84
|
+
min?:
|
|
85
|
+
| DataLink
|
|
86
|
+
| {
|
|
87
|
+
x?: number | DataLink
|
|
88
|
+
y?: number | DataLink
|
|
89
|
+
z?: number | DataLink
|
|
90
|
+
}
|
|
91
|
+
max?:
|
|
92
|
+
| DataLink
|
|
93
|
+
| {
|
|
94
|
+
x?: number | DataLink
|
|
95
|
+
y?: number | DataLink
|
|
96
|
+
z?: number | DataLink
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
| DataLink
|
|
102
|
+
/* Show loading placeholder box */
|
|
103
|
+
showLoadingBox?: boolean | DataLink
|
|
104
|
+
/* Display shadows */
|
|
105
|
+
shadows?: boolean | DataLink
|
|
106
|
+
/* Default camera position */
|
|
107
|
+
camera?:
|
|
108
|
+
| DataLink
|
|
109
|
+
| {
|
|
110
|
+
fov?: number | DataLink
|
|
111
|
+
aspect?: number | DataLink
|
|
112
|
+
near?: number | DataLink
|
|
113
|
+
far?: number | DataLink
|
|
114
|
+
position?:
|
|
115
|
+
| DataLink
|
|
116
|
+
| {
|
|
117
|
+
x?: number | DataLink
|
|
118
|
+
y?: number | DataLink
|
|
119
|
+
z?: number | DataLink
|
|
120
|
+
}
|
|
121
|
+
quaternion?:
|
|
122
|
+
| DataLink
|
|
123
|
+
| {
|
|
124
|
+
x?: number | DataLink
|
|
125
|
+
y?: number | DataLink
|
|
126
|
+
z?: number | DataLink
|
|
127
|
+
w?: number | DataLink
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/* Enable orbit controls */
|
|
131
|
+
enableOrbitControls?: boolean | DataLink
|
|
132
|
+
/* Camera control options */
|
|
133
|
+
orbitControls?:
|
|
134
|
+
| DataLink
|
|
135
|
+
| {
|
|
136
|
+
autoRotate?: boolean | DataLink
|
|
137
|
+
enableZoom?: boolean | DataLink
|
|
138
|
+
enablePan?: boolean | DataLink
|
|
139
|
+
enableRotate?: boolean | DataLink
|
|
140
|
+
enableDamping?: boolean | DataLink
|
|
141
|
+
dampingFactor?: number | DataLink
|
|
142
|
+
rotateSpeed?: number | DataLink
|
|
143
|
+
zoomSpeed?: number | DataLink
|
|
144
|
+
panSpeed?: number | DataLink
|
|
145
|
+
minDistance?: number | DataLink
|
|
146
|
+
maxDistance?: number | DataLink
|
|
147
|
+
minPolarAngle?: number | DataLink
|
|
148
|
+
maxPolarAngle?: number | DataLink
|
|
149
|
+
minAzimuthAngle?: number | DataLink
|
|
150
|
+
maxAzimuthAngle?: number | DataLink
|
|
151
|
+
}
|
|
152
|
+
/* Move controls options */
|
|
153
|
+
moveControls?:
|
|
154
|
+
| DataLink
|
|
155
|
+
| {
|
|
156
|
+
responsiveness?: number | DataLink
|
|
157
|
+
rotationRingColor?: string | DataLink
|
|
158
|
+
rotationRingSize?: number | DataLink
|
|
159
|
+
showBoundingBox?: boolean | DataLink
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
events?: BrickBasicEvents & {
|
|
163
|
+
/* Event of error occurred */
|
|
164
|
+
onError?: Array<EventAction>
|
|
165
|
+
/* Event of object changed position or rotation */
|
|
166
|
+
onChange?: Array<EventAction>
|
|
167
|
+
/* Event of object selected */
|
|
168
|
+
onSelectChange?: Array<EventAction>
|
|
169
|
+
/* Event of object collision occurred */
|
|
170
|
+
onCollision?: Array<EventAction>
|
|
171
|
+
}
|
|
172
|
+
animation?: AnimationBasicEvents & {
|
|
173
|
+
onError?: Animation
|
|
174
|
+
onChange?: Animation
|
|
175
|
+
onSelectChange?: Animation
|
|
176
|
+
onCollision?: Animation
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* 3D viewer brick */
|
|
181
|
+
export type Brick3DViewer = Brick &
|
|
182
|
+
Brick3DViewerDef & {
|
|
183
|
+
templateKey: 'BRICK_3D_VIEWER'
|
|
184
|
+
switches: Array<
|
|
185
|
+
SwitchDef &
|
|
186
|
+
Brick3DViewerDef & {
|
|
187
|
+
conds?: Array<{
|
|
188
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
189
|
+
cond:
|
|
190
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
191
|
+
| SwitchCondData
|
|
192
|
+
| {
|
|
193
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
194
|
+
outlet: ''
|
|
195
|
+
value: any
|
|
196
|
+
}
|
|
197
|
+
}>
|
|
198
|
+
}
|
|
199
|
+
>
|
|
200
|
+
}
|