@fugood/bricks-project 2.21.0-beta.27 → 2.21.0-beta.31
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 +31 -0
- package/package.json +2 -2
- package/types/bricks.ts +12 -0
- package/types/generators.ts +276 -117
- package/types/system.ts +25 -0
|
@@ -47,6 +47,7 @@ export const templateActionNameMap = {
|
|
|
47
47
|
selections: 'ALERT_SELECTIONS',
|
|
48
48
|
selectionResult: 'ALERT_SELECTION_RESULT',
|
|
49
49
|
timeout: 'ALERT_TIMEOUT',
|
|
50
|
+
hideSelections: 'ALERT_HIDE_SELECTIONS',
|
|
50
51
|
},
|
|
51
52
|
POPUP_RESET: {
|
|
52
53
|
popupClearType: 'POPUP_CLEAR_TYPE',
|
|
@@ -54,6 +55,7 @@ export const templateActionNameMap = {
|
|
|
54
55
|
},
|
|
55
56
|
TAKE_SCREENSHOT: {
|
|
56
57
|
currentSubspace: 'TAKE_SCREENSHOT_CURRENT_SUBSPACE',
|
|
58
|
+
brickId: 'TAKE_SCREENSHOT_BRICK_ID',
|
|
57
59
|
format: 'TAKE_SCREENSHOT_FORMAT',
|
|
58
60
|
quality: 'TAKE_SCREENSHOT_QUALITY',
|
|
59
61
|
width: 'TAKE_SCREENSHOT_WIDTH',
|
|
@@ -65,7 +67,9 @@ export const templateActionNameMap = {
|
|
|
65
67
|
type: 'CHANNEL_SUBSCRIBE_TYPE',
|
|
66
68
|
livetime: 'CHANNEL_SUBSCRIBE_LIVETIME',
|
|
67
69
|
dataResult: 'CHANNEL_SUBSCRIBE_DATA_RESULT',
|
|
70
|
+
dataAssignList: 'CHANNEL_SUBSCRIBE_DATA_ASSIGN_LIST',
|
|
68
71
|
progressResult: 'CHANNEL_SUBSCRIBE_PROGRESS_RESULT',
|
|
72
|
+
progressAssignList: 'CHANNEL_SUBSCRIBE_PROGRESS_ASSIGN_LIST',
|
|
69
73
|
errorResult: 'CHANNEL_SUBSCRIBE_ERROR_RESULT',
|
|
70
74
|
},
|
|
71
75
|
CHANNEL_UNSUBSCRIBE: {
|
|
@@ -557,4 +561,31 @@ export const templateActionNameMap = {
|
|
|
557
561
|
sessionCustomKey: 'GENERATOR_LLM_SESSION_CUSTOM_KEY',
|
|
558
562
|
},
|
|
559
563
|
},
|
|
564
|
+
GENERATOR_ASSISTANT: {
|
|
565
|
+
GENERATOR_ASSISTANT_ADD_MESSAGE: {
|
|
566
|
+
role: 'GENERATOR_ASSISTANT_ROLE',
|
|
567
|
+
content: 'GENERATOR_ASSISTANT_CONTENT',
|
|
568
|
+
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
569
|
+
},
|
|
570
|
+
GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX: {
|
|
571
|
+
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
572
|
+
content: 'GENERATOR_ASSISTANT_CONTENT',
|
|
573
|
+
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
574
|
+
},
|
|
575
|
+
GENERATOR_ASSISTANT_ADD_AUDIO_MESSAGE: {
|
|
576
|
+
role: 'GENERATOR_ASSISTANT_ROLE',
|
|
577
|
+
contentFile: 'GENERATOR_ASSISTANT_CONTENT_FILE',
|
|
578
|
+
contentBase64: 'GENERATOR_ASSISTANT_CONTENT_BASE64',
|
|
579
|
+
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
580
|
+
},
|
|
581
|
+
GENERATOR_ASSISTANT_UPDATE_AUDIO_MESSAGE_AT_INDEX: {
|
|
582
|
+
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
583
|
+
contentFile: 'GENERATOR_ASSISTANT_CONTENT_FILE',
|
|
584
|
+
contentBase64: 'GENERATOR_ASSISTANT_CONTENT_BASE64',
|
|
585
|
+
payload: 'GENERATOR_ASSISTANT_PAYLOAD',
|
|
586
|
+
},
|
|
587
|
+
GENERATOR_ASSISTANT_REMOVE_MESSAGE_AT_INDEX: {
|
|
588
|
+
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
589
|
+
},
|
|
590
|
+
},
|
|
560
591
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugood/bricks-project",
|
|
3
|
-
"version": "2.21.0-beta.
|
|
3
|
+
"version": "2.21.0-beta.31",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node scripts/build.js"
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
"lodash": "^4.17.4",
|
|
14
14
|
"uuid": "^8.3.1"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "366ad791d1217e2a5b7dc9ab7ba65196023f2357"
|
|
17
17
|
}
|
package/types/bricks.ts
CHANGED
|
@@ -3153,6 +3153,17 @@ Default property:
|
|
|
3153
3153
|
}
|
|
3154
3154
|
}
|
|
3155
3155
|
>
|
|
3156
|
+
/* Event of the Camera mount error */
|
|
3157
|
+
mountError?: Array<
|
|
3158
|
+
EventAction & {
|
|
3159
|
+
eventPropertyMapping?: {
|
|
3160
|
+
mountError: {
|
|
3161
|
+
type: 'string'
|
|
3162
|
+
path: string
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
>
|
|
3156
3167
|
}
|
|
3157
3168
|
outlets?: {
|
|
3158
3169
|
/* Picture taken result */
|
|
@@ -3171,6 +3182,7 @@ Default property:
|
|
|
3171
3182
|
barcodeRead?: Animation
|
|
3172
3183
|
pictureTaken?: Animation
|
|
3173
3184
|
recordFinish?: Animation
|
|
3185
|
+
mountError?: Animation
|
|
3174
3186
|
}
|
|
3175
3187
|
}
|
|
3176
3188
|
|
package/types/generators.ts
CHANGED
|
@@ -3547,6 +3547,10 @@ Default property:
|
|
|
3547
3547
|
outlets?: {
|
|
3548
3548
|
/* Signal to create peer connection */
|
|
3549
3549
|
signal?: () => Data
|
|
3550
|
+
/* Local SDP offer */
|
|
3551
|
+
sdpOffer?: () => Data
|
|
3552
|
+
/* Local SDP answer */
|
|
3553
|
+
sdpAnswer?: () => Data
|
|
3550
3554
|
/* Peer connection state */
|
|
3551
3555
|
connectionState?: () => Data
|
|
3552
3556
|
/* ICE connection state */
|
|
@@ -3576,6 +3580,8 @@ export type GeneratorWebRTC = Generator &
|
|
|
3576
3580
|
__typename: 'SwitchCondInnerStateOutlet'
|
|
3577
3581
|
outlet:
|
|
3578
3582
|
| 'signal'
|
|
3583
|
+
| 'sdpOffer'
|
|
3584
|
+
| 'sdpAnswer'
|
|
3579
3585
|
| 'connectionState'
|
|
3580
3586
|
| 'iceConnectionState'
|
|
3581
3587
|
| 'signalingState'
|
|
@@ -3588,121 +3594,6 @@ export type GeneratorWebRTC = Generator &
|
|
|
3588
3594
|
>
|
|
3589
3595
|
}
|
|
3590
3596
|
|
|
3591
|
-
interface GeneratorTensorFlowInferenceDef {
|
|
3592
|
-
/*
|
|
3593
|
-
Default property:
|
|
3594
|
-
{
|
|
3595
|
-
"inputType": "camera",
|
|
3596
|
-
"minScore": 0.5,
|
|
3597
|
-
"objectLimit": 20,
|
|
3598
|
-
"imageChannelFormat": "rgb",
|
|
3599
|
-
"imageNormalize": "off",
|
|
3600
|
-
"cameraInit": false,
|
|
3601
|
-
"cameraFps": 10,
|
|
3602
|
-
"cameraRotate": 0
|
|
3603
|
-
}
|
|
3604
|
-
*/
|
|
3605
|
-
property?: {
|
|
3606
|
-
/* URL to download TF.js graph model
|
|
3607
|
-
You can find pre-trained model on [TensorFlow Hub](https://tfhub.dev) */
|
|
3608
|
-
modelUrl?: string | DataLink
|
|
3609
|
-
/* MD5 of model JSON */
|
|
3610
|
-
modelMd5?: string | DataLink
|
|
3611
|
-
/* Model input source */
|
|
3612
|
-
inputType?: 'raw' | 'media-image' | 'camera' | DataLink
|
|
3613
|
-
/* Model output type
|
|
3614
|
-
label: Classification problem (model output number or score array)
|
|
3615
|
-
object-boxes: Object detection (model output [labels, boxes])
|
|
3616
|
-
raw: No transform */
|
|
3617
|
-
outputType?: 'label' | 'object-boxes' | 'raw' | DataLink
|
|
3618
|
-
/* Model output labels */
|
|
3619
|
-
labels?: Array<string | DataLink> | DataLink
|
|
3620
|
-
/* Download labels from URL */
|
|
3621
|
-
labelsUrl?: string | DataLink
|
|
3622
|
-
/* MD5 checksum of label file */
|
|
3623
|
-
labelsMd5?: string | DataLink
|
|
3624
|
-
/* Output score limit */
|
|
3625
|
-
minScore?: number | DataLink
|
|
3626
|
-
/* Object limit for object detection */
|
|
3627
|
-
objectLimit?: number | DataLink
|
|
3628
|
-
/* Input channel format */
|
|
3629
|
-
imageChannelFormat?: 'rgb' | 'grayscale' | DataLink
|
|
3630
|
-
/* Input data format of the model is channel first (Commonly is channel last) */
|
|
3631
|
-
imageChannelFirst?: boolean | DataLink
|
|
3632
|
-
/* Resize to input layer height */
|
|
3633
|
-
imageResizeHeight?: number | DataLink
|
|
3634
|
-
/* Resize to input layer width */
|
|
3635
|
-
imageResizeWidth?: number | DataLink
|
|
3636
|
-
/* Input data normalize */
|
|
3637
|
-
imageNormalize?: 'off' | '0~1' | '-1~1' | DataLink
|
|
3638
|
-
/* Start infer on camera when initialized */
|
|
3639
|
-
cameraInit?: boolean | DataLink
|
|
3640
|
-
/* Target Camera brick ID */
|
|
3641
|
-
cameraTarget?: string | DataLink
|
|
3642
|
-
/* Infer fps, 0 is unlimited */
|
|
3643
|
-
cameraFps?: number | DataLink
|
|
3644
|
-
/* Camera rotate correction */
|
|
3645
|
-
cameraRotate?: number | DataLink
|
|
3646
|
-
/* Show detect object bounding box on Camera brick */
|
|
3647
|
-
cameraShowObjectBox?: boolean | DataLink
|
|
3648
|
-
/* Bonding box border size */
|
|
3649
|
-
cameraBoxBorderSize?: number | DataLink
|
|
3650
|
-
/* Bonding box border color */
|
|
3651
|
-
cameraBoxBorderColor?: Array<string | DataLink> | DataLink
|
|
3652
|
-
/* The URL of image to infer */
|
|
3653
|
-
mediaImageUrl?: string | DataLink
|
|
3654
|
-
/* MD5 checksum of image */
|
|
3655
|
-
mediaImageMd5?: string | DataLink
|
|
3656
|
-
/* The data input to infer */
|
|
3657
|
-
rawInput?: any
|
|
3658
|
-
}
|
|
3659
|
-
events?: {
|
|
3660
|
-
/* Event of TensorFlow inference error */
|
|
3661
|
-
onError?: Array<
|
|
3662
|
-
EventAction & {
|
|
3663
|
-
eventPropertyMapping?: {
|
|
3664
|
-
errorMessage: {
|
|
3665
|
-
type: 'string'
|
|
3666
|
-
path: string
|
|
3667
|
-
}
|
|
3668
|
-
}
|
|
3669
|
-
}
|
|
3670
|
-
>
|
|
3671
|
-
}
|
|
3672
|
-
outlets?: {
|
|
3673
|
-
/* Model inference spend time in ms */
|
|
3674
|
-
modelPerformance?: () => Data
|
|
3675
|
-
/* Model state */
|
|
3676
|
-
modelState?: () => Data
|
|
3677
|
-
/* Transformed infer result */
|
|
3678
|
-
result?: () => Data
|
|
3679
|
-
/* Raw infer result */
|
|
3680
|
-
rawResult?: () => Data
|
|
3681
|
-
}
|
|
3682
|
-
}
|
|
3683
|
-
|
|
3684
|
-
/* TensorFlow Inference */
|
|
3685
|
-
export type GeneratorTensorFlowInference = Generator &
|
|
3686
|
-
GeneratorTensorFlowInferenceDef & {
|
|
3687
|
-
templateKey: 'GENERATOR_TENSORFLOW_INFERENCE'
|
|
3688
|
-
switches: Array<
|
|
3689
|
-
SwitchDef &
|
|
3690
|
-
GeneratorTensorFlowInferenceDef & {
|
|
3691
|
-
conds?: Array<{
|
|
3692
|
-
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
3693
|
-
cond:
|
|
3694
|
-
| SwitchCondInnerStateCurrentCanvas
|
|
3695
|
-
| SwitchCondData
|
|
3696
|
-
| {
|
|
3697
|
-
__typename: 'SwitchCondInnerStateOutlet'
|
|
3698
|
-
outlet: 'modelPerformance' | 'modelState' | 'result' | 'rawResult'
|
|
3699
|
-
value: any
|
|
3700
|
-
}
|
|
3701
|
-
}>
|
|
3702
|
-
}
|
|
3703
|
-
>
|
|
3704
|
-
}
|
|
3705
|
-
|
|
3706
3597
|
/* Run Crawler request with defined properties */
|
|
3707
3598
|
export type GeneratorWebCrawlerActionRunRequest = Action & {
|
|
3708
3599
|
__actionName: 'GENERATOR_WEB_CRAWLER_RUN_REQUEST'
|
|
@@ -3853,6 +3744,17 @@ Default property:
|
|
|
3853
3744
|
}
|
|
3854
3745
|
}
|
|
3855
3746
|
>
|
|
3747
|
+
/* Event for recorded file */
|
|
3748
|
+
recorded?: Array<
|
|
3749
|
+
EventAction & {
|
|
3750
|
+
eventPropertyMapping?: {
|
|
3751
|
+
recordedPath: {
|
|
3752
|
+
type: 'string'
|
|
3753
|
+
path: string
|
|
3754
|
+
}
|
|
3755
|
+
}
|
|
3756
|
+
}
|
|
3757
|
+
>
|
|
3856
3758
|
}
|
|
3857
3759
|
outlets?: {
|
|
3858
3760
|
/* Is recording */
|
|
@@ -4105,6 +4007,7 @@ Default property:
|
|
|
4105
4007
|
"cameraType": "back",
|
|
4106
4008
|
"cameraPosition": "top",
|
|
4107
4009
|
"nextButtonText": "NEXT",
|
|
4010
|
+
"skipButtonText": "SKIP",
|
|
4108
4011
|
"doneButtonText": "DONE",
|
|
4109
4012
|
"selectColumns": 3,
|
|
4110
4013
|
"sizeFactor": 2
|
|
@@ -4184,12 +4087,13 @@ Default property:
|
|
|
4184
4087
|
selectOptions?:
|
|
4185
4088
|
| DataLink
|
|
4186
4089
|
| {
|
|
4090
|
+
withConfirmButton?: boolean | DataLink
|
|
4187
4091
|
options?:
|
|
4188
4092
|
| Array<
|
|
4189
4093
|
| DataLink
|
|
4190
4094
|
| {
|
|
4191
4095
|
value?: string | DataLink
|
|
4192
|
-
|
|
4096
|
+
image_uri?: string | DataLink
|
|
4193
4097
|
label?: string | DataLink
|
|
4194
4098
|
}
|
|
4195
4099
|
>
|
|
@@ -4203,7 +4107,7 @@ Default property:
|
|
|
4203
4107
|
| DataLink
|
|
4204
4108
|
| {
|
|
4205
4109
|
value?: string | DataLink
|
|
4206
|
-
|
|
4110
|
+
image_uri?: string | DataLink
|
|
4207
4111
|
label?: string | DataLink
|
|
4208
4112
|
}
|
|
4209
4113
|
>
|
|
@@ -4214,6 +4118,7 @@ Default property:
|
|
|
4214
4118
|
yesnoOptions?:
|
|
4215
4119
|
| DataLink
|
|
4216
4120
|
| {
|
|
4121
|
+
withConfirmButton?: boolean | DataLink
|
|
4217
4122
|
yesBtnText?: string | DataLink
|
|
4218
4123
|
noBtnText?: string | DataLink
|
|
4219
4124
|
}
|
|
@@ -4250,6 +4155,8 @@ Default property:
|
|
|
4250
4155
|
cameraPosition?: 'top' | 'left' | 'bottom' | 'right' | DataLink
|
|
4251
4156
|
/* "Next" button text */
|
|
4252
4157
|
nextButtonText?: string | DataLink
|
|
4158
|
+
/* "Skip" button text */
|
|
4159
|
+
skipButtonText?: string | DataLink
|
|
4253
4160
|
/* "Done" button text */
|
|
4254
4161
|
doneButtonText?: string | DataLink
|
|
4255
4162
|
/* Select columns */
|
|
@@ -6491,6 +6398,10 @@ Default property:
|
|
|
6491
6398
|
onCompletion?: Array<
|
|
6492
6399
|
EventAction & {
|
|
6493
6400
|
eventPropertyMapping?: {
|
|
6401
|
+
completionSessionKey: {
|
|
6402
|
+
type: 'string'
|
|
6403
|
+
path: string
|
|
6404
|
+
}
|
|
6494
6405
|
completionResult: {
|
|
6495
6406
|
type: 'string'
|
|
6496
6407
|
path: string
|
|
@@ -6510,6 +6421,10 @@ Default property:
|
|
|
6510
6421
|
onCompletionFinished?: Array<
|
|
6511
6422
|
EventAction & {
|
|
6512
6423
|
eventPropertyMapping?: {
|
|
6424
|
+
completionSessionKey: {
|
|
6425
|
+
type: 'string'
|
|
6426
|
+
path: string
|
|
6427
|
+
}
|
|
6513
6428
|
completionResult: {
|
|
6514
6429
|
type: 'string'
|
|
6515
6430
|
path: string
|
|
@@ -6529,6 +6444,10 @@ Default property:
|
|
|
6529
6444
|
onCompletionFunctionCall?: Array<
|
|
6530
6445
|
EventAction & {
|
|
6531
6446
|
eventPropertyMapping?: {
|
|
6447
|
+
completionSessionKey: {
|
|
6448
|
+
type: 'string'
|
|
6449
|
+
path: string
|
|
6450
|
+
}
|
|
6532
6451
|
completionFunctionCallName: {
|
|
6533
6452
|
type: 'string'
|
|
6534
6453
|
path: string
|
|
@@ -6610,3 +6529,243 @@ export type GeneratorLLM = Generator &
|
|
|
6610
6529
|
}
|
|
6611
6530
|
>
|
|
6612
6531
|
}
|
|
6532
|
+
|
|
6533
|
+
/* Add a message to the assistant */
|
|
6534
|
+
export type GeneratorAssistantActionAddMessage = ActionWithParams & {
|
|
6535
|
+
__actionName: 'GENERATOR_ASSISTANT_ADD_MESSAGE'
|
|
6536
|
+
params?: Array<
|
|
6537
|
+
| {
|
|
6538
|
+
input: 'role'
|
|
6539
|
+
value?: string | DataLink
|
|
6540
|
+
mapping?: string
|
|
6541
|
+
}
|
|
6542
|
+
| {
|
|
6543
|
+
input: 'content'
|
|
6544
|
+
value?: string | DataLink
|
|
6545
|
+
mapping?: string
|
|
6546
|
+
}
|
|
6547
|
+
| {
|
|
6548
|
+
input: 'payload'
|
|
6549
|
+
value?: {} | DataLink
|
|
6550
|
+
mapping?: string
|
|
6551
|
+
}
|
|
6552
|
+
>
|
|
6553
|
+
}
|
|
6554
|
+
|
|
6555
|
+
/* Update a message at a specific index */
|
|
6556
|
+
export type GeneratorAssistantActionUpdateMessageAtIndex = ActionWithParams & {
|
|
6557
|
+
__actionName: 'GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX'
|
|
6558
|
+
params?: Array<
|
|
6559
|
+
| {
|
|
6560
|
+
input: 'index'
|
|
6561
|
+
value?: number | DataLink
|
|
6562
|
+
mapping?: string
|
|
6563
|
+
}
|
|
6564
|
+
| {
|
|
6565
|
+
input: 'content'
|
|
6566
|
+
value?: string | DataLink
|
|
6567
|
+
mapping?: string
|
|
6568
|
+
}
|
|
6569
|
+
| {
|
|
6570
|
+
input: 'payload'
|
|
6571
|
+
value?: {} | DataLink
|
|
6572
|
+
mapping?: string
|
|
6573
|
+
}
|
|
6574
|
+
>
|
|
6575
|
+
}
|
|
6576
|
+
|
|
6577
|
+
/* Add an audio message and convert it to text to the assistant (if STT enabled) */
|
|
6578
|
+
export type GeneratorAssistantActionAddAudioMessage = ActionWithParams & {
|
|
6579
|
+
__actionName: 'GENERATOR_ASSISTANT_ADD_AUDIO_MESSAGE'
|
|
6580
|
+
params?: Array<
|
|
6581
|
+
| {
|
|
6582
|
+
input: 'role'
|
|
6583
|
+
value?: string | DataLink
|
|
6584
|
+
mapping?: string
|
|
6585
|
+
}
|
|
6586
|
+
| {
|
|
6587
|
+
input: 'contentFile'
|
|
6588
|
+
value?: string | DataLink
|
|
6589
|
+
mapping?: string
|
|
6590
|
+
}
|
|
6591
|
+
| {
|
|
6592
|
+
input: 'contentBase64'
|
|
6593
|
+
value?: string | DataLink
|
|
6594
|
+
mapping?: string
|
|
6595
|
+
}
|
|
6596
|
+
| {
|
|
6597
|
+
input: 'payload'
|
|
6598
|
+
value?: {} | DataLink
|
|
6599
|
+
mapping?: string
|
|
6600
|
+
}
|
|
6601
|
+
>
|
|
6602
|
+
}
|
|
6603
|
+
|
|
6604
|
+
/* Update a audio message at a specific index */
|
|
6605
|
+
export type GeneratorAssistantActionUpdateAudioMessageAtIndex = ActionWithParams & {
|
|
6606
|
+
__actionName: 'GENERATOR_ASSISTANT_UPDATE_AUDIO_MESSAGE_AT_INDEX'
|
|
6607
|
+
params?: Array<
|
|
6608
|
+
| {
|
|
6609
|
+
input: 'index'
|
|
6610
|
+
value?: number | DataLink
|
|
6611
|
+
mapping?: string
|
|
6612
|
+
}
|
|
6613
|
+
| {
|
|
6614
|
+
input: 'contentFile'
|
|
6615
|
+
value?: string | DataLink
|
|
6616
|
+
mapping?: string
|
|
6617
|
+
}
|
|
6618
|
+
| {
|
|
6619
|
+
input: 'contentBase64'
|
|
6620
|
+
value?: string | DataLink
|
|
6621
|
+
mapping?: string
|
|
6622
|
+
}
|
|
6623
|
+
| {
|
|
6624
|
+
input: 'payload'
|
|
6625
|
+
value?: {} | DataLink
|
|
6626
|
+
mapping?: string
|
|
6627
|
+
}
|
|
6628
|
+
>
|
|
6629
|
+
}
|
|
6630
|
+
|
|
6631
|
+
/* Remove a message at a specific index */
|
|
6632
|
+
export type GeneratorAssistantActionRemoveMessageAtIndex = ActionWithParams & {
|
|
6633
|
+
__actionName: 'GENERATOR_ASSISTANT_REMOVE_MESSAGE_AT_INDEX'
|
|
6634
|
+
params?: Array<{
|
|
6635
|
+
input: 'index'
|
|
6636
|
+
value?: number | DataLink
|
|
6637
|
+
mapping?: string
|
|
6638
|
+
}>
|
|
6639
|
+
}
|
|
6640
|
+
|
|
6641
|
+
/* Reset all messages of the assistant */
|
|
6642
|
+
export type GeneratorAssistantActionResetMessages = Action & {
|
|
6643
|
+
__actionName: 'GENERATOR_ASSISTANT_RESET_MESSAGES'
|
|
6644
|
+
}
|
|
6645
|
+
|
|
6646
|
+
/* Submit the assistant */
|
|
6647
|
+
export type GeneratorAssistantActionSubmit = Action & {
|
|
6648
|
+
__actionName: 'GENERATOR_ASSISTANT_SUBMIT'
|
|
6649
|
+
}
|
|
6650
|
+
|
|
6651
|
+
/* Cancel the assistant responding */
|
|
6652
|
+
export type GeneratorAssistantActionCancel = Action & {
|
|
6653
|
+
__actionName: 'GENERATOR_ASSISTANT_CANCEL'
|
|
6654
|
+
}
|
|
6655
|
+
|
|
6656
|
+
interface GeneratorAssistantDef {
|
|
6657
|
+
/*
|
|
6658
|
+
Default property:
|
|
6659
|
+
{
|
|
6660
|
+
"initialMessages": [
|
|
6661
|
+
null
|
|
6662
|
+
],
|
|
6663
|
+
"cacheMessages": false,
|
|
6664
|
+
"llmLivePolicy": "only-in-use",
|
|
6665
|
+
"llmSessionKey": "default-assistant",
|
|
6666
|
+
"sttEnabled": true,
|
|
6667
|
+
"sttLivePolicy": "only-in-use",
|
|
6668
|
+
"ttsEnabled": false,
|
|
6669
|
+
"ttsLivePolicy": "only-in-use"
|
|
6670
|
+
}
|
|
6671
|
+
*/
|
|
6672
|
+
property?: {
|
|
6673
|
+
/* Whether to heat up generators on initialization for better performance */
|
|
6674
|
+
heatup?: boolean | DataLink
|
|
6675
|
+
/* Messages */
|
|
6676
|
+
initialMessages?:
|
|
6677
|
+
| Array<
|
|
6678
|
+
| DataLink
|
|
6679
|
+
| {
|
|
6680
|
+
role?: string | DataLink
|
|
6681
|
+
content?: string | DataLink
|
|
6682
|
+
}
|
|
6683
|
+
>
|
|
6684
|
+
| DataLink
|
|
6685
|
+
/* Whether to cache messages */
|
|
6686
|
+
cacheMessages?: boolean | DataLink
|
|
6687
|
+
/* LLM Generator (Currently only support `LLM (GGML)` generator) */
|
|
6688
|
+
llmGeneratorId?: string | DataLink
|
|
6689
|
+
/* LLM Live Policy. If the policy is `only-in-use`, the LLM context will be released when the assistant is not in use. */
|
|
6690
|
+
llmLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
6691
|
+
/* LLM main session key */
|
|
6692
|
+
llmSessionKey?: string | DataLink
|
|
6693
|
+
/* STT Generator use for transcribing audio message (Currently only support `STT (GGML)` generator) */
|
|
6694
|
+
sttGeneratorId?: string | DataLink
|
|
6695
|
+
/* STT Enabled */
|
|
6696
|
+
sttEnabled?: boolean | DataLink
|
|
6697
|
+
/* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when the assistant is not in use. */
|
|
6698
|
+
sttLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
6699
|
+
/* TTS Generator use for generating LLM response audio message (Currently only support `TTS (ONNX)` generator) */
|
|
6700
|
+
ttsGeneratorId?: string | DataLink
|
|
6701
|
+
/* TTS Enabled */
|
|
6702
|
+
ttsEnabled?: boolean | DataLink
|
|
6703
|
+
/* TTS Live Policy. If the policy is `only-in-use`, the TTS context will be released when the assistant is not in use. */
|
|
6704
|
+
ttsLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
6705
|
+
}
|
|
6706
|
+
events?: {
|
|
6707
|
+
/* Error event */
|
|
6708
|
+
onError?: Array<
|
|
6709
|
+
EventAction & {
|
|
6710
|
+
eventPropertyMapping?: {
|
|
6711
|
+
error: {
|
|
6712
|
+
type: 'string'
|
|
6713
|
+
path: string
|
|
6714
|
+
}
|
|
6715
|
+
}
|
|
6716
|
+
}
|
|
6717
|
+
>
|
|
6718
|
+
/* Log event */
|
|
6719
|
+
onLogs?: Array<
|
|
6720
|
+
EventAction & {
|
|
6721
|
+
eventPropertyMapping?: {
|
|
6722
|
+
logs: {
|
|
6723
|
+
type: 'array'
|
|
6724
|
+
path: string
|
|
6725
|
+
}
|
|
6726
|
+
}
|
|
6727
|
+
}
|
|
6728
|
+
>
|
|
6729
|
+
/* Messages update event */
|
|
6730
|
+
onMessagesUpdate?: Array<
|
|
6731
|
+
EventAction & {
|
|
6732
|
+
eventPropertyMapping?: {
|
|
6733
|
+
messages: {
|
|
6734
|
+
type: 'array'
|
|
6735
|
+
path: string
|
|
6736
|
+
}
|
|
6737
|
+
}
|
|
6738
|
+
}
|
|
6739
|
+
>
|
|
6740
|
+
}
|
|
6741
|
+
outlets?: {
|
|
6742
|
+
/* Whether the assistant is heating up */
|
|
6743
|
+
isHeatingUp?: () => Data
|
|
6744
|
+
/* Whether the assistant is responding */
|
|
6745
|
+
isResponding?: () => Data
|
|
6746
|
+
/* Messages of the assistant */
|
|
6747
|
+
messages?: () => Data
|
|
6748
|
+
}
|
|
6749
|
+
}
|
|
6750
|
+
|
|
6751
|
+
/* AI Assistant */
|
|
6752
|
+
export type GeneratorAssistant = Generator &
|
|
6753
|
+
GeneratorAssistantDef & {
|
|
6754
|
+
templateKey: 'GENERATOR_ASSISTANT'
|
|
6755
|
+
switches: Array<
|
|
6756
|
+
SwitchDef &
|
|
6757
|
+
GeneratorAssistantDef & {
|
|
6758
|
+
conds?: Array<{
|
|
6759
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
6760
|
+
cond:
|
|
6761
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
6762
|
+
| SwitchCondData
|
|
6763
|
+
| {
|
|
6764
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
6765
|
+
outlet: 'isHeatingUp' | 'isResponding' | 'messages'
|
|
6766
|
+
value: any
|
|
6767
|
+
}
|
|
6768
|
+
}>
|
|
6769
|
+
}
|
|
6770
|
+
>
|
|
6771
|
+
}
|
package/types/system.ts
CHANGED
|
@@ -222,6 +222,11 @@ export type SystemActionAlert = ActionWithParams & {
|
|
|
222
222
|
value?: number | DataLink
|
|
223
223
|
mapping?: string
|
|
224
224
|
}
|
|
225
|
+
| {
|
|
226
|
+
input: 'hideSelections'
|
|
227
|
+
value?: boolean | DataLink
|
|
228
|
+
mapping?: string
|
|
229
|
+
}
|
|
225
230
|
>
|
|
226
231
|
}
|
|
227
232
|
|
|
@@ -251,6 +256,11 @@ export type SystemActionTakeScreenshot = ActionWithParams & {
|
|
|
251
256
|
value?: boolean | DataLink
|
|
252
257
|
mapping?: string
|
|
253
258
|
}
|
|
259
|
+
| {
|
|
260
|
+
input: 'brickId'
|
|
261
|
+
value?: string | DataLink | (() => Brick)
|
|
262
|
+
mapping?: string
|
|
263
|
+
}
|
|
254
264
|
| {
|
|
255
265
|
input: 'format'
|
|
256
266
|
value?: 'jpg' | 'png' | DataLink
|
|
@@ -303,11 +313,21 @@ export type SystemActionChannelSubscribe = ActionWithParams & {
|
|
|
303
313
|
value?: string | DataLink | (() => Data)
|
|
304
314
|
mapping?: string
|
|
305
315
|
}
|
|
316
|
+
| {
|
|
317
|
+
input: 'dataAssignList'
|
|
318
|
+
value?: {} | DataLink
|
|
319
|
+
mapping?: string
|
|
320
|
+
}
|
|
306
321
|
| {
|
|
307
322
|
input: 'progressResult'
|
|
308
323
|
value?: string | DataLink | (() => Data)
|
|
309
324
|
mapping?: string
|
|
310
325
|
}
|
|
326
|
+
| {
|
|
327
|
+
input: 'progressAssignList'
|
|
328
|
+
value?: {} | DataLink
|
|
329
|
+
mapping?: string
|
|
330
|
+
}
|
|
311
331
|
| {
|
|
312
332
|
input: 'errorResult'
|
|
313
333
|
value?: string | DataLink | (() => Data)
|
|
@@ -475,3 +495,8 @@ export type SystemActionThrowException = ActionWithParams & {
|
|
|
475
495
|
}
|
|
476
496
|
>
|
|
477
497
|
}
|
|
498
|
+
|
|
499
|
+
/* Dismiss keyboard */
|
|
500
|
+
export type SystemActionDismissKeyboard = Action & {
|
|
501
|
+
__actionName: 'DISMISS_KEYBOARD'
|
|
502
|
+
}
|