@fugood/bricks-project 2.22.0-beta.1 → 2.22.0-beta.11

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.
@@ -47,7 +47,7 @@ Default property:
47
47
  completed?: Array<EventAction>
48
48
  }
49
49
  outlets?: {
50
- /* Result of each countdown change */
50
+ /* Countdown step value */
51
51
  countdown?: () => Data
52
52
  }
53
53
  }
@@ -691,7 +691,7 @@ Default property:
691
691
  }
692
692
  */
693
693
  property?: {
694
- /* Start query on generator initialized */
694
+ /* Start generator initialization execution immediately */
695
695
  init?: boolean | DataLink
696
696
  /* Data Bank Space ID */
697
697
  spacename?: string | DataLink
@@ -730,7 +730,7 @@ Default property:
730
730
  }
731
731
  }
732
732
 
733
- /* Fetch data & subscribe data change from Data Bank */
733
+ /* Get Data or subscribe to Data changes from Data Bank */
734
734
  export type GeneratorDataBank = Generator &
735
735
  GeneratorDataBankDef & {
736
736
  templateKey: 'GENERATOR_DATA_BANK'
@@ -752,7 +752,7 @@ export type GeneratorDataBank = Generator &
752
752
  >
753
753
  }
754
754
 
755
- /* Run GraphQL query with defined properties */
755
+ /* Execute GraphQL request with defined properties */
756
756
  export type GeneratorGraphQLActionRunQuery = ActionWithParams & {
757
757
  __actionName: 'GENERATOR_GRAPHQL_RUN_QUERY'
758
758
  params?: Array<
@@ -797,7 +797,7 @@ Default property:
797
797
  }
798
798
  */
799
799
  property?: {
800
- /* Start GraphQL query on generator initialized */
800
+ /* Start GraphQL request immediately after generator initialization */
801
801
  init?: boolean | DataLink
802
802
  /* GraphQL request type */
803
803
  type?: 'query' | 'mutation' | 'subscription' | DataLink
@@ -805,9 +805,9 @@ Default property:
805
805
  headers?: {} | DataLink
806
806
  /* HTTP request URL endpoint */
807
807
  endpoint?: string | DataLink
808
- /* Subscrpition endpoint */
808
+ /* Subscription endpoint */
809
809
  endpointForSubscription?: string | DataLink
810
- /* Subscrpition connection params */
810
+ /* Subscription connection params */
811
811
  connectionParams?: {} | DataLink
812
812
  /* Query content */
813
813
  query?: string | DataLink
@@ -831,9 +831,9 @@ Default property:
831
831
  firebaseMessagingSenderId?: string | DataLink
832
832
  }
833
833
  events?: {
834
- /* Event of subscription on connection */
834
+ /* Event triggered when subscription connection is successful */
835
835
  subscriptionOnConnection?: Array<EventAction>
836
- /* Server connections error of GraphQL subscription */
836
+ /* Event triggered when subscription connection error occurs */
837
837
  subscriptionOnConnectionError?: Array<EventAction>
838
838
  }
839
839
  outlets?: {
@@ -973,22 +973,22 @@ export type GeneratorHTTP = Generator &
973
973
  >
974
974
  }
975
975
 
976
- /* Start play sound */
976
+ /* Start playing sound */
977
977
  export type GeneratorSoundPlayerActionPlay = Action & {
978
978
  __actionName: 'GENERATOR_SOUND_PLAYER_PLAY'
979
979
  }
980
980
 
981
- /* Pause play sound */
981
+ /* Pause playing sound */
982
982
  export type GeneratorSoundPlayerActionPause = Action & {
983
983
  __actionName: 'GENERATOR_SOUND_PLAYER_PAUSE'
984
984
  }
985
985
 
986
- /* Resume play sound from pause */
986
+ /* Resume playing sound from pause */
987
987
  export type GeneratorSoundPlayerActionResume = Action & {
988
988
  __actionName: 'GENERATOR_SOUND_PLAYER_RESUME'
989
989
  }
990
990
 
991
- /* Stop play sound */
991
+ /* Stop playing sound */
992
992
  export type GeneratorSoundPlayerActionRelease = Action & {
993
993
  __actionName: 'GENERATOR_SOUND_PLAYER_RELEASE'
994
994
  }
@@ -1002,32 +1002,32 @@ Default property:
1002
1002
  }
1003
1003
  */
1004
1004
  property?: {
1005
- /* The sound file path */
1005
+ /* Sound file path */
1006
1006
  filePath?: string | DataLink
1007
- /* The checksum of file */
1007
+ /* MD5 */
1008
1008
  md5?: string | DataLink
1009
- /* Repeat the sound */
1009
+ /* Repeat playback */
1010
1010
  loop?: boolean | DataLink
1011
- /* The volume of sound (0 - 100) */
1011
+ /* Sound volume (0 - 100) */
1012
1012
  volume?: number | DataLink
1013
1013
  }
1014
1014
  events?: {
1015
- /* Event on sound file loaded */
1015
+ /* Sound file loaded successfully */
1016
1016
  onLoad?: Array<EventAction>
1017
- /* Event on load error */
1017
+ /* Sound file load error */
1018
1018
  onLoadError?: Array<EventAction>
1019
- /* Event on sound play */
1019
+ /* Sound playback complete */
1020
1020
  onPlay?: Array<EventAction>
1021
- /* Event on sound end */
1021
+ /* Sound file playback end */
1022
1022
  onEnd?: Array<EventAction>
1023
1023
  }
1024
1024
  outlets?: {
1025
- /* Is sound playing */
1025
+ /* Whether the sound is playing */
1026
1026
  isPlaying?: () => Data
1027
1027
  }
1028
1028
  }
1029
1029
 
1030
- /* Play sound file from file system, support sound format refer this https://developer.android.com/guide/topics/media/media-formats */
1030
+ /* Play sound, see supported formats at https://developer.android.com/guide/topics/media/media-formats */
1031
1031
  export type GeneratorSoundPlayer = Generator &
1032
1032
  GeneratorSoundPlayerDef & {
1033
1033
  templateKey: 'GENERATOR_SOUND_PLAYER'
@@ -1062,43 +1062,42 @@ Default property:
1062
1062
  }
1063
1063
  */
1064
1064
  property?: {
1065
- /* Enable listening */
1065
+ /* Enable listening for input */
1066
1066
  enabled?: boolean | DataLink
1067
- /* Key map to convert key or key code to specify content (e.g. { 37: 'left' }) */
1067
+ /* Key map to transform key or key code to the designated content (e.g. { 37: 'left' }) */
1068
1068
  keyMap?: {} | DataLink
1069
- /* Key outlet prefer use key code or key.
1070
- Please note that the key code is not supported on iOS / tvOS, so it will use `key` if value is `auto`. */
1069
+ /* Key outlet preference use key code or key. */
1071
1070
  keyOutletPrefer?: 'auto' | 'key-code' | 'key' | DataLink
1072
- /* Stop key or code to finish batch */
1071
+ /* Key or code to finish continuous input */
1073
1072
  batchStopKeys?: Array<string | DataLink | number | DataLink | DataLink> | DataLink
1074
- /* Debounce time to finish batch (ms) */
1073
+ /* Debounce time (ms) to finish continuous input */
1075
1074
  batchDebounce?: number | DataLink
1076
- /* Max wait time to finish batch (ms) (Default: No limit) */
1075
+ /* Maximum wait time (ms) to finish continuous input (default: unlimited) */
1077
1076
  batchDebounceMaxWait?: number | DataLink
1078
1077
  }
1079
1078
  events?: {
1080
- /* Event of key down */
1079
+ /* Event on key press */
1081
1080
  onDown?: Array<EventAction>
1082
- /* Event of key up */
1081
+ /* Event on key up */
1083
1082
  onUp?: Array<EventAction>
1084
- /* Event of batch input finished */
1083
+ /* Event on continuous input complete */
1085
1084
  onBatch?: Array<EventAction>
1086
1085
  }
1087
1086
  outlets?: {
1088
- /* Last key down code */
1087
+ /* Last key code pressed */
1089
1088
  lastKeyDown?: () => Data
1090
- /* Last key down flags */
1089
+ /* Modifier key information on last key press */
1091
1090
  lastKeyDownFlags?: () => Data
1092
- /* Last key up code */
1091
+ /* Last key code released */
1093
1092
  lastKeyUp?: () => Data
1094
- /* Last key up flags */
1093
+ /* Modifier key information on last key release */
1095
1094
  lastKeyUpFlags?: () => Data
1096
- /* Last batch events */
1095
+ /* Last continuous event */
1097
1096
  lastBatchEvents?: () => Data
1098
1097
  }
1099
1098
  }
1100
1099
 
1101
- /* Listening keyboard (controller) event */
1100
+ /* Access keyboard (remote control) events */
1102
1101
  export type GeneratorKeyboard = Generator &
1103
1102
  GeneratorKeyboardDef & {
1104
1103
  templateKey: 'GENERATOR_KEYBOARD'
@@ -1395,22 +1394,22 @@ export type GeneratorStep = Generator &
1395
1394
  >
1396
1395
  }
1397
1396
 
1398
- /* Start the next iterate */
1397
+ /* Proceed to next iteration */
1399
1398
  export type GeneratorIteratorActionNext = Action & {
1400
1399
  __actionName: 'GENERATOR_ITERATOR_NEXT'
1401
1400
  }
1402
1401
 
1403
- /* Back to the previous iterate */
1402
+ /* Go back to previous iteration */
1404
1403
  export type GeneratorIteratorActionPrevious = Action & {
1405
1404
  __actionName: 'GENERATOR_ITERATOR_PREVIOUS'
1406
1405
  }
1407
1406
 
1408
- /* Skip to last iterate element (Ignore loop) */
1407
+ /* Jump to the last iteration element (ignoring the loop setting) */
1409
1408
  export type GeneratorIteratorActionLast = Action & {
1410
1409
  __actionName: 'GENERATOR_ITERATOR_LAST'
1411
1410
  }
1412
1411
 
1413
- /* Reset the iterator state */
1412
+ /* Reset iteration state */
1414
1413
  export type GeneratorIteratorActionReset = Action & {
1415
1414
  __actionName: 'GENERATOR_ITERATOR_RESET'
1416
1415
  }
@@ -1425,40 +1424,40 @@ Default property:
1425
1424
  }
1426
1425
  */
1427
1426
  property?: {
1428
- /* The data source of the value. If it is an array, the value element is used. If it is an object, Object.values() is used as the data. If it is a string, the source character of the value is taken. If it is a number, it represents a count of 1N. */
1427
+ /* Data source for iteration. If it's an Array, it will iterate through elements. If it's an Object, it will use Object.values() as data source. If it's a String, it will iterate through characters. If it's a Number, it represents count from 1 to N. */
1429
1428
  data?: any
1430
- /* Starting element index */
1429
+ /* Starting element position */
1431
1430
  start?: number | DataLink
1432
- /* Iterate step */
1431
+ /* Step size for each iteration */
1433
1432
  step?: number | DataLink
1434
- /* The maximum number of iterations (Set -1 for unlimited) */
1433
+ /* Maximum number of iterations (can be set to -1 for unlimited) */
1435
1434
  maxQuantity?: number | DataLink
1436
- /* Loop iterate */
1435
+ /* Whether to loop the iteration */
1437
1436
  loop?: boolean | DataLink
1438
1437
  }
1439
1438
  events?: {
1440
- /* Event on iterate */
1439
+ /* Event triggered on each iteration */
1441
1440
  iterate?: Array<EventAction>
1442
- /* Event on iterate round start */
1441
+ /* Event triggered on the first iteration of a round */
1443
1442
  first?: Array<EventAction>
1444
- /* Event on iterate round end */
1443
+ /* Event triggered on the last iteration of a round */
1445
1444
  end?: Array<EventAction>
1446
1445
  }
1447
1446
  outlets?: {
1448
- /* Elements that have been iterated (Included current iterated) */
1447
+ /* Elements that have been iterated (including current one) */
1449
1448
  iteratedArray?: () => Data
1450
- /* Elements not yet iterated */
1449
+ /* Elements that will be iterated but have not been iterated yet */
1451
1450
  upcomingArray?: () => Data
1452
- /* Current iterated element */
1451
+ /* Current iteration element */
1453
1452
  value?: () => Data
1454
- /* Current Key of iterated element (number: same as value; array, string: index; object: string) */
1453
+ /* Key of the current iteration element (for number: same as value, for array/string: index, for object: string key) */
1455
1454
  key?: () => Data
1456
- /* The current number of iterations (if data is 6 and step is 2, this value will be returned in order: 1, 2, 3) */
1455
+ /* Current iteration count (if data is 6 and step is 2, this will return: 1,2,3 in sequence) */
1457
1456
  index?: () => Data
1458
1457
  }
1459
1458
  }
1460
1459
 
1461
- /* Iterate values (Array, Object, Number, String) */
1460
+ /* Iterate through values (Array, Object, Number, String) */
1462
1461
  export type GeneratorIterator = Generator &
1463
1462
  GeneratorIteratorDef & {
1464
1463
  templateKey: 'GENERATOR_ITERATOR'
@@ -2065,14 +2064,11 @@ Default property:
2065
2064
  }
2066
2065
  */
2067
2066
  property?: {
2068
- /* Try attach on generator initialized
2069
- On web require user activation to attach device */
2067
+ /* Try attach on generator initialized On web require user activation to attach device */
2070
2068
  attachOnInit?: boolean | DataLink
2071
2069
  /* The serial device driver */
2072
2070
  driver?: 'fd' | 'usb' | DataLink
2073
- /* The serial device path
2074
- e.g. /dev/ttyS0 or /dev/bus/usb/001/001
2075
- For desktop and web is device index number */
2071
+ /* The serial device path e.g. /dev/ttyS0 or /dev/bus/usb/001/001 For desktop and web is device index number */
2076
2072
  path?: string | DataLink
2077
2073
  /* The serial USB vendor id (autoconnect first) */
2078
2074
  vendorId?: number | DataLink
@@ -4307,6 +4303,521 @@ export type GeneratorSqlite = Generator &
4307
4303
  >
4308
4304
  }
4309
4305
 
4306
+ /* Refresh tools and resources, used for case if tools or resources are changed. Note that the current connections will be closed. */
4307
+ export type GeneratorMCPServerActionRefreshResources = Action & {
4308
+ __actionName: 'GENERATOR_MCP_SERVER_REFRESH_RESOURCES'
4309
+ }
4310
+
4311
+ interface GeneratorMCPServerDef {
4312
+ /*
4313
+ Default property:
4314
+ {
4315
+ "enabled": true,
4316
+ "listening": true,
4317
+ "authType": "none",
4318
+ "name": "bricks-foundation-mcp-server-default",
4319
+ "version": "1.0.0",
4320
+ "resources": [],
4321
+ "tools": [],
4322
+ "prompts": []
4323
+ }
4324
+ */
4325
+ property?: {
4326
+ /* Enable MCP server. If enabled and Listening is false, the generator can still provide application-scoped resources. */
4327
+ enabled?: boolean | DataLink
4328
+ /* Application-scoped generator key, key cannot be the same with other application-scoped generators */
4329
+ globalGeneratorKey?: string | DataLink
4330
+ /* Start MCP server */
4331
+ listening?: boolean | DataLink
4332
+ /* HTTP server port */
4333
+ port?: number | DataLink
4334
+ /* Authorization type of HTTP request */
4335
+ authType?: 'none' | 'bearer' | DataLink
4336
+ /* Token of bearer auth */
4337
+ bearerToken?: string | DataLink
4338
+ /* Name of the MCP server */
4339
+ name?: string | DataLink
4340
+ /* Version of the MCP server */
4341
+ version?: string | DataLink
4342
+ /* Resources
4343
+ Type:
4344
+ `static`: Return static data
4345
+ `detect-data-change`: Watch data target change to return data,
4346
+ please update data with ({ id: string, content: string | object }),
4347
+ and ensure the id is same with request id
4348
+ `script`: Run a JavaScript code to return data
4349
+ - Script can define members to call generator functions
4350
+ - Script support async/await */
4351
+ resources?:
4352
+ | Array<
4353
+ | DataLink
4354
+ | {
4355
+ enabled?: boolean | DataLink
4356
+ name?: string | DataLink
4357
+ description?: string | DataLink
4358
+ uriOrTemplate?: string | DataLink
4359
+ type?: 'static' | 'detect-data-change' | 'script' | DataLink
4360
+ staticData?: any
4361
+ dataChangeConfig?:
4362
+ | DataLink
4363
+ | {
4364
+ target?: string | DataLink
4365
+ timeout?: number | DataLink
4366
+ additionalParams?: {} | DataLink
4367
+ }
4368
+ scriptConfig?:
4369
+ | DataLink
4370
+ | {
4371
+ code?: string | DataLink
4372
+ timeout?: number | DataLink
4373
+ members?:
4374
+ | Array<
4375
+ | DataLink
4376
+ | {
4377
+ handler?: string | DataLink
4378
+ varName?: string | DataLink
4379
+ }
4380
+ >
4381
+ | DataLink
4382
+ additionalParams?: {} | DataLink
4383
+ }
4384
+ }
4385
+ >
4386
+ | DataLink
4387
+ /* Tools
4388
+ Type:
4389
+ `detect-data-change`: Watch data target change to return data,
4390
+ please update data with ({ id: string, content: string | object }),
4391
+ and ensure the id is same with request id.
4392
+ `script`: Run a JavaScript code to return data
4393
+ - Script can define members to call generator functions
4394
+ - Script support async/await */
4395
+ tools?:
4396
+ | Array<
4397
+ | DataLink
4398
+ | {
4399
+ enabled?: boolean | DataLink
4400
+ name?: string | DataLink
4401
+ description?: string | DataLink
4402
+ params?: {} | DataLink
4403
+ type?: 'detect-data-change' | 'script' | DataLink
4404
+ dataChangeConfig?:
4405
+ | DataLink
4406
+ | {
4407
+ target?: string | DataLink
4408
+ timeout?: number | DataLink
4409
+ additionalParams?: {} | DataLink
4410
+ }
4411
+ scriptConfig?:
4412
+ | DataLink
4413
+ | {
4414
+ code?: string | DataLink
4415
+ timeout?: number | DataLink
4416
+ members?:
4417
+ | Array<
4418
+ | DataLink
4419
+ | {
4420
+ handler?: string | DataLink
4421
+ varName?: string | DataLink
4422
+ }
4423
+ >
4424
+ | DataLink
4425
+ additionalParams?: {} | DataLink
4426
+ }
4427
+ }
4428
+ >
4429
+ | DataLink
4430
+ /* Prompts
4431
+ Type:
4432
+ `static`: Return static data
4433
+ `detect-data-change`: Watch data target change to return data,
4434
+ please update data with ({ id: string, content: string | object }),
4435
+ and ensure the id is same with request id
4436
+ `script`: Run a JavaScript code to return data
4437
+ - Script can define members to call generator functions
4438
+ - Script support async/await */
4439
+ prompts?:
4440
+ | Array<
4441
+ | DataLink
4442
+ | {
4443
+ enabled?: boolean | DataLink
4444
+ name?: string | DataLink
4445
+ description?: string | DataLink
4446
+ arguments?: {} | DataLink
4447
+ type?: 'static' | 'detect-data-change' | 'script' | DataLink
4448
+ staticData?: any
4449
+ dataChangeConfig?:
4450
+ | DataLink
4451
+ | {
4452
+ target?: string | DataLink
4453
+ timeout?: number | DataLink
4454
+ additionalParams?: {} | DataLink
4455
+ }
4456
+ scriptConfig?:
4457
+ | DataLink
4458
+ | {
4459
+ code?: string | DataLink
4460
+ timeout?: number | DataLink
4461
+ members?:
4462
+ | Array<
4463
+ | DataLink
4464
+ | {
4465
+ handler?: string | DataLink
4466
+ varName?: string | DataLink
4467
+ }
4468
+ >
4469
+ | DataLink
4470
+ additionalParams?: {} | DataLink
4471
+ }
4472
+ }
4473
+ >
4474
+ | DataLink
4475
+ }
4476
+ events?: {
4477
+ /* Listening of HTTP server */
4478
+ onListening?: Array<EventAction>
4479
+ /* Error of HTTP server */
4480
+ onError?: Array<EventAction>
4481
+ /* Client error of HTTP server */
4482
+ onClientError?: Array<EventAction>
4483
+ /* Client close of HTTP server */
4484
+ onClientClose?: Array<EventAction>
4485
+ /* On request resource (Request: { name: string, uri: string, params: object }) */
4486
+ onRequestResource?: Array<EventAction>
4487
+ /* On call tool (Request: { name: string, params: object }) */
4488
+ onCallTool?: Array<EventAction>
4489
+ /* On get prompt (Request: { name: string, arguments: object }) */
4490
+ onGetPrompt?: Array<EventAction>
4491
+ }
4492
+ outlets?: {
4493
+ /* Whether the HTTP server is listening */
4494
+ isListening?: () => Data
4495
+ /* Last error of HTTP server */
4496
+ lastError?: () => Data
4497
+ /* MCP server endpoint URL */
4498
+ endpoint?: () => Data
4499
+ /* Connected remotes (Session ID) */
4500
+ connectedRemotes?: () => Data
4501
+ /* Last resource request ({ name: string, uri: string, params: object }) */
4502
+ lastResourceRequest?: () => Data
4503
+ /* Last tool call ({ name: string, params: object }) */
4504
+ lastToolCall?: () => Data
4505
+ /* Last prompt get ({ name: string, arguments: object }) */
4506
+ lastPromptGet?: () => Data
4507
+ }
4508
+ }
4509
+
4510
+ /* Model Context Protocol (MCP) Server (https://docs.anthropic.com/en/docs/agents-and-tools/mcp) */
4511
+ export type GeneratorMCPServer = Generator &
4512
+ GeneratorMCPServerDef & {
4513
+ templateKey: 'GENERATOR_MCP_SERVER'
4514
+ switches: Array<
4515
+ SwitchDef &
4516
+ GeneratorMCPServerDef & {
4517
+ conds?: Array<{
4518
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
4519
+ cond:
4520
+ | SwitchCondInnerStateCurrentCanvas
4521
+ | SwitchCondData
4522
+ | {
4523
+ __typename: 'SwitchCondInnerStateOutlet'
4524
+ outlet:
4525
+ | 'isListening'
4526
+ | 'lastError'
4527
+ | 'endpoint'
4528
+ | 'connectedRemotes'
4529
+ | 'lastResourceRequest'
4530
+ | 'lastToolCall'
4531
+ | 'lastPromptGet'
4532
+ value: any
4533
+ }
4534
+ }>
4535
+ }
4536
+ >
4537
+ }
4538
+
4539
+ /* Connect to MCP server */
4540
+ export type GeneratorMCPActionConnect = Action & {
4541
+ __actionName: 'GENERATOR_MCP_CONNECT'
4542
+ }
4543
+
4544
+ /* Disconnect from MCP server */
4545
+ export type GeneratorMCPActionDisconnect = Action & {
4546
+ __actionName: 'GENERATOR_MCP_DISCONNECT'
4547
+ }
4548
+
4549
+ /* List resources */
4550
+ export type GeneratorMCPActionListResources = ActionWithParams & {
4551
+ __actionName: 'GENERATOR_MCP_LIST_RESOURCES'
4552
+ params?: Array<{
4553
+ input: 'requestId'
4554
+ value?: string | DataLink | EventProperty
4555
+ mapping?: string
4556
+ }>
4557
+ }
4558
+
4559
+ /* List resource templates */
4560
+ export type GeneratorMCPActionListResourceTemplates = ActionWithParams & {
4561
+ __actionName: 'GENERATOR_MCP_LIST_RESOURCE_TEMPLATES'
4562
+ params?: Array<{
4563
+ input: 'requestId'
4564
+ value?: string | DataLink | EventProperty
4565
+ mapping?: string
4566
+ }>
4567
+ }
4568
+
4569
+ /* Read resource */
4570
+ export type GeneratorMCPActionReadResource = ActionWithParams & {
4571
+ __actionName: 'GENERATOR_MCP_READ_RESOURCE'
4572
+ params?: Array<
4573
+ | {
4574
+ input: 'requestId'
4575
+ value?: string | DataLink | EventProperty
4576
+ mapping?: string
4577
+ }
4578
+ | {
4579
+ input: 'uri'
4580
+ value?: string | DataLink | EventProperty
4581
+ mapping?: string
4582
+ }
4583
+ | {
4584
+ input: 'variables'
4585
+ value?: {} | DataLink | EventProperty
4586
+ mapping?: string
4587
+ }
4588
+ >
4589
+ }
4590
+
4591
+ /* List tools */
4592
+ export type GeneratorMCPActionListTools = ActionWithParams & {
4593
+ __actionName: 'GENERATOR_MCP_LIST_TOOLS'
4594
+ params?: Array<{
4595
+ input: 'requestId'
4596
+ value?: string | DataLink | EventProperty
4597
+ mapping?: string
4598
+ }>
4599
+ }
4600
+
4601
+ /* Call tool */
4602
+ export type GeneratorMCPActionCallTool = ActionWithParams & {
4603
+ __actionName: 'GENERATOR_MCP_CALL_TOOL'
4604
+ params?: Array<
4605
+ | {
4606
+ input: 'requestId'
4607
+ value?: string | DataLink | EventProperty
4608
+ mapping?: string
4609
+ }
4610
+ | {
4611
+ input: 'name'
4612
+ value?: string | DataLink | EventProperty
4613
+ mapping?: string
4614
+ }
4615
+ | {
4616
+ input: 'variables'
4617
+ value?: {} | DataLink | EventProperty
4618
+ mapping?: string
4619
+ }
4620
+ >
4621
+ }
4622
+
4623
+ /* List prompts */
4624
+ export type GeneratorMCPActionListPrompts = ActionWithParams & {
4625
+ __actionName: 'GENERATOR_MCP_LIST_PROMPTS'
4626
+ params?: Array<{
4627
+ input: 'requestId'
4628
+ value?: string | DataLink | EventProperty
4629
+ mapping?: string
4630
+ }>
4631
+ }
4632
+
4633
+ /* Request prompt */
4634
+ export type GeneratorMCPActionGetPrompt = ActionWithParams & {
4635
+ __actionName: 'GENERATOR_MCP_GET_PROMPT'
4636
+ params?: Array<
4637
+ | {
4638
+ input: 'requestId'
4639
+ value?: string | DataLink | EventProperty
4640
+ mapping?: string
4641
+ }
4642
+ | {
4643
+ input: 'name'
4644
+ value?: string | DataLink | EventProperty
4645
+ mapping?: string
4646
+ }
4647
+ | {
4648
+ input: 'variables'
4649
+ value?: {} | DataLink | EventProperty
4650
+ mapping?: string
4651
+ }
4652
+ >
4653
+ }
4654
+
4655
+ interface GeneratorMCPDef {
4656
+ /*
4657
+ Default property:
4658
+ {
4659
+ "init": false,
4660
+ "type": "streamable-http",
4661
+ "url": "",
4662
+ "autoReconnect": true,
4663
+ "maxReconnectAttempts": 10,
4664
+ "reconnectInterval": 1000,
4665
+ "generatorId": "",
4666
+ "generatorKey": "",
4667
+ "name": "bricks-foundation-mcp-client-default",
4668
+ "version": "1.0.0",
4669
+ "ignoreResourceInList": [],
4670
+ "ignoreToolInList": [],
4671
+ "ignorePromptInList": [],
4672
+ "requestTimeout": 60000
4673
+ }
4674
+ */
4675
+ property?: {
4676
+ /* Initialize the MCP client on start */
4677
+ init?: boolean | DataLink
4678
+ /* Type of the MCP connection, e.g. sse or direct-link (generator) */
4679
+ type?: 'streamable-http' | 'sse' | 'direct-link' | DataLink
4680
+ /* URL of the MCP server, e.g. http://localhost:19853/sse */
4681
+ url?: string | DataLink
4682
+ /* Whether to automatically reconnect to the MCP server */
4683
+ autoReconnect?: boolean | DataLink
4684
+ /* Maximum number of reconnection attempts */
4685
+ maxReconnectAttempts?: number | DataLink
4686
+ /* Reconnection interval in milliseconds */
4687
+ reconnectInterval?: number | DataLink
4688
+ /* SSE connection headers */
4689
+ sseHeaders?: {} | DataLink
4690
+ /* Send request headers */
4691
+ sendHeaders?: {} | DataLink
4692
+ /* Bearer token for authentication */
4693
+ bearerToken?: string | DataLink
4694
+ /* Generator MCP Server ID for direct link */
4695
+ generatorId?: string | DataLink
4696
+ /* Application-scoped key of Generator MCP Server for direct link (If ID is not provided) */
4697
+ generatorKey?: string | DataLink
4698
+ /* Name of the MCP client */
4699
+ name?: string | DataLink
4700
+ /* Version of the MCP client */
4701
+ version?: string | DataLink
4702
+ /* Ignore resources in list response */
4703
+ ignoreResourceInList?: Array<string | DataLink> | DataLink
4704
+ /* Ignore tools in list response */
4705
+ ignoreToolInList?: Array<string | DataLink> | DataLink
4706
+ /* Ignore prompts in list response */
4707
+ ignorePromptInList?: Array<string | DataLink> | DataLink
4708
+ /* Request timeout in milliseconds */
4709
+ requestTimeout?: number | DataLink
4710
+ }
4711
+ events?: {
4712
+ /* On connected */
4713
+ onConnected?: Array<EventAction>
4714
+ /* On connection error */
4715
+ onConnectionError?: Array<EventAction>
4716
+ /* On disconnected */
4717
+ onDisconnected?: Array<EventAction>
4718
+ /* On list resources */
4719
+ onListResources?: Array<EventAction>
4720
+ /* On list resources error */
4721
+ onListResourcesError?: Array<EventAction>
4722
+ /* On list resource templates */
4723
+ onListResourceTemplates?: Array<EventAction>
4724
+ /* On list resource templates error */
4725
+ onListResourceTemplatesError?: Array<EventAction>
4726
+ /* On read resource */
4727
+ onReadResource?: Array<EventAction>
4728
+ /* On read resource error */
4729
+ onReadResourceError?: Array<EventAction>
4730
+ /* On list tools */
4731
+ onListTools?: Array<EventAction>
4732
+ /* On list tools error */
4733
+ onListToolsError?: Array<EventAction>
4734
+ /* On call tool */
4735
+ onCallTool?: Array<EventAction>
4736
+ /* On call tool error */
4737
+ onCallToolError?: Array<EventAction>
4738
+ /* On list prompts */
4739
+ onListPrompts?: Array<EventAction>
4740
+ /* On list prompts error */
4741
+ onListPromptsError?: Array<EventAction>
4742
+ /* On get prompt */
4743
+ onGetPrompt?: Array<EventAction>
4744
+ /* On get prompt error */
4745
+ onGetPromptError?: Array<EventAction>
4746
+ }
4747
+ outlets?: {
4748
+ /* Connection state */
4749
+ connectionState?: () => Data
4750
+ /* List resources response */
4751
+ listResourcesResponse?: () => Data
4752
+ /* List resources error */
4753
+ listResourcesError?: () => Data
4754
+ /* List resource templates response */
4755
+ listResourceTemplatesResponse?: () => Data
4756
+ /* List resource templates error */
4757
+ listResourceTemplatesError?: () => Data
4758
+ /* Read resource response */
4759
+ readResourceResponse?: () => Data
4760
+ /* Read resource error */
4761
+ readResourceError?: () => Data
4762
+ /* List tools response */
4763
+ listToolsResponse?: () => Data
4764
+ /* List tools error */
4765
+ listToolsError?: () => Data
4766
+ /* Call tool response */
4767
+ callToolResponse?: () => Data
4768
+ /* Call tool error */
4769
+ callToolError?: () => Data
4770
+ /* List prompts response */
4771
+ listPromptsResponse?: () => Data
4772
+ /* List prompts error */
4773
+ listPromptsError?: () => Data
4774
+ /* Get prompt response */
4775
+ getPromptResponse?: () => Data
4776
+ /* Request prompt error */
4777
+ getPromptError?: () => Data
4778
+ /* Last error */
4779
+ lastError?: () => Data
4780
+ }
4781
+ }
4782
+
4783
+ /* Model Context Protocol (MCP) Client, support SSE and Generator MCPServer direct link */
4784
+ export type GeneratorMCP = Generator &
4785
+ GeneratorMCPDef & {
4786
+ templateKey: 'GENERATOR_MCP'
4787
+ switches: Array<
4788
+ SwitchDef &
4789
+ GeneratorMCPDef & {
4790
+ conds?: Array<{
4791
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
4792
+ cond:
4793
+ | SwitchCondInnerStateCurrentCanvas
4794
+ | SwitchCondData
4795
+ | {
4796
+ __typename: 'SwitchCondInnerStateOutlet'
4797
+ outlet:
4798
+ | 'connectionState'
4799
+ | 'listResourcesResponse'
4800
+ | 'listResourcesError'
4801
+ | 'listResourceTemplatesResponse'
4802
+ | 'listResourceTemplatesError'
4803
+ | 'readResourceResponse'
4804
+ | 'readResourceError'
4805
+ | 'listToolsResponse'
4806
+ | 'listToolsError'
4807
+ | 'callToolResponse'
4808
+ | 'callToolError'
4809
+ | 'listPromptsResponse'
4810
+ | 'listPromptsError'
4811
+ | 'getPromptResponse'
4812
+ | 'getPromptError'
4813
+ | 'lastError'
4814
+ value: any
4815
+ }
4816
+ }>
4817
+ }
4818
+ >
4819
+ }
4820
+
4310
4821
  /* Load the model */
4311
4822
  export type GeneratorTTSActionLoadModel = Action & {
4312
4823
  __actionName: 'GENERATOR_TTS_LOAD_MODEL'
@@ -4484,6 +4995,11 @@ export type GeneratorOnnxLLMActionInfer = ActionWithParams & {
4484
4995
  value?: Array<any> | DataLink | EventProperty
4485
4996
  mapping?: string
4486
4997
  }
4998
+ | {
4999
+ input: 'images'
5000
+ value?: Array<any> | DataLink | EventProperty
5001
+ mapping?: string
5002
+ }
4487
5003
  >
4488
5004
  }
4489
5005
 
@@ -4520,12 +5036,17 @@ Default property:
4520
5036
  /* LLM model */
4521
5037
  model?:
4522
5038
  | 'Custom'
5039
+ | 'onnx-community/gemma-3-1b-it-ONNX'
4523
5040
  | 'BricksDisplay/phi-1_5'
4524
5041
  | 'BricksDisplay/phi-1_5-q4'
4525
- | 'Qwen1.5-0.5B'
4526
- | 'Qwen1.5-1.8B'
4527
- | 'Qwen1.5-0.5B-Chat'
4528
- | 'Qwen1.5-1.8B-Chat'
5042
+ | 'onnx-community/Phi-3.5-vision-instruct'
5043
+ | 'onnx-community/Phi-3-vision-128k-instruct'
5044
+ | 'onnx-community/Phi-4-mini-instruct-ONNX-MHA'
5045
+ | 'onnx-community/Qwen2.5-0.5B'
5046
+ | 'onnx-community/Qwen2.5-0.5B-Instruct'
5047
+ | 'onnx-community/Qwen2.5-1.5B'
5048
+ | 'onnx-community/Qwen2.5-1.5B-Instruct'
5049
+ | 'onnx-community/Qwen2-VL-2B-Instruct'
4529
5050
  | 'stablelm-2-1_6b'
4530
5051
  | 'BricksDisplay/stablelm-2-1_6b-q4'
4531
5052
  | 'stablelm-2-zephyr-1_6b'
@@ -4598,6 +5119,12 @@ Default property:
4598
5119
  Choose model from https://huggingface.co/models?pipeline_tag=text2text-generation&library=transformers.js
4599
5120
  or https://huggingface.co/models?pipeline_tag=text-generation&library=transformers.js&sort=trending */
4600
5121
  customModel?: string | DataLink
5122
+ /* Prompt to inference */
5123
+ prompt?: string | DataLink
5124
+ /* Messages to inference */
5125
+ messages?: Array<DataLink | {}> | DataLink
5126
+ /* Images with message to inference */
5127
+ images?: Array<string | DataLink> | DataLink
4601
5128
  /* Max new tokens to generate */
4602
5129
  maxNewTokens?: number | DataLink
4603
5130
  /* Temperature */
@@ -5647,8 +6174,9 @@ Default property:
5647
6174
  "useMmap": true,
5648
6175
  "cacheKType": "f16",
5649
6176
  "cacheVType": "f16",
6177
+ "ctxShift": true,
5650
6178
  "transformScriptEnabled": false,
5651
- "transformScriptCode": "\/\* Global variable: inputs = { prompt, messages, variables } \*\/\nreturn inputs.prompt",
6179
+ "transformScriptCode": "\/\* Global variable: inputs = { prompt, messages, variables }, members = { llmUtils } \*\/\nreturn inputs.prompt",
5652
6180
  "transformScriptVariables": {},
5653
6181
  "sessionMinSaveSize": 50,
5654
6182
  "sessionRemain": 10,
@@ -5732,6 +6260,8 @@ Default property:
5732
6260
  cacheKType?: 'f16' | 'f32' | 'q8_0' | 'q4_0' | 'q4_1' | 'iq4_nl' | 'q5_0' | 'q5_1' | DataLink
5733
6261
  /* KV cache data type for the V (Default: f16) */
5734
6262
  cacheVType?: 'f16' | 'f32' | 'q8_0' | 'q4_0' | 'q4_1' | 'iq4_nl' | 'q5_0' | 'q5_1' | DataLink
6263
+ /* Enable context shift */
6264
+ ctxShift?: boolean | DataLink
5735
6265
  /* Enable Transform Script for processing the prompt */
5736
6266
  transformScriptEnabled?: boolean | DataLink
5737
6267
  /* Code of Transform Script */
@@ -5750,8 +6280,10 @@ Default property:
5750
6280
  sessionRemain?: number | DataLink
5751
6281
  /* TODO:loran_gqarms_norm_epsrope_freq_baserope_freq_scale */
5752
6282
  completionMode?: 'auto' | 'chat' | 'text' | DataLink
5753
- /* Tools for chat mode */
5754
- completionTools?: {} | DataLink
6283
+ /* Tools for chat mode using OpenAI-compatible function calling format
6284
+ Format: Array of objects with {type, function: {name, description, parameters}} structure
6285
+ See: https://platform.openai.com/docs/guides/function-calling */
6286
+ completionTools?: Array<{} | DataLink> | DataLink
5755
6287
  /* Enable parallel tool calls */
5756
6288
  completionParallelToolCalls?: boolean | DataLink
5757
6289
  /* Tool choice for chat mode */
@@ -5917,6 +6449,168 @@ export type GeneratorLLM = Generator &
5917
6449
  >
5918
6450
  }
5919
6451
 
6452
+ /* Load the model */
6453
+ export type GeneratorQnnLlmActionLoadModel = Action & {
6454
+ __actionName: 'GENERATOR_QNN_LLM_LOAD_MODEL'
6455
+ }
6456
+
6457
+ /* Abort model download */
6458
+ export type GeneratorQnnLlmActionAbortModelDownload = Action & {
6459
+ __actionName: 'GENERATOR_QNN_LLM_ABORT_MODEL_DOWNLOAD'
6460
+ }
6461
+
6462
+ /* Generate text */
6463
+ export type GeneratorQnnLlmActionGenerate = ActionWithParams & {
6464
+ __actionName: 'GENERATOR_QNN_LLM_GENERATE'
6465
+ params?: Array<
6466
+ | {
6467
+ input: 'prompt'
6468
+ value?: string | DataLink | EventProperty
6469
+ mapping?: string
6470
+ }
6471
+ | {
6472
+ input: 'messages'
6473
+ value?: Array<any> | DataLink | EventProperty
6474
+ mapping?: string
6475
+ }
6476
+ >
6477
+ }
6478
+
6479
+ /* Abort generation */
6480
+ export type GeneratorQnnLlmActionAbortGeneration = Action & {
6481
+ __actionName: 'GENERATOR_QNN_LLM_ABORT_GENERATION'
6482
+ }
6483
+
6484
+ /* Release context */
6485
+ export type GeneratorQnnLlmActionReleaseContext = Action & {
6486
+ __actionName: 'GENERATOR_QNN_LLM_RELEASE_CONTEXT'
6487
+ }
6488
+
6489
+ interface GeneratorQnnLlmDef {
6490
+ /*
6491
+ Default property:
6492
+ {
6493
+ "modelType": "Llama 3.2 3B Chat",
6494
+ "chatFormat": "Llama 3.x",
6495
+ "toolCallParser": "llama3_json",
6496
+ "toolChoice": "auto",
6497
+ "parallelToolCalls": false,
6498
+ "greedy": false
6499
+ }
6500
+ */
6501
+ property?: {
6502
+ /* Load model context when generator is initialized */
6503
+ init?: boolean | DataLink
6504
+ /* Model type */
6505
+ modelType?:
6506
+ | 'Llama 3 8B Chat'
6507
+ | 'Llama 3.1 8B Chat'
6508
+ | 'Llama 3.2 3B Chat'
6509
+ | 'Mistral 7B Instruct v0.3'
6510
+ | 'Qwen 2 7B Chat'
6511
+ | 'Phi 3.5 Mini'
6512
+ | 'Granite v3.1 8B Instruct'
6513
+ | 'Custom'
6514
+ | DataLink
6515
+ /* SOC model */
6516
+ socModel?: 'X Elite' | 'X Plus' | '8 Elite' | '8 Gen 3' | 'QCS8550' | DataLink
6517
+ /* Custom model base URL
6518
+ The URL directory should contain `config.json` (model config) file, `model_part_*_of_*.bin` (model split files) files and `tokenizer.json` (tokenizer config) file. */
6519
+ customModelUrl?: string | DataLink
6520
+ /* Custom model split parts */
6521
+ customModelSplitParts?: number | DataLink
6522
+ /* Chat format */
6523
+ chatFormat?: 'Llama 2' | 'Llama 3' | 'Llama 3.x' | 'Mistral v0.3' | 'Qwen 2' | DataLink
6524
+ /* Custom chat format template */
6525
+ customChatFormat?: string | DataLink
6526
+ /* Prompt to generate */
6527
+ prompt?: string | DataLink
6528
+ /* Chat messages */
6529
+ messages?:
6530
+ | Array<
6531
+ | DataLink
6532
+ | {
6533
+ role?: string | DataLink
6534
+ content?: string | DataLink
6535
+ }
6536
+ >
6537
+ | DataLink
6538
+ /* Stop words */
6539
+ stopWords?: Array<string | DataLink> | DataLink
6540
+ /* Tool call parser */
6541
+ toolCallParser?: 'llama3_json' | 'mistral' | DataLink
6542
+ /* Tools for chat mode using OpenAI-compatible function calling format
6543
+ Format: Array of objects with {type, function: {name, description, parameters}} structure
6544
+ See: https://platform.openai.com/docs/guides/function-calling */
6545
+ tools?: Array<{} | DataLink> | DataLink
6546
+ /* Tool choice for chat mode */
6547
+ toolChoice?: 'none' | 'auto' | 'required' | DataLink
6548
+ /* Enable parallel tool calls */
6549
+ parallelToolCalls?: boolean | DataLink
6550
+ /* Number of threads, -1 to use n-threads from model config */
6551
+ nThreads?: number | DataLink
6552
+ /* Temperature, -1 to use temperature from model config */
6553
+ temperature?: number | DataLink
6554
+ /* Seed, -1 to use seed from model config */
6555
+ seed?: number | DataLink
6556
+ /* Top K, -1 to use top-k from model config */
6557
+ topK?: number | DataLink
6558
+ /* Top P, -1 to use top-p from model config */
6559
+ topP?: number | DataLink
6560
+ /* Greedy, use greedy sampling */
6561
+ greedy?: boolean | DataLink
6562
+ }
6563
+ events?: {
6564
+ /* Event triggered when load is done */
6565
+ onContextStateChange?: Array<EventAction>
6566
+ /* Event triggered when generate is done */
6567
+ onGenerate?: Array<EventAction>
6568
+ /* Event triggered on get function call request */
6569
+ onFunctionCall?: Array<EventAction>
6570
+ /* Event triggered when error occurs */
6571
+ onError?: Array<EventAction>
6572
+ }
6573
+ outlets?: {
6574
+ /* Context state */
6575
+ contextState?: () => Data
6576
+ /* Generation result */
6577
+ result?: () => Data
6578
+ /* Full context (Prompt + Generation Result) */
6579
+ fullContext?: () => Data
6580
+ /* Last function call details */
6581
+ lastFunctionCall?: () => Data
6582
+ /* Completion details */
6583
+ completionDetails?: () => Data
6584
+ }
6585
+ }
6586
+
6587
+ /* Local LLM inference using Qualcomm AI Engine */
6588
+ export type GeneratorQnnLlm = Generator &
6589
+ GeneratorQnnLlmDef & {
6590
+ templateKey: 'GENERATOR_QNN_LLM'
6591
+ switches: Array<
6592
+ SwitchDef &
6593
+ GeneratorQnnLlmDef & {
6594
+ conds?: Array<{
6595
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
6596
+ cond:
6597
+ | SwitchCondInnerStateCurrentCanvas
6598
+ | SwitchCondData
6599
+ | {
6600
+ __typename: 'SwitchCondInnerStateOutlet'
6601
+ outlet:
6602
+ | 'contextState'
6603
+ | 'result'
6604
+ | 'fullContext'
6605
+ | 'lastFunctionCall'
6606
+ | 'completionDetails'
6607
+ value: any
6608
+ }
6609
+ }>
6610
+ }
6611
+ >
6612
+ }
6613
+
5920
6614
  /* Run text completion */
5921
6615
  export type GeneratorOpenAILLMActionCompletion = ActionWithParams & {
5922
6616
  __actionName: 'GENERATOR_OPENAI_LLM_COMPLETION'
@@ -5991,7 +6685,10 @@ Default property:
5991
6685
  "apiEndpoint": "https://api.openai.com/v1",
5992
6686
  "model": "gpt-4o-mini",
5993
6687
  "completionMessages": [
5994
- null
6688
+ {
6689
+ "role": "system",
6690
+ "content": "You are a helpful assistant."
6691
+ }
5995
6692
  ],
5996
6693
  "completionMaxTokens": 1024,
5997
6694
  "completionTemperature": 1,
@@ -6027,8 +6724,10 @@ Default property:
6027
6724
  }
6028
6725
  >
6029
6726
  | DataLink
6030
- /* Tools for chat mode */
6031
- completionTools?: {} | DataLink
6727
+ /* Tools for chat mode following OpenAI function calling format
6728
+ Format: Array of objects with {type, function: {name, description, parameters}} structure
6729
+ See: https://platform.openai.com/docs/guides/function-calling */
6730
+ completionTools?: Array<{} | DataLink> | DataLink
6032
6731
  /* Enable parallel tool calls */
6033
6732
  completionParallelToolCalls?: boolean | DataLink
6034
6733
  /* Tool choice for chat mode */
@@ -6106,6 +6805,104 @@ export type GeneratorOpenAILLM = Generator &
6106
6805
  >
6107
6806
  }
6108
6807
 
6808
+ /* Generate audio */
6809
+ export type GeneratorOpenAiTTSActionGenerate = ActionWithParams & {
6810
+ __actionName: 'GENERATOR_OPENAI_TTS_GENERATE'
6811
+ params?: Array<{
6812
+ input: 'text'
6813
+ value?: string | DataLink | EventProperty
6814
+ mapping?: string
6815
+ }>
6816
+ }
6817
+
6818
+ /* Clean cache */
6819
+ export type GeneratorOpenAiTTSActionCleanCache = Action & {
6820
+ __actionName: 'GENERATOR_OPENAI_TTS_CLEAN_CACHE'
6821
+ }
6822
+
6823
+ interface GeneratorOpenAiTTSDef {
6824
+ /*
6825
+ Default property:
6826
+ {
6827
+ "apiEndpoint": "https://api.openai.com/v1",
6828
+ "model": "tts-1",
6829
+ "voice": "alloy",
6830
+ "speed": 1,
6831
+ "outputType": "play",
6832
+ "playbackVolume": 100,
6833
+ "cacheGenerated": true,
6834
+ "autoInferEnable": false,
6835
+ "softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
6836
+ "hardBreakTime": 500
6837
+ }
6838
+ */
6839
+ property?: {
6840
+ /* API endpoint URL */
6841
+ apiEndpoint?: string | DataLink
6842
+ /* OpenAI API Key */
6843
+ apiKey?: string | DataLink
6844
+ /* OpenAI TTS model */
6845
+ model?: string | DataLink
6846
+ /* Voice to use
6847
+ Select voice from https://openai.fm , default alloy */
6848
+ voice?: string | DataLink
6849
+ /* Additional instructions for the speech generation */
6850
+ instructions?: string | DataLink
6851
+ /* Speed of the generated audio */
6852
+ speed?: number | DataLink
6853
+ /* Output mode */
6854
+ outputType?: 'play' | 'file' | DataLink
6855
+ /* Playback volume (0 - 100) */
6856
+ playbackVolume?: number | DataLink
6857
+ /* Enable cache for generated audio */
6858
+ cacheGenerated?: boolean | DataLink
6859
+ /* Text to generate */
6860
+ prompt?: string | DataLink
6861
+ /* Auto inference when prompt changes */
6862
+ autoInferEnable?: boolean | DataLink
6863
+ /* Segmentation rule for auto inference */
6864
+ softBreakRegex?: string | DataLink
6865
+ /* Time to force inference when softBreakRegex is not satisfied */
6866
+ hardBreakTime?: number | DataLink
6867
+ }
6868
+ events?: {
6869
+ /* Event triggered when state change */
6870
+ onContextStateChange?: Array<EventAction>
6871
+ /* Event triggered when error occurs */
6872
+ onError?: Array<EventAction>
6873
+ }
6874
+ outlets?: {
6875
+ /* Context state */
6876
+ contextState?: () => Data
6877
+ /* Generated audio file */
6878
+ generatedAudio?: () => Data
6879
+ /* Generated audio file is playing */
6880
+ generatedAudioPlaying?: () => Data
6881
+ }
6882
+ }
6883
+
6884
+ /* Generate speech from text using OpenAI's Text-to-Speech API */
6885
+ export type GeneratorOpenAiTTS = Generator &
6886
+ GeneratorOpenAiTTSDef & {
6887
+ templateKey: 'GENERATOR_OPENAI_TTS'
6888
+ switches: Array<
6889
+ SwitchDef &
6890
+ GeneratorOpenAiTTSDef & {
6891
+ conds?: Array<{
6892
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
6893
+ cond:
6894
+ | SwitchCondInnerStateCurrentCanvas
6895
+ | SwitchCondData
6896
+ | {
6897
+ __typename: 'SwitchCondInnerStateOutlet'
6898
+ outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
6899
+ value: any
6900
+ }
6901
+ }>
6902
+ }
6903
+ >
6904
+ }
6905
+
6109
6906
  /* Add a message to the assistant */
6110
6907
  export type GeneratorAssistantActionAddMessage = ActionWithParams & {
6111
6908
  __actionName: 'GENERATOR_ASSISTANT_ADD_MESSAGE'
@@ -6163,6 +6960,55 @@ export type GeneratorAssistantActionAddMessage = ActionWithParams & {
6163
6960
  >
6164
6961
  }
6165
6962
 
6963
+ /* Initialize messages from MCP prompt */
6964
+ export type GeneratorAssistantActionInitMcpPrompt = ActionWithParams & {
6965
+ __actionName: 'GENERATOR_ASSISTANT_INIT_MCP_PROMPT'
6966
+ params?: Array<
6967
+ | {
6968
+ input: 'mcpClientName'
6969
+ value?: string | DataLink | EventProperty
6970
+ mapping?: string
6971
+ }
6972
+ | {
6973
+ input: 'mcpPromptName'
6974
+ value?: string | DataLink | EventProperty
6975
+ mapping?: string
6976
+ }
6977
+ | {
6978
+ input: 'mcpArguments'
6979
+ value?: {} | DataLink | EventProperty
6980
+ mapping?: string
6981
+ }
6982
+ | {
6983
+ input: 'firstMessageAsSystem'
6984
+ value?: boolean | DataLink | EventProperty
6985
+ mapping?: string
6986
+ }
6987
+ >
6988
+ }
6989
+
6990
+ /* Add messages from MCP prompt */
6991
+ export type GeneratorAssistantActionAddMcpPromptMessage = ActionWithParams & {
6992
+ __actionName: 'GENERATOR_ASSISTANT_ADD_MCP_PROMPT_MESSAGE'
6993
+ params?: Array<
6994
+ | {
6995
+ input: 'mcpClientName'
6996
+ value?: string | DataLink | EventProperty
6997
+ mapping?: string
6998
+ }
6999
+ | {
7000
+ input: 'mcpPromptName'
7001
+ value?: string | DataLink | EventProperty
7002
+ mapping?: string
7003
+ }
7004
+ | {
7005
+ input: 'mcpArguments'
7006
+ value?: {} | DataLink | EventProperty
7007
+ mapping?: string
7008
+ }
7009
+ >
7010
+ }
7011
+
6166
7012
  /* Update a message at a specific index */
6167
7013
  export type GeneratorAssistantActionUpdateMessageAtIndex = ActionWithParams & {
6168
7014
  __actionName: 'GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX'
@@ -6332,8 +7178,25 @@ export type GeneratorAssistantActionReset = Action & {
6332
7178
  }
6333
7179
 
6334
7180
  /* Submit the assistant */
6335
- export type GeneratorAssistantActionSubmit = Action & {
7181
+ export type GeneratorAssistantActionSubmit = ActionWithParams & {
6336
7182
  __actionName: 'GENERATOR_ASSISTANT_SUBMIT'
7183
+ params?: Array<
7184
+ | {
7185
+ input: 'continueOnToolCallConfirm'
7186
+ value?: boolean | DataLink | EventProperty
7187
+ mapping?: string
7188
+ }
7189
+ | {
7190
+ input: 'continueOnToolCallStrategy'
7191
+ value?: 'never' | 'success' | 'always' | DataLink | EventProperty
7192
+ mapping?: string
7193
+ }
7194
+ | {
7195
+ input: 'continueOnToolCallLimit'
7196
+ value?: number | DataLink | EventProperty
7197
+ mapping?: string
7198
+ }
7199
+ >
6337
7200
  }
6338
7201
 
6339
7202
  /* Cancel the assistant responding */
@@ -6341,16 +7204,82 @@ export type GeneratorAssistantActionCancel = Action & {
6341
7204
  __actionName: 'GENERATOR_ASSISTANT_CANCEL'
6342
7205
  }
6343
7206
 
7207
+ /* Check the enabled MCP clients connection status and available tools */
7208
+ export type GeneratorAssistantActionCheckMcpServers = Action & {
7209
+ __actionName: 'GENERATOR_ASSISTANT_CHECK_MCP_SERVERS'
7210
+ }
7211
+
7212
+ /* Insert an MCP resource as a new assistant message */
7213
+ export type GeneratorAssistantActionInsertMcpResource = ActionWithParams & {
7214
+ __actionName: 'GENERATOR_ASSISTANT_INSERT_MCP_RESOURCE'
7215
+ params?: Array<
7216
+ | {
7217
+ input: 'mcpClientName'
7218
+ value?: string | DataLink | EventProperty
7219
+ mapping?: string
7220
+ }
7221
+ | {
7222
+ input: 'mcpResourceUri'
7223
+ value?: string | DataLink | EventProperty
7224
+ mapping?: string
7225
+ }
7226
+ | {
7227
+ input: 'mcpVariables'
7228
+ value?: {} | DataLink | EventProperty
7229
+ mapping?: string
7230
+ }
7231
+ | {
7232
+ input: 'role'
7233
+ value?: string | DataLink | EventProperty
7234
+ mapping?: string
7235
+ }
7236
+ >
7237
+ }
7238
+
7239
+ /* Summarize messages based on the conversation
7240
+
7241
+ Note: Summary uses the same LLM context size, so it is recommended only to use it when the system prompt (in Initial Messages) is long, otherwise it may still fail when the context is full (Ctx Shift is NO). */
7242
+ export type GeneratorAssistantActionSummaryMessages = ActionWithParams & {
7243
+ __actionName: 'GENERATOR_ASSISTANT_SUMMARY_MESSAGES'
7244
+ params?: Array<
7245
+ | {
7246
+ input: 'summaryMessages'
7247
+ value?: Array<any> | DataLink | EventProperty
7248
+ mapping?: string
7249
+ }
7250
+ | {
7251
+ input: 'summarySessionKey'
7252
+ value?: string | DataLink | EventProperty
7253
+ mapping?: string
7254
+ }
7255
+ >
7256
+ }
7257
+
6344
7258
  interface GeneratorAssistantDef {
6345
7259
  /*
6346
7260
  Default property:
6347
7261
  {
6348
7262
  "initialMessages": [
6349
- null
7263
+ {
7264
+ "role": "system",
7265
+ "content": "You are a helpful assistant."
7266
+ }
6350
7267
  ],
6351
7268
  "cacheMessages": false,
6352
7269
  "llmLivePolicy": "only-in-use",
6353
7270
  "llmSessionKey": "default-assistant",
7271
+ "llmAutoSummaryMessages": false,
7272
+ "llmSummaryMessages": [
7273
+ {
7274
+ "role": "system",
7275
+ "content": "You are a helpful assistant specialized in summarizing conversations. Create a concise summary of the conversation that captures the key points while maintaining important context. The summary should be clear, accurate, and briefer than the original conversation."
7276
+ },
7277
+ {
7278
+ "role": "user",
7279
+ "content": "Please summarize the following conversation into a concise system message that can replace the previous conversation context while maintaining all important information. Here is the conversation to summarize:\n\n"
7280
+ }
7281
+ ],
7282
+ "llmSummarySessionKey": "assistant-default-summary",
6354
7283
  "fileSearchEnabled": false,
6355
7284
  "fileSearchLivePolicy": "only-in-use",
6356
7285
  "sttEnabled": true,
@@ -6374,12 +7303,28 @@ Default property:
6374
7303
  | DataLink
6375
7304
  /* Whether to cache messages */
6376
7305
  cacheMessages?: boolean | DataLink
6377
- /* LLM Generator (Currently only support `LLM (GGML)` generator) */
7306
+ /* LLM Generator (Supports `LLM (GGML)` and `OpenAI LLM` generators) */
6378
7307
  llmGeneratorId?: string | DataLink
6379
7308
  /* LLM Live Policy. If the policy is `only-in-use`, the LLM context will be released when the assistant is not in use. */
6380
7309
  llmLivePolicy?: 'only-in-use' | 'manual' | DataLink
6381
7310
  /* LLM main session key */
6382
7311
  llmSessionKey?: string | DataLink
7312
+ /* Auto Summary Messages (Automatically summarize messages when the LLM context is full or content gets truncated, currently only supported with LLM (GGML) generators)
7313
+
7314
+ Note: Summary uses the same LLM context size, so it is recommended only to use it when the system prompt (in Initial Messages) is long, otherwise it may still fail when the context is full (Ctx Shift is NO). */
7315
+ llmAutoSummaryMessages?: boolean | DataLink
7316
+ /* Summary Messages (Messages used for summarization prompt, conversation will be appended to the last message) */
7317
+ llmSummaryMessages?:
7318
+ | Array<
7319
+ | DataLink
7320
+ | {
7321
+ role?: string | DataLink
7322
+ content?: string | DataLink
7323
+ }
7324
+ >
7325
+ | DataLink
7326
+ /* Summary Session Key (Custom session key for summarization) */
7327
+ llmSummarySessionKey?: string | DataLink
6383
7328
  /* File Search (Vector Store) Enabled */
6384
7329
  fileSearchEnabled?: boolean | DataLink
6385
7330
  /* File Search (Vector Store) Generator */
@@ -6392,18 +7337,29 @@ Default property:
6392
7337
  fileSearchThreshold?: number | DataLink
6393
7338
  /* File Search Ignore Threshold. (Default: false) */
6394
7339
  fileSearchIgnoreThreshold?: boolean | DataLink
6395
- /* STT Generator use for transcribing audio message (Currently only support `STT (GGML)` generator) */
7340
+ /* STT Generator use for transcribing audio message (Supports `STT (GGML)` generators) */
6396
7341
  sttGeneratorId?: string | DataLink
6397
7342
  /* STT Enabled */
6398
7343
  sttEnabled?: boolean | DataLink
6399
7344
  /* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when the assistant is not in use. */
6400
7345
  sttLivePolicy?: 'only-in-use' | 'manual' | DataLink
6401
- /* TTS Generator use for generating LLM response audio message (Currently only support `TTS (ONNX)` generator) */
7346
+ /* TTS Generator use for generating LLM response audio message (Supports `TTS (ONNX)` and `OpenAI TTS` generators) */
6402
7347
  ttsGeneratorId?: string | DataLink
6403
7348
  /* TTS Enabled */
6404
7349
  ttsEnabled?: boolean | DataLink
6405
7350
  /* TTS Live Policy. If the policy is `only-in-use`, the TTS context will be released when the assistant is not in use. */
6406
7351
  ttsLivePolicy?: 'only-in-use' | 'manual' | DataLink
7352
+ /* MCP Generators (Add a unique name if generator name property are duplicate) */
7353
+ mcpGenerators?:
7354
+ | Array<
7355
+ | DataLink
7356
+ | {
7357
+ generatorId?: string | DataLink
7358
+ name?: string | DataLink
7359
+ enabled?: boolean | DataLink
7360
+ }
7361
+ >
7362
+ | DataLink
6407
7363
  }
6408
7364
  events?: {
6409
7365
  /* Error event */
@@ -6426,6 +7382,8 @@ Default property:
6426
7382
  files?: () => Data
6427
7383
  /* Messages of the assistant */
6428
7384
  messages?: () => Data
7385
+ /* MCP servers status and available tools */
7386
+ mcpServers?: () => Data
6429
7387
  }
6430
7388
  }
6431
7389
 
@@ -6450,6 +7408,7 @@ export type GeneratorAssistant = Generator &
6450
7408
  | 'isBusy'
6451
7409
  | 'files'
6452
7410
  | 'messages'
7411
+ | 'mcpServers'
6453
7412
  value: any
6454
7413
  }
6455
7414
  }>