@fugood/bricks-project 2.21.2 → 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 +20 -0
- package/package.json +1 -1
- package/tools/postinstall.ts +1 -2
- package/types/generators.ts +174 -5
- package/utils/event-props.ts +32 -0
|
@@ -533,6 +533,14 @@ export const templateActionNameMap = {
|
|
|
533
533
|
name: 'GENERATOR_MCP_NAME',
|
|
534
534
|
variables: 'GENERATOR_MCP_VARIABLES',
|
|
535
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
|
+
},
|
|
536
544
|
},
|
|
537
545
|
GENERATOR_TTS: {
|
|
538
546
|
GENERATOR_TTS_GENERATE: {
|
|
@@ -543,6 +551,7 @@ export const templateActionNameMap = {
|
|
|
543
551
|
GENERATOR_ONNX_LLM_INFER: {
|
|
544
552
|
prompt: 'GENERATOR_ONNX_LLM_PROMPT',
|
|
545
553
|
chat: 'GENERATOR_ONNX_LLM_CHAT',
|
|
554
|
+
images: 'GENERATOR_ONNX_LLM_IMAGES',
|
|
546
555
|
},
|
|
547
556
|
},
|
|
548
557
|
GENERATOR_ONNX_STT: {
|
|
@@ -676,6 +685,17 @@ export const templateActionNameMap = {
|
|
|
676
685
|
fileSearchCitationCount: 'GENERATOR_ASSISTANT_FILE_SEARCH_CITATION_COUNT',
|
|
677
686
|
fileSearchInsertMethod: 'GENERATOR_ASSISTANT_FILE_SEARCH_INSERT_METHOD',
|
|
678
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
|
+
},
|
|
679
699
|
GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX: {
|
|
680
700
|
index: 'GENERATOR_ASSISTANT_INDEX',
|
|
681
701
|
content: 'GENERATOR_ASSISTANT_CONTENT',
|
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/generators.ts
CHANGED
|
@@ -4327,7 +4327,8 @@ Default property:
|
|
|
4327
4327
|
"name": "bricks-foundation-mcp-server-default",
|
|
4328
4328
|
"version": "1.0.0",
|
|
4329
4329
|
"resources": [],
|
|
4330
|
-
"tools": []
|
|
4330
|
+
"tools": [],
|
|
4331
|
+
"prompts": []
|
|
4331
4332
|
}
|
|
4332
4333
|
*/
|
|
4333
4334
|
property?: {
|
|
@@ -4429,6 +4430,49 @@ Default property:
|
|
|
4429
4430
|
}
|
|
4430
4431
|
>
|
|
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
|
|
4432
4476
|
}
|
|
4433
4477
|
events?: {
|
|
4434
4478
|
/* Listening of HTTP server */
|
|
@@ -4443,6 +4487,8 @@ Default property:
|
|
|
4443
4487
|
onRequestResource?: Array<EventAction>
|
|
4444
4488
|
/* On call tool (Request: { name: string, params: object }) */
|
|
4445
4489
|
onCallTool?: Array<EventAction>
|
|
4490
|
+
/* On get prompt (Request: { name: string, arguments: object }) */
|
|
4491
|
+
onGetPrompt?: Array<EventAction>
|
|
4446
4492
|
}
|
|
4447
4493
|
outlets?: {
|
|
4448
4494
|
/* Whether the HTTP server is listening */
|
|
@@ -4455,6 +4501,8 @@ Default property:
|
|
|
4455
4501
|
lastResourceRequest?: () => Data
|
|
4456
4502
|
/* Last tool call ({ name: string, params: object }) */
|
|
4457
4503
|
lastToolCall?: () => Data
|
|
4504
|
+
/* Last prompt get ({ name: string, arguments: object }) */
|
|
4505
|
+
lastPromptGet?: () => Data
|
|
4458
4506
|
}
|
|
4459
4507
|
}
|
|
4460
4508
|
|
|
@@ -4478,6 +4526,7 @@ export type GeneratorMCPServer = Generator &
|
|
|
4478
4526
|
| 'connectedRemotes'
|
|
4479
4527
|
| 'lastResourceRequest'
|
|
4480
4528
|
| 'lastToolCall'
|
|
4529
|
+
| 'lastPromptGet'
|
|
4481
4530
|
value: any
|
|
4482
4531
|
}
|
|
4483
4532
|
}>
|
|
@@ -4569,6 +4618,38 @@ export type GeneratorMCPActionCallTool = ActionWithParams & {
|
|
|
4569
4618
|
>
|
|
4570
4619
|
}
|
|
4571
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
|
+
|
|
4572
4653
|
interface GeneratorMCPDef {
|
|
4573
4654
|
/*
|
|
4574
4655
|
Default property:
|
|
@@ -4584,6 +4665,7 @@ Default property:
|
|
|
4584
4665
|
"version": "1.0.0",
|
|
4585
4666
|
"ignoreResourceInList": [],
|
|
4586
4667
|
"ignoreToolInList": [],
|
|
4668
|
+
"ignorePromptInList": [],
|
|
4587
4669
|
"requestTimeout": 60000
|
|
4588
4670
|
}
|
|
4589
4671
|
*/
|
|
@@ -4616,6 +4698,8 @@ Default property:
|
|
|
4616
4698
|
ignoreResourceInList?: Array<string | DataLink> | DataLink
|
|
4617
4699
|
/* Ignore tools in list response */
|
|
4618
4700
|
ignoreToolInList?: Array<string | DataLink> | DataLink
|
|
4701
|
+
/* Ignore prompts in list response */
|
|
4702
|
+
ignorePromptInList?: Array<string | DataLink> | DataLink
|
|
4619
4703
|
/* Request timeout in milliseconds */
|
|
4620
4704
|
requestTimeout?: number | DataLink
|
|
4621
4705
|
}
|
|
@@ -4646,6 +4730,14 @@ Default property:
|
|
|
4646
4730
|
onCallTool?: Array<EventAction>
|
|
4647
4731
|
/* On call tool error */
|
|
4648
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>
|
|
4649
4741
|
}
|
|
4650
4742
|
outlets?: {
|
|
4651
4743
|
/* Connection state */
|
|
@@ -4670,6 +4762,14 @@ Default property:
|
|
|
4670
4762
|
callToolResponse?: () => Data
|
|
4671
4763
|
/* Call tool error */
|
|
4672
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
|
|
4673
4773
|
/* Last error */
|
|
4674
4774
|
lastError?: () => Data
|
|
4675
4775
|
}
|
|
@@ -4701,6 +4801,10 @@ export type GeneratorMCP = Generator &
|
|
|
4701
4801
|
| 'listToolsError'
|
|
4702
4802
|
| 'callToolResponse'
|
|
4703
4803
|
| 'callToolError'
|
|
4804
|
+
| 'listPromptsResponse'
|
|
4805
|
+
| 'listPromptsError'
|
|
4806
|
+
| 'getPromptResponse'
|
|
4807
|
+
| 'getPromptError'
|
|
4704
4808
|
| 'lastError'
|
|
4705
4809
|
value: any
|
|
4706
4810
|
}
|
|
@@ -4886,6 +4990,11 @@ export type GeneratorOnnxLLMActionInfer = ActionWithParams & {
|
|
|
4886
4990
|
value?: Array<any> | DataLink | EventProperty
|
|
4887
4991
|
mapping?: string
|
|
4888
4992
|
}
|
|
4993
|
+
| {
|
|
4994
|
+
input: 'images'
|
|
4995
|
+
value?: Array<any> | DataLink | EventProperty
|
|
4996
|
+
mapping?: string
|
|
4997
|
+
}
|
|
4889
4998
|
>
|
|
4890
4999
|
}
|
|
4891
5000
|
|
|
@@ -4922,12 +5031,17 @@ Default property:
|
|
|
4922
5031
|
/* LLM model */
|
|
4923
5032
|
model?:
|
|
4924
5033
|
| 'Custom'
|
|
5034
|
+
| 'onnx-community/gemma-3-1b-it-ONNX'
|
|
4925
5035
|
| 'BricksDisplay/phi-1_5'
|
|
4926
5036
|
| 'BricksDisplay/phi-1_5-q4'
|
|
4927
|
-
| '
|
|
4928
|
-
| '
|
|
4929
|
-
| '
|
|
4930
|
-
| '
|
|
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'
|
|
4931
5045
|
| 'stablelm-2-1_6b'
|
|
4932
5046
|
| 'BricksDisplay/stablelm-2-1_6b-q4'
|
|
4933
5047
|
| 'stablelm-2-zephyr-1_6b'
|
|
@@ -5000,6 +5114,12 @@ Default property:
|
|
|
5000
5114
|
Choose model from https://huggingface.co/models?pipeline_tag=text2text-generation&library=transformers.js
|
|
5001
5115
|
or https://huggingface.co/models?pipeline_tag=text-generation&library=transformers.js&sort=trending */
|
|
5002
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
|
|
5003
5123
|
/* Max new tokens to generate */
|
|
5004
5124
|
maxNewTokens?: number | DataLink
|
|
5005
5125
|
/* Temperature */
|
|
@@ -6823,6 +6943,55 @@ export type GeneratorAssistantActionAddMessage = ActionWithParams & {
|
|
|
6823
6943
|
>
|
|
6824
6944
|
}
|
|
6825
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
|
+
|
|
6826
6995
|
/* Update a message at a specific index */
|
|
6827
6996
|
export type GeneratorAssistantActionUpdateMessageAtIndex = ActionWithParams & {
|
|
6828
6997
|
__actionName: 'GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX'
|
package/utils/event-props.ts
CHANGED
|
@@ -644,9 +644,25 @@ export const templateEventPropsMap = {
|
|
|
644
644
|
'GENERATOR_MCP_SERVER_SESSION_ID', // type: string
|
|
645
645
|
],
|
|
646
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
|
|
647
652
|
'GENERATOR_MCP_SERVER_REQUEST', // type: object
|
|
648
653
|
],
|
|
649
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
|
|
650
666
|
'GENERATOR_MCP_SERVER_REQUEST', // type: object
|
|
651
667
|
],
|
|
652
668
|
},
|
|
@@ -694,6 +710,22 @@ export const templateEventPropsMap = {
|
|
|
694
710
|
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
695
711
|
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
696
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
|
+
],
|
|
697
729
|
},
|
|
698
730
|
GENERATOR_TTS: {
|
|
699
731
|
onContextStateChange: [
|