@fugood/bricks-project 2.21.1 → 2.21.2

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.
@@ -512,6 +512,28 @@ export const templateActionNameMap = {
512
512
  paramsString: 'GENERATOR_SQLITE_PARAMS_STRING',
513
513
  },
514
514
  },
515
+
516
+ GENERATOR_MCP: {
517
+ GENERATOR_MCP_LIST_RESOURCES: {
518
+ requestId: 'GENERATOR_MCP_REQUEST_ID',
519
+ },
520
+ GENERATOR_MCP_LIST_RESOURCE_TEMPLATES: {
521
+ requestId: 'GENERATOR_MCP_REQUEST_ID',
522
+ },
523
+ GENERATOR_MCP_READ_RESOURCE: {
524
+ requestId: 'GENERATOR_MCP_REQUEST_ID',
525
+ uri: 'GENERATOR_MCP_URI',
526
+ variables: 'GENERATOR_MCP_VARIABLES',
527
+ },
528
+ GENERATOR_MCP_LIST_TOOLS: {
529
+ requestId: 'GENERATOR_MCP_REQUEST_ID',
530
+ },
531
+ GENERATOR_MCP_CALL_TOOL: {
532
+ requestId: 'GENERATOR_MCP_REQUEST_ID',
533
+ name: 'GENERATOR_MCP_NAME',
534
+ variables: 'GENERATOR_MCP_VARIABLES',
535
+ },
536
+ },
515
537
  GENERATOR_TTS: {
516
538
  GENERATOR_TTS_GENERATE: {
517
539
  text: 'GENERATOR_TTS_TEXT',
@@ -615,6 +637,12 @@ export const templateActionNameMap = {
615
637
  sessionCustomKey: 'GENERATOR_LLM_SESSION_CUSTOM_KEY',
616
638
  },
617
639
  },
640
+ GENERATOR_QNN_LLM: {
641
+ GENERATOR_QNN_LLM_GENERATE: {
642
+ prompt: 'GENERATOR_QNN_LLM_PROMPT',
643
+ messages: 'GENERATOR_QNN_LLM_MESSAGES',
644
+ },
645
+ },
618
646
  GENERATOR_OPENAI_LLM: {
619
647
  GENERATOR_OPENAI_LLM_COMPLETION: {
620
648
  messages: 'GENERATOR_OPENAI_LLM_MESSAGES',
@@ -630,6 +658,11 @@ export const templateActionNameMap = {
630
658
  responseFormat: 'GENERATOR_OPENAI_LLM_RESPONSE_FORMAT',
631
659
  },
632
660
  },
661
+ GENERATOR_OPENAI_TTS: {
662
+ GENERATOR_OPENAI_TTS_GENERATE: {
663
+ text: 'GENERATOR_OPENAI_TTS_TEXT',
664
+ },
665
+ },
633
666
  GENERATOR_ASSISTANT: {
634
667
  GENERATOR_ASSISTANT_ADD_MESSAGE: {
635
668
  role: 'GENERATOR_ASSISTANT_ROLE',
@@ -679,6 +712,17 @@ export const templateActionNameMap = {
679
712
  GENERATOR_ASSISTANT_REMOVE_MESSAGE_AT_INDEX: {
680
713
  index: 'GENERATOR_ASSISTANT_INDEX',
681
714
  },
715
+ GENERATOR_ASSISTANT_SUBMIT: {
716
+ continueOnToolCallConfirm: 'GENERATOR_ASSISTANT_CONTINUE_ON_TOOL_CALL_CONFIRM',
717
+ continueOnToolCallStrategy: 'GENERATOR_ASSISTANT_CONTINUE_ON_TOOL_CALL_STRATEGY',
718
+ continueOnToolCallLimit: 'GENERATOR_ASSISTANT_CONTINUE_ON_TOOL_CALL_LIMIT',
719
+ },
720
+ GENERATOR_ASSISTANT_INSERT_MCP_RESOURCE: {
721
+ mcpClientName: 'GENERATOR_ASSISTANT_MCP_CLIENT_NAME',
722
+ mcpResourceUri: 'GENERATOR_ASSISTANT_MCP_RESOURCE_URI',
723
+ mcpVariables: 'GENERATOR_ASSISTANT_MCP_VARIABLES',
724
+ role: 'GENERATOR_ASSISTANT_ROLE',
725
+ },
682
726
  },
683
727
  GENERATOR_VECTOR_STORE: {
684
728
  GENERATOR_VECTOR_STORE_RESET: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.21.1",
3
+ "version": "2.21.2",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "node scripts/build.js"
package/types/bricks.ts CHANGED
@@ -1227,6 +1227,8 @@ Default property:
1227
1227
  }
1228
1228
  >
1229
1229
  | DataLink
1230
+ /* Multiple slideshow media path lists to combine (Array of path arrays) */
1231
+ pathsList?: Array<Array<any> | DataLink | DataLink> | DataLink
1230
1232
  /* Loop the slideshow */
1231
1233
  loop?: boolean | DataLink
1232
1234
  /* Shuffle the slideshow */
@@ -4307,6 +4307,408 @@ export type GeneratorSqlite = Generator &
4307
4307
  >
4308
4308
  }
4309
4309
 
4310
+ /* Refresh tools and resources, used for case if tools or resources are changed. Note that the current connections will be closed. */
4311
+ export type GeneratorMCPServerActionRefreshResources = Action & {
4312
+ __actionName: 'GENERATOR_MCP_SERVER_REFRESH_RESOURCES'
4313
+ }
4314
+
4315
+ /* End stream */
4316
+ export type GeneratorMCPServerActionEndStream = Action & {
4317
+ __actionName: 'GENERATOR_MCP_SERVER_END_STREAM'
4318
+ }
4319
+
4320
+ interface GeneratorMCPServerDef {
4321
+ /*
4322
+ Default property:
4323
+ {
4324
+ "enabled": true,
4325
+ "listening": true,
4326
+ "authType": "none",
4327
+ "name": "bricks-foundation-mcp-server-default",
4328
+ "version": "1.0.0",
4329
+ "resources": [],
4330
+ "tools": []
4331
+ }
4332
+ */
4333
+ property?: {
4334
+ /* Enable MCP server. If enabled and Listening is false, the generator can still provide application-scoped resources. */
4335
+ enabled?: boolean | DataLink
4336
+ /* Start MCP server */
4337
+ listening?: boolean | DataLink
4338
+ /* HTTP server port */
4339
+ port?: number | DataLink
4340
+ /* Authorization type of HTTP request */
4341
+ authType?: 'none' | 'bearer' | DataLink
4342
+ /* Token of bearer auth */
4343
+ bearerToken?: string | DataLink
4344
+ /* Name of the MCP server */
4345
+ name?: string | DataLink
4346
+ /* Version of the MCP server */
4347
+ version?: string | DataLink
4348
+ /* Resources
4349
+ Type:
4350
+ `static`: Return static data
4351
+ `detect-data-change`: Watch data target change to return data,
4352
+ please update data with ({ id: string, content: string | object }),
4353
+ and ensure the id is same with request id
4354
+ `script`: Not implemented yet */
4355
+ resources?:
4356
+ | Array<
4357
+ | DataLink
4358
+ | {
4359
+ enabled?: boolean | DataLink
4360
+ name?: string | DataLink
4361
+ description?: string | DataLink
4362
+ uriOrTemplate?: string | DataLink
4363
+ type?: 'static' | 'detect-data-change' | 'script' | DataLink
4364
+ staticData?: any
4365
+ dataChangeConfig?:
4366
+ | DataLink
4367
+ | {
4368
+ target?: string | DataLink
4369
+ timeout?: number | DataLink
4370
+ payload?: any
4371
+ }
4372
+ scriptConfig?:
4373
+ | DataLink
4374
+ | {
4375
+ code?: string | DataLink
4376
+ timeout?: number | DataLink
4377
+ members?:
4378
+ | Array<
4379
+ | DataLink
4380
+ | {
4381
+ handler?: string | DataLink
4382
+ varName?: string | DataLink
4383
+ }
4384
+ >
4385
+ | DataLink
4386
+ payload?: any
4387
+ }
4388
+ }
4389
+ >
4390
+ | DataLink
4391
+ /* Tools
4392
+ Type:
4393
+ `detect-data-change`: Watch data target change to return data,
4394
+ please update data with ({ id: string, content: string | object }),
4395
+ and ensure the id is same with request id.
4396
+ `script`: Not implemented yet */
4397
+ tools?:
4398
+ | Array<
4399
+ | DataLink
4400
+ | {
4401
+ enabled?: boolean | DataLink
4402
+ name?: string | DataLink
4403
+ description?: string | DataLink
4404
+ params?: {} | DataLink
4405
+ type?: 'detect-data-change' | 'script' | DataLink
4406
+ dataChangeConfig?:
4407
+ | DataLink
4408
+ | {
4409
+ target?: string | DataLink
4410
+ timeout?: number | DataLink
4411
+ payload?: any
4412
+ }
4413
+ scriptConfig?:
4414
+ | DataLink
4415
+ | {
4416
+ code?: string | DataLink
4417
+ timeout?: number | DataLink
4418
+ members?:
4419
+ | Array<
4420
+ | DataLink
4421
+ | {
4422
+ handler?: string | DataLink
4423
+ varName?: string | DataLink
4424
+ }
4425
+ >
4426
+ | DataLink
4427
+ payload?: any
4428
+ }
4429
+ }
4430
+ >
4431
+ | DataLink
4432
+ }
4433
+ events?: {
4434
+ /* Listening of HTTP server */
4435
+ onListening?: Array<EventAction>
4436
+ /* Error of HTTP server */
4437
+ onError?: Array<EventAction>
4438
+ /* Client error of HTTP server */
4439
+ onClientError?: Array<EventAction>
4440
+ /* Client close of HTTP server */
4441
+ onClientClose?: Array<EventAction>
4442
+ /* On request resource (Request: { name: string, uri: string, params: object }) */
4443
+ onRequestResource?: Array<EventAction>
4444
+ /* On call tool (Request: { name: string, params: object }) */
4445
+ onCallTool?: Array<EventAction>
4446
+ }
4447
+ outlets?: {
4448
+ /* Whether the HTTP server is listening */
4449
+ isListening?: () => Data
4450
+ /* Last error of HTTP server */
4451
+ lastError?: () => Data
4452
+ /* Connected remotes (Session ID) */
4453
+ connectedRemotes?: () => Data
4454
+ /* Last resource request ({ name: string, uri: string, params: object }) */
4455
+ lastResourceRequest?: () => Data
4456
+ /* Last tool call ({ name: string, params: object }) */
4457
+ lastToolCall?: () => Data
4458
+ }
4459
+ }
4460
+
4461
+ /* Model Context Protocol (MCP) Server (https://docs.anthropic.com/en/docs/agents-and-tools/mcp) */
4462
+ export type GeneratorMCPServer = Generator &
4463
+ GeneratorMCPServerDef & {
4464
+ templateKey: 'GENERATOR_MCP_SERVER'
4465
+ switches: Array<
4466
+ SwitchDef &
4467
+ GeneratorMCPServerDef & {
4468
+ conds?: Array<{
4469
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
4470
+ cond:
4471
+ | SwitchCondInnerStateCurrentCanvas
4472
+ | SwitchCondData
4473
+ | {
4474
+ __typename: 'SwitchCondInnerStateOutlet'
4475
+ outlet:
4476
+ | 'isListening'
4477
+ | 'lastError'
4478
+ | 'connectedRemotes'
4479
+ | 'lastResourceRequest'
4480
+ | 'lastToolCall'
4481
+ value: any
4482
+ }
4483
+ }>
4484
+ }
4485
+ >
4486
+ }
4487
+
4488
+ /* Connect to MCP server */
4489
+ export type GeneratorMCPActionConnect = Action & {
4490
+ __actionName: 'GENERATOR_MCP_CONNECT'
4491
+ }
4492
+
4493
+ /* Disconnect from MCP server */
4494
+ export type GeneratorMCPActionDisconnect = Action & {
4495
+ __actionName: 'GENERATOR_MCP_DISCONNECT'
4496
+ }
4497
+
4498
+ /* List resources */
4499
+ export type GeneratorMCPActionListResources = ActionWithParams & {
4500
+ __actionName: 'GENERATOR_MCP_LIST_RESOURCES'
4501
+ params?: Array<{
4502
+ input: 'requestId'
4503
+ value?: string | DataLink | EventProperty
4504
+ mapping?: string
4505
+ }>
4506
+ }
4507
+
4508
+ /* List resource templates */
4509
+ export type GeneratorMCPActionListResourceTemplates = ActionWithParams & {
4510
+ __actionName: 'GENERATOR_MCP_LIST_RESOURCE_TEMPLATES'
4511
+ params?: Array<{
4512
+ input: 'requestId'
4513
+ value?: string | DataLink | EventProperty
4514
+ mapping?: string
4515
+ }>
4516
+ }
4517
+
4518
+ /* Read resource */
4519
+ export type GeneratorMCPActionReadResource = ActionWithParams & {
4520
+ __actionName: 'GENERATOR_MCP_READ_RESOURCE'
4521
+ params?: Array<
4522
+ | {
4523
+ input: 'requestId'
4524
+ value?: string | DataLink | EventProperty
4525
+ mapping?: string
4526
+ }
4527
+ | {
4528
+ input: 'uri'
4529
+ value?: string | DataLink | EventProperty
4530
+ mapping?: string
4531
+ }
4532
+ | {
4533
+ input: 'variables'
4534
+ value?: {} | DataLink | EventProperty
4535
+ mapping?: string
4536
+ }
4537
+ >
4538
+ }
4539
+
4540
+ /* List tools */
4541
+ export type GeneratorMCPActionListTools = ActionWithParams & {
4542
+ __actionName: 'GENERATOR_MCP_LIST_TOOLS'
4543
+ params?: Array<{
4544
+ input: 'requestId'
4545
+ value?: string | DataLink | EventProperty
4546
+ mapping?: string
4547
+ }>
4548
+ }
4549
+
4550
+ /* Call tool */
4551
+ export type GeneratorMCPActionCallTool = ActionWithParams & {
4552
+ __actionName: 'GENERATOR_MCP_CALL_TOOL'
4553
+ params?: Array<
4554
+ | {
4555
+ input: 'requestId'
4556
+ value?: string | DataLink | EventProperty
4557
+ mapping?: string
4558
+ }
4559
+ | {
4560
+ input: 'name'
4561
+ value?: string | DataLink | EventProperty
4562
+ mapping?: string
4563
+ }
4564
+ | {
4565
+ input: 'variables'
4566
+ value?: {} | DataLink | EventProperty
4567
+ mapping?: string
4568
+ }
4569
+ >
4570
+ }
4571
+
4572
+ interface GeneratorMCPDef {
4573
+ /*
4574
+ Default property:
4575
+ {
4576
+ "init": false,
4577
+ "type": "sse",
4578
+ "url": "",
4579
+ "autoReconnect": true,
4580
+ "maxReconnectAttempts": 10,
4581
+ "reconnectInterval": 1000,
4582
+ "generatorId": "",
4583
+ "name": "bricks-foundation-mcp-client-default",
4584
+ "version": "1.0.0",
4585
+ "ignoreResourceInList": [],
4586
+ "ignoreToolInList": [],
4587
+ "requestTimeout": 60000
4588
+ }
4589
+ */
4590
+ property?: {
4591
+ /* Initialize the MCP client on start */
4592
+ init?: boolean | DataLink
4593
+ /* Type of the MCP connection, e.g. sse or direct-link (generator) */
4594
+ type?: 'sse' | 'direct-link' | DataLink
4595
+ /* URL of the MCP server, e.g. http://localhost:19853/sse */
4596
+ url?: string | DataLink
4597
+ /* Whether to automatically reconnect to the MCP server */
4598
+ autoReconnect?: boolean | DataLink
4599
+ /* Maximum number of reconnection attempts */
4600
+ maxReconnectAttempts?: number | DataLink
4601
+ /* Reconnection interval in milliseconds */
4602
+ reconnectInterval?: number | DataLink
4603
+ /* SSE connection headers */
4604
+ sseHeaders?: {} | DataLink
4605
+ /* Send request headers */
4606
+ sendHeaders?: {} | DataLink
4607
+ /* Bearer token for authentication */
4608
+ bearerToken?: string | DataLink
4609
+ /* Generator MCPServer ID for direct link */
4610
+ generatorId?: string | DataLink
4611
+ /* Name of the MCP client */
4612
+ name?: string | DataLink
4613
+ /* Version of the MCP client */
4614
+ version?: string | DataLink
4615
+ /* Ignore resources in list response */
4616
+ ignoreResourceInList?: Array<string | DataLink> | DataLink
4617
+ /* Ignore tools in list response */
4618
+ ignoreToolInList?: Array<string | DataLink> | DataLink
4619
+ /* Request timeout in milliseconds */
4620
+ requestTimeout?: number | DataLink
4621
+ }
4622
+ events?: {
4623
+ /* On connected */
4624
+ onConnected?: Array<EventAction>
4625
+ /* On connection error */
4626
+ onConnectionError?: Array<EventAction>
4627
+ /* On disconnected */
4628
+ onDisconnected?: Array<EventAction>
4629
+ /* On list resources */
4630
+ onListResources?: Array<EventAction>
4631
+ /* On list resources error */
4632
+ onListResourcesError?: Array<EventAction>
4633
+ /* On list resource templates */
4634
+ onListResourceTemplates?: Array<EventAction>
4635
+ /* On list resource templates error */
4636
+ onListResourceTemplatesError?: Array<EventAction>
4637
+ /* On read resource */
4638
+ onReadResource?: Array<EventAction>
4639
+ /* On read resource error */
4640
+ onReadResourceError?: Array<EventAction>
4641
+ /* On list tools */
4642
+ onListTools?: Array<EventAction>
4643
+ /* On list tools error */
4644
+ onListToolsError?: Array<EventAction>
4645
+ /* On call tool */
4646
+ onCallTool?: Array<EventAction>
4647
+ /* On call tool error */
4648
+ onCallToolError?: Array<EventAction>
4649
+ }
4650
+ outlets?: {
4651
+ /* Connection state */
4652
+ connectionState?: () => Data
4653
+ /* List resources response */
4654
+ listResourcesResponse?: () => Data
4655
+ /* List resources error */
4656
+ listResourcesError?: () => Data
4657
+ /* List resource templates response */
4658
+ listResourceTemplatesResponse?: () => Data
4659
+ /* List resource templates error */
4660
+ listResourceTemplatesError?: () => Data
4661
+ /* Read resource response */
4662
+ readResourceResponse?: () => Data
4663
+ /* Read resource error */
4664
+ readResourceError?: () => Data
4665
+ /* List tools response */
4666
+ listToolsResponse?: () => Data
4667
+ /* List tools error */
4668
+ listToolsError?: () => Data
4669
+ /* Call tool response */
4670
+ callToolResponse?: () => Data
4671
+ /* Call tool error */
4672
+ callToolError?: () => Data
4673
+ /* Last error */
4674
+ lastError?: () => Data
4675
+ }
4676
+ }
4677
+
4678
+ /* Model Context Protocol (MCP) Client, support SSE and Generator MCPServer direct link */
4679
+ export type GeneratorMCP = Generator &
4680
+ GeneratorMCPDef & {
4681
+ templateKey: 'GENERATOR_MCP'
4682
+ switches: Array<
4683
+ SwitchDef &
4684
+ GeneratorMCPDef & {
4685
+ conds?: Array<{
4686
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
4687
+ cond:
4688
+ | SwitchCondInnerStateCurrentCanvas
4689
+ | SwitchCondData
4690
+ | {
4691
+ __typename: 'SwitchCondInnerStateOutlet'
4692
+ outlet:
4693
+ | 'connectionState'
4694
+ | 'listResourcesResponse'
4695
+ | 'listResourcesError'
4696
+ | 'listResourceTemplatesResponse'
4697
+ | 'listResourceTemplatesError'
4698
+ | 'readResourceResponse'
4699
+ | 'readResourceError'
4700
+ | 'listToolsResponse'
4701
+ | 'listToolsError'
4702
+ | 'callToolResponse'
4703
+ | 'callToolError'
4704
+ | 'lastError'
4705
+ value: any
4706
+ }
4707
+ }>
4708
+ }
4709
+ >
4710
+ }
4711
+
4310
4712
  /* Load the model */
4311
4713
  export type GeneratorTTSActionLoadModel = Action & {
4312
4714
  __actionName: 'GENERATOR_TTS_LOAD_MODEL'
@@ -5917,6 +6319,166 @@ export type GeneratorLLM = Generator &
5917
6319
  >
5918
6320
  }
5919
6321
 
6322
+ /* Load the model */
6323
+ export type GeneratorQnnLlmActionLoadModel = Action & {
6324
+ __actionName: 'GENERATOR_QNN_LLM_LOAD_MODEL'
6325
+ }
6326
+
6327
+ /* Abort model download */
6328
+ export type GeneratorQnnLlmActionAbortModelDownload = Action & {
6329
+ __actionName: 'GENERATOR_QNN_LLM_ABORT_MODEL_DOWNLOAD'
6330
+ }
6331
+
6332
+ /* Generate text */
6333
+ export type GeneratorQnnLlmActionGenerate = ActionWithParams & {
6334
+ __actionName: 'GENERATOR_QNN_LLM_GENERATE'
6335
+ params?: Array<
6336
+ | {
6337
+ input: 'prompt'
6338
+ value?: string | DataLink | EventProperty
6339
+ mapping?: string
6340
+ }
6341
+ | {
6342
+ input: 'messages'
6343
+ value?: Array<any> | DataLink | EventProperty
6344
+ mapping?: string
6345
+ }
6346
+ >
6347
+ }
6348
+
6349
+ /* Abort generation */
6350
+ export type GeneratorQnnLlmActionAbortGeneration = Action & {
6351
+ __actionName: 'GENERATOR_QNN_LLM_ABORT_GENERATION'
6352
+ }
6353
+
6354
+ /* Release context */
6355
+ export type GeneratorQnnLlmActionReleaseContext = Action & {
6356
+ __actionName: 'GENERATOR_QNN_LLM_RELEASE_CONTEXT'
6357
+ }
6358
+
6359
+ interface GeneratorQnnLlmDef {
6360
+ /*
6361
+ Default property:
6362
+ {
6363
+ "modelType": "Llama 3.2 3B Chat",
6364
+ "chatFormat": "Llama 3.x",
6365
+ "toolCallParser": "llama3_json",
6366
+ "toolChoice": "auto",
6367
+ "parallelToolCalls": false,
6368
+ "greedy": false
6369
+ }
6370
+ */
6371
+ property?: {
6372
+ /* Load model context when generator is initialized */
6373
+ init?: boolean | DataLink
6374
+ /* Model type */
6375
+ modelType?:
6376
+ | 'Llama 3 8B Chat'
6377
+ | 'Llama 3.1 8B Chat'
6378
+ | 'Llama 3.2 3B Chat'
6379
+ | 'Mistral 7B Instruct v0.3'
6380
+ | 'Qwen 2 7B Chat'
6381
+ | 'Phi 3.5 Mini'
6382
+ | 'Granite v3.1 8B Instruct'
6383
+ | 'Custom'
6384
+ | DataLink
6385
+ /* SOC model */
6386
+ socModel?: 'X Elite' | 'X Plus' | '8 Elite' | '8 Gen 3' | 'QCS8550' | DataLink
6387
+ /* Custom model base URL
6388
+ The URL directory should contain `config.json` (model config) file, `model_part_*_of_*.bin` (model split files) files and `tokenizer.json` (tokenizer config) file. */
6389
+ customModelUrl?: string | DataLink
6390
+ /* Custom model split parts */
6391
+ customModelSplitParts?: number | DataLink
6392
+ /* Chat format */
6393
+ chatFormat?: 'Llama 2' | 'Llama 3' | 'Llama 3.x' | 'Mistral v0.3' | 'Qwen 2' | DataLink
6394
+ /* Custom chat format template */
6395
+ customChatFormat?: string | DataLink
6396
+ /* Prompt to generate */
6397
+ prompt?: string | DataLink
6398
+ /* Chat messages */
6399
+ messages?:
6400
+ | Array<
6401
+ | DataLink
6402
+ | {
6403
+ role?: string | DataLink
6404
+ content?: string | DataLink
6405
+ }
6406
+ >
6407
+ | DataLink
6408
+ /* Stop words */
6409
+ stopWords?: Array<string | DataLink> | DataLink
6410
+ /* Tool call parser */
6411
+ toolCallParser?: 'llama3_json' | 'mistral' | DataLink
6412
+ /* Tools for chat mode */
6413
+ tools?: {} | DataLink
6414
+ /* Tool choice for chat mode */
6415
+ toolChoice?: 'none' | 'auto' | 'required' | DataLink
6416
+ /* Enable parallel tool calls */
6417
+ parallelToolCalls?: boolean | DataLink
6418
+ /* Number of threads, -1 to use n-threads from model config */
6419
+ nThreads?: number | DataLink
6420
+ /* Temperature, -1 to use temperature from model config */
6421
+ temperature?: number | DataLink
6422
+ /* Seed, -1 to use seed from model config */
6423
+ seed?: number | DataLink
6424
+ /* Top K, -1 to use top-k from model config */
6425
+ topK?: number | DataLink
6426
+ /* Top P, -1 to use top-p from model config */
6427
+ topP?: number | DataLink
6428
+ /* Greedy, use greedy sampling */
6429
+ greedy?: boolean | DataLink
6430
+ }
6431
+ events?: {
6432
+ /* Event triggered when load is done */
6433
+ onContextStateChange?: Array<EventAction>
6434
+ /* Event triggered when generate is done */
6435
+ onGenerate?: Array<EventAction>
6436
+ /* Event triggered on get function call request */
6437
+ onFunctionCall?: Array<EventAction>
6438
+ /* Event triggered when error occurs */
6439
+ onError?: Array<EventAction>
6440
+ }
6441
+ outlets?: {
6442
+ /* Context state */
6443
+ contextState?: () => Data
6444
+ /* Generation result */
6445
+ result?: () => Data
6446
+ /* Full context (Prompt + Generation Result) */
6447
+ fullContext?: () => Data
6448
+ /* Last function call details */
6449
+ lastFunctionCall?: () => Data
6450
+ /* Completion details */
6451
+ completionDetails?: () => Data
6452
+ }
6453
+ }
6454
+
6455
+ /* Local LLM inference using Qualcomm AI Engine */
6456
+ export type GeneratorQnnLlm = Generator &
6457
+ GeneratorQnnLlmDef & {
6458
+ templateKey: 'GENERATOR_QNN_LLM'
6459
+ switches: Array<
6460
+ SwitchDef &
6461
+ GeneratorQnnLlmDef & {
6462
+ conds?: Array<{
6463
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
6464
+ cond:
6465
+ | SwitchCondInnerStateCurrentCanvas
6466
+ | SwitchCondData
6467
+ | {
6468
+ __typename: 'SwitchCondInnerStateOutlet'
6469
+ outlet:
6470
+ | 'contextState'
6471
+ | 'result'
6472
+ | 'fullContext'
6473
+ | 'lastFunctionCall'
6474
+ | 'completionDetails'
6475
+ value: any
6476
+ }
6477
+ }>
6478
+ }
6479
+ >
6480
+ }
6481
+
5920
6482
  /* Run text completion */
5921
6483
  export type GeneratorOpenAILLMActionCompletion = ActionWithParams & {
5922
6484
  __actionName: 'GENERATOR_OPENAI_LLM_COMPLETION'
@@ -6106,6 +6668,104 @@ export type GeneratorOpenAILLM = Generator &
6106
6668
  >
6107
6669
  }
6108
6670
 
6671
+ /* Generate audio */
6672
+ export type GeneratorOpenAiTTSActionGenerate = ActionWithParams & {
6673
+ __actionName: 'GENERATOR_OPENAI_TTS_GENERATE'
6674
+ params?: Array<{
6675
+ input: 'text'
6676
+ value?: string | DataLink | EventProperty
6677
+ mapping?: string
6678
+ }>
6679
+ }
6680
+
6681
+ /* Clean cache */
6682
+ export type GeneratorOpenAiTTSActionCleanCache = Action & {
6683
+ __actionName: 'GENERATOR_OPENAI_TTS_CLEAN_CACHE'
6684
+ }
6685
+
6686
+ interface GeneratorOpenAiTTSDef {
6687
+ /*
6688
+ Default property:
6689
+ {
6690
+ "apiEndpoint": "https://api.openai.com/v1",
6691
+ "model": "tts-1",
6692
+ "voice": "alloy",
6693
+ "speed": 1,
6694
+ "outputType": "play",
6695
+ "playbackVolume": 100,
6696
+ "cacheGenerated": true,
6697
+ "autoInferEnable": false,
6698
+ "softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
6699
+ "hardBreakTime": 500
6700
+ }
6701
+ */
6702
+ property?: {
6703
+ /* API endpoint URL */
6704
+ apiEndpoint?: string | DataLink
6705
+ /* OpenAI API Key */
6706
+ apiKey?: string | DataLink
6707
+ /* OpenAI TTS model */
6708
+ model?: string | DataLink
6709
+ /* Voice to use
6710
+ Select voice from https://openai.fm , default alloy */
6711
+ voice?: string | DataLink
6712
+ /* Additional instructions for the speech generation */
6713
+ instructions?: string | DataLink
6714
+ /* Speed of the generated audio */
6715
+ speed?: number | DataLink
6716
+ /* Output mode */
6717
+ outputType?: 'play' | 'file' | DataLink
6718
+ /* Playback volume (0 - 100) */
6719
+ playbackVolume?: number | DataLink
6720
+ /* Enable cache for generated audio */
6721
+ cacheGenerated?: boolean | DataLink
6722
+ /* Text to generate */
6723
+ prompt?: string | DataLink
6724
+ /* Auto inference when prompt changes */
6725
+ autoInferEnable?: boolean | DataLink
6726
+ /* Segmentation rule for auto inference */
6727
+ softBreakRegex?: string | DataLink
6728
+ /* Time to force inference when softBreakRegex is not satisfied */
6729
+ hardBreakTime?: number | DataLink
6730
+ }
6731
+ events?: {
6732
+ /* Event triggered when state change */
6733
+ onContextStateChange?: Array<EventAction>
6734
+ /* Event triggered when error occurs */
6735
+ onError?: Array<EventAction>
6736
+ }
6737
+ outlets?: {
6738
+ /* Context state */
6739
+ contextState?: () => Data
6740
+ /* Generated audio file */
6741
+ generatedAudio?: () => Data
6742
+ /* Generated audio file is playing */
6743
+ generatedAudioPlaying?: () => Data
6744
+ }
6745
+ }
6746
+
6747
+ /* Generate speech from text using OpenAI's Text-to-Speech API */
6748
+ export type GeneratorOpenAiTTS = Generator &
6749
+ GeneratorOpenAiTTSDef & {
6750
+ templateKey: 'GENERATOR_OPENAI_TTS'
6751
+ switches: Array<
6752
+ SwitchDef &
6753
+ GeneratorOpenAiTTSDef & {
6754
+ conds?: Array<{
6755
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
6756
+ cond:
6757
+ | SwitchCondInnerStateCurrentCanvas
6758
+ | SwitchCondData
6759
+ | {
6760
+ __typename: 'SwitchCondInnerStateOutlet'
6761
+ outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
6762
+ value: any
6763
+ }
6764
+ }>
6765
+ }
6766
+ >
6767
+ }
6768
+
6109
6769
  /* Add a message to the assistant */
6110
6770
  export type GeneratorAssistantActionAddMessage = ActionWithParams & {
6111
6771
  __actionName: 'GENERATOR_ASSISTANT_ADD_MESSAGE'
@@ -6332,8 +6992,25 @@ export type GeneratorAssistantActionReset = Action & {
6332
6992
  }
6333
6993
 
6334
6994
  /* Submit the assistant */
6335
- export type GeneratorAssistantActionSubmit = Action & {
6995
+ export type GeneratorAssistantActionSubmit = ActionWithParams & {
6336
6996
  __actionName: 'GENERATOR_ASSISTANT_SUBMIT'
6997
+ params?: Array<
6998
+ | {
6999
+ input: 'continueOnToolCallConfirm'
7000
+ value?: boolean | DataLink | EventProperty
7001
+ mapping?: string
7002
+ }
7003
+ | {
7004
+ input: 'continueOnToolCallStrategy'
7005
+ value?: 'never' | 'success' | 'always' | DataLink | EventProperty
7006
+ mapping?: string
7007
+ }
7008
+ | {
7009
+ input: 'continueOnToolCallLimit'
7010
+ value?: number | DataLink | EventProperty
7011
+ mapping?: string
7012
+ }
7013
+ >
6337
7014
  }
6338
7015
 
6339
7016
  /* Cancel the assistant responding */
@@ -6341,6 +7018,38 @@ export type GeneratorAssistantActionCancel = Action & {
6341
7018
  __actionName: 'GENERATOR_ASSISTANT_CANCEL'
6342
7019
  }
6343
7020
 
7021
+ /* Check the enabled MCP clients connection status and available tools */
7022
+ export type GeneratorAssistantActionCheckMcpServers = Action & {
7023
+ __actionName: 'GENERATOR_ASSISTANT_CHECK_MCP_SERVERS'
7024
+ }
7025
+
7026
+ /* Insert an MCP resource as a new assistant message */
7027
+ export type GeneratorAssistantActionInsertMcpResource = ActionWithParams & {
7028
+ __actionName: 'GENERATOR_ASSISTANT_INSERT_MCP_RESOURCE'
7029
+ params?: Array<
7030
+ | {
7031
+ input: 'mcpClientName'
7032
+ value?: string | DataLink | EventProperty
7033
+ mapping?: string
7034
+ }
7035
+ | {
7036
+ input: 'mcpResourceUri'
7037
+ value?: string | DataLink | EventProperty
7038
+ mapping?: string
7039
+ }
7040
+ | {
7041
+ input: 'mcpVariables'
7042
+ value?: {} | DataLink | EventProperty
7043
+ mapping?: string
7044
+ }
7045
+ | {
7046
+ input: 'role'
7047
+ value?: string | DataLink | EventProperty
7048
+ mapping?: string
7049
+ }
7050
+ >
7051
+ }
7052
+
6344
7053
  interface GeneratorAssistantDef {
6345
7054
  /*
6346
7055
  Default property:
@@ -6404,6 +7113,17 @@ Default property:
6404
7113
  ttsEnabled?: boolean | DataLink
6405
7114
  /* TTS Live Policy. If the policy is `only-in-use`, the TTS context will be released when the assistant is not in use. */
6406
7115
  ttsLivePolicy?: 'only-in-use' | 'manual' | DataLink
7116
+ /* MCP Generators (Add a unique name if generator name property are duplicate) */
7117
+ mcpGenerators?:
7118
+ | Array<
7119
+ | DataLink
7120
+ | {
7121
+ generatorId?: string | DataLink
7122
+ name?: string | DataLink
7123
+ enabled?: boolean | DataLink
7124
+ }
7125
+ >
7126
+ | DataLink
6407
7127
  }
6408
7128
  events?: {
6409
7129
  /* Error event */
@@ -6426,6 +7146,8 @@ Default property:
6426
7146
  files?: () => Data
6427
7147
  /* Messages of the assistant */
6428
7148
  messages?: () => Data
7149
+ /* MCP servers status and available tools */
7150
+ mcpServers?: () => Data
6429
7151
  }
6430
7152
  }
6431
7153
 
@@ -6450,6 +7172,7 @@ export type GeneratorAssistant = Generator &
6450
7172
  | 'isBusy'
6451
7173
  | 'files'
6452
7174
  | 'messages'
7175
+ | 'mcpServers'
6453
7176
  value: any
6454
7177
  }
6455
7178
  }>
@@ -630,6 +630,71 @@ export const templateEventPropsMap = {
630
630
  'GENERATOR_SQLITE_QUERY_RESULT', // type: array
631
631
  ],
632
632
  },
633
+ GENERATOR_MCP_SERVER: {
634
+ onError: [
635
+ 'GENERATOR_MCP_SERVER_ERROR_MESSAGE', // type: string
636
+ ],
637
+ onClientError: [
638
+ 'GENERATOR_MCP_SERVER_CLIENT_ADDRESS', // type: string
639
+ 'GENERATOR_MCP_SERVER_SESSION_ID', // type: string
640
+ 'GENERATOR_MCP_SERVER_ERROR_MESSAGE', // type: string
641
+ ],
642
+ onClientClose: [
643
+ 'GENERATOR_MCP_SERVER_CLIENT_ADDRESS', // type: string
644
+ 'GENERATOR_MCP_SERVER_SESSION_ID', // type: string
645
+ ],
646
+ onRequestResource: [
647
+ 'GENERATOR_MCP_SERVER_REQUEST', // type: object
648
+ ],
649
+ onCallTool: [
650
+ 'GENERATOR_MCP_SERVER_REQUEST', // type: object
651
+ ],
652
+ },
653
+ GENERATOR_MCP: {
654
+ onConnectionError: [
655
+ 'GENERATOR_MCP_ERROR_MESSAGE', // type: string
656
+ ],
657
+ onListResources: [
658
+ 'GENERATOR_MCP_REQUEST_ID', // type: string
659
+ 'GENERATOR_MCP_RESPONSE', // type: object
660
+ ],
661
+ onListResourcesError: [
662
+ 'GENERATOR_MCP_REQUEST_ID', // type: string
663
+ 'GENERATOR_MCP_ERROR_MESSAGE', // type: string
664
+ ],
665
+ onListResourceTemplates: [
666
+ 'GENERATOR_MCP_REQUEST_ID', // type: string
667
+ 'GENERATOR_MCP_RESPONSE', // type: object
668
+ ],
669
+ onListResourceTemplatesError: [
670
+ 'GENERATOR_MCP_REQUEST_ID', // type: string
671
+ 'GENERATOR_MCP_ERROR_MESSAGE', // type: string
672
+ ],
673
+ onReadResource: [
674
+ 'GENERATOR_MCP_REQUEST_ID', // type: string
675
+ 'GENERATOR_MCP_RESPONSE', // type: object
676
+ ],
677
+ onReadResourceError: [
678
+ 'GENERATOR_MCP_REQUEST_ID', // type: string
679
+ 'GENERATOR_MCP_ERROR_MESSAGE', // type: string
680
+ ],
681
+ onListTools: [
682
+ 'GENERATOR_MCP_REQUEST_ID', // type: string
683
+ 'GENERATOR_MCP_RESPONSE', // type: object
684
+ ],
685
+ onListToolsError: [
686
+ 'GENERATOR_MCP_REQUEST_ID', // type: string
687
+ 'GENERATOR_MCP_ERROR_MESSAGE', // type: string
688
+ ],
689
+ onCallTool: [
690
+ 'GENERATOR_MCP_REQUEST_ID', // type: string
691
+ 'GENERATOR_MCP_RESPONSE', // type: object
692
+ ],
693
+ onCallToolError: [
694
+ 'GENERATOR_MCP_REQUEST_ID', // type: string
695
+ 'GENERATOR_MCP_ERROR_MESSAGE', // type: string
696
+ ],
697
+ },
633
698
  GENERATOR_TTS: {
634
699
  onContextStateChange: [
635
700
  'GENERATOR_TTS_CONTEXT_STATE', // type: string
@@ -697,6 +762,23 @@ export const templateEventPropsMap = {
697
762
  'GENERATOR_LLM_COMPLETION_FUNCTION_DETAILS', // type: object
698
763
  ],
699
764
  },
765
+ GENERATOR_QNN_LLM: {
766
+ onContextStateChange: [
767
+ 'GENERATOR_QNN_LLM_CONTEXT_STATE', // type: string
768
+ ],
769
+ onGenerate: [
770
+ 'GENERATOR_QNN_LLM_RESULT', // type: string
771
+ 'GENERATOR_QNN_LLM_FULL_CONTEXT', // type: string
772
+ ],
773
+ onFunctionCall: [
774
+ 'GENERATOR_QNN_LLM_FUNCTION_CALL_NAME', // type: string
775
+ 'GENERATOR_QNN_LLM_FUNCTION_CALL_ARGUMENTS', // type: object
776
+ 'GENERATOR_QNN_LLM_FUNCTION_CALL_DETAILS', // type: object
777
+ ],
778
+ onError: [
779
+ 'GENERATOR_QNN_LLM_ERROR', // type: string
780
+ ],
781
+ },
700
782
  GENERATOR_OPENAI_LLM: {
701
783
  onError: [
702
784
  'GENERATOR_OPENAI_LLM_ERROR', // type: string
@@ -714,6 +796,14 @@ export const templateEventPropsMap = {
714
796
  'GENERATOR_OPENAI_LLM_COMPLETION_FUNCTION_ARGUMENTS', // type: string
715
797
  ],
716
798
  },
799
+ GENERATOR_OPENAI_TTS: {
800
+ onContextStateChange: [
801
+ 'GENERATOR_OPENAI_TTS_CONTEXT_STATE', // type: string
802
+ ],
803
+ onError: [
804
+ 'GENERATOR_OPENAI_TTS_ERROR', // type: string
805
+ ],
806
+ },
717
807
  GENERATOR_ASSISTANT: {
718
808
  onError: [
719
809
  'GENERATOR_ASSISTANT_ERROR', // type: string