@fugood/bricks-project 2.21.1 → 2.21.3
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 +64 -0
- package/package.json +1 -1
- package/tools/postinstall.ts +1 -2
- package/types/bricks.ts +2 -0
- package/types/generators.ts +897 -5
- package/utils/event-props.ts +122 -0
|
@@ -512,6 +512,36 @@ 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
|
+
GENERATOR_MCP_LIST_PROMPTS: {
|
|
537
|
+
requestId: 'GENERATOR_MCP_REQUEST_ID',
|
|
538
|
+
},
|
|
539
|
+
GENERATOR_MCP_GET_PROMPT: {
|
|
540
|
+
requestId: 'GENERATOR_MCP_REQUEST_ID',
|
|
541
|
+
name: 'GENERATOR_MCP_NAME',
|
|
542
|
+
variables: 'GENERATOR_MCP_VARIABLES',
|
|
543
|
+
},
|
|
544
|
+
},
|
|
515
545
|
GENERATOR_TTS: {
|
|
516
546
|
GENERATOR_TTS_GENERATE: {
|
|
517
547
|
text: 'GENERATOR_TTS_TEXT',
|
|
@@ -521,6 +551,7 @@ export const templateActionNameMap = {
|
|
|
521
551
|
GENERATOR_ONNX_LLM_INFER: {
|
|
522
552
|
prompt: 'GENERATOR_ONNX_LLM_PROMPT',
|
|
523
553
|
chat: 'GENERATOR_ONNX_LLM_CHAT',
|
|
554
|
+
images: 'GENERATOR_ONNX_LLM_IMAGES',
|
|
524
555
|
},
|
|
525
556
|
},
|
|
526
557
|
GENERATOR_ONNX_STT: {
|
|
@@ -615,6 +646,12 @@ export const templateActionNameMap = {
|
|
|
615
646
|
sessionCustomKey: 'GENERATOR_LLM_SESSION_CUSTOM_KEY',
|
|
616
647
|
},
|
|
617
648
|
},
|
|
649
|
+
GENERATOR_QNN_LLM: {
|
|
650
|
+
GENERATOR_QNN_LLM_GENERATE: {
|
|
651
|
+
prompt: 'GENERATOR_QNN_LLM_PROMPT',
|
|
652
|
+
messages: 'GENERATOR_QNN_LLM_MESSAGES',
|
|
653
|
+
},
|
|
654
|
+
},
|
|
618
655
|
GENERATOR_OPENAI_LLM: {
|
|
619
656
|
GENERATOR_OPENAI_LLM_COMPLETION: {
|
|
620
657
|
messages: 'GENERATOR_OPENAI_LLM_MESSAGES',
|
|
@@ -630,6 +667,11 @@ export const templateActionNameMap = {
|
|
|
630
667
|
responseFormat: 'GENERATOR_OPENAI_LLM_RESPONSE_FORMAT',
|
|
631
668
|
},
|
|
632
669
|
},
|
|
670
|
+
GENERATOR_OPENAI_TTS: {
|
|
671
|
+
GENERATOR_OPENAI_TTS_GENERATE: {
|
|
672
|
+
text: 'GENERATOR_OPENAI_TTS_TEXT',
|
|
673
|
+
},
|
|
674
|
+
},
|
|
633
675
|
GENERATOR_ASSISTANT: {
|
|
634
676
|
GENERATOR_ASSISTANT_ADD_MESSAGE: {
|
|
635
677
|
role: 'GENERATOR_ASSISTANT_ROLE',
|
|
@@ -643,6 +685,17 @@ export const templateActionNameMap = {
|
|
|
643
685
|
fileSearchCitationCount: 'GENERATOR_ASSISTANT_FILE_SEARCH_CITATION_COUNT',
|
|
644
686
|
fileSearchInsertMethod: 'GENERATOR_ASSISTANT_FILE_SEARCH_INSERT_METHOD',
|
|
645
687
|
},
|
|
688
|
+
GENERATOR_ASSISTANT_INIT_MCP_PROMPT: {
|
|
689
|
+
mcpClientName: 'GENERATOR_ASSISTANT_MCP_CLIENT_NAME',
|
|
690
|
+
mcpPromptName: 'GENERATOR_ASSISTANT_MCP_PROMPT_NAME',
|
|
691
|
+
mcpArguments: 'GENERATOR_ASSISTANT_MCP_ARGUMENTS',
|
|
692
|
+
firstMessageAsSystem: 'GENERATOR_ASSISTANT_FIRST_MESSAGE_AS_SYSTEM',
|
|
693
|
+
},
|
|
694
|
+
GENERATOR_ASSISTANT_ADD_MCP_PROMPT_MESSAGE: {
|
|
695
|
+
mcpClientName: 'GENERATOR_ASSISTANT_MCP_CLIENT_NAME',
|
|
696
|
+
mcpPromptName: 'GENERATOR_ASSISTANT_MCP_PROMPT_NAME',
|
|
697
|
+
mcpArguments: 'GENERATOR_ASSISTANT_MCP_ARGUMENTS',
|
|
698
|
+
},
|
|
646
699
|
GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX: {
|
|
647
700
|
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
648
701
|
content: 'GENERATOR_ASSISTANT_CONTENT',
|
|
@@ -679,6 +732,17 @@ export const templateActionNameMap = {
|
|
|
679
732
|
GENERATOR_ASSISTANT_REMOVE_MESSAGE_AT_INDEX: {
|
|
680
733
|
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
681
734
|
},
|
|
735
|
+
GENERATOR_ASSISTANT_SUBMIT: {
|
|
736
|
+
continueOnToolCallConfirm: 'GENERATOR_ASSISTANT_CONTINUE_ON_TOOL_CALL_CONFIRM',
|
|
737
|
+
continueOnToolCallStrategy: 'GENERATOR_ASSISTANT_CONTINUE_ON_TOOL_CALL_STRATEGY',
|
|
738
|
+
continueOnToolCallLimit: 'GENERATOR_ASSISTANT_CONTINUE_ON_TOOL_CALL_LIMIT',
|
|
739
|
+
},
|
|
740
|
+
GENERATOR_ASSISTANT_INSERT_MCP_RESOURCE: {
|
|
741
|
+
mcpClientName: 'GENERATOR_ASSISTANT_MCP_CLIENT_NAME',
|
|
742
|
+
mcpResourceUri: 'GENERATOR_ASSISTANT_MCP_RESOURCE_URI',
|
|
743
|
+
mcpVariables: 'GENERATOR_ASSISTANT_MCP_VARIABLES',
|
|
744
|
+
role: 'GENERATOR_ASSISTANT_ROLE',
|
|
745
|
+
},
|
|
682
746
|
},
|
|
683
747
|
GENERATOR_VECTOR_STORE: {
|
|
684
748
|
GENERATOR_VECTOR_STORE_RESET: {
|
package/package.json
CHANGED
package/tools/postinstall.ts
CHANGED
|
@@ -51,8 +51,7 @@ const handleMcpConfigOverride = async (mcpConfigPath: string) => {
|
|
|
51
51
|
console.log(`Updated ${mcpConfigPath}`)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
if (await exists(`${cwd}/.
|
|
55
|
-
await $`mkdir -p ${cwd}/.cursor`
|
|
54
|
+
if (await exists(`${cwd}/.cursor/rules/instructions.mdc`)) {
|
|
56
55
|
const cursorMcpConfigPath = `${cwd}/.cursor/mcp.json`
|
|
57
56
|
await handleMcpConfigOverride(cursorMcpConfigPath)
|
|
58
57
|
}
|
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 */
|
package/types/generators.ts
CHANGED
|
@@ -4307,6 +4307,512 @@ 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
|
+
"prompts": []
|
|
4332
|
+
}
|
|
4333
|
+
*/
|
|
4334
|
+
property?: {
|
|
4335
|
+
/* Enable MCP server. If enabled and Listening is false, the generator can still provide application-scoped resources. */
|
|
4336
|
+
enabled?: boolean | DataLink
|
|
4337
|
+
/* Start MCP server */
|
|
4338
|
+
listening?: boolean | DataLink
|
|
4339
|
+
/* HTTP server port */
|
|
4340
|
+
port?: number | DataLink
|
|
4341
|
+
/* Authorization type of HTTP request */
|
|
4342
|
+
authType?: 'none' | 'bearer' | DataLink
|
|
4343
|
+
/* Token of bearer auth */
|
|
4344
|
+
bearerToken?: string | DataLink
|
|
4345
|
+
/* Name of the MCP server */
|
|
4346
|
+
name?: string | DataLink
|
|
4347
|
+
/* Version of the MCP server */
|
|
4348
|
+
version?: string | DataLink
|
|
4349
|
+
/* Resources
|
|
4350
|
+
Type:
|
|
4351
|
+
`static`: Return static data
|
|
4352
|
+
`detect-data-change`: Watch data target change to return data,
|
|
4353
|
+
please update data with ({ id: string, content: string | object }),
|
|
4354
|
+
and ensure the id is same with request id
|
|
4355
|
+
`script`: Not implemented yet */
|
|
4356
|
+
resources?:
|
|
4357
|
+
| Array<
|
|
4358
|
+
| DataLink
|
|
4359
|
+
| {
|
|
4360
|
+
enabled?: boolean | DataLink
|
|
4361
|
+
name?: string | DataLink
|
|
4362
|
+
description?: string | DataLink
|
|
4363
|
+
uriOrTemplate?: string | DataLink
|
|
4364
|
+
type?: 'static' | 'detect-data-change' | 'script' | DataLink
|
|
4365
|
+
staticData?: any
|
|
4366
|
+
dataChangeConfig?:
|
|
4367
|
+
| DataLink
|
|
4368
|
+
| {
|
|
4369
|
+
target?: string | DataLink
|
|
4370
|
+
timeout?: number | DataLink
|
|
4371
|
+
payload?: any
|
|
4372
|
+
}
|
|
4373
|
+
scriptConfig?:
|
|
4374
|
+
| DataLink
|
|
4375
|
+
| {
|
|
4376
|
+
code?: string | DataLink
|
|
4377
|
+
timeout?: number | DataLink
|
|
4378
|
+
members?:
|
|
4379
|
+
| Array<
|
|
4380
|
+
| DataLink
|
|
4381
|
+
| {
|
|
4382
|
+
handler?: string | DataLink
|
|
4383
|
+
varName?: string | DataLink
|
|
4384
|
+
}
|
|
4385
|
+
>
|
|
4386
|
+
| DataLink
|
|
4387
|
+
payload?: any
|
|
4388
|
+
}
|
|
4389
|
+
}
|
|
4390
|
+
>
|
|
4391
|
+
| DataLink
|
|
4392
|
+
/* Tools
|
|
4393
|
+
Type:
|
|
4394
|
+
`detect-data-change`: Watch data target change to return data,
|
|
4395
|
+
please update data with ({ id: string, content: string | object }),
|
|
4396
|
+
and ensure the id is same with request id.
|
|
4397
|
+
`script`: Not implemented yet */
|
|
4398
|
+
tools?:
|
|
4399
|
+
| Array<
|
|
4400
|
+
| DataLink
|
|
4401
|
+
| {
|
|
4402
|
+
enabled?: boolean | DataLink
|
|
4403
|
+
name?: string | DataLink
|
|
4404
|
+
description?: string | DataLink
|
|
4405
|
+
params?: {} | DataLink
|
|
4406
|
+
type?: 'detect-data-change' | 'script' | DataLink
|
|
4407
|
+
dataChangeConfig?:
|
|
4408
|
+
| DataLink
|
|
4409
|
+
| {
|
|
4410
|
+
target?: string | DataLink
|
|
4411
|
+
timeout?: number | DataLink
|
|
4412
|
+
payload?: any
|
|
4413
|
+
}
|
|
4414
|
+
scriptConfig?:
|
|
4415
|
+
| DataLink
|
|
4416
|
+
| {
|
|
4417
|
+
code?: string | DataLink
|
|
4418
|
+
timeout?: number | DataLink
|
|
4419
|
+
members?:
|
|
4420
|
+
| Array<
|
|
4421
|
+
| DataLink
|
|
4422
|
+
| {
|
|
4423
|
+
handler?: string | DataLink
|
|
4424
|
+
varName?: string | DataLink
|
|
4425
|
+
}
|
|
4426
|
+
>
|
|
4427
|
+
| DataLink
|
|
4428
|
+
payload?: any
|
|
4429
|
+
}
|
|
4430
|
+
}
|
|
4431
|
+
>
|
|
4432
|
+
| DataLink
|
|
4433
|
+
/* Prompts
|
|
4434
|
+
Type:
|
|
4435
|
+
`static`: Return static data
|
|
4436
|
+
`detect-data-change`: Watch data target change to return data,
|
|
4437
|
+
please update data with ({ id: string, content: string | object }),
|
|
4438
|
+
and ensure the id is same with request id
|
|
4439
|
+
`script`: Not implemented yet */
|
|
4440
|
+
prompts?:
|
|
4441
|
+
| Array<
|
|
4442
|
+
| DataLink
|
|
4443
|
+
| {
|
|
4444
|
+
enabled?: boolean | DataLink
|
|
4445
|
+
name?: string | DataLink
|
|
4446
|
+
description?: string | DataLink
|
|
4447
|
+
arguments?: {} | DataLink
|
|
4448
|
+
type?: 'static' | 'detect-data-change' | 'script' | DataLink
|
|
4449
|
+
staticData?: any
|
|
4450
|
+
dataChangeConfig?:
|
|
4451
|
+
| DataLink
|
|
4452
|
+
| {
|
|
4453
|
+
target?: string | DataLink
|
|
4454
|
+
timeout?: number | DataLink
|
|
4455
|
+
payload?: any
|
|
4456
|
+
}
|
|
4457
|
+
scriptConfig?:
|
|
4458
|
+
| DataLink
|
|
4459
|
+
| {
|
|
4460
|
+
code?: string | DataLink
|
|
4461
|
+
timeout?: number | DataLink
|
|
4462
|
+
members?:
|
|
4463
|
+
| Array<
|
|
4464
|
+
| DataLink
|
|
4465
|
+
| {
|
|
4466
|
+
handler?: string | DataLink
|
|
4467
|
+
varName?: string | DataLink
|
|
4468
|
+
}
|
|
4469
|
+
>
|
|
4470
|
+
| DataLink
|
|
4471
|
+
payload?: any
|
|
4472
|
+
}
|
|
4473
|
+
}
|
|
4474
|
+
>
|
|
4475
|
+
| DataLink
|
|
4476
|
+
}
|
|
4477
|
+
events?: {
|
|
4478
|
+
/* Listening of HTTP server */
|
|
4479
|
+
onListening?: Array<EventAction>
|
|
4480
|
+
/* Error of HTTP server */
|
|
4481
|
+
onError?: Array<EventAction>
|
|
4482
|
+
/* Client error of HTTP server */
|
|
4483
|
+
onClientError?: Array<EventAction>
|
|
4484
|
+
/* Client close of HTTP server */
|
|
4485
|
+
onClientClose?: Array<EventAction>
|
|
4486
|
+
/* On request resource (Request: { name: string, uri: string, params: object }) */
|
|
4487
|
+
onRequestResource?: Array<EventAction>
|
|
4488
|
+
/* On call tool (Request: { name: string, params: object }) */
|
|
4489
|
+
onCallTool?: Array<EventAction>
|
|
4490
|
+
/* On get prompt (Request: { name: string, arguments: object }) */
|
|
4491
|
+
onGetPrompt?: Array<EventAction>
|
|
4492
|
+
}
|
|
4493
|
+
outlets?: {
|
|
4494
|
+
/* Whether the HTTP server is listening */
|
|
4495
|
+
isListening?: () => Data
|
|
4496
|
+
/* Last error of HTTP server */
|
|
4497
|
+
lastError?: () => Data
|
|
4498
|
+
/* Connected remotes (Session ID) */
|
|
4499
|
+
connectedRemotes?: () => Data
|
|
4500
|
+
/* Last resource request ({ name: string, uri: string, params: object }) */
|
|
4501
|
+
lastResourceRequest?: () => Data
|
|
4502
|
+
/* Last tool call ({ name: string, params: object }) */
|
|
4503
|
+
lastToolCall?: () => Data
|
|
4504
|
+
/* Last prompt get ({ name: string, arguments: object }) */
|
|
4505
|
+
lastPromptGet?: () => Data
|
|
4506
|
+
}
|
|
4507
|
+
}
|
|
4508
|
+
|
|
4509
|
+
/* Model Context Protocol (MCP) Server (https://docs.anthropic.com/en/docs/agents-and-tools/mcp) */
|
|
4510
|
+
export type GeneratorMCPServer = Generator &
|
|
4511
|
+
GeneratorMCPServerDef & {
|
|
4512
|
+
templateKey: 'GENERATOR_MCP_SERVER'
|
|
4513
|
+
switches: Array<
|
|
4514
|
+
SwitchDef &
|
|
4515
|
+
GeneratorMCPServerDef & {
|
|
4516
|
+
conds?: Array<{
|
|
4517
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
4518
|
+
cond:
|
|
4519
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
4520
|
+
| SwitchCondData
|
|
4521
|
+
| {
|
|
4522
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
4523
|
+
outlet:
|
|
4524
|
+
| 'isListening'
|
|
4525
|
+
| 'lastError'
|
|
4526
|
+
| 'connectedRemotes'
|
|
4527
|
+
| 'lastResourceRequest'
|
|
4528
|
+
| 'lastToolCall'
|
|
4529
|
+
| 'lastPromptGet'
|
|
4530
|
+
value: any
|
|
4531
|
+
}
|
|
4532
|
+
}>
|
|
4533
|
+
}
|
|
4534
|
+
>
|
|
4535
|
+
}
|
|
4536
|
+
|
|
4537
|
+
/* Connect to MCP server */
|
|
4538
|
+
export type GeneratorMCPActionConnect = Action & {
|
|
4539
|
+
__actionName: 'GENERATOR_MCP_CONNECT'
|
|
4540
|
+
}
|
|
4541
|
+
|
|
4542
|
+
/* Disconnect from MCP server */
|
|
4543
|
+
export type GeneratorMCPActionDisconnect = Action & {
|
|
4544
|
+
__actionName: 'GENERATOR_MCP_DISCONNECT'
|
|
4545
|
+
}
|
|
4546
|
+
|
|
4547
|
+
/* List resources */
|
|
4548
|
+
export type GeneratorMCPActionListResources = ActionWithParams & {
|
|
4549
|
+
__actionName: 'GENERATOR_MCP_LIST_RESOURCES'
|
|
4550
|
+
params?: Array<{
|
|
4551
|
+
input: 'requestId'
|
|
4552
|
+
value?: string | DataLink | EventProperty
|
|
4553
|
+
mapping?: string
|
|
4554
|
+
}>
|
|
4555
|
+
}
|
|
4556
|
+
|
|
4557
|
+
/* List resource templates */
|
|
4558
|
+
export type GeneratorMCPActionListResourceTemplates = ActionWithParams & {
|
|
4559
|
+
__actionName: 'GENERATOR_MCP_LIST_RESOURCE_TEMPLATES'
|
|
4560
|
+
params?: Array<{
|
|
4561
|
+
input: 'requestId'
|
|
4562
|
+
value?: string | DataLink | EventProperty
|
|
4563
|
+
mapping?: string
|
|
4564
|
+
}>
|
|
4565
|
+
}
|
|
4566
|
+
|
|
4567
|
+
/* Read resource */
|
|
4568
|
+
export type GeneratorMCPActionReadResource = ActionWithParams & {
|
|
4569
|
+
__actionName: 'GENERATOR_MCP_READ_RESOURCE'
|
|
4570
|
+
params?: Array<
|
|
4571
|
+
| {
|
|
4572
|
+
input: 'requestId'
|
|
4573
|
+
value?: string | DataLink | EventProperty
|
|
4574
|
+
mapping?: string
|
|
4575
|
+
}
|
|
4576
|
+
| {
|
|
4577
|
+
input: 'uri'
|
|
4578
|
+
value?: string | DataLink | EventProperty
|
|
4579
|
+
mapping?: string
|
|
4580
|
+
}
|
|
4581
|
+
| {
|
|
4582
|
+
input: 'variables'
|
|
4583
|
+
value?: {} | DataLink | EventProperty
|
|
4584
|
+
mapping?: string
|
|
4585
|
+
}
|
|
4586
|
+
>
|
|
4587
|
+
}
|
|
4588
|
+
|
|
4589
|
+
/* List tools */
|
|
4590
|
+
export type GeneratorMCPActionListTools = ActionWithParams & {
|
|
4591
|
+
__actionName: 'GENERATOR_MCP_LIST_TOOLS'
|
|
4592
|
+
params?: Array<{
|
|
4593
|
+
input: 'requestId'
|
|
4594
|
+
value?: string | DataLink | EventProperty
|
|
4595
|
+
mapping?: string
|
|
4596
|
+
}>
|
|
4597
|
+
}
|
|
4598
|
+
|
|
4599
|
+
/* Call tool */
|
|
4600
|
+
export type GeneratorMCPActionCallTool = ActionWithParams & {
|
|
4601
|
+
__actionName: 'GENERATOR_MCP_CALL_TOOL'
|
|
4602
|
+
params?: Array<
|
|
4603
|
+
| {
|
|
4604
|
+
input: 'requestId'
|
|
4605
|
+
value?: string | DataLink | EventProperty
|
|
4606
|
+
mapping?: string
|
|
4607
|
+
}
|
|
4608
|
+
| {
|
|
4609
|
+
input: 'name'
|
|
4610
|
+
value?: string | DataLink | EventProperty
|
|
4611
|
+
mapping?: string
|
|
4612
|
+
}
|
|
4613
|
+
| {
|
|
4614
|
+
input: 'variables'
|
|
4615
|
+
value?: {} | DataLink | EventProperty
|
|
4616
|
+
mapping?: string
|
|
4617
|
+
}
|
|
4618
|
+
>
|
|
4619
|
+
}
|
|
4620
|
+
|
|
4621
|
+
/* List prompts */
|
|
4622
|
+
export type GeneratorMCPActionListPrompts = ActionWithParams & {
|
|
4623
|
+
__actionName: 'GENERATOR_MCP_LIST_PROMPTS'
|
|
4624
|
+
params?: Array<{
|
|
4625
|
+
input: 'requestId'
|
|
4626
|
+
value?: string | DataLink | EventProperty
|
|
4627
|
+
mapping?: string
|
|
4628
|
+
}>
|
|
4629
|
+
}
|
|
4630
|
+
|
|
4631
|
+
/* Request prompt */
|
|
4632
|
+
export type GeneratorMCPActionGetPrompt = ActionWithParams & {
|
|
4633
|
+
__actionName: 'GENERATOR_MCP_GET_PROMPT'
|
|
4634
|
+
params?: Array<
|
|
4635
|
+
| {
|
|
4636
|
+
input: 'requestId'
|
|
4637
|
+
value?: string | DataLink | EventProperty
|
|
4638
|
+
mapping?: string
|
|
4639
|
+
}
|
|
4640
|
+
| {
|
|
4641
|
+
input: 'name'
|
|
4642
|
+
value?: string | DataLink | EventProperty
|
|
4643
|
+
mapping?: string
|
|
4644
|
+
}
|
|
4645
|
+
| {
|
|
4646
|
+
input: 'variables'
|
|
4647
|
+
value?: {} | DataLink | EventProperty
|
|
4648
|
+
mapping?: string
|
|
4649
|
+
}
|
|
4650
|
+
>
|
|
4651
|
+
}
|
|
4652
|
+
|
|
4653
|
+
interface GeneratorMCPDef {
|
|
4654
|
+
/*
|
|
4655
|
+
Default property:
|
|
4656
|
+
{
|
|
4657
|
+
"init": false,
|
|
4658
|
+
"type": "sse",
|
|
4659
|
+
"url": "",
|
|
4660
|
+
"autoReconnect": true,
|
|
4661
|
+
"maxReconnectAttempts": 10,
|
|
4662
|
+
"reconnectInterval": 1000,
|
|
4663
|
+
"generatorId": "",
|
|
4664
|
+
"name": "bricks-foundation-mcp-client-default",
|
|
4665
|
+
"version": "1.0.0",
|
|
4666
|
+
"ignoreResourceInList": [],
|
|
4667
|
+
"ignoreToolInList": [],
|
|
4668
|
+
"ignorePromptInList": [],
|
|
4669
|
+
"requestTimeout": 60000
|
|
4670
|
+
}
|
|
4671
|
+
*/
|
|
4672
|
+
property?: {
|
|
4673
|
+
/* Initialize the MCP client on start */
|
|
4674
|
+
init?: boolean | DataLink
|
|
4675
|
+
/* Type of the MCP connection, e.g. sse or direct-link (generator) */
|
|
4676
|
+
type?: 'sse' | 'direct-link' | DataLink
|
|
4677
|
+
/* URL of the MCP server, e.g. http://localhost:19853/sse */
|
|
4678
|
+
url?: string | DataLink
|
|
4679
|
+
/* Whether to automatically reconnect to the MCP server */
|
|
4680
|
+
autoReconnect?: boolean | DataLink
|
|
4681
|
+
/* Maximum number of reconnection attempts */
|
|
4682
|
+
maxReconnectAttempts?: number | DataLink
|
|
4683
|
+
/* Reconnection interval in milliseconds */
|
|
4684
|
+
reconnectInterval?: number | DataLink
|
|
4685
|
+
/* SSE connection headers */
|
|
4686
|
+
sseHeaders?: {} | DataLink
|
|
4687
|
+
/* Send request headers */
|
|
4688
|
+
sendHeaders?: {} | DataLink
|
|
4689
|
+
/* Bearer token for authentication */
|
|
4690
|
+
bearerToken?: string | DataLink
|
|
4691
|
+
/* Generator MCPServer ID for direct link */
|
|
4692
|
+
generatorId?: string | DataLink
|
|
4693
|
+
/* Name of the MCP client */
|
|
4694
|
+
name?: string | DataLink
|
|
4695
|
+
/* Version of the MCP client */
|
|
4696
|
+
version?: string | DataLink
|
|
4697
|
+
/* Ignore resources in list response */
|
|
4698
|
+
ignoreResourceInList?: Array<string | DataLink> | DataLink
|
|
4699
|
+
/* Ignore tools in list response */
|
|
4700
|
+
ignoreToolInList?: Array<string | DataLink> | DataLink
|
|
4701
|
+
/* Ignore prompts in list response */
|
|
4702
|
+
ignorePromptInList?: Array<string | DataLink> | DataLink
|
|
4703
|
+
/* Request timeout in milliseconds */
|
|
4704
|
+
requestTimeout?: number | DataLink
|
|
4705
|
+
}
|
|
4706
|
+
events?: {
|
|
4707
|
+
/* On connected */
|
|
4708
|
+
onConnected?: Array<EventAction>
|
|
4709
|
+
/* On connection error */
|
|
4710
|
+
onConnectionError?: Array<EventAction>
|
|
4711
|
+
/* On disconnected */
|
|
4712
|
+
onDisconnected?: Array<EventAction>
|
|
4713
|
+
/* On list resources */
|
|
4714
|
+
onListResources?: Array<EventAction>
|
|
4715
|
+
/* On list resources error */
|
|
4716
|
+
onListResourcesError?: Array<EventAction>
|
|
4717
|
+
/* On list resource templates */
|
|
4718
|
+
onListResourceTemplates?: Array<EventAction>
|
|
4719
|
+
/* On list resource templates error */
|
|
4720
|
+
onListResourceTemplatesError?: Array<EventAction>
|
|
4721
|
+
/* On read resource */
|
|
4722
|
+
onReadResource?: Array<EventAction>
|
|
4723
|
+
/* On read resource error */
|
|
4724
|
+
onReadResourceError?: Array<EventAction>
|
|
4725
|
+
/* On list tools */
|
|
4726
|
+
onListTools?: Array<EventAction>
|
|
4727
|
+
/* On list tools error */
|
|
4728
|
+
onListToolsError?: Array<EventAction>
|
|
4729
|
+
/* On call tool */
|
|
4730
|
+
onCallTool?: Array<EventAction>
|
|
4731
|
+
/* On call tool error */
|
|
4732
|
+
onCallToolError?: Array<EventAction>
|
|
4733
|
+
/* On list prompts */
|
|
4734
|
+
onListPrompts?: Array<EventAction>
|
|
4735
|
+
/* On list prompts error */
|
|
4736
|
+
onListPromptsError?: Array<EventAction>
|
|
4737
|
+
/* On get prompt */
|
|
4738
|
+
onGetPrompt?: Array<EventAction>
|
|
4739
|
+
/* On get prompt error */
|
|
4740
|
+
onGetPromptError?: Array<EventAction>
|
|
4741
|
+
}
|
|
4742
|
+
outlets?: {
|
|
4743
|
+
/* Connection state */
|
|
4744
|
+
connectionState?: () => Data
|
|
4745
|
+
/* List resources response */
|
|
4746
|
+
listResourcesResponse?: () => Data
|
|
4747
|
+
/* List resources error */
|
|
4748
|
+
listResourcesError?: () => Data
|
|
4749
|
+
/* List resource templates response */
|
|
4750
|
+
listResourceTemplatesResponse?: () => Data
|
|
4751
|
+
/* List resource templates error */
|
|
4752
|
+
listResourceTemplatesError?: () => Data
|
|
4753
|
+
/* Read resource response */
|
|
4754
|
+
readResourceResponse?: () => Data
|
|
4755
|
+
/* Read resource error */
|
|
4756
|
+
readResourceError?: () => Data
|
|
4757
|
+
/* List tools response */
|
|
4758
|
+
listToolsResponse?: () => Data
|
|
4759
|
+
/* List tools error */
|
|
4760
|
+
listToolsError?: () => Data
|
|
4761
|
+
/* Call tool response */
|
|
4762
|
+
callToolResponse?: () => Data
|
|
4763
|
+
/* Call tool error */
|
|
4764
|
+
callToolError?: () => Data
|
|
4765
|
+
/* List prompts response */
|
|
4766
|
+
listPromptsResponse?: () => Data
|
|
4767
|
+
/* List prompts error */
|
|
4768
|
+
listPromptsError?: () => Data
|
|
4769
|
+
/* Get prompt response */
|
|
4770
|
+
getPromptResponse?: () => Data
|
|
4771
|
+
/* Request prompt error */
|
|
4772
|
+
getPromptError?: () => Data
|
|
4773
|
+
/* Last error */
|
|
4774
|
+
lastError?: () => Data
|
|
4775
|
+
}
|
|
4776
|
+
}
|
|
4777
|
+
|
|
4778
|
+
/* Model Context Protocol (MCP) Client, support SSE and Generator MCPServer direct link */
|
|
4779
|
+
export type GeneratorMCP = Generator &
|
|
4780
|
+
GeneratorMCPDef & {
|
|
4781
|
+
templateKey: 'GENERATOR_MCP'
|
|
4782
|
+
switches: Array<
|
|
4783
|
+
SwitchDef &
|
|
4784
|
+
GeneratorMCPDef & {
|
|
4785
|
+
conds?: Array<{
|
|
4786
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
4787
|
+
cond:
|
|
4788
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
4789
|
+
| SwitchCondData
|
|
4790
|
+
| {
|
|
4791
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
4792
|
+
outlet:
|
|
4793
|
+
| 'connectionState'
|
|
4794
|
+
| 'listResourcesResponse'
|
|
4795
|
+
| 'listResourcesError'
|
|
4796
|
+
| 'listResourceTemplatesResponse'
|
|
4797
|
+
| 'listResourceTemplatesError'
|
|
4798
|
+
| 'readResourceResponse'
|
|
4799
|
+
| 'readResourceError'
|
|
4800
|
+
| 'listToolsResponse'
|
|
4801
|
+
| 'listToolsError'
|
|
4802
|
+
| 'callToolResponse'
|
|
4803
|
+
| 'callToolError'
|
|
4804
|
+
| 'listPromptsResponse'
|
|
4805
|
+
| 'listPromptsError'
|
|
4806
|
+
| 'getPromptResponse'
|
|
4807
|
+
| 'getPromptError'
|
|
4808
|
+
| 'lastError'
|
|
4809
|
+
value: any
|
|
4810
|
+
}
|
|
4811
|
+
}>
|
|
4812
|
+
}
|
|
4813
|
+
>
|
|
4814
|
+
}
|
|
4815
|
+
|
|
4310
4816
|
/* Load the model */
|
|
4311
4817
|
export type GeneratorTTSActionLoadModel = Action & {
|
|
4312
4818
|
__actionName: 'GENERATOR_TTS_LOAD_MODEL'
|
|
@@ -4484,6 +4990,11 @@ export type GeneratorOnnxLLMActionInfer = ActionWithParams & {
|
|
|
4484
4990
|
value?: Array<any> | DataLink | EventProperty
|
|
4485
4991
|
mapping?: string
|
|
4486
4992
|
}
|
|
4993
|
+
| {
|
|
4994
|
+
input: 'images'
|
|
4995
|
+
value?: Array<any> | DataLink | EventProperty
|
|
4996
|
+
mapping?: string
|
|
4997
|
+
}
|
|
4487
4998
|
>
|
|
4488
4999
|
}
|
|
4489
5000
|
|
|
@@ -4520,12 +5031,17 @@ Default property:
|
|
|
4520
5031
|
/* LLM model */
|
|
4521
5032
|
model?:
|
|
4522
5033
|
| 'Custom'
|
|
5034
|
+
| 'onnx-community/gemma-3-1b-it-ONNX'
|
|
4523
5035
|
| 'BricksDisplay/phi-1_5'
|
|
4524
5036
|
| 'BricksDisplay/phi-1_5-q4'
|
|
4525
|
-
| '
|
|
4526
|
-
| '
|
|
4527
|
-
| '
|
|
4528
|
-
| '
|
|
5037
|
+
| 'onnx-community/Phi-3.5-vision-instruct'
|
|
5038
|
+
| 'onnx-community/Phi-3-vision-128k-instruct'
|
|
5039
|
+
| 'onnx-community/Phi-4-mini-instruct-ONNX-MHA'
|
|
5040
|
+
| 'onnx-community/Qwen2.5-0.5B'
|
|
5041
|
+
| 'onnx-community/Qwen2.5-0.5B-Instruct'
|
|
5042
|
+
| 'onnx-community/Qwen2.5-1.5B'
|
|
5043
|
+
| 'onnx-community/Qwen2.5-1.5B-Instruct'
|
|
5044
|
+
| 'onnx-community/Qwen2-VL-2B-Instruct'
|
|
4529
5045
|
| 'stablelm-2-1_6b'
|
|
4530
5046
|
| 'BricksDisplay/stablelm-2-1_6b-q4'
|
|
4531
5047
|
| 'stablelm-2-zephyr-1_6b'
|
|
@@ -4598,6 +5114,12 @@ Default property:
|
|
|
4598
5114
|
Choose model from https://huggingface.co/models?pipeline_tag=text2text-generation&library=transformers.js
|
|
4599
5115
|
or https://huggingface.co/models?pipeline_tag=text-generation&library=transformers.js&sort=trending */
|
|
4600
5116
|
customModel?: string | DataLink
|
|
5117
|
+
/* Prompt to inference */
|
|
5118
|
+
prompt?: string | DataLink
|
|
5119
|
+
/* Messages to inference */
|
|
5120
|
+
messages?: Array<DataLink | {}> | DataLink
|
|
5121
|
+
/* Images with message to inference */
|
|
5122
|
+
images?: Array<string | DataLink> | DataLink
|
|
4601
5123
|
/* Max new tokens to generate */
|
|
4602
5124
|
maxNewTokens?: number | DataLink
|
|
4603
5125
|
/* Temperature */
|
|
@@ -5917,6 +6439,166 @@ export type GeneratorLLM = Generator &
|
|
|
5917
6439
|
>
|
|
5918
6440
|
}
|
|
5919
6441
|
|
|
6442
|
+
/* Load the model */
|
|
6443
|
+
export type GeneratorQnnLlmActionLoadModel = Action & {
|
|
6444
|
+
__actionName: 'GENERATOR_QNN_LLM_LOAD_MODEL'
|
|
6445
|
+
}
|
|
6446
|
+
|
|
6447
|
+
/* Abort model download */
|
|
6448
|
+
export type GeneratorQnnLlmActionAbortModelDownload = Action & {
|
|
6449
|
+
__actionName: 'GENERATOR_QNN_LLM_ABORT_MODEL_DOWNLOAD'
|
|
6450
|
+
}
|
|
6451
|
+
|
|
6452
|
+
/* Generate text */
|
|
6453
|
+
export type GeneratorQnnLlmActionGenerate = ActionWithParams & {
|
|
6454
|
+
__actionName: 'GENERATOR_QNN_LLM_GENERATE'
|
|
6455
|
+
params?: Array<
|
|
6456
|
+
| {
|
|
6457
|
+
input: 'prompt'
|
|
6458
|
+
value?: string | DataLink | EventProperty
|
|
6459
|
+
mapping?: string
|
|
6460
|
+
}
|
|
6461
|
+
| {
|
|
6462
|
+
input: 'messages'
|
|
6463
|
+
value?: Array<any> | DataLink | EventProperty
|
|
6464
|
+
mapping?: string
|
|
6465
|
+
}
|
|
6466
|
+
>
|
|
6467
|
+
}
|
|
6468
|
+
|
|
6469
|
+
/* Abort generation */
|
|
6470
|
+
export type GeneratorQnnLlmActionAbortGeneration = Action & {
|
|
6471
|
+
__actionName: 'GENERATOR_QNN_LLM_ABORT_GENERATION'
|
|
6472
|
+
}
|
|
6473
|
+
|
|
6474
|
+
/* Release context */
|
|
6475
|
+
export type GeneratorQnnLlmActionReleaseContext = Action & {
|
|
6476
|
+
__actionName: 'GENERATOR_QNN_LLM_RELEASE_CONTEXT'
|
|
6477
|
+
}
|
|
6478
|
+
|
|
6479
|
+
interface GeneratorQnnLlmDef {
|
|
6480
|
+
/*
|
|
6481
|
+
Default property:
|
|
6482
|
+
{
|
|
6483
|
+
"modelType": "Llama 3.2 3B Chat",
|
|
6484
|
+
"chatFormat": "Llama 3.x",
|
|
6485
|
+
"toolCallParser": "llama3_json",
|
|
6486
|
+
"toolChoice": "auto",
|
|
6487
|
+
"parallelToolCalls": false,
|
|
6488
|
+
"greedy": false
|
|
6489
|
+
}
|
|
6490
|
+
*/
|
|
6491
|
+
property?: {
|
|
6492
|
+
/* Load model context when generator is initialized */
|
|
6493
|
+
init?: boolean | DataLink
|
|
6494
|
+
/* Model type */
|
|
6495
|
+
modelType?:
|
|
6496
|
+
| 'Llama 3 8B Chat'
|
|
6497
|
+
| 'Llama 3.1 8B Chat'
|
|
6498
|
+
| 'Llama 3.2 3B Chat'
|
|
6499
|
+
| 'Mistral 7B Instruct v0.3'
|
|
6500
|
+
| 'Qwen 2 7B Chat'
|
|
6501
|
+
| 'Phi 3.5 Mini'
|
|
6502
|
+
| 'Granite v3.1 8B Instruct'
|
|
6503
|
+
| 'Custom'
|
|
6504
|
+
| DataLink
|
|
6505
|
+
/* SOC model */
|
|
6506
|
+
socModel?: 'X Elite' | 'X Plus' | '8 Elite' | '8 Gen 3' | 'QCS8550' | DataLink
|
|
6507
|
+
/* Custom model base URL
|
|
6508
|
+
The URL directory should contain `config.json` (model config) file, `model_part_*_of_*.bin` (model split files) files and `tokenizer.json` (tokenizer config) file. */
|
|
6509
|
+
customModelUrl?: string | DataLink
|
|
6510
|
+
/* Custom model split parts */
|
|
6511
|
+
customModelSplitParts?: number | DataLink
|
|
6512
|
+
/* Chat format */
|
|
6513
|
+
chatFormat?: 'Llama 2' | 'Llama 3' | 'Llama 3.x' | 'Mistral v0.3' | 'Qwen 2' | DataLink
|
|
6514
|
+
/* Custom chat format template */
|
|
6515
|
+
customChatFormat?: string | DataLink
|
|
6516
|
+
/* Prompt to generate */
|
|
6517
|
+
prompt?: string | DataLink
|
|
6518
|
+
/* Chat messages */
|
|
6519
|
+
messages?:
|
|
6520
|
+
| Array<
|
|
6521
|
+
| DataLink
|
|
6522
|
+
| {
|
|
6523
|
+
role?: string | DataLink
|
|
6524
|
+
content?: string | DataLink
|
|
6525
|
+
}
|
|
6526
|
+
>
|
|
6527
|
+
| DataLink
|
|
6528
|
+
/* Stop words */
|
|
6529
|
+
stopWords?: Array<string | DataLink> | DataLink
|
|
6530
|
+
/* Tool call parser */
|
|
6531
|
+
toolCallParser?: 'llama3_json' | 'mistral' | DataLink
|
|
6532
|
+
/* Tools for chat mode */
|
|
6533
|
+
tools?: {} | DataLink
|
|
6534
|
+
/* Tool choice for chat mode */
|
|
6535
|
+
toolChoice?: 'none' | 'auto' | 'required' | DataLink
|
|
6536
|
+
/* Enable parallel tool calls */
|
|
6537
|
+
parallelToolCalls?: boolean | DataLink
|
|
6538
|
+
/* Number of threads, -1 to use n-threads from model config */
|
|
6539
|
+
nThreads?: number | DataLink
|
|
6540
|
+
/* Temperature, -1 to use temperature from model config */
|
|
6541
|
+
temperature?: number | DataLink
|
|
6542
|
+
/* Seed, -1 to use seed from model config */
|
|
6543
|
+
seed?: number | DataLink
|
|
6544
|
+
/* Top K, -1 to use top-k from model config */
|
|
6545
|
+
topK?: number | DataLink
|
|
6546
|
+
/* Top P, -1 to use top-p from model config */
|
|
6547
|
+
topP?: number | DataLink
|
|
6548
|
+
/* Greedy, use greedy sampling */
|
|
6549
|
+
greedy?: boolean | DataLink
|
|
6550
|
+
}
|
|
6551
|
+
events?: {
|
|
6552
|
+
/* Event triggered when load is done */
|
|
6553
|
+
onContextStateChange?: Array<EventAction>
|
|
6554
|
+
/* Event triggered when generate is done */
|
|
6555
|
+
onGenerate?: Array<EventAction>
|
|
6556
|
+
/* Event triggered on get function call request */
|
|
6557
|
+
onFunctionCall?: Array<EventAction>
|
|
6558
|
+
/* Event triggered when error occurs */
|
|
6559
|
+
onError?: Array<EventAction>
|
|
6560
|
+
}
|
|
6561
|
+
outlets?: {
|
|
6562
|
+
/* Context state */
|
|
6563
|
+
contextState?: () => Data
|
|
6564
|
+
/* Generation result */
|
|
6565
|
+
result?: () => Data
|
|
6566
|
+
/* Full context (Prompt + Generation Result) */
|
|
6567
|
+
fullContext?: () => Data
|
|
6568
|
+
/* Last function call details */
|
|
6569
|
+
lastFunctionCall?: () => Data
|
|
6570
|
+
/* Completion details */
|
|
6571
|
+
completionDetails?: () => Data
|
|
6572
|
+
}
|
|
6573
|
+
}
|
|
6574
|
+
|
|
6575
|
+
/* Local LLM inference using Qualcomm AI Engine */
|
|
6576
|
+
export type GeneratorQnnLlm = Generator &
|
|
6577
|
+
GeneratorQnnLlmDef & {
|
|
6578
|
+
templateKey: 'GENERATOR_QNN_LLM'
|
|
6579
|
+
switches: Array<
|
|
6580
|
+
SwitchDef &
|
|
6581
|
+
GeneratorQnnLlmDef & {
|
|
6582
|
+
conds?: Array<{
|
|
6583
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
6584
|
+
cond:
|
|
6585
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
6586
|
+
| SwitchCondData
|
|
6587
|
+
| {
|
|
6588
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
6589
|
+
outlet:
|
|
6590
|
+
| 'contextState'
|
|
6591
|
+
| 'result'
|
|
6592
|
+
| 'fullContext'
|
|
6593
|
+
| 'lastFunctionCall'
|
|
6594
|
+
| 'completionDetails'
|
|
6595
|
+
value: any
|
|
6596
|
+
}
|
|
6597
|
+
}>
|
|
6598
|
+
}
|
|
6599
|
+
>
|
|
6600
|
+
}
|
|
6601
|
+
|
|
5920
6602
|
/* Run text completion */
|
|
5921
6603
|
export type GeneratorOpenAILLMActionCompletion = ActionWithParams & {
|
|
5922
6604
|
__actionName: 'GENERATOR_OPENAI_LLM_COMPLETION'
|
|
@@ -6106,6 +6788,104 @@ export type GeneratorOpenAILLM = Generator &
|
|
|
6106
6788
|
>
|
|
6107
6789
|
}
|
|
6108
6790
|
|
|
6791
|
+
/* Generate audio */
|
|
6792
|
+
export type GeneratorOpenAiTTSActionGenerate = ActionWithParams & {
|
|
6793
|
+
__actionName: 'GENERATOR_OPENAI_TTS_GENERATE'
|
|
6794
|
+
params?: Array<{
|
|
6795
|
+
input: 'text'
|
|
6796
|
+
value?: string | DataLink | EventProperty
|
|
6797
|
+
mapping?: string
|
|
6798
|
+
}>
|
|
6799
|
+
}
|
|
6800
|
+
|
|
6801
|
+
/* Clean cache */
|
|
6802
|
+
export type GeneratorOpenAiTTSActionCleanCache = Action & {
|
|
6803
|
+
__actionName: 'GENERATOR_OPENAI_TTS_CLEAN_CACHE'
|
|
6804
|
+
}
|
|
6805
|
+
|
|
6806
|
+
interface GeneratorOpenAiTTSDef {
|
|
6807
|
+
/*
|
|
6808
|
+
Default property:
|
|
6809
|
+
{
|
|
6810
|
+
"apiEndpoint": "https://api.openai.com/v1",
|
|
6811
|
+
"model": "tts-1",
|
|
6812
|
+
"voice": "alloy",
|
|
6813
|
+
"speed": 1,
|
|
6814
|
+
"outputType": "play",
|
|
6815
|
+
"playbackVolume": 100,
|
|
6816
|
+
"cacheGenerated": true,
|
|
6817
|
+
"autoInferEnable": false,
|
|
6818
|
+
"softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
|
|
6819
|
+
"hardBreakTime": 500
|
|
6820
|
+
}
|
|
6821
|
+
*/
|
|
6822
|
+
property?: {
|
|
6823
|
+
/* API endpoint URL */
|
|
6824
|
+
apiEndpoint?: string | DataLink
|
|
6825
|
+
/* OpenAI API Key */
|
|
6826
|
+
apiKey?: string | DataLink
|
|
6827
|
+
/* OpenAI TTS model */
|
|
6828
|
+
model?: string | DataLink
|
|
6829
|
+
/* Voice to use
|
|
6830
|
+
Select voice from https://openai.fm , default alloy */
|
|
6831
|
+
voice?: string | DataLink
|
|
6832
|
+
/* Additional instructions for the speech generation */
|
|
6833
|
+
instructions?: string | DataLink
|
|
6834
|
+
/* Speed of the generated audio */
|
|
6835
|
+
speed?: number | DataLink
|
|
6836
|
+
/* Output mode */
|
|
6837
|
+
outputType?: 'play' | 'file' | DataLink
|
|
6838
|
+
/* Playback volume (0 - 100) */
|
|
6839
|
+
playbackVolume?: number | DataLink
|
|
6840
|
+
/* Enable cache for generated audio */
|
|
6841
|
+
cacheGenerated?: boolean | DataLink
|
|
6842
|
+
/* Text to generate */
|
|
6843
|
+
prompt?: string | DataLink
|
|
6844
|
+
/* Auto inference when prompt changes */
|
|
6845
|
+
autoInferEnable?: boolean | DataLink
|
|
6846
|
+
/* Segmentation rule for auto inference */
|
|
6847
|
+
softBreakRegex?: string | DataLink
|
|
6848
|
+
/* Time to force inference when softBreakRegex is not satisfied */
|
|
6849
|
+
hardBreakTime?: number | DataLink
|
|
6850
|
+
}
|
|
6851
|
+
events?: {
|
|
6852
|
+
/* Event triggered when state change */
|
|
6853
|
+
onContextStateChange?: Array<EventAction>
|
|
6854
|
+
/* Event triggered when error occurs */
|
|
6855
|
+
onError?: Array<EventAction>
|
|
6856
|
+
}
|
|
6857
|
+
outlets?: {
|
|
6858
|
+
/* Context state */
|
|
6859
|
+
contextState?: () => Data
|
|
6860
|
+
/* Generated audio file */
|
|
6861
|
+
generatedAudio?: () => Data
|
|
6862
|
+
/* Generated audio file is playing */
|
|
6863
|
+
generatedAudioPlaying?: () => Data
|
|
6864
|
+
}
|
|
6865
|
+
}
|
|
6866
|
+
|
|
6867
|
+
/* Generate speech from text using OpenAI's Text-to-Speech API */
|
|
6868
|
+
export type GeneratorOpenAiTTS = Generator &
|
|
6869
|
+
GeneratorOpenAiTTSDef & {
|
|
6870
|
+
templateKey: 'GENERATOR_OPENAI_TTS'
|
|
6871
|
+
switches: Array<
|
|
6872
|
+
SwitchDef &
|
|
6873
|
+
GeneratorOpenAiTTSDef & {
|
|
6874
|
+
conds?: Array<{
|
|
6875
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
6876
|
+
cond:
|
|
6877
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
6878
|
+
| SwitchCondData
|
|
6879
|
+
| {
|
|
6880
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
6881
|
+
outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
|
|
6882
|
+
value: any
|
|
6883
|
+
}
|
|
6884
|
+
}>
|
|
6885
|
+
}
|
|
6886
|
+
>
|
|
6887
|
+
}
|
|
6888
|
+
|
|
6109
6889
|
/* Add a message to the assistant */
|
|
6110
6890
|
export type GeneratorAssistantActionAddMessage = ActionWithParams & {
|
|
6111
6891
|
__actionName: 'GENERATOR_ASSISTANT_ADD_MESSAGE'
|
|
@@ -6163,6 +6943,55 @@ export type GeneratorAssistantActionAddMessage = ActionWithParams & {
|
|
|
6163
6943
|
>
|
|
6164
6944
|
}
|
|
6165
6945
|
|
|
6946
|
+
/* Initialize messages from MCP prompt */
|
|
6947
|
+
export type GeneratorAssistantActionInitMcpPrompt = ActionWithParams & {
|
|
6948
|
+
__actionName: 'GENERATOR_ASSISTANT_INIT_MCP_PROMPT'
|
|
6949
|
+
params?: Array<
|
|
6950
|
+
| {
|
|
6951
|
+
input: 'mcpClientName'
|
|
6952
|
+
value?: string | DataLink | EventProperty
|
|
6953
|
+
mapping?: string
|
|
6954
|
+
}
|
|
6955
|
+
| {
|
|
6956
|
+
input: 'mcpPromptName'
|
|
6957
|
+
value?: string | DataLink | EventProperty
|
|
6958
|
+
mapping?: string
|
|
6959
|
+
}
|
|
6960
|
+
| {
|
|
6961
|
+
input: 'mcpArguments'
|
|
6962
|
+
value?: {} | DataLink | EventProperty
|
|
6963
|
+
mapping?: string
|
|
6964
|
+
}
|
|
6965
|
+
| {
|
|
6966
|
+
input: 'firstMessageAsSystem'
|
|
6967
|
+
value?: boolean | DataLink | EventProperty
|
|
6968
|
+
mapping?: string
|
|
6969
|
+
}
|
|
6970
|
+
>
|
|
6971
|
+
}
|
|
6972
|
+
|
|
6973
|
+
/* Add messages from MCP prompt */
|
|
6974
|
+
export type GeneratorAssistantActionAddMcpPromptMessage = ActionWithParams & {
|
|
6975
|
+
__actionName: 'GENERATOR_ASSISTANT_ADD_MCP_PROMPT_MESSAGE'
|
|
6976
|
+
params?: Array<
|
|
6977
|
+
| {
|
|
6978
|
+
input: 'mcpClientName'
|
|
6979
|
+
value?: string | DataLink | EventProperty
|
|
6980
|
+
mapping?: string
|
|
6981
|
+
}
|
|
6982
|
+
| {
|
|
6983
|
+
input: 'mcpPromptName'
|
|
6984
|
+
value?: string | DataLink | EventProperty
|
|
6985
|
+
mapping?: string
|
|
6986
|
+
}
|
|
6987
|
+
| {
|
|
6988
|
+
input: 'mcpArguments'
|
|
6989
|
+
value?: {} | DataLink | EventProperty
|
|
6990
|
+
mapping?: string
|
|
6991
|
+
}
|
|
6992
|
+
>
|
|
6993
|
+
}
|
|
6994
|
+
|
|
6166
6995
|
/* Update a message at a specific index */
|
|
6167
6996
|
export type GeneratorAssistantActionUpdateMessageAtIndex = ActionWithParams & {
|
|
6168
6997
|
__actionName: 'GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX'
|
|
@@ -6332,8 +7161,25 @@ export type GeneratorAssistantActionReset = Action & {
|
|
|
6332
7161
|
}
|
|
6333
7162
|
|
|
6334
7163
|
/* Submit the assistant */
|
|
6335
|
-
export type GeneratorAssistantActionSubmit =
|
|
7164
|
+
export type GeneratorAssistantActionSubmit = ActionWithParams & {
|
|
6336
7165
|
__actionName: 'GENERATOR_ASSISTANT_SUBMIT'
|
|
7166
|
+
params?: Array<
|
|
7167
|
+
| {
|
|
7168
|
+
input: 'continueOnToolCallConfirm'
|
|
7169
|
+
value?: boolean | DataLink | EventProperty
|
|
7170
|
+
mapping?: string
|
|
7171
|
+
}
|
|
7172
|
+
| {
|
|
7173
|
+
input: 'continueOnToolCallStrategy'
|
|
7174
|
+
value?: 'never' | 'success' | 'always' | DataLink | EventProperty
|
|
7175
|
+
mapping?: string
|
|
7176
|
+
}
|
|
7177
|
+
| {
|
|
7178
|
+
input: 'continueOnToolCallLimit'
|
|
7179
|
+
value?: number | DataLink | EventProperty
|
|
7180
|
+
mapping?: string
|
|
7181
|
+
}
|
|
7182
|
+
>
|
|
6337
7183
|
}
|
|
6338
7184
|
|
|
6339
7185
|
/* Cancel the assistant responding */
|
|
@@ -6341,6 +7187,38 @@ export type GeneratorAssistantActionCancel = Action & {
|
|
|
6341
7187
|
__actionName: 'GENERATOR_ASSISTANT_CANCEL'
|
|
6342
7188
|
}
|
|
6343
7189
|
|
|
7190
|
+
/* Check the enabled MCP clients connection status and available tools */
|
|
7191
|
+
export type GeneratorAssistantActionCheckMcpServers = Action & {
|
|
7192
|
+
__actionName: 'GENERATOR_ASSISTANT_CHECK_MCP_SERVERS'
|
|
7193
|
+
}
|
|
7194
|
+
|
|
7195
|
+
/* Insert an MCP resource as a new assistant message */
|
|
7196
|
+
export type GeneratorAssistantActionInsertMcpResource = ActionWithParams & {
|
|
7197
|
+
__actionName: 'GENERATOR_ASSISTANT_INSERT_MCP_RESOURCE'
|
|
7198
|
+
params?: Array<
|
|
7199
|
+
| {
|
|
7200
|
+
input: 'mcpClientName'
|
|
7201
|
+
value?: string | DataLink | EventProperty
|
|
7202
|
+
mapping?: string
|
|
7203
|
+
}
|
|
7204
|
+
| {
|
|
7205
|
+
input: 'mcpResourceUri'
|
|
7206
|
+
value?: string | DataLink | EventProperty
|
|
7207
|
+
mapping?: string
|
|
7208
|
+
}
|
|
7209
|
+
| {
|
|
7210
|
+
input: 'mcpVariables'
|
|
7211
|
+
value?: {} | DataLink | EventProperty
|
|
7212
|
+
mapping?: string
|
|
7213
|
+
}
|
|
7214
|
+
| {
|
|
7215
|
+
input: 'role'
|
|
7216
|
+
value?: string | DataLink | EventProperty
|
|
7217
|
+
mapping?: string
|
|
7218
|
+
}
|
|
7219
|
+
>
|
|
7220
|
+
}
|
|
7221
|
+
|
|
6344
7222
|
interface GeneratorAssistantDef {
|
|
6345
7223
|
/*
|
|
6346
7224
|
Default property:
|
|
@@ -6404,6 +7282,17 @@ Default property:
|
|
|
6404
7282
|
ttsEnabled?: boolean | DataLink
|
|
6405
7283
|
/* TTS Live Policy. If the policy is `only-in-use`, the TTS context will be released when the assistant is not in use. */
|
|
6406
7284
|
ttsLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
7285
|
+
/* MCP Generators (Add a unique name if generator name property are duplicate) */
|
|
7286
|
+
mcpGenerators?:
|
|
7287
|
+
| Array<
|
|
7288
|
+
| DataLink
|
|
7289
|
+
| {
|
|
7290
|
+
generatorId?: string | DataLink
|
|
7291
|
+
name?: string | DataLink
|
|
7292
|
+
enabled?: boolean | DataLink
|
|
7293
|
+
}
|
|
7294
|
+
>
|
|
7295
|
+
| DataLink
|
|
6407
7296
|
}
|
|
6408
7297
|
events?: {
|
|
6409
7298
|
/* Error event */
|
|
@@ -6426,6 +7315,8 @@ Default property:
|
|
|
6426
7315
|
files?: () => Data
|
|
6427
7316
|
/* Messages of the assistant */
|
|
6428
7317
|
messages?: () => Data
|
|
7318
|
+
/* MCP servers status and available tools */
|
|
7319
|
+
mcpServers?: () => Data
|
|
6429
7320
|
}
|
|
6430
7321
|
}
|
|
6431
7322
|
|
|
@@ -6450,6 +7341,7 @@ export type GeneratorAssistant = Generator &
|
|
|
6450
7341
|
| 'isBusy'
|
|
6451
7342
|
| 'files'
|
|
6452
7343
|
| 'messages'
|
|
7344
|
+
| 'mcpServers'
|
|
6453
7345
|
value: any
|
|
6454
7346
|
}
|
|
6455
7347
|
}>
|
package/utils/event-props.ts
CHANGED
|
@@ -630,6 +630,103 @@ 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_ID', // type: string
|
|
648
|
+
'GENERATOR_MCP_SERVER_REQUEST_NAME', // type: string
|
|
649
|
+
'GENERATOR_MCP_SERVER_REQUEST_URI', // type: string
|
|
650
|
+
'GENERATOR_MCP_SERVER_REQUEST_VARIABLES', // type: object
|
|
651
|
+
'GENERATOR_MCP_SERVER_REQUEST_TIMEOUT', // type: number
|
|
652
|
+
'GENERATOR_MCP_SERVER_REQUEST', // type: object
|
|
653
|
+
],
|
|
654
|
+
onCallTool: [
|
|
655
|
+
'GENERATOR_MCP_SERVER_REQUEST_ID', // type: string
|
|
656
|
+
'GENERATOR_MCP_SERVER_REQUEST_NAME', // type: string
|
|
657
|
+
'GENERATOR_MCP_SERVER_REQUEST_VARIABLES', // type: object
|
|
658
|
+
'GENERATOR_MCP_SERVER_REQUEST_TIMEOUT', // type: number
|
|
659
|
+
'GENERATOR_MCP_SERVER_REQUEST', // type: object
|
|
660
|
+
],
|
|
661
|
+
onGetPrompt: [
|
|
662
|
+
'GENERATOR_MCP_SERVER_REQUEST_ID', // type: string
|
|
663
|
+
'GENERATOR_MCP_SERVER_REQUEST_NAME', // type: string
|
|
664
|
+
'GENERATOR_MCP_SERVER_REQUEST_VARIABLES', // type: object
|
|
665
|
+
'GENERATOR_MCP_SERVER_REQUEST_TIMEOUT', // type: number
|
|
666
|
+
'GENERATOR_MCP_SERVER_REQUEST', // type: object
|
|
667
|
+
],
|
|
668
|
+
},
|
|
669
|
+
GENERATOR_MCP: {
|
|
670
|
+
onConnectionError: [
|
|
671
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
672
|
+
],
|
|
673
|
+
onListResources: [
|
|
674
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
675
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
676
|
+
],
|
|
677
|
+
onListResourcesError: [
|
|
678
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
679
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
680
|
+
],
|
|
681
|
+
onListResourceTemplates: [
|
|
682
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
683
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
684
|
+
],
|
|
685
|
+
onListResourceTemplatesError: [
|
|
686
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
687
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
688
|
+
],
|
|
689
|
+
onReadResource: [
|
|
690
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
691
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
692
|
+
],
|
|
693
|
+
onReadResourceError: [
|
|
694
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
695
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
696
|
+
],
|
|
697
|
+
onListTools: [
|
|
698
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
699
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
700
|
+
],
|
|
701
|
+
onListToolsError: [
|
|
702
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
703
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
704
|
+
],
|
|
705
|
+
onCallTool: [
|
|
706
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
707
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
708
|
+
],
|
|
709
|
+
onCallToolError: [
|
|
710
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
711
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
712
|
+
],
|
|
713
|
+
onListPrompts: [
|
|
714
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
715
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
716
|
+
],
|
|
717
|
+
onListPromptsError: [
|
|
718
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
719
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
720
|
+
],
|
|
721
|
+
onGetPrompt: [
|
|
722
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
723
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
724
|
+
],
|
|
725
|
+
onGetPromptError: [
|
|
726
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
727
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
728
|
+
],
|
|
729
|
+
},
|
|
633
730
|
GENERATOR_TTS: {
|
|
634
731
|
onContextStateChange: [
|
|
635
732
|
'GENERATOR_TTS_CONTEXT_STATE', // type: string
|
|
@@ -697,6 +794,23 @@ export const templateEventPropsMap = {
|
|
|
697
794
|
'GENERATOR_LLM_COMPLETION_FUNCTION_DETAILS', // type: object
|
|
698
795
|
],
|
|
699
796
|
},
|
|
797
|
+
GENERATOR_QNN_LLM: {
|
|
798
|
+
onContextStateChange: [
|
|
799
|
+
'GENERATOR_QNN_LLM_CONTEXT_STATE', // type: string
|
|
800
|
+
],
|
|
801
|
+
onGenerate: [
|
|
802
|
+
'GENERATOR_QNN_LLM_RESULT', // type: string
|
|
803
|
+
'GENERATOR_QNN_LLM_FULL_CONTEXT', // type: string
|
|
804
|
+
],
|
|
805
|
+
onFunctionCall: [
|
|
806
|
+
'GENERATOR_QNN_LLM_FUNCTION_CALL_NAME', // type: string
|
|
807
|
+
'GENERATOR_QNN_LLM_FUNCTION_CALL_ARGUMENTS', // type: object
|
|
808
|
+
'GENERATOR_QNN_LLM_FUNCTION_CALL_DETAILS', // type: object
|
|
809
|
+
],
|
|
810
|
+
onError: [
|
|
811
|
+
'GENERATOR_QNN_LLM_ERROR', // type: string
|
|
812
|
+
],
|
|
813
|
+
},
|
|
700
814
|
GENERATOR_OPENAI_LLM: {
|
|
701
815
|
onError: [
|
|
702
816
|
'GENERATOR_OPENAI_LLM_ERROR', // type: string
|
|
@@ -714,6 +828,14 @@ export const templateEventPropsMap = {
|
|
|
714
828
|
'GENERATOR_OPENAI_LLM_COMPLETION_FUNCTION_ARGUMENTS', // type: string
|
|
715
829
|
],
|
|
716
830
|
},
|
|
831
|
+
GENERATOR_OPENAI_TTS: {
|
|
832
|
+
onContextStateChange: [
|
|
833
|
+
'GENERATOR_OPENAI_TTS_CONTEXT_STATE', // type: string
|
|
834
|
+
],
|
|
835
|
+
onError: [
|
|
836
|
+
'GENERATOR_OPENAI_TTS_ERROR', // type: string
|
|
837
|
+
],
|
|
838
|
+
},
|
|
717
839
|
GENERATOR_ASSISTANT: {
|
|
718
840
|
onError: [
|
|
719
841
|
'GENERATOR_ASSISTANT_ERROR', // type: string
|