@fugood/bricks-project 2.24.0-beta.9 → 2.24.0
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 +38 -0
- package/compile/index.ts +460 -158
- package/compile/util.ts +2 -0
- package/package.json +7 -3
- package/package.json.bak +27 -0
- package/skills/{bricks-project → bricks-ctor}/SKILL.md +2 -2
- package/skills/{bricks-project → bricks-ctor}/rules/animation.md +1 -1
- package/skills/{bricks-project → bricks-ctor}/rules/architecture-patterns.md +7 -0
- package/skills/{bricks-project → bricks-ctor}/rules/buttress.md +10 -7
- package/skills/{bricks-project → bricks-ctor}/rules/data-calculation.md +1 -1
- package/skills/{bricks-project → bricks-ctor}/rules/local-sync.md +2 -2
- package/skills/{bricks-project → bricks-ctor}/rules/media-flow.md +3 -3
- package/skills/{bricks-project → bricks-ctor}/rules/remote-data-bank.md +6 -6
- package/skills/{bricks-project → bricks-ctor}/rules/standby-transition.md +1 -1
- package/skills/bricks-design/LICENSE.txt +180 -0
- package/skills/bricks-design/SKILL.md +66 -0
- package/tools/deploy.ts +66 -12
- package/tools/icons/fa6pro-meta.json +3669 -26125
- package/tools/mcp-server.ts +11 -878
- package/tools/mcp-tools/compile.ts +91 -0
- package/tools/mcp-tools/huggingface.ts +762 -0
- package/tools/mcp-tools/icons.ts +70 -0
- package/tools/mcp-tools/lottie.ts +102 -0
- package/tools/mcp-tools/media.ts +110 -0
- package/tools/postinstall.ts +137 -40
- package/tools/preview-main.mjs +135 -2
- package/tools/preview.ts +41 -2
- package/tools/pull.ts +37 -19
- package/tsconfig.json +16 -0
- package/types/animation.ts +4 -0
- package/types/automation.ts +4 -1
- package/types/brick-base.ts +1 -1
- package/types/bricks/Camera.ts +47 -12
- package/types/bricks/Chart.ts +9 -3
- package/types/bricks/GenerativeMedia.ts +29 -13
- package/types/bricks/Icon.ts +8 -4
- package/types/bricks/Image.ts +9 -5
- package/types/bricks/Items.ts +28 -14
- package/types/bricks/Lottie.ts +14 -6
- package/types/bricks/Maps.ts +15 -7
- package/types/bricks/QrCode.ts +8 -4
- package/types/bricks/Rect.ts +44 -5
- package/types/bricks/RichText.ts +8 -4
- package/types/bricks/Rive.ts +20 -10
- package/types/bricks/Slideshow.ts +19 -9
- package/types/bricks/Svg.ts +7 -3
- package/types/bricks/Text.ts +8 -4
- package/types/bricks/TextInput.ts +22 -12
- package/types/bricks/Video.ts +10 -6
- package/types/bricks/VideoStreaming.ts +7 -3
- package/types/bricks/WebRtcStream.ts +6 -2
- package/types/bricks/WebView.ts +11 -7
- package/types/canvas.ts +2 -0
- package/types/common.ts +15 -8
- package/types/data-calc-command.ts +2 -0
- package/types/data-calc.ts +1 -0
- package/types/data.ts +2 -0
- package/types/generators/AlarmClock.ts +16 -10
- package/types/generators/Assistant.ts +68 -17
- package/types/generators/BleCentral.ts +30 -10
- package/types/generators/BlePeripheral.ts +10 -6
- package/types/generators/CanvasMap.ts +9 -5
- package/types/generators/CastlesPay.ts +14 -6
- package/types/generators/DataBank.ts +43 -8
- package/types/generators/File.ts +108 -29
- package/types/generators/GraphQl.ts +11 -5
- package/types/generators/Http.ts +32 -9
- package/types/generators/HttpServer.ts +22 -14
- package/types/generators/Information.ts +8 -4
- package/types/generators/Intent.ts +14 -4
- package/types/generators/Iterator.ts +14 -10
- package/types/generators/Keyboard.ts +26 -12
- package/types/generators/LlmAnthropicCompat.ts +32 -10
- package/types/generators/LlmAppleBuiltin.ts +24 -9
- package/types/generators/LlmGgml.ts +139 -30
- package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
- package/types/generators/LlmMlx.ts +227 -0
- package/types/generators/LlmOnnx.ts +33 -13
- package/types/generators/LlmOpenAiCompat.ts +46 -10
- package/types/generators/LlmQualcommAiEngine.ts +44 -12
- package/types/generators/Mcp.ts +374 -33
- package/types/generators/McpServer.ts +57 -18
- package/types/generators/MediaFlow.ts +37 -11
- package/types/generators/MqttBroker.ts +28 -10
- package/types/generators/MqttClient.ts +18 -8
- package/types/generators/Question.ts +12 -8
- package/types/generators/RealtimeTranscription.ts +107 -18
- package/types/generators/RerankerGgml.ts +42 -11
- package/types/generators/SerialPort.ts +17 -9
- package/types/generators/SoundPlayer.ts +9 -3
- package/types/generators/SoundRecorder.ts +23 -8
- package/types/generators/SpeechToTextGgml.ts +51 -17
- package/types/generators/SpeechToTextOnnx.ts +17 -10
- package/types/generators/SpeechToTextPlatform.ts +14 -6
- package/types/generators/SqLite.ts +19 -9
- package/types/generators/Step.ts +8 -4
- package/types/generators/SttAppleBuiltin.ts +21 -8
- package/types/generators/Tcp.ts +12 -8
- package/types/generators/TcpServer.ts +19 -13
- package/types/generators/TextToSpeechAppleBuiltin.ts +20 -7
- package/types/generators/TextToSpeechGgml.ts +28 -10
- package/types/generators/TextToSpeechOnnx.ts +18 -11
- package/types/generators/TextToSpeechOpenAiLike.ts +13 -7
- package/types/generators/ThermalPrinter.ts +12 -8
- package/types/generators/Tick.ts +10 -6
- package/types/generators/Udp.ts +16 -7
- package/types/generators/VadGgml.ts +50 -13
- package/types/generators/VadOnnx.ts +41 -11
- package/types/generators/VadTraditional.ts +27 -12
- package/types/generators/VectorStore.ts +32 -11
- package/types/generators/Watchdog.ts +18 -9
- package/types/generators/WebCrawler.ts +10 -6
- package/types/generators/WebRtc.ts +29 -15
- package/types/generators/WebSocket.ts +10 -6
- package/types/generators/index.ts +2 -0
- package/types/subspace.ts +4 -0
- package/types/system.ts +1 -1
- package/utils/event-props.ts +833 -1022
- package/api/index.ts +0 -1
- package/api/instance.ts +0 -213
- package/types/generators/TextToSpeechApple.ts +0 -113
- package/types/generators/TtsAppleBuiltin.ts +0 -105
- /package/skills/{bricks-project → bricks-ctor}/rules/automations.md +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Local LLM inference using Qualcomm AI Engine
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type {
|
|
@@ -10,6 +13,7 @@ import type {
|
|
|
10
13
|
Action,
|
|
11
14
|
EventProperty,
|
|
12
15
|
} from '../common'
|
|
16
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
13
17
|
|
|
14
18
|
/* Load the model */
|
|
15
19
|
export type GeneratorQnnLlmActionLoadModel = Action & {
|
|
@@ -108,7 +112,7 @@ Default property:
|
|
|
108
112
|
| DataLink
|
|
109
113
|
/* SOC model */
|
|
110
114
|
socModel?: 'X Elite' | 'X Plus' | '8 Elite' | '8 Gen 3' | 'QCS8550' | DataLink
|
|
111
|
-
/* Custom model base URL
|
|
115
|
+
/* Custom model base URL
|
|
112
116
|
The model should be bundled, for details see https://github.com/mybigday/node-qnn-llm?tab=readme-ov-file#bundled-file */
|
|
113
117
|
customModelUrl?: string | DataLink
|
|
114
118
|
/* Custom model MD5 */
|
|
@@ -142,7 +146,7 @@ Default property:
|
|
|
142
146
|
stopWords?: Array<string | DataLink> | DataLink
|
|
143
147
|
/* Tool call parser */
|
|
144
148
|
toolCallParser?: 'llama3_json' | 'mistral' | 'hermes' | 'internlm' | 'phi4' | DataLink
|
|
145
|
-
/* Tools for chat mode using OpenAI-compatible function calling format
|
|
149
|
+
/* Tools for chat mode using OpenAI-compatible function calling format
|
|
146
150
|
Format: Array of objects with {type, function: {name, description, parameters}} structure
|
|
147
151
|
See: https://platform.openai.com/docs/guides/function-calling */
|
|
148
152
|
tools?: Array<{} | DataLink> | DataLink
|
|
@@ -165,25 +169,53 @@ Default property:
|
|
|
165
169
|
}
|
|
166
170
|
events?: {
|
|
167
171
|
/* Event triggered when context state changes */
|
|
168
|
-
onContextStateChange?: Array<
|
|
172
|
+
onContextStateChange?: Array<
|
|
173
|
+
EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onContextStateChange']>
|
|
174
|
+
>
|
|
169
175
|
/* Event triggered when generate is done */
|
|
170
|
-
onGenerate?: Array<EventAction
|
|
176
|
+
onGenerate?: Array<EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onGenerate']>>
|
|
171
177
|
/* Event triggered on get function call request */
|
|
172
|
-
onFunctionCall?: Array<
|
|
178
|
+
onFunctionCall?: Array<
|
|
179
|
+
EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onFunctionCall']>
|
|
180
|
+
>
|
|
173
181
|
/* Event triggered when error occurs */
|
|
174
|
-
onError?: Array<EventAction
|
|
182
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onError']>>
|
|
175
183
|
}
|
|
176
184
|
outlets?: {
|
|
177
185
|
/* Context state */
|
|
178
|
-
contextState?: () => Data
|
|
186
|
+
contextState?: () => Data<string>
|
|
179
187
|
/* Generation result */
|
|
180
|
-
result?: () => Data
|
|
188
|
+
result?: () => Data<string>
|
|
181
189
|
/* Full context (Prompt + Generation Result) */
|
|
182
|
-
fullContext?: () => Data
|
|
190
|
+
fullContext?: () => Data<string>
|
|
183
191
|
/* Last function call details */
|
|
184
|
-
lastFunctionCall?: () => Data
|
|
192
|
+
lastFunctionCall?: () => Data<{
|
|
193
|
+
id?: string
|
|
194
|
+
type?: string
|
|
195
|
+
function?: {
|
|
196
|
+
name?: string
|
|
197
|
+
arguments?: string
|
|
198
|
+
[key: string]: any
|
|
199
|
+
}
|
|
200
|
+
[key: string]: any
|
|
201
|
+
}>
|
|
185
202
|
/* Completion details */
|
|
186
|
-
completionDetails?: () => Data
|
|
203
|
+
completionDetails?: () => Data<{
|
|
204
|
+
text?: string
|
|
205
|
+
content?: string
|
|
206
|
+
reasoning_content?: string
|
|
207
|
+
tool_calls?: Array<{
|
|
208
|
+
id?: string
|
|
209
|
+
type?: string
|
|
210
|
+
function?: {
|
|
211
|
+
name?: string
|
|
212
|
+
arguments?: string
|
|
213
|
+
[key: string]: any
|
|
214
|
+
}
|
|
215
|
+
[key: string]: any
|
|
216
|
+
}>
|
|
217
|
+
[key: string]: any
|
|
218
|
+
}>
|
|
187
219
|
}
|
|
188
220
|
}
|
|
189
221
|
|
package/types/generators/Mcp.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* MCP client connecting to tool servers via Streamable HTTP, SSE, or direct-link to in-app MCP Server generator. Provides tools, resources, and prompts for Assistant
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type {
|
|
@@ -10,6 +13,7 @@ import type {
|
|
|
10
13
|
Action,
|
|
11
14
|
EventProperty,
|
|
12
15
|
} from '../common'
|
|
16
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
13
17
|
|
|
14
18
|
/* Connect to MCP server */
|
|
15
19
|
export type GeneratorMCPActionConnect = Action & {
|
|
@@ -189,75 +193,412 @@ Default property:
|
|
|
189
193
|
/* On connected */
|
|
190
194
|
onConnected?: Array<EventAction>
|
|
191
195
|
/* On connection error */
|
|
192
|
-
onConnectionError?: Array<
|
|
196
|
+
onConnectionError?: Array<
|
|
197
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onConnectionError']>
|
|
198
|
+
>
|
|
193
199
|
/* On disconnected */
|
|
194
200
|
onDisconnected?: Array<EventAction>
|
|
195
201
|
/* On list resources */
|
|
196
|
-
onListResources?: Array<
|
|
202
|
+
onListResources?: Array<
|
|
203
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResources']>
|
|
204
|
+
>
|
|
197
205
|
/* On list resources error */
|
|
198
|
-
onListResourcesError?: Array<
|
|
206
|
+
onListResourcesError?: Array<
|
|
207
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResourcesError']>
|
|
208
|
+
>
|
|
199
209
|
/* On list resource templates */
|
|
200
|
-
onListResourceTemplates?: Array<
|
|
210
|
+
onListResourceTemplates?: Array<
|
|
211
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResourceTemplates']>
|
|
212
|
+
>
|
|
201
213
|
/* On list resource templates error */
|
|
202
|
-
onListResourceTemplatesError?: Array<
|
|
214
|
+
onListResourceTemplatesError?: Array<
|
|
215
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListResourceTemplatesError']>
|
|
216
|
+
>
|
|
203
217
|
/* On read resource */
|
|
204
|
-
onReadResource?: Array<
|
|
218
|
+
onReadResource?: Array<
|
|
219
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onReadResource']>
|
|
220
|
+
>
|
|
205
221
|
/* On read resource error */
|
|
206
|
-
onReadResourceError?: Array<
|
|
222
|
+
onReadResourceError?: Array<
|
|
223
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onReadResourceError']>
|
|
224
|
+
>
|
|
207
225
|
/* On list tools */
|
|
208
|
-
onListTools?: Array<EventAction
|
|
226
|
+
onListTools?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListTools']>>
|
|
209
227
|
/* On list tools error */
|
|
210
|
-
onListToolsError?: Array<
|
|
228
|
+
onListToolsError?: Array<
|
|
229
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListToolsError']>
|
|
230
|
+
>
|
|
211
231
|
/* On call tool */
|
|
212
|
-
onCallTool?: Array<EventAction
|
|
232
|
+
onCallTool?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onCallTool']>>
|
|
213
233
|
/* On call tool error */
|
|
214
|
-
onCallToolError?: Array<
|
|
234
|
+
onCallToolError?: Array<
|
|
235
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onCallToolError']>
|
|
236
|
+
>
|
|
215
237
|
/* On list prompts */
|
|
216
|
-
onListPrompts?: Array<EventAction
|
|
238
|
+
onListPrompts?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListPrompts']>>
|
|
217
239
|
/* On list prompts error */
|
|
218
|
-
onListPromptsError?: Array<
|
|
240
|
+
onListPromptsError?: Array<
|
|
241
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onListPromptsError']>
|
|
242
|
+
>
|
|
219
243
|
/* On get prompt */
|
|
220
|
-
onGetPrompt?: Array<EventAction
|
|
244
|
+
onGetPrompt?: Array<EventAction<string & keyof TemplateEventPropsMap['Mcp']['onGetPrompt']>>
|
|
221
245
|
/* On get prompt error */
|
|
222
|
-
onGetPromptError?: Array<
|
|
246
|
+
onGetPromptError?: Array<
|
|
247
|
+
EventAction<string & keyof TemplateEventPropsMap['Mcp']['onGetPromptError']>
|
|
248
|
+
>
|
|
223
249
|
}
|
|
224
250
|
outlets?: {
|
|
225
251
|
/* Connection state */
|
|
226
|
-
connectionState?: () => Data
|
|
252
|
+
connectionState?: () => Data<string>
|
|
227
253
|
/* List resources response */
|
|
228
|
-
listResourcesResponse?: () => Data
|
|
254
|
+
listResourcesResponse?: () => Data<{
|
|
255
|
+
id?: string
|
|
256
|
+
response?: {
|
|
257
|
+
resources?: Array<{
|
|
258
|
+
name?: string
|
|
259
|
+
[key: string]: any
|
|
260
|
+
}>
|
|
261
|
+
resourceTemplates?: Array<{
|
|
262
|
+
name?: string
|
|
263
|
+
[key: string]: any
|
|
264
|
+
}>
|
|
265
|
+
contents?: Array<{
|
|
266
|
+
uri?: string
|
|
267
|
+
text?: string
|
|
268
|
+
blob?: string
|
|
269
|
+
mimeType?: string
|
|
270
|
+
[key: string]: any
|
|
271
|
+
}>
|
|
272
|
+
tools?: Array<{
|
|
273
|
+
name?: string
|
|
274
|
+
description?: string
|
|
275
|
+
inputSchema?: { [key: string]: any }
|
|
276
|
+
[key: string]: any
|
|
277
|
+
}>
|
|
278
|
+
content?: Array<{
|
|
279
|
+
type?: string
|
|
280
|
+
text?: string
|
|
281
|
+
[key: string]: any
|
|
282
|
+
}>
|
|
283
|
+
prompts?: Array<{
|
|
284
|
+
name?: string
|
|
285
|
+
[key: string]: any
|
|
286
|
+
}>
|
|
287
|
+
messages?: Array<{
|
|
288
|
+
role?: string
|
|
289
|
+
content?: any
|
|
290
|
+
[key: string]: any
|
|
291
|
+
}>
|
|
292
|
+
[key: string]: any
|
|
293
|
+
}
|
|
294
|
+
[key: string]: any
|
|
295
|
+
}>
|
|
229
296
|
/* List resources error */
|
|
230
|
-
listResourcesError?: () => Data
|
|
297
|
+
listResourcesError?: () => Data<{
|
|
298
|
+
id?: string
|
|
299
|
+
error?: string
|
|
300
|
+
[key: string]: any
|
|
301
|
+
}>
|
|
231
302
|
/* List resource templates response */
|
|
232
|
-
listResourceTemplatesResponse?: () => Data
|
|
303
|
+
listResourceTemplatesResponse?: () => Data<{
|
|
304
|
+
id?: string
|
|
305
|
+
response?: {
|
|
306
|
+
resources?: Array<{
|
|
307
|
+
name?: string
|
|
308
|
+
[key: string]: any
|
|
309
|
+
}>
|
|
310
|
+
resourceTemplates?: Array<{
|
|
311
|
+
name?: string
|
|
312
|
+
[key: string]: any
|
|
313
|
+
}>
|
|
314
|
+
contents?: Array<{
|
|
315
|
+
uri?: string
|
|
316
|
+
text?: string
|
|
317
|
+
blob?: string
|
|
318
|
+
mimeType?: string
|
|
319
|
+
[key: string]: any
|
|
320
|
+
}>
|
|
321
|
+
tools?: Array<{
|
|
322
|
+
name?: string
|
|
323
|
+
description?: string
|
|
324
|
+
inputSchema?: { [key: string]: any }
|
|
325
|
+
[key: string]: any
|
|
326
|
+
}>
|
|
327
|
+
content?: Array<{
|
|
328
|
+
type?: string
|
|
329
|
+
text?: string
|
|
330
|
+
[key: string]: any
|
|
331
|
+
}>
|
|
332
|
+
prompts?: Array<{
|
|
333
|
+
name?: string
|
|
334
|
+
[key: string]: any
|
|
335
|
+
}>
|
|
336
|
+
messages?: Array<{
|
|
337
|
+
role?: string
|
|
338
|
+
content?: any
|
|
339
|
+
[key: string]: any
|
|
340
|
+
}>
|
|
341
|
+
[key: string]: any
|
|
342
|
+
}
|
|
343
|
+
[key: string]: any
|
|
344
|
+
}>
|
|
233
345
|
/* List resource templates error */
|
|
234
|
-
listResourceTemplatesError?: () => Data
|
|
346
|
+
listResourceTemplatesError?: () => Data<{
|
|
347
|
+
id?: string
|
|
348
|
+
error?: string
|
|
349
|
+
[key: string]: any
|
|
350
|
+
}>
|
|
235
351
|
/* Read resource response */
|
|
236
|
-
readResourceResponse?: () => Data
|
|
352
|
+
readResourceResponse?: () => Data<{
|
|
353
|
+
id?: string
|
|
354
|
+
response?: {
|
|
355
|
+
resources?: Array<{
|
|
356
|
+
name?: string
|
|
357
|
+
[key: string]: any
|
|
358
|
+
}>
|
|
359
|
+
resourceTemplates?: Array<{
|
|
360
|
+
name?: string
|
|
361
|
+
[key: string]: any
|
|
362
|
+
}>
|
|
363
|
+
contents?: Array<{
|
|
364
|
+
uri?: string
|
|
365
|
+
text?: string
|
|
366
|
+
blob?: string
|
|
367
|
+
mimeType?: string
|
|
368
|
+
[key: string]: any
|
|
369
|
+
}>
|
|
370
|
+
tools?: Array<{
|
|
371
|
+
name?: string
|
|
372
|
+
description?: string
|
|
373
|
+
inputSchema?: { [key: string]: any }
|
|
374
|
+
[key: string]: any
|
|
375
|
+
}>
|
|
376
|
+
content?: Array<{
|
|
377
|
+
type?: string
|
|
378
|
+
text?: string
|
|
379
|
+
[key: string]: any
|
|
380
|
+
}>
|
|
381
|
+
prompts?: Array<{
|
|
382
|
+
name?: string
|
|
383
|
+
[key: string]: any
|
|
384
|
+
}>
|
|
385
|
+
messages?: Array<{
|
|
386
|
+
role?: string
|
|
387
|
+
content?: any
|
|
388
|
+
[key: string]: any
|
|
389
|
+
}>
|
|
390
|
+
[key: string]: any
|
|
391
|
+
}
|
|
392
|
+
[key: string]: any
|
|
393
|
+
}>
|
|
237
394
|
/* Read resource error */
|
|
238
|
-
readResourceError?: () => Data
|
|
395
|
+
readResourceError?: () => Data<{
|
|
396
|
+
id?: string
|
|
397
|
+
error?: string
|
|
398
|
+
[key: string]: any
|
|
399
|
+
}>
|
|
239
400
|
/* List tools response */
|
|
240
|
-
listToolsResponse?: () => Data
|
|
401
|
+
listToolsResponse?: () => Data<{
|
|
402
|
+
id?: string
|
|
403
|
+
response?: {
|
|
404
|
+
resources?: Array<{
|
|
405
|
+
name?: string
|
|
406
|
+
[key: string]: any
|
|
407
|
+
}>
|
|
408
|
+
resourceTemplates?: Array<{
|
|
409
|
+
name?: string
|
|
410
|
+
[key: string]: any
|
|
411
|
+
}>
|
|
412
|
+
contents?: Array<{
|
|
413
|
+
uri?: string
|
|
414
|
+
text?: string
|
|
415
|
+
blob?: string
|
|
416
|
+
mimeType?: string
|
|
417
|
+
[key: string]: any
|
|
418
|
+
}>
|
|
419
|
+
tools?: Array<{
|
|
420
|
+
name?: string
|
|
421
|
+
description?: string
|
|
422
|
+
inputSchema?: { [key: string]: any }
|
|
423
|
+
[key: string]: any
|
|
424
|
+
}>
|
|
425
|
+
content?: Array<{
|
|
426
|
+
type?: string
|
|
427
|
+
text?: string
|
|
428
|
+
[key: string]: any
|
|
429
|
+
}>
|
|
430
|
+
prompts?: Array<{
|
|
431
|
+
name?: string
|
|
432
|
+
[key: string]: any
|
|
433
|
+
}>
|
|
434
|
+
messages?: Array<{
|
|
435
|
+
role?: string
|
|
436
|
+
content?: any
|
|
437
|
+
[key: string]: any
|
|
438
|
+
}>
|
|
439
|
+
[key: string]: any
|
|
440
|
+
}
|
|
441
|
+
[key: string]: any
|
|
442
|
+
}>
|
|
241
443
|
/* List tools error */
|
|
242
|
-
listToolsError?: () => Data
|
|
444
|
+
listToolsError?: () => Data<{
|
|
445
|
+
id?: string
|
|
446
|
+
error?: string
|
|
447
|
+
[key: string]: any
|
|
448
|
+
}>
|
|
243
449
|
/* Call tool response */
|
|
244
|
-
callToolResponse?: () => Data
|
|
450
|
+
callToolResponse?: () => Data<{
|
|
451
|
+
id?: string
|
|
452
|
+
response?: {
|
|
453
|
+
resources?: Array<{
|
|
454
|
+
name?: string
|
|
455
|
+
[key: string]: any
|
|
456
|
+
}>
|
|
457
|
+
resourceTemplates?: Array<{
|
|
458
|
+
name?: string
|
|
459
|
+
[key: string]: any
|
|
460
|
+
}>
|
|
461
|
+
contents?: Array<{
|
|
462
|
+
uri?: string
|
|
463
|
+
text?: string
|
|
464
|
+
blob?: string
|
|
465
|
+
mimeType?: string
|
|
466
|
+
[key: string]: any
|
|
467
|
+
}>
|
|
468
|
+
tools?: Array<{
|
|
469
|
+
name?: string
|
|
470
|
+
description?: string
|
|
471
|
+
inputSchema?: { [key: string]: any }
|
|
472
|
+
[key: string]: any
|
|
473
|
+
}>
|
|
474
|
+
content?: Array<{
|
|
475
|
+
type?: string
|
|
476
|
+
text?: string
|
|
477
|
+
[key: string]: any
|
|
478
|
+
}>
|
|
479
|
+
prompts?: Array<{
|
|
480
|
+
name?: string
|
|
481
|
+
[key: string]: any
|
|
482
|
+
}>
|
|
483
|
+
messages?: Array<{
|
|
484
|
+
role?: string
|
|
485
|
+
content?: any
|
|
486
|
+
[key: string]: any
|
|
487
|
+
}>
|
|
488
|
+
[key: string]: any
|
|
489
|
+
}
|
|
490
|
+
[key: string]: any
|
|
491
|
+
}>
|
|
245
492
|
/* Call tool error */
|
|
246
|
-
callToolError?: () => Data
|
|
493
|
+
callToolError?: () => Data<{
|
|
494
|
+
id?: string
|
|
495
|
+
error?: string
|
|
496
|
+
[key: string]: any
|
|
497
|
+
}>
|
|
247
498
|
/* List prompts response */
|
|
248
|
-
listPromptsResponse?: () => Data
|
|
499
|
+
listPromptsResponse?: () => Data<{
|
|
500
|
+
id?: string
|
|
501
|
+
response?: {
|
|
502
|
+
resources?: Array<{
|
|
503
|
+
name?: string
|
|
504
|
+
[key: string]: any
|
|
505
|
+
}>
|
|
506
|
+
resourceTemplates?: Array<{
|
|
507
|
+
name?: string
|
|
508
|
+
[key: string]: any
|
|
509
|
+
}>
|
|
510
|
+
contents?: Array<{
|
|
511
|
+
uri?: string
|
|
512
|
+
text?: string
|
|
513
|
+
blob?: string
|
|
514
|
+
mimeType?: string
|
|
515
|
+
[key: string]: any
|
|
516
|
+
}>
|
|
517
|
+
tools?: Array<{
|
|
518
|
+
name?: string
|
|
519
|
+
description?: string
|
|
520
|
+
inputSchema?: { [key: string]: any }
|
|
521
|
+
[key: string]: any
|
|
522
|
+
}>
|
|
523
|
+
content?: Array<{
|
|
524
|
+
type?: string
|
|
525
|
+
text?: string
|
|
526
|
+
[key: string]: any
|
|
527
|
+
}>
|
|
528
|
+
prompts?: Array<{
|
|
529
|
+
name?: string
|
|
530
|
+
[key: string]: any
|
|
531
|
+
}>
|
|
532
|
+
messages?: Array<{
|
|
533
|
+
role?: string
|
|
534
|
+
content?: any
|
|
535
|
+
[key: string]: any
|
|
536
|
+
}>
|
|
537
|
+
[key: string]: any
|
|
538
|
+
}
|
|
539
|
+
[key: string]: any
|
|
540
|
+
}>
|
|
249
541
|
/* List prompts error */
|
|
250
|
-
listPromptsError?: () => Data
|
|
542
|
+
listPromptsError?: () => Data<{
|
|
543
|
+
id?: string
|
|
544
|
+
error?: string
|
|
545
|
+
[key: string]: any
|
|
546
|
+
}>
|
|
251
547
|
/* Get prompt response */
|
|
252
|
-
getPromptResponse?: () => Data
|
|
548
|
+
getPromptResponse?: () => Data<{
|
|
549
|
+
id?: string
|
|
550
|
+
response?: {
|
|
551
|
+
resources?: Array<{
|
|
552
|
+
name?: string
|
|
553
|
+
[key: string]: any
|
|
554
|
+
}>
|
|
555
|
+
resourceTemplates?: Array<{
|
|
556
|
+
name?: string
|
|
557
|
+
[key: string]: any
|
|
558
|
+
}>
|
|
559
|
+
contents?: Array<{
|
|
560
|
+
uri?: string
|
|
561
|
+
text?: string
|
|
562
|
+
blob?: string
|
|
563
|
+
mimeType?: string
|
|
564
|
+
[key: string]: any
|
|
565
|
+
}>
|
|
566
|
+
tools?: Array<{
|
|
567
|
+
name?: string
|
|
568
|
+
description?: string
|
|
569
|
+
inputSchema?: { [key: string]: any }
|
|
570
|
+
[key: string]: any
|
|
571
|
+
}>
|
|
572
|
+
content?: Array<{
|
|
573
|
+
type?: string
|
|
574
|
+
text?: string
|
|
575
|
+
[key: string]: any
|
|
576
|
+
}>
|
|
577
|
+
prompts?: Array<{
|
|
578
|
+
name?: string
|
|
579
|
+
[key: string]: any
|
|
580
|
+
}>
|
|
581
|
+
messages?: Array<{
|
|
582
|
+
role?: string
|
|
583
|
+
content?: any
|
|
584
|
+
[key: string]: any
|
|
585
|
+
}>
|
|
586
|
+
[key: string]: any
|
|
587
|
+
}
|
|
588
|
+
[key: string]: any
|
|
589
|
+
}>
|
|
253
590
|
/* Request prompt error */
|
|
254
|
-
getPromptError?: () => Data
|
|
591
|
+
getPromptError?: () => Data<{
|
|
592
|
+
id?: string
|
|
593
|
+
error?: string
|
|
594
|
+
[key: string]: any
|
|
595
|
+
}>
|
|
255
596
|
/* Last error */
|
|
256
|
-
lastError?: () => Data
|
|
597
|
+
lastError?: () => Data<string>
|
|
257
598
|
}
|
|
258
599
|
}
|
|
259
600
|
|
|
260
|
-
/*
|
|
601
|
+
/* MCP client connecting to tool servers via Streamable HTTP, SSE, or direct-link to in-app MCP Server generator. Provides tools, resources, and prompts for Assistant */
|
|
261
602
|
export type GeneratorMCP = Generator &
|
|
262
603
|
GeneratorMCPDef & {
|
|
263
604
|
templateKey: 'GENERATOR_MCP'
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/* Auto generated by build script
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* MCP server exposing tools, resources (static/detect-data-change/script), and prompts. Supports HTTP listening with Bearer auth or direct-link from in-app MCP client
|
|
4
|
+
*/
|
|
2
5
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
6
|
import type { Data, DataLink } from '../data'
|
|
4
7
|
import type {
|
|
@@ -10,6 +13,7 @@ import type {
|
|
|
10
13
|
Action,
|
|
11
14
|
EventProperty,
|
|
12
15
|
} from '../common'
|
|
16
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
13
17
|
|
|
14
18
|
/* Refresh tools and resources, used for case if tools or resources are changed. Note that the current connections will be closed. */
|
|
15
19
|
export type GeneratorMCPServerActionRefreshResources = Action & {
|
|
@@ -47,7 +51,7 @@ Default property:
|
|
|
47
51
|
name?: string | DataLink
|
|
48
52
|
/* Version of the MCP server */
|
|
49
53
|
version?: string | DataLink
|
|
50
|
-
/* Resources
|
|
54
|
+
/* Resources
|
|
51
55
|
Type:
|
|
52
56
|
`static`: Return static data
|
|
53
57
|
`detect-data-change`: Watch data target change to return data,
|
|
@@ -93,7 +97,7 @@ Default property:
|
|
|
93
97
|
}
|
|
94
98
|
>
|
|
95
99
|
| DataLink
|
|
96
|
-
/* Tools
|
|
100
|
+
/* Tools
|
|
97
101
|
Type:
|
|
98
102
|
`static`: Return static data
|
|
99
103
|
`detect-data-change`: Watch data target change to return data,
|
|
@@ -139,7 +143,7 @@ Default property:
|
|
|
139
143
|
}
|
|
140
144
|
>
|
|
141
145
|
| DataLink
|
|
142
|
-
/* Prompts
|
|
146
|
+
/* Prompts
|
|
143
147
|
Type:
|
|
144
148
|
`static`: Return static data
|
|
145
149
|
`detect-data-change`: Watch data target change to return data,
|
|
@@ -190,37 +194,72 @@ Default property:
|
|
|
190
194
|
/* Listening of HTTP server */
|
|
191
195
|
onListening?: Array<EventAction>
|
|
192
196
|
/* Error of HTTP server */
|
|
193
|
-
onError?: Array<EventAction
|
|
197
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['McpServer']['onError']>>
|
|
194
198
|
/* Client error of HTTP server */
|
|
195
|
-
onClientError?: Array<
|
|
199
|
+
onClientError?: Array<
|
|
200
|
+
EventAction<string & keyof TemplateEventPropsMap['McpServer']['onClientError']>
|
|
201
|
+
>
|
|
196
202
|
/* Client close of HTTP server */
|
|
197
|
-
onClientClose?: Array<
|
|
203
|
+
onClientClose?: Array<
|
|
204
|
+
EventAction<string & keyof TemplateEventPropsMap['McpServer']['onClientClose']>
|
|
205
|
+
>
|
|
198
206
|
/* On request resource (Request: { name: string, uri: string, params: object }) */
|
|
199
|
-
onRequestResource?: Array<
|
|
207
|
+
onRequestResource?: Array<
|
|
208
|
+
EventAction<string & keyof TemplateEventPropsMap['McpServer']['onRequestResource']>
|
|
209
|
+
>
|
|
200
210
|
/* On call tool (Request: { name: string, params: object }) */
|
|
201
|
-
onCallTool?: Array<EventAction
|
|
211
|
+
onCallTool?: Array<EventAction<string & keyof TemplateEventPropsMap['McpServer']['onCallTool']>>
|
|
202
212
|
/* On get prompt (Request: { name: string, arguments: object }) */
|
|
203
|
-
onGetPrompt?: Array<
|
|
213
|
+
onGetPrompt?: Array<
|
|
214
|
+
EventAction<string & keyof TemplateEventPropsMap['McpServer']['onGetPrompt']>
|
|
215
|
+
>
|
|
204
216
|
}
|
|
205
217
|
outlets?: {
|
|
206
218
|
/* Whether the HTTP server is listening */
|
|
207
|
-
isListening?: () => Data
|
|
219
|
+
isListening?: () => Data<boolean>
|
|
208
220
|
/* Last error of HTTP server */
|
|
209
|
-
lastError?: () => Data
|
|
221
|
+
lastError?: () => Data<string>
|
|
210
222
|
/* MCP server endpoint URL */
|
|
211
|
-
endpoint?: () => Data
|
|
223
|
+
endpoint?: () => Data<string>
|
|
212
224
|
/* Connected remotes (Session ID) */
|
|
213
|
-
connectedRemotes?: () => Data
|
|
225
|
+
connectedRemotes?: () => Data<Array<string>>
|
|
214
226
|
/* Last resource request ({ name: string, uri: string, params: object }) */
|
|
215
|
-
lastResourceRequest?: () => Data
|
|
227
|
+
lastResourceRequest?: () => Data<{
|
|
228
|
+
type?: string
|
|
229
|
+
id?: string
|
|
230
|
+
name?: string
|
|
231
|
+
uri?: string
|
|
232
|
+
params?: { [key: string]: any }
|
|
233
|
+
arguments?: { [key: string]: any }
|
|
234
|
+
timeout?: number
|
|
235
|
+
[key: string]: any
|
|
236
|
+
}>
|
|
216
237
|
/* Last tool call ({ name: string, params: object }) */
|
|
217
|
-
lastToolCall?: () => Data
|
|
238
|
+
lastToolCall?: () => Data<{
|
|
239
|
+
type?: string
|
|
240
|
+
id?: string
|
|
241
|
+
name?: string
|
|
242
|
+
uri?: string
|
|
243
|
+
params?: { [key: string]: any }
|
|
244
|
+
arguments?: { [key: string]: any }
|
|
245
|
+
timeout?: number
|
|
246
|
+
[key: string]: any
|
|
247
|
+
}>
|
|
218
248
|
/* Last prompt get ({ name: string, arguments: object }) */
|
|
219
|
-
lastPromptGet?: () => Data
|
|
249
|
+
lastPromptGet?: () => Data<{
|
|
250
|
+
type?: string
|
|
251
|
+
id?: string
|
|
252
|
+
name?: string
|
|
253
|
+
uri?: string
|
|
254
|
+
params?: { [key: string]: any }
|
|
255
|
+
arguments?: { [key: string]: any }
|
|
256
|
+
timeout?: number
|
|
257
|
+
[key: string]: any
|
|
258
|
+
}>
|
|
220
259
|
}
|
|
221
260
|
}
|
|
222
261
|
|
|
223
|
-
/*
|
|
262
|
+
/* MCP server exposing tools, resources (static/detect-data-change/script), and prompts. Supports HTTP listening with Bearer auth or direct-link from in-app MCP client */
|
|
224
263
|
export type GeneratorMCPServer = Generator &
|
|
225
264
|
GeneratorMCPServerDef & {
|
|
226
265
|
templateKey: 'GENERATOR_MCP_SERVER'
|