@fugood/bricks-project 2.22.0-beta.2 → 2.22.0-beta.20
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 +146 -1
- package/compile/index.ts +1 -0
- package/package.json +3 -2
- package/tools/mcp-server.ts +86 -0
- package/tools/postinstall.ts +63 -5
- package/tools/preview-main.mjs +13 -7
- package/tools/preview.ts +31 -25
- package/types/bricks.ts +105 -2
- package/types/canvas.ts +1 -1
- package/types/common.ts +2 -2
- package/types/data.ts +6 -0
- package/types/generators.ts +1931 -231
- package/types/system.ts +42 -0
- package/utils/data.ts +18 -0
- package/utils/event-props.ts +185 -0
package/types/system.ts
CHANGED
|
@@ -467,6 +467,16 @@ export type SystemActionChannelPublish = ActionWithParams & {
|
|
|
467
467
|
>
|
|
468
468
|
}
|
|
469
469
|
|
|
470
|
+
/* Delay for a certain time between actions */
|
|
471
|
+
export type SystemActionDelay = ActionWithParams & {
|
|
472
|
+
__actionName: 'DELAY'
|
|
473
|
+
params?: Array<{
|
|
474
|
+
input: 'time'
|
|
475
|
+
value?: number | DataLink | EventProperty
|
|
476
|
+
mapping?: string
|
|
477
|
+
}>
|
|
478
|
+
}
|
|
479
|
+
|
|
470
480
|
/* [Internal] Use a shared application */
|
|
471
481
|
export type SystemActionUseShareApplication = ActionWithParams & {
|
|
472
482
|
__actionName: 'USE_SHARE_APPLICATION'
|
|
@@ -599,3 +609,35 @@ export type SystemActionThrowException = ActionWithParams & {
|
|
|
599
609
|
export type SystemActionDismissKeyboard = Action & {
|
|
600
610
|
__actionName: 'DISMISS_KEYBOARD'
|
|
601
611
|
}
|
|
612
|
+
|
|
613
|
+
/* Trigger application AI filter */
|
|
614
|
+
export type SystemActionTriggerApplicationFilter = ActionWithParams & {
|
|
615
|
+
__actionName: 'TRIGGER_APPLICATION_FILTER'
|
|
616
|
+
params?: Array<
|
|
617
|
+
| {
|
|
618
|
+
input: 'name'
|
|
619
|
+
value?: string | DataLink | EventProperty
|
|
620
|
+
mapping?: string
|
|
621
|
+
}
|
|
622
|
+
| {
|
|
623
|
+
input: 'variables'
|
|
624
|
+
value?: any | EventProperty
|
|
625
|
+
mapping?: string
|
|
626
|
+
}
|
|
627
|
+
| {
|
|
628
|
+
input: 'result'
|
|
629
|
+
value?: string | DataLink | (() => Data) | EventProperty
|
|
630
|
+
mapping?: string
|
|
631
|
+
}
|
|
632
|
+
| {
|
|
633
|
+
input: 'error'
|
|
634
|
+
value?: string | DataLink | (() => Data) | EventProperty
|
|
635
|
+
mapping?: string
|
|
636
|
+
}
|
|
637
|
+
>
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/* Stop running application AI filter */
|
|
641
|
+
export type SystemActionStopApplicationFilter = Action & {
|
|
642
|
+
__actionName: 'STOP_APPLICATION_FILTER'
|
|
643
|
+
}
|
package/utils/data.ts
CHANGED
|
@@ -64,6 +64,7 @@ type SystemDataName =
|
|
|
64
64
|
| 'workspaceName'
|
|
65
65
|
| 'applicationInfo'
|
|
66
66
|
| 'applicationName'
|
|
67
|
+
| 'deviceID'
|
|
67
68
|
| 'macAddress'
|
|
68
69
|
| 'bindDeviceCode'
|
|
69
70
|
| 'bindDeviceCodeExpire'
|
|
@@ -74,6 +75,7 @@ type SystemDataName =
|
|
|
74
75
|
| 'env'
|
|
75
76
|
| 'isViewDebugModeEnabled'
|
|
76
77
|
| 'language'
|
|
78
|
+
| 'aiFilters'
|
|
77
79
|
|
|
78
80
|
type SystemDataInfo = {
|
|
79
81
|
name: SystemDataName
|
|
@@ -343,6 +345,14 @@ export const systemDataList: Array<SystemDataInfo> = [
|
|
|
343
345
|
type: 'string',
|
|
344
346
|
value: '',
|
|
345
347
|
},
|
|
348
|
+
{
|
|
349
|
+
name: 'deviceID',
|
|
350
|
+
id: 'PROPERTY_BANK_DATA_NODE_8b5c2d9e-f0a1-4b2c-8d3e-4f5a6b7c8d9e',
|
|
351
|
+
title: 'SYSTEM: Device ID',
|
|
352
|
+
description: 'Device ID of current device',
|
|
353
|
+
type: 'string',
|
|
354
|
+
value: 'unknown',
|
|
355
|
+
},
|
|
346
356
|
{
|
|
347
357
|
name: 'macAddress',
|
|
348
358
|
id: 'PROPERTY_BANK_DATA_NODE_f01fcc78-0723-11ed-ac00-877339de1030',
|
|
@@ -423,6 +433,14 @@ export const systemDataList: Array<SystemDataInfo> = [
|
|
|
423
433
|
type: 'string',
|
|
424
434
|
value: '',
|
|
425
435
|
},
|
|
436
|
+
{
|
|
437
|
+
name: 'aiFilters',
|
|
438
|
+
id: 'PROPERTY_BANK_DATA_NODE_3ffc1e98-8f65-4cc8-a949-3da8d2092ccb',
|
|
439
|
+
title: 'SYSTEM: AI Filters',
|
|
440
|
+
description: 'AI filters configuration from the application',
|
|
441
|
+
type: 'array',
|
|
442
|
+
value: [],
|
|
443
|
+
},
|
|
426
444
|
]
|
|
427
445
|
|
|
428
446
|
export const useSystemData = (name: SystemDataName): Data => {
|
package/utils/event-props.ts
CHANGED
|
@@ -615,6 +615,103 @@ export const templateEventPropsMap = {
|
|
|
615
615
|
'GENERATOR_SQLITE_QUERY_RESULT', // type: array
|
|
616
616
|
],
|
|
617
617
|
},
|
|
618
|
+
GENERATOR_MCP_SERVER: {
|
|
619
|
+
onError: [
|
|
620
|
+
'GENERATOR_MCP_SERVER_ERROR_MESSAGE', // type: string
|
|
621
|
+
],
|
|
622
|
+
onClientError: [
|
|
623
|
+
'GENERATOR_MCP_SERVER_CLIENT_ADDRESS', // type: string
|
|
624
|
+
'GENERATOR_MCP_SERVER_SESSION_ID', // type: string
|
|
625
|
+
'GENERATOR_MCP_SERVER_ERROR_MESSAGE', // type: string
|
|
626
|
+
],
|
|
627
|
+
onClientClose: [
|
|
628
|
+
'GENERATOR_MCP_SERVER_CLIENT_ADDRESS', // type: string
|
|
629
|
+
'GENERATOR_MCP_SERVER_SESSION_ID', // type: string
|
|
630
|
+
],
|
|
631
|
+
onRequestResource: [
|
|
632
|
+
'GENERATOR_MCP_SERVER_REQUEST_ID', // type: string
|
|
633
|
+
'GENERATOR_MCP_SERVER_REQUEST_NAME', // type: string
|
|
634
|
+
'GENERATOR_MCP_SERVER_REQUEST_URI', // type: string
|
|
635
|
+
'GENERATOR_MCP_SERVER_REQUEST_VARIABLES', // type: object
|
|
636
|
+
'GENERATOR_MCP_SERVER_REQUEST_TIMEOUT', // type: number
|
|
637
|
+
'GENERATOR_MCP_SERVER_REQUEST', // type: object
|
|
638
|
+
],
|
|
639
|
+
onCallTool: [
|
|
640
|
+
'GENERATOR_MCP_SERVER_REQUEST_ID', // type: string
|
|
641
|
+
'GENERATOR_MCP_SERVER_REQUEST_NAME', // type: string
|
|
642
|
+
'GENERATOR_MCP_SERVER_REQUEST_VARIABLES', // type: object
|
|
643
|
+
'GENERATOR_MCP_SERVER_REQUEST_TIMEOUT', // type: number
|
|
644
|
+
'GENERATOR_MCP_SERVER_REQUEST', // type: object
|
|
645
|
+
],
|
|
646
|
+
onGetPrompt: [
|
|
647
|
+
'GENERATOR_MCP_SERVER_REQUEST_ID', // type: string
|
|
648
|
+
'GENERATOR_MCP_SERVER_REQUEST_NAME', // type: string
|
|
649
|
+
'GENERATOR_MCP_SERVER_REQUEST_VARIABLES', // type: object
|
|
650
|
+
'GENERATOR_MCP_SERVER_REQUEST_TIMEOUT', // type: number
|
|
651
|
+
'GENERATOR_MCP_SERVER_REQUEST', // type: object
|
|
652
|
+
],
|
|
653
|
+
},
|
|
654
|
+
GENERATOR_MCP: {
|
|
655
|
+
onConnectionError: [
|
|
656
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
657
|
+
],
|
|
658
|
+
onListResources: [
|
|
659
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
660
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
661
|
+
],
|
|
662
|
+
onListResourcesError: [
|
|
663
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
664
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
665
|
+
],
|
|
666
|
+
onListResourceTemplates: [
|
|
667
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
668
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
669
|
+
],
|
|
670
|
+
onListResourceTemplatesError: [
|
|
671
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
672
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
673
|
+
],
|
|
674
|
+
onReadResource: [
|
|
675
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
676
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
677
|
+
],
|
|
678
|
+
onReadResourceError: [
|
|
679
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
680
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
681
|
+
],
|
|
682
|
+
onListTools: [
|
|
683
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
684
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
685
|
+
],
|
|
686
|
+
onListToolsError: [
|
|
687
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
688
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
689
|
+
],
|
|
690
|
+
onCallTool: [
|
|
691
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
692
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
693
|
+
],
|
|
694
|
+
onCallToolError: [
|
|
695
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
696
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
697
|
+
],
|
|
698
|
+
onListPrompts: [
|
|
699
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
700
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
701
|
+
],
|
|
702
|
+
onListPromptsError: [
|
|
703
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
704
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
705
|
+
],
|
|
706
|
+
onGetPrompt: [
|
|
707
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
708
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
709
|
+
],
|
|
710
|
+
onGetPromptError: [
|
|
711
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
712
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
713
|
+
],
|
|
714
|
+
},
|
|
618
715
|
GENERATOR_TTS: {
|
|
619
716
|
onContextStateChange: [
|
|
620
717
|
'GENERATOR_TTS_CONTEXT_STATE', // type: string
|
|
@@ -627,6 +724,16 @@ export const templateEventPropsMap = {
|
|
|
627
724
|
onContextStateChange: [
|
|
628
725
|
'GENERATOR_ONNX_LLM_CONTEXT_STATE', // type: string
|
|
629
726
|
],
|
|
727
|
+
onFunctionCall: [
|
|
728
|
+
'GENERATOR_ONNX_LLM_FUNCTION_CALL_NAME', // type: string
|
|
729
|
+
'GENERATOR_ONNX_LLM_FUNCTION_CALL_ARGUMENTS', // type: object
|
|
730
|
+
'GENERATOR_ONNX_LLM_FUNCTION_CALL_DETAILS', // type: object
|
|
731
|
+
],
|
|
732
|
+
onCompletionFinished: [
|
|
733
|
+
'GENERATOR_ONNX_LLM_COMPLETION_RESULT', // type: string
|
|
734
|
+
'GENERATOR_ONNX_LLM_COMPLETION_TOOL_CALLS', // type: array
|
|
735
|
+
'GENERATOR_ONNX_LLM_COMPLETION_FULL_CONTEXT', // type: string
|
|
736
|
+
],
|
|
630
737
|
onError: [
|
|
631
738
|
'GENERATOR_ONNX_LLM_ERROR', // type: string
|
|
632
739
|
],
|
|
@@ -654,6 +761,46 @@ export const templateEventPropsMap = {
|
|
|
654
761
|
'GENERATOR_SPEECH_INFERENCE_TRANSCRIBE_TIME', // type: number
|
|
655
762
|
],
|
|
656
763
|
},
|
|
764
|
+
GENERATOR_VAD_INFERENCE: {
|
|
765
|
+
onContextStateChange: [
|
|
766
|
+
'GENERATOR_VAD_INFERENCE_CONTEXT_STATE', // type: string
|
|
767
|
+
'GENERATOR_VAD_INFERENCE_CONTEXT_DETAILS', // type: object
|
|
768
|
+
],
|
|
769
|
+
onError: [
|
|
770
|
+
'GENERATOR_VAD_INFERENCE_ERROR', // type: string
|
|
771
|
+
],
|
|
772
|
+
onDetected: [
|
|
773
|
+
'GENERATOR_VAD_INFERENCE_DETECTION_SEGMENTS', // type: array
|
|
774
|
+
'GENERATOR_VAD_INFERENCE_DETECTION_TIME', // type: number
|
|
775
|
+
],
|
|
776
|
+
},
|
|
777
|
+
GENERATOR_REALTIME_TRANSCRIPTION: {
|
|
778
|
+
onTranscribe: [
|
|
779
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_TRANSCRIBE_EVENT', // type: object
|
|
780
|
+
],
|
|
781
|
+
onVad: [
|
|
782
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT', // type: object
|
|
783
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT_TYPE', // type: string
|
|
784
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT_CONFIDENCE', // type: number
|
|
785
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT_DURATION', // type: number
|
|
786
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_VAD_EVENT_SLICE_INDEX', // type: number
|
|
787
|
+
],
|
|
788
|
+
onError: [
|
|
789
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_ERROR', // type: string
|
|
790
|
+
],
|
|
791
|
+
onStatusChange: [
|
|
792
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_IS_ACTIVE', // type: bool
|
|
793
|
+
],
|
|
794
|
+
onStatsUpdate: [
|
|
795
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_STATS_TYPE', // type: string
|
|
796
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_STATS_TIMESTAMP', // type: number
|
|
797
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_STATS', // type: object
|
|
798
|
+
],
|
|
799
|
+
onEnd: [
|
|
800
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_END_RESULTS', // type: array
|
|
801
|
+
'GENERATOR_REALTIME_TRANSCRIPTION_END_AUDIO_OUTPUT_PATH', // type: string
|
|
802
|
+
],
|
|
803
|
+
},
|
|
657
804
|
GENERATOR_LLM: {
|
|
658
805
|
onContextStateChange: [
|
|
659
806
|
'GENERATOR_LLM_CONTEXT_STATE', // type: string
|
|
@@ -673,15 +820,45 @@ export const templateEventPropsMap = {
|
|
|
673
820
|
'GENERATOR_LLM_COMPLETION_RESULT', // type: string
|
|
674
821
|
'GENERATOR_LLM_COMPLETION_TOOL_CALLS', // type: array
|
|
675
822
|
'GENERATOR_LLM_COMPLETION_FULL_CONTEXT', // type: string
|
|
823
|
+
'GENERATOR_LLM_COMPLETION_IS_CONTEXT_FULL', // type: bool
|
|
824
|
+
'GENERATOR_LLM_COMPLETION_IS_TRUNCATED', // type: bool
|
|
676
825
|
'GENERATOR_LLM_COMPLETION_RESULT_DETAILS', // type: object
|
|
677
826
|
],
|
|
678
827
|
onCompletionFunctionCall: [
|
|
679
828
|
'GENERATOR_LLM_COMPLETION_SESSION_KEY', // type: string
|
|
829
|
+
'GENERATOR_LLM_COMPLETION_FUNCTION_CALL_ID', // type: string
|
|
680
830
|
'GENERATOR_LLM_COMPLETION_FUNCTION_CALL_NAME', // type: string
|
|
681
831
|
'GENERATOR_LLM_COMPLETION_FUNCTION_ARGUMENTS', // type: object
|
|
682
832
|
'GENERATOR_LLM_COMPLETION_FUNCTION_DETAILS', // type: object
|
|
683
833
|
],
|
|
684
834
|
},
|
|
835
|
+
GENERATOR_GGML_TTS: {
|
|
836
|
+
onContextStateChange: [
|
|
837
|
+
'GENERATOR_GGML_TTS_CONTEXT_STATE', // type: string
|
|
838
|
+
],
|
|
839
|
+
onError: [
|
|
840
|
+
'GENERATOR_GGML_TTS_ERROR', // type: string
|
|
841
|
+
],
|
|
842
|
+
},
|
|
843
|
+
GENERATOR_RERANKER: {},
|
|
844
|
+
GENERATOR_QNN_LLM: {
|
|
845
|
+
onContextStateChange: [
|
|
846
|
+
'GENERATOR_QNN_LLM_CONTEXT_STATE', // type: string
|
|
847
|
+
],
|
|
848
|
+
onGenerate: [
|
|
849
|
+
'GENERATOR_QNN_LLM_RESULT', // type: string
|
|
850
|
+
'GENERATOR_QNN_LLM_FULL_CONTEXT', // type: string
|
|
851
|
+
'GENERATOR_QNN_LLM_TOOL_CALLS', // type: array
|
|
852
|
+
],
|
|
853
|
+
onFunctionCall: [
|
|
854
|
+
'GENERATOR_QNN_LLM_FUNCTION_CALL_NAME', // type: string
|
|
855
|
+
'GENERATOR_QNN_LLM_FUNCTION_CALL_ARGUMENTS', // type: object
|
|
856
|
+
'GENERATOR_QNN_LLM_FUNCTION_CALL_DETAILS', // type: object
|
|
857
|
+
],
|
|
858
|
+
onError: [
|
|
859
|
+
'GENERATOR_QNN_LLM_ERROR', // type: string
|
|
860
|
+
],
|
|
861
|
+
},
|
|
685
862
|
GENERATOR_OPENAI_LLM: {
|
|
686
863
|
onError: [
|
|
687
864
|
'GENERATOR_OPENAI_LLM_ERROR', // type: string
|
|
@@ -699,6 +876,14 @@ export const templateEventPropsMap = {
|
|
|
699
876
|
'GENERATOR_OPENAI_LLM_COMPLETION_FUNCTION_ARGUMENTS', // type: string
|
|
700
877
|
],
|
|
701
878
|
},
|
|
879
|
+
GENERATOR_OPENAI_TTS: {
|
|
880
|
+
onContextStateChange: [
|
|
881
|
+
'GENERATOR_OPENAI_TTS_CONTEXT_STATE', // type: string
|
|
882
|
+
],
|
|
883
|
+
onError: [
|
|
884
|
+
'GENERATOR_OPENAI_TTS_ERROR', // type: string
|
|
885
|
+
],
|
|
886
|
+
},
|
|
702
887
|
GENERATOR_ASSISTANT: {
|
|
703
888
|
onError: [
|
|
704
889
|
'GENERATOR_ASSISTANT_ERROR', // type: string
|