@fugood/bricks-project 2.22.0-beta.2 → 2.22.0-beta.4
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 +27 -0
- package/package.json +3 -2
- package/tools/mcp-server.ts +86 -0
- package/tools/postinstall.ts +54 -2
- package/tools/preview-main.mjs +13 -7
- package/tools/preview.ts +31 -25
- package/types/generators.ts +471 -0
- package/utils/event-props.ts +73 -0
|
@@ -512,6 +512,28 @@ export const templateActionNameMap = {
|
|
|
512
512
|
paramsString: 'GENERATOR_SQLITE_PARAMS_STRING',
|
|
513
513
|
},
|
|
514
514
|
},
|
|
515
|
+
|
|
516
|
+
GENERATOR_MCP: {
|
|
517
|
+
GENERATOR_MCP_LIST_RESOURCES: {
|
|
518
|
+
requestId: 'GENERATOR_MCP_REQUEST_ID',
|
|
519
|
+
},
|
|
520
|
+
GENERATOR_MCP_LIST_RESOURCE_TEMPLATES: {
|
|
521
|
+
requestId: 'GENERATOR_MCP_REQUEST_ID',
|
|
522
|
+
},
|
|
523
|
+
GENERATOR_MCP_READ_RESOURCE: {
|
|
524
|
+
requestId: 'GENERATOR_MCP_REQUEST_ID',
|
|
525
|
+
uri: 'GENERATOR_MCP_URI',
|
|
526
|
+
variables: 'GENERATOR_MCP_VARIABLES',
|
|
527
|
+
},
|
|
528
|
+
GENERATOR_MCP_LIST_TOOLS: {
|
|
529
|
+
requestId: 'GENERATOR_MCP_REQUEST_ID',
|
|
530
|
+
},
|
|
531
|
+
GENERATOR_MCP_CALL_TOOL: {
|
|
532
|
+
requestId: 'GENERATOR_MCP_REQUEST_ID',
|
|
533
|
+
name: 'GENERATOR_MCP_NAME',
|
|
534
|
+
variables: 'GENERATOR_MCP_VARIABLES',
|
|
535
|
+
},
|
|
536
|
+
},
|
|
515
537
|
GENERATOR_TTS: {
|
|
516
538
|
GENERATOR_TTS_GENERATE: {
|
|
517
539
|
text: 'GENERATOR_TTS_TEXT',
|
|
@@ -630,6 +652,11 @@ export const templateActionNameMap = {
|
|
|
630
652
|
responseFormat: 'GENERATOR_OPENAI_LLM_RESPONSE_FORMAT',
|
|
631
653
|
},
|
|
632
654
|
},
|
|
655
|
+
GENERATOR_OPENAI_TTS: {
|
|
656
|
+
GENERATOR_OPENAI_TTS_GENERATE: {
|
|
657
|
+
text: 'GENERATOR_OPENAI_TTS_TEXT',
|
|
658
|
+
},
|
|
659
|
+
},
|
|
633
660
|
GENERATOR_ASSISTANT: {
|
|
634
661
|
GENERATOR_ASSISTANT_ADD_MESSAGE: {
|
|
635
662
|
role: 'GENERATOR_ASSISTANT_ROLE',
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugood/bricks-project",
|
|
3
|
-
"version": "2.22.0-beta.
|
|
3
|
+
"version": "2.22.0-beta.4",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node scripts/build.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
+
"@modelcontextprotocol/sdk": "^1.7.0",
|
|
9
10
|
"@types/escodegen": "^0.0.10",
|
|
10
11
|
"@types/lodash": "^4.17.12",
|
|
11
12
|
"acorn": "^8.13.0",
|
|
@@ -13,5 +14,5 @@
|
|
|
13
14
|
"lodash": "^4.17.4",
|
|
14
15
|
"uuid": "^8.3.1"
|
|
15
16
|
},
|
|
16
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "8a7f2856827423c67c0e26adcefbbc6e3ba6fc5c"
|
|
17
18
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
|
|
2
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
3
|
+
import { z } from 'zod'
|
|
4
|
+
import { $ } from 'bun'
|
|
5
|
+
|
|
6
|
+
const server = new McpServer({
|
|
7
|
+
name: 'bricks-project',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const dirname = import.meta.dirname
|
|
12
|
+
const projectDir = String(dirname).split('/node_modules/')[0]
|
|
13
|
+
|
|
14
|
+
server.tool('compile', {}, async () => {
|
|
15
|
+
let log
|
|
16
|
+
try {
|
|
17
|
+
log = await $`bun compile`.cwd(projectDir).text()
|
|
18
|
+
} catch (err) {
|
|
19
|
+
log = err.stdout.toString() + '\n' + err.stderr.toString()
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
content: [{ type: 'text', text: log || 'Compiled successfully' }],
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
// NOTE: Cursor (Or VSCode) seems set ELECTRON_RUN_AS_NODE to 1, so we need to unset it
|
|
27
|
+
process.env.ELECTRON_RUN_AS_NODE = ''
|
|
28
|
+
|
|
29
|
+
server.tool(
|
|
30
|
+
'take-preview-screenshot',
|
|
31
|
+
{
|
|
32
|
+
delay: z
|
|
33
|
+
.number()
|
|
34
|
+
.describe('Delay in milliseconds before taking screenshot')
|
|
35
|
+
.optional()
|
|
36
|
+
.default(3000),
|
|
37
|
+
width: z.number().describe('Width of the screenshot').optional().default(600),
|
|
38
|
+
height: z.number().optional().default(480),
|
|
39
|
+
responseImage: z
|
|
40
|
+
.boolean()
|
|
41
|
+
.describe(
|
|
42
|
+
'Whether to response image content (base64 encoded jpeg). If false, only saved path will be responded as text.',
|
|
43
|
+
)
|
|
44
|
+
.optional()
|
|
45
|
+
.default(false),
|
|
46
|
+
} as any,
|
|
47
|
+
async ({ delay, width, height, responseImage }: any) => {
|
|
48
|
+
let log = ''
|
|
49
|
+
let error = false
|
|
50
|
+
try {
|
|
51
|
+
const args = [
|
|
52
|
+
'--take-screenshot',
|
|
53
|
+
JSON.stringify({
|
|
54
|
+
delay,
|
|
55
|
+
width,
|
|
56
|
+
height,
|
|
57
|
+
path: `${dirname}/screenshot.jpg`,
|
|
58
|
+
closeAfter: true,
|
|
59
|
+
headless: true,
|
|
60
|
+
}),
|
|
61
|
+
]
|
|
62
|
+
log = await $`bunx --bun electron ${dirname}/preview-main.mjs ${args}`.cwd(projectDir).text()
|
|
63
|
+
} catch (err) {
|
|
64
|
+
log = err.stdout.toString() + '\n' + err.stderr.toString()
|
|
65
|
+
error = true
|
|
66
|
+
}
|
|
67
|
+
let screenshotBase64: any = null
|
|
68
|
+
if (!error && responseImage) {
|
|
69
|
+
const screenshot = await Bun.file(`${dirname}/screenshot.jpg`).arrayBuffer()
|
|
70
|
+
screenshotBase64 = Buffer.from(screenshot).toString('base64')
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
content: [
|
|
74
|
+
{ type: 'text', text: log },
|
|
75
|
+
screenshotBase64 && {
|
|
76
|
+
type: 'image',
|
|
77
|
+
data: screenshotBase64,
|
|
78
|
+
mimeType: 'image/jpeg',
|
|
79
|
+
},
|
|
80
|
+
].filter(Boolean),
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
const transport = new StdioServerTransport()
|
|
86
|
+
await server.connect(transport)
|
package/tools/postinstall.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ } from 'bun'
|
|
2
|
-
|
|
2
|
+
import { stat, readFile, writeFile } from 'fs/promises'
|
|
3
3
|
const cwd = process.cwd()
|
|
4
4
|
|
|
5
5
|
const libFiles = ['types', 'utils', 'index.ts']
|
|
@@ -9,4 +9,56 @@ for (const file of libFiles) {
|
|
|
9
9
|
await $`cp -r ${__dirname}/../${file} ${cwd}/project`
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
console.log('Copied files to project/')
|
|
12
|
+
console.log('Copied files to project/')
|
|
13
|
+
|
|
14
|
+
async function exists(f: string) {
|
|
15
|
+
try {
|
|
16
|
+
await stat(f)
|
|
17
|
+
return true
|
|
18
|
+
} catch {
|
|
19
|
+
return false
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const projectMcpServer = {
|
|
24
|
+
command: 'bun',
|
|
25
|
+
args: [`${cwd}/node_modules/@fugood/bricks-project/tools/mcp-server.ts`],
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const defaultMcpConfig = {
|
|
29
|
+
mcpServers: {
|
|
30
|
+
'bricks-project': projectMcpServer,
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const handleMcpConfigOverride = async (mcpConfigPath: string) => {
|
|
35
|
+
let mcpConfig: { mcpServers: Record<string, typeof projectMcpServer> } | null = null
|
|
36
|
+
if (await exists(mcpConfigPath)) {
|
|
37
|
+
const configStr = await readFile(mcpConfigPath, 'utf-8')
|
|
38
|
+
try {
|
|
39
|
+
mcpConfig = JSON.parse(configStr)
|
|
40
|
+
if (!mcpConfig?.mcpServers) throw new Error('mcpServers is not defined')
|
|
41
|
+
mcpConfig.mcpServers['bricks-project'] = projectMcpServer
|
|
42
|
+
} catch (e) {
|
|
43
|
+
mcpConfig = defaultMcpConfig
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
mcpConfig = defaultMcpConfig
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
await writeFile(mcpConfigPath, `${JSON.stringify(mcpConfig, null, 2)}\n`)
|
|
50
|
+
|
|
51
|
+
console.log(`Updated ${mcpConfigPath}`)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (await exists(`${cwd}/.cursorrules`)) {
|
|
55
|
+
await $`mkdir -p ${cwd}/.cursor`
|
|
56
|
+
const cursorMcpConfigPath = `${cwd}/.cursor/mcp.json`
|
|
57
|
+
await handleMcpConfigOverride(cursorMcpConfigPath)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (await exists(`${cwd}/CLAUDE.md`)) {
|
|
61
|
+
await $`mkdir -p ${cwd}/.cursor`
|
|
62
|
+
const claudeCodeMcpConfigPath = `${cwd}/.mcp.json`
|
|
63
|
+
await handleMcpConfigOverride(claudeCodeMcpConfigPath)
|
|
64
|
+
}
|
package/tools/preview-main.mjs
CHANGED
|
@@ -20,7 +20,7 @@ let takeScreenshotConfig = null
|
|
|
20
20
|
try {
|
|
21
21
|
if (values['take-screenshot']) {
|
|
22
22
|
takeScreenshotConfig = JSON.parse(values['take-screenshot'])
|
|
23
|
-
if (!takeScreenshotConfig.path) takeScreenshotConfig.path = `${cwd}/screenshot.
|
|
23
|
+
if (!takeScreenshotConfig.path) takeScreenshotConfig.path = `${cwd}/screenshot.jpg`
|
|
24
24
|
if (!takeScreenshotConfig.width) takeScreenshotConfig.width = 1280
|
|
25
25
|
if (!takeScreenshotConfig.height) takeScreenshotConfig.height = 768
|
|
26
26
|
if (!takeScreenshotConfig.delay) takeScreenshotConfig.delay = 1000
|
|
@@ -46,8 +46,13 @@ if (!previewUrl) throw new Error(`Invalid BRICKS_STAGE: ${stage}`)
|
|
|
46
46
|
|
|
47
47
|
app.on('ready', () => {
|
|
48
48
|
let show = true
|
|
49
|
-
if (takeScreenshotConfig
|
|
50
|
-
const mainWindow = new BrowserWindow({
|
|
49
|
+
if (takeScreenshotConfig && !takeScreenshotConfig.noHeadless) show = false
|
|
50
|
+
const mainWindow = new BrowserWindow({
|
|
51
|
+
width: takeScreenshotConfig?.width || 1280,
|
|
52
|
+
height: takeScreenshotConfig?.height || 768,
|
|
53
|
+
frame: !takeScreenshotConfig,
|
|
54
|
+
show,
|
|
55
|
+
})
|
|
51
56
|
mainWindow.setBackgroundColor('#333')
|
|
52
57
|
mainWindow.loadURL(previewUrl)
|
|
53
58
|
|
|
@@ -56,18 +61,19 @@ app.on('ready', () => {
|
|
|
56
61
|
type: 'config',
|
|
57
62
|
configFile: { _originTitle: 'Test', ...config, title: Math.random().toString() },
|
|
58
63
|
workspace: { billing: { lock: {}, plan: 'free' } },
|
|
64
|
+
showMenu: false,
|
|
59
65
|
}
|
|
60
66
|
mainWindow.webContents.executeJavaScript(
|
|
61
67
|
`window.postMessage(JSON.stringify(${JSON.stringify(payload)}))`,
|
|
62
68
|
)
|
|
63
69
|
if (takeScreenshotConfig) {
|
|
64
|
-
const { delay, width, height, path,
|
|
70
|
+
const { delay, width, height, path, keepOpen = false } = takeScreenshotConfig
|
|
65
71
|
setTimeout(() => {
|
|
66
72
|
console.log('Taking screenshot')
|
|
67
|
-
mainWindow.webContents.capturePage(
|
|
73
|
+
mainWindow.webContents.capturePage().then((image) => {
|
|
68
74
|
console.log('Writing screenshot to', path)
|
|
69
|
-
writeFile(path, image.
|
|
70
|
-
if (
|
|
75
|
+
writeFile(path, image.resize({ width, height }).toJPEG(75))
|
|
76
|
+
if (!keepOpen) {
|
|
71
77
|
console.log('Closing app')
|
|
72
78
|
app.quit()
|
|
73
79
|
}
|
package/tools/preview.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { $ } from 'bun'
|
|
2
2
|
import { watch } from 'fs'
|
|
3
|
+
import type { FSWatcher } from 'fs'
|
|
3
4
|
import { parseArgs } from 'util'
|
|
4
5
|
import { debounce } from 'lodash'
|
|
5
6
|
|
|
@@ -8,55 +9,60 @@ const { values } = parseArgs({
|
|
|
8
9
|
options: {
|
|
9
10
|
'skip-typecheck': { type: 'boolean' },
|
|
10
11
|
'clear-cache': { type: 'boolean' },
|
|
11
|
-
|
|
12
|
+
screenshot: { type: 'boolean' },
|
|
12
13
|
'screenshot-delay': { type: 'string' },
|
|
13
14
|
'screenshot-width': { type: 'string' },
|
|
14
15
|
'screenshot-height': { type: 'string' },
|
|
15
16
|
'screenshot-path': { type: 'string' },
|
|
16
|
-
'screenshot-
|
|
17
|
-
'screenshot-headless': { type: 'boolean' },
|
|
17
|
+
'screenshot-keep-open': { type: 'boolean' },
|
|
18
|
+
'screenshot-no-headless': { type: 'boolean' },
|
|
18
19
|
},
|
|
19
20
|
strict: true,
|
|
20
21
|
allowPositionals: true,
|
|
21
22
|
})
|
|
22
23
|
|
|
23
|
-
const useTypecheck = !values['skip-typecheck']
|
|
24
|
-
|
|
25
|
-
const compile = async () => {
|
|
26
|
-
if (useTypecheck) await $`bun typecheck`
|
|
27
|
-
await $`bun compile`
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
await compile()
|
|
31
|
-
|
|
32
|
-
const compileDebounced = debounce(compile, 500)
|
|
33
|
-
|
|
34
24
|
const cwd = process.cwd()
|
|
35
25
|
|
|
36
|
-
const watcher = watch(`${cwd}/subspaces`, { recursive: true }, async (event, filename) => {
|
|
37
|
-
console.log(`Detected ${event} in ${filename}`)
|
|
38
|
-
compileDebounced()
|
|
39
|
-
})
|
|
40
|
-
|
|
41
26
|
const app = await Bun.file(`${cwd}/application.json`).json()
|
|
42
27
|
|
|
43
28
|
let args: string[] = []
|
|
44
29
|
if (values['clear-cache']) args.push('--clear-cache')
|
|
45
30
|
|
|
31
|
+
let needWatcher = true
|
|
46
32
|
if (values['screenshot']) {
|
|
47
33
|
args.push(`--take-screenshot`)
|
|
34
|
+
const keepOpen = values['screenshot-keep-open'] ?? false
|
|
48
35
|
args.push(
|
|
49
36
|
JSON.stringify({
|
|
50
37
|
delay: Number(values['screenshot-delay']) || 1000,
|
|
51
|
-
width: Number(values['screenshot-width']) ||
|
|
52
|
-
height: Number(values['screenshot-height']) ||
|
|
53
|
-
path: values['screenshot-path'] || `${cwd}/screenshot.
|
|
54
|
-
|
|
55
|
-
|
|
38
|
+
width: Number(values['screenshot-width']) || 600,
|
|
39
|
+
height: Number(values['screenshot-height']) || 480,
|
|
40
|
+
path: values['screenshot-path'] || `${cwd}/screenshot.jpg`,
|
|
41
|
+
keepOpen,
|
|
42
|
+
noHeadless: values['screenshot-no-headless'] ?? false,
|
|
56
43
|
}),
|
|
57
44
|
)
|
|
45
|
+
needWatcher = keepOpen
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const useTypecheck = !values['skip-typecheck']
|
|
49
|
+
|
|
50
|
+
const compile = async () => {
|
|
51
|
+
if (useTypecheck) await $`bun typecheck`
|
|
52
|
+
await $`bun compile`
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
await compile()
|
|
56
|
+
|
|
57
|
+
let watcher: FSWatcher | null = null
|
|
58
|
+
if (needWatcher) {
|
|
59
|
+
const compileDebounced = debounce(compile, 500)
|
|
60
|
+
watcher = watch(`${cwd}/subspaces`, { recursive: true }, async (event, filename) => {
|
|
61
|
+
console.log(`Detected ${event} in ${filename}`)
|
|
62
|
+
compileDebounced()
|
|
63
|
+
})
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
await $`BRICKS_STAGE=${app.stage || 'production'} bunx --bun electron ${__dirname}/preview-main.mjs ${args}`
|
|
61
67
|
|
|
62
|
-
watcher.close()
|
|
68
|
+
if (watcher) watcher.close()
|
package/types/generators.ts
CHANGED
|
@@ -4307,6 +4307,379 @@ export type GeneratorSqlite = Generator &
|
|
|
4307
4307
|
>
|
|
4308
4308
|
}
|
|
4309
4309
|
|
|
4310
|
+
/* Refresh tools and resources, used for case if tools or resources are changed */
|
|
4311
|
+
export type GeneratorMCPServerActionRefreshResources = Action & {
|
|
4312
|
+
__actionName: 'GENERATOR_MCP_SERVER_REFRESH_RESOURCES'
|
|
4313
|
+
}
|
|
4314
|
+
|
|
4315
|
+
/* End stream */
|
|
4316
|
+
export type GeneratorMCPServerActionEndStream = Action & {
|
|
4317
|
+
__actionName: 'GENERATOR_MCP_SERVER_END_STREAM'
|
|
4318
|
+
}
|
|
4319
|
+
|
|
4320
|
+
interface GeneratorMCPServerDef {
|
|
4321
|
+
/*
|
|
4322
|
+
Default property:
|
|
4323
|
+
{
|
|
4324
|
+
"enabled": true,
|
|
4325
|
+
"listening": true,
|
|
4326
|
+
"authType": "none",
|
|
4327
|
+
"name": "bricks-foundation-mcp-server-default",
|
|
4328
|
+
"version": "1.0.0",
|
|
4329
|
+
"resources": [],
|
|
4330
|
+
"tools": []
|
|
4331
|
+
}
|
|
4332
|
+
*/
|
|
4333
|
+
property?: {
|
|
4334
|
+
/* Enable MCP server. If enabled and Listening is false, the generator can still provide application-scoped resources. */
|
|
4335
|
+
enabled?: boolean | DataLink
|
|
4336
|
+
/* Start MCP server */
|
|
4337
|
+
listening?: boolean | DataLink
|
|
4338
|
+
/* HTTP server port */
|
|
4339
|
+
port?: number | DataLink
|
|
4340
|
+
/* Authorization type of HTTP request */
|
|
4341
|
+
authType?: 'none' | 'bearer' | DataLink
|
|
4342
|
+
/* Token of bearer auth */
|
|
4343
|
+
bearerToken?: string | DataLink
|
|
4344
|
+
/* Name of the MCP server */
|
|
4345
|
+
name?: string | DataLink
|
|
4346
|
+
/* Version of the MCP server */
|
|
4347
|
+
version?: string | DataLink
|
|
4348
|
+
/* Resources
|
|
4349
|
+
Type:
|
|
4350
|
+
`static`: Return static data
|
|
4351
|
+
`detect-data-change`: Watch data target change to return data,
|
|
4352
|
+
please update data with ({ id: string, content: string | object }),
|
|
4353
|
+
and ensure the id is same with request id
|
|
4354
|
+
`script`: Not implemented yet */
|
|
4355
|
+
resources?:
|
|
4356
|
+
| Array<
|
|
4357
|
+
| DataLink
|
|
4358
|
+
| {
|
|
4359
|
+
enabled?: boolean | DataLink
|
|
4360
|
+
name?: string | DataLink
|
|
4361
|
+
description?: string | DataLink
|
|
4362
|
+
uriOrTemplate?: string | DataLink
|
|
4363
|
+
type?: 'static' | 'detect-data-change' | 'script' | DataLink
|
|
4364
|
+
staticData?: any
|
|
4365
|
+
dataChangeConfig?:
|
|
4366
|
+
| DataLink
|
|
4367
|
+
| {
|
|
4368
|
+
target?: string | DataLink
|
|
4369
|
+
timeout?: number | DataLink
|
|
4370
|
+
payload?: any
|
|
4371
|
+
}
|
|
4372
|
+
scriptConfig?:
|
|
4373
|
+
| DataLink
|
|
4374
|
+
| {
|
|
4375
|
+
code?: string | DataLink
|
|
4376
|
+
timeout?: number | DataLink
|
|
4377
|
+
members?:
|
|
4378
|
+
| Array<
|
|
4379
|
+
| DataLink
|
|
4380
|
+
| {
|
|
4381
|
+
handler?: string | DataLink
|
|
4382
|
+
varName?: string | DataLink
|
|
4383
|
+
}
|
|
4384
|
+
>
|
|
4385
|
+
| DataLink
|
|
4386
|
+
payload?: any
|
|
4387
|
+
}
|
|
4388
|
+
}
|
|
4389
|
+
>
|
|
4390
|
+
| DataLink
|
|
4391
|
+
/* Tools */
|
|
4392
|
+
tools?:
|
|
4393
|
+
| Array<
|
|
4394
|
+
| DataLink
|
|
4395
|
+
| {
|
|
4396
|
+
enabled?: boolean | DataLink
|
|
4397
|
+
name?: string | DataLink
|
|
4398
|
+
description?: string | DataLink
|
|
4399
|
+
params?: {} | DataLink
|
|
4400
|
+
type?: 'detect-data-change' | 'script' | DataLink
|
|
4401
|
+
dataChangeConfig?:
|
|
4402
|
+
| DataLink
|
|
4403
|
+
| {
|
|
4404
|
+
target?: string | DataLink
|
|
4405
|
+
timeout?: number | DataLink
|
|
4406
|
+
payload?: any
|
|
4407
|
+
}
|
|
4408
|
+
scriptConfig?:
|
|
4409
|
+
| DataLink
|
|
4410
|
+
| {
|
|
4411
|
+
code?: string | DataLink
|
|
4412
|
+
timeout?: number | DataLink
|
|
4413
|
+
members?:
|
|
4414
|
+
| Array<
|
|
4415
|
+
| DataLink
|
|
4416
|
+
| {
|
|
4417
|
+
handler?: string | DataLink
|
|
4418
|
+
varName?: string | DataLink
|
|
4419
|
+
}
|
|
4420
|
+
>
|
|
4421
|
+
| DataLink
|
|
4422
|
+
payload?: any
|
|
4423
|
+
}
|
|
4424
|
+
}
|
|
4425
|
+
>
|
|
4426
|
+
| DataLink
|
|
4427
|
+
}
|
|
4428
|
+
events?: {
|
|
4429
|
+
/* Listening of HTTP server */
|
|
4430
|
+
onListening?: Array<EventAction>
|
|
4431
|
+
/* Error of HTTP server */
|
|
4432
|
+
onError?: Array<EventAction>
|
|
4433
|
+
/* Client error of HTTP server */
|
|
4434
|
+
onClientError?: Array<EventAction>
|
|
4435
|
+
/* Client close of HTTP server */
|
|
4436
|
+
onClientClose?: Array<EventAction>
|
|
4437
|
+
/* On request resource (Request: { name: string, uri: string, params: object }) */
|
|
4438
|
+
onRequestResource?: Array<EventAction>
|
|
4439
|
+
/* On call tool (Request: { name: string, params: object }) */
|
|
4440
|
+
onCallTool?: Array<EventAction>
|
|
4441
|
+
}
|
|
4442
|
+
outlets?: {
|
|
4443
|
+
/* Whether the HTTP server is listening */
|
|
4444
|
+
isListening?: () => Data
|
|
4445
|
+
/* Last error of HTTP server */
|
|
4446
|
+
lastError?: () => Data
|
|
4447
|
+
/* Connected remotes (Session ID) */
|
|
4448
|
+
connectedRemotes?: () => Data
|
|
4449
|
+
/* Last resource request ({ name: string, uri: string, params: object }) */
|
|
4450
|
+
lastResourceRequest?: () => Data
|
|
4451
|
+
/* Last tool call ({ name: string, params: object }) */
|
|
4452
|
+
lastToolCall?: () => Data
|
|
4453
|
+
}
|
|
4454
|
+
}
|
|
4455
|
+
|
|
4456
|
+
/* Model Context Protocol (MCP) Server (https://docs.anthropic.com/en/docs/agents-and-tools/mcp) */
|
|
4457
|
+
export type GeneratorMCPServer = Generator &
|
|
4458
|
+
GeneratorMCPServerDef & {
|
|
4459
|
+
templateKey: 'GENERATOR_MCP_SERVER'
|
|
4460
|
+
switches: Array<
|
|
4461
|
+
SwitchDef &
|
|
4462
|
+
GeneratorMCPServerDef & {
|
|
4463
|
+
conds?: Array<{
|
|
4464
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
4465
|
+
cond:
|
|
4466
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
4467
|
+
| SwitchCondData
|
|
4468
|
+
| {
|
|
4469
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
4470
|
+
outlet:
|
|
4471
|
+
| 'isListening'
|
|
4472
|
+
| 'lastError'
|
|
4473
|
+
| 'connectedRemotes'
|
|
4474
|
+
| 'lastResourceRequest'
|
|
4475
|
+
| 'lastToolCall'
|
|
4476
|
+
value: any
|
|
4477
|
+
}
|
|
4478
|
+
}>
|
|
4479
|
+
}
|
|
4480
|
+
>
|
|
4481
|
+
}
|
|
4482
|
+
|
|
4483
|
+
/* Connect to MCP server */
|
|
4484
|
+
export type GeneratorMCPActionConnect = Action & {
|
|
4485
|
+
__actionName: 'GENERATOR_MCP_CONNECT'
|
|
4486
|
+
}
|
|
4487
|
+
|
|
4488
|
+
/* Disconnect from MCP server */
|
|
4489
|
+
export type GeneratorMCPActionDisconnect = Action & {
|
|
4490
|
+
__actionName: 'GENERATOR_MCP_DISCONNECT'
|
|
4491
|
+
}
|
|
4492
|
+
|
|
4493
|
+
/* List resources */
|
|
4494
|
+
export type GeneratorMCPActionListResources = ActionWithParams & {
|
|
4495
|
+
__actionName: 'GENERATOR_MCP_LIST_RESOURCES'
|
|
4496
|
+
params?: Array<{
|
|
4497
|
+
input: 'requestId'
|
|
4498
|
+
value?: string | DataLink | EventProperty
|
|
4499
|
+
mapping?: string
|
|
4500
|
+
}>
|
|
4501
|
+
}
|
|
4502
|
+
|
|
4503
|
+
/* List resource templates */
|
|
4504
|
+
export type GeneratorMCPActionListResourceTemplates = ActionWithParams & {
|
|
4505
|
+
__actionName: 'GENERATOR_MCP_LIST_RESOURCE_TEMPLATES'
|
|
4506
|
+
params?: Array<{
|
|
4507
|
+
input: 'requestId'
|
|
4508
|
+
value?: string | DataLink | EventProperty
|
|
4509
|
+
mapping?: string
|
|
4510
|
+
}>
|
|
4511
|
+
}
|
|
4512
|
+
|
|
4513
|
+
/* Read resource */
|
|
4514
|
+
export type GeneratorMCPActionReadResource = ActionWithParams & {
|
|
4515
|
+
__actionName: 'GENERATOR_MCP_READ_RESOURCE'
|
|
4516
|
+
params?: Array<
|
|
4517
|
+
| {
|
|
4518
|
+
input: 'requestId'
|
|
4519
|
+
value?: string | DataLink | EventProperty
|
|
4520
|
+
mapping?: string
|
|
4521
|
+
}
|
|
4522
|
+
| {
|
|
4523
|
+
input: 'uri'
|
|
4524
|
+
value?: string | DataLink | EventProperty
|
|
4525
|
+
mapping?: string
|
|
4526
|
+
}
|
|
4527
|
+
| {
|
|
4528
|
+
input: 'variables'
|
|
4529
|
+
value?: {} | DataLink | EventProperty
|
|
4530
|
+
mapping?: string
|
|
4531
|
+
}
|
|
4532
|
+
>
|
|
4533
|
+
}
|
|
4534
|
+
|
|
4535
|
+
/* List tools */
|
|
4536
|
+
export type GeneratorMCPActionListTools = ActionWithParams & {
|
|
4537
|
+
__actionName: 'GENERATOR_MCP_LIST_TOOLS'
|
|
4538
|
+
params?: Array<{
|
|
4539
|
+
input: 'requestId'
|
|
4540
|
+
value?: string | DataLink | EventProperty
|
|
4541
|
+
mapping?: string
|
|
4542
|
+
}>
|
|
4543
|
+
}
|
|
4544
|
+
|
|
4545
|
+
/* Call tool */
|
|
4546
|
+
export type GeneratorMCPActionCallTool = ActionWithParams & {
|
|
4547
|
+
__actionName: 'GENERATOR_MCP_CALL_TOOL'
|
|
4548
|
+
params?: Array<
|
|
4549
|
+
| {
|
|
4550
|
+
input: 'requestId'
|
|
4551
|
+
value?: string | DataLink | EventProperty
|
|
4552
|
+
mapping?: string
|
|
4553
|
+
}
|
|
4554
|
+
| {
|
|
4555
|
+
input: 'name'
|
|
4556
|
+
value?: string | DataLink | EventProperty
|
|
4557
|
+
mapping?: string
|
|
4558
|
+
}
|
|
4559
|
+
| {
|
|
4560
|
+
input: 'variables'
|
|
4561
|
+
value?: {} | DataLink | EventProperty
|
|
4562
|
+
mapping?: string
|
|
4563
|
+
}
|
|
4564
|
+
>
|
|
4565
|
+
}
|
|
4566
|
+
|
|
4567
|
+
interface GeneratorMCPDef {
|
|
4568
|
+
/*
|
|
4569
|
+
Default property:
|
|
4570
|
+
{
|
|
4571
|
+
"init": false,
|
|
4572
|
+
"type": "sse",
|
|
4573
|
+
"url": "",
|
|
4574
|
+
"generatorId": ""
|
|
4575
|
+
}
|
|
4576
|
+
*/
|
|
4577
|
+
property?: {
|
|
4578
|
+
/* Initialize the MCP client on start */
|
|
4579
|
+
init?: boolean | DataLink
|
|
4580
|
+
/* Type of the MCP connection, e.g. sse or direct-link (generator) */
|
|
4581
|
+
type?: 'sse' | 'direct-link' | DataLink
|
|
4582
|
+
/* URL of the MCP server, e.g. http://localhost:19853/sse */
|
|
4583
|
+
url?: string | DataLink
|
|
4584
|
+
/* SSE connection headers */
|
|
4585
|
+
sseHeaders?: {} | DataLink
|
|
4586
|
+
/* Send request headers */
|
|
4587
|
+
sendHeaders?: {} | DataLink
|
|
4588
|
+
/* Bearer token for authentication */
|
|
4589
|
+
bearerToken?: string | DataLink
|
|
4590
|
+
/* Generator MCPServer ID for direct link */
|
|
4591
|
+
generatorId?: string | DataLink
|
|
4592
|
+
}
|
|
4593
|
+
events?: {
|
|
4594
|
+
/* On connected */
|
|
4595
|
+
onConnected?: Array<EventAction>
|
|
4596
|
+
/* On connection error */
|
|
4597
|
+
onConnectionError?: Array<EventAction>
|
|
4598
|
+
/* On disconnected */
|
|
4599
|
+
onDisconnected?: Array<EventAction>
|
|
4600
|
+
/* On list resources */
|
|
4601
|
+
onListResources?: Array<EventAction>
|
|
4602
|
+
/* On list resources error */
|
|
4603
|
+
onListResourcesError?: Array<EventAction>
|
|
4604
|
+
/* On list resource templates */
|
|
4605
|
+
onListResourceTemplates?: Array<EventAction>
|
|
4606
|
+
/* On list resource templates error */
|
|
4607
|
+
onListResourceTemplatesError?: Array<EventAction>
|
|
4608
|
+
/* On read resource */
|
|
4609
|
+
onReadResource?: Array<EventAction>
|
|
4610
|
+
/* On read resource error */
|
|
4611
|
+
onReadResourceError?: Array<EventAction>
|
|
4612
|
+
/* On list tools */
|
|
4613
|
+
onListTools?: Array<EventAction>
|
|
4614
|
+
/* On list tools error */
|
|
4615
|
+
onListToolsError?: Array<EventAction>
|
|
4616
|
+
/* On call tool */
|
|
4617
|
+
onCallTool?: Array<EventAction>
|
|
4618
|
+
/* On call tool error */
|
|
4619
|
+
onCallToolError?: Array<EventAction>
|
|
4620
|
+
}
|
|
4621
|
+
outlets?: {
|
|
4622
|
+
/* Connection state */
|
|
4623
|
+
connectionState?: () => Data
|
|
4624
|
+
/* List resources response */
|
|
4625
|
+
listResourcesResponse?: () => Data
|
|
4626
|
+
/* List resources error */
|
|
4627
|
+
listResourcesError?: () => Data
|
|
4628
|
+
/* List resource templates response */
|
|
4629
|
+
listResourceTemplatesResponse?: () => Data
|
|
4630
|
+
/* List resource templates error */
|
|
4631
|
+
listResourceTemplatesError?: () => Data
|
|
4632
|
+
/* Read resource response */
|
|
4633
|
+
readResourceResponse?: () => Data
|
|
4634
|
+
/* Read resource error */
|
|
4635
|
+
readResourceError?: () => Data
|
|
4636
|
+
/* List tools response */
|
|
4637
|
+
listToolsResponse?: () => Data
|
|
4638
|
+
/* List tools error */
|
|
4639
|
+
listToolsError?: () => Data
|
|
4640
|
+
/* Call tool response */
|
|
4641
|
+
callToolResponse?: () => Data
|
|
4642
|
+
/* Call tool error */
|
|
4643
|
+
callToolError?: () => Data
|
|
4644
|
+
/* Last error */
|
|
4645
|
+
lastError?: () => Data
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
|
|
4649
|
+
/* Model Context Protocol (MCP) Client, support SSE and Generator MCPServer direct link */
|
|
4650
|
+
export type GeneratorMCP = Generator &
|
|
4651
|
+
GeneratorMCPDef & {
|
|
4652
|
+
templateKey: 'GENERATOR_MCP'
|
|
4653
|
+
switches: Array<
|
|
4654
|
+
SwitchDef &
|
|
4655
|
+
GeneratorMCPDef & {
|
|
4656
|
+
conds?: Array<{
|
|
4657
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
4658
|
+
cond:
|
|
4659
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
4660
|
+
| SwitchCondData
|
|
4661
|
+
| {
|
|
4662
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
4663
|
+
outlet:
|
|
4664
|
+
| 'connectionState'
|
|
4665
|
+
| 'listResourcesResponse'
|
|
4666
|
+
| 'listResourcesError'
|
|
4667
|
+
| 'listResourceTemplatesResponse'
|
|
4668
|
+
| 'listResourceTemplatesError'
|
|
4669
|
+
| 'readResourceResponse'
|
|
4670
|
+
| 'readResourceError'
|
|
4671
|
+
| 'listToolsResponse'
|
|
4672
|
+
| 'listToolsError'
|
|
4673
|
+
| 'callToolResponse'
|
|
4674
|
+
| 'callToolError'
|
|
4675
|
+
| 'lastError'
|
|
4676
|
+
value: any
|
|
4677
|
+
}
|
|
4678
|
+
}>
|
|
4679
|
+
}
|
|
4680
|
+
>
|
|
4681
|
+
}
|
|
4682
|
+
|
|
4310
4683
|
/* Load the model */
|
|
4311
4684
|
export type GeneratorTTSActionLoadModel = Action & {
|
|
4312
4685
|
__actionName: 'GENERATOR_TTS_LOAD_MODEL'
|
|
@@ -6106,6 +6479,104 @@ export type GeneratorOpenAILLM = Generator &
|
|
|
6106
6479
|
>
|
|
6107
6480
|
}
|
|
6108
6481
|
|
|
6482
|
+
/* Generate audio */
|
|
6483
|
+
export type GeneratorOpenAiTTSActionGenerate = ActionWithParams & {
|
|
6484
|
+
__actionName: 'GENERATOR_OPENAI_TTS_GENERATE'
|
|
6485
|
+
params?: Array<{
|
|
6486
|
+
input: 'text'
|
|
6487
|
+
value?: string | DataLink | EventProperty
|
|
6488
|
+
mapping?: string
|
|
6489
|
+
}>
|
|
6490
|
+
}
|
|
6491
|
+
|
|
6492
|
+
/* Clean cache */
|
|
6493
|
+
export type GeneratorOpenAiTTSActionCleanCache = Action & {
|
|
6494
|
+
__actionName: 'GENERATOR_OPENAI_TTS_CLEAN_CACHE'
|
|
6495
|
+
}
|
|
6496
|
+
|
|
6497
|
+
interface GeneratorOpenAiTTSDef {
|
|
6498
|
+
/*
|
|
6499
|
+
Default property:
|
|
6500
|
+
{
|
|
6501
|
+
"apiEndpoint": "https://api.openai.com/v1",
|
|
6502
|
+
"model": "tts-1",
|
|
6503
|
+
"voice": "alloy",
|
|
6504
|
+
"speed": 1,
|
|
6505
|
+
"outputType": "play",
|
|
6506
|
+
"playbackVolume": 100,
|
|
6507
|
+
"cacheGenerated": true,
|
|
6508
|
+
"autoInferEnable": false,
|
|
6509
|
+
"softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
|
|
6510
|
+
"hardBreakTime": 500
|
|
6511
|
+
}
|
|
6512
|
+
*/
|
|
6513
|
+
property?: {
|
|
6514
|
+
/* API endpoint URL */
|
|
6515
|
+
apiEndpoint?: string | DataLink
|
|
6516
|
+
/* OpenAI API Key */
|
|
6517
|
+
apiKey?: string | DataLink
|
|
6518
|
+
/* OpenAI TTS model */
|
|
6519
|
+
model?: string | DataLink
|
|
6520
|
+
/* Voice to use
|
|
6521
|
+
Select voice from https://openai.fm , default alloy */
|
|
6522
|
+
voice?: string | DataLink
|
|
6523
|
+
/* Additional instructions for the speech generation */
|
|
6524
|
+
instructions?: string | DataLink
|
|
6525
|
+
/* Speed of the generated audio */
|
|
6526
|
+
speed?: number | DataLink
|
|
6527
|
+
/* Output mode */
|
|
6528
|
+
outputType?: 'play' | 'file' | DataLink
|
|
6529
|
+
/* Playback volume (0 - 100) */
|
|
6530
|
+
playbackVolume?: number | DataLink
|
|
6531
|
+
/* Enable cache for generated audio */
|
|
6532
|
+
cacheGenerated?: boolean | DataLink
|
|
6533
|
+
/* Text to generate */
|
|
6534
|
+
prompt?: string | DataLink
|
|
6535
|
+
/* Auto inference when prompt changes */
|
|
6536
|
+
autoInferEnable?: boolean | DataLink
|
|
6537
|
+
/* Segmentation rule for auto inference */
|
|
6538
|
+
softBreakRegex?: string | DataLink
|
|
6539
|
+
/* Time to force inference when softBreakRegex is not satisfied */
|
|
6540
|
+
hardBreakTime?: number | DataLink
|
|
6541
|
+
}
|
|
6542
|
+
events?: {
|
|
6543
|
+
/* Event triggered when state change */
|
|
6544
|
+
onContextStateChange?: Array<EventAction>
|
|
6545
|
+
/* Event triggered when error occurs */
|
|
6546
|
+
onError?: Array<EventAction>
|
|
6547
|
+
}
|
|
6548
|
+
outlets?: {
|
|
6549
|
+
/* Context state */
|
|
6550
|
+
contextState?: () => Data
|
|
6551
|
+
/* Generated audio file */
|
|
6552
|
+
generatedAudio?: () => Data
|
|
6553
|
+
/* Generated audio file is playing */
|
|
6554
|
+
generatedAudioPlaying?: () => Data
|
|
6555
|
+
}
|
|
6556
|
+
}
|
|
6557
|
+
|
|
6558
|
+
/* Generate speech from text using OpenAI's Text-to-Speech API */
|
|
6559
|
+
export type GeneratorOpenAiTTS = Generator &
|
|
6560
|
+
GeneratorOpenAiTTSDef & {
|
|
6561
|
+
templateKey: 'GENERATOR_OPENAI_TTS'
|
|
6562
|
+
switches: Array<
|
|
6563
|
+
SwitchDef &
|
|
6564
|
+
GeneratorOpenAiTTSDef & {
|
|
6565
|
+
conds?: Array<{
|
|
6566
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
6567
|
+
cond:
|
|
6568
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
6569
|
+
| SwitchCondData
|
|
6570
|
+
| {
|
|
6571
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
6572
|
+
outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
|
|
6573
|
+
value: any
|
|
6574
|
+
}
|
|
6575
|
+
}>
|
|
6576
|
+
}
|
|
6577
|
+
>
|
|
6578
|
+
}
|
|
6579
|
+
|
|
6109
6580
|
/* Add a message to the assistant */
|
|
6110
6581
|
export type GeneratorAssistantActionAddMessage = ActionWithParams & {
|
|
6111
6582
|
__actionName: 'GENERATOR_ASSISTANT_ADD_MESSAGE'
|
package/utils/event-props.ts
CHANGED
|
@@ -615,6 +615,71 @@ export const templateEventPropsMap = {
|
|
|
615
615
|
'GENERATOR_SQLITE_QUERY_RESULT', // type: array
|
|
616
616
|
],
|
|
617
617
|
},
|
|
618
|
+
GENERATOR_MCP_SERVER: {
|
|
619
|
+
onError: [
|
|
620
|
+
'GENERATOR_MCP_SERVER_ERROR_MESSAGE', // type: string
|
|
621
|
+
],
|
|
622
|
+
onClientError: [
|
|
623
|
+
'GENERATOR_MCP_SERVER_CLIENT_ADDRESS', // type: string
|
|
624
|
+
'GENERATOR_MCP_SERVER_SESSION_ID', // type: string
|
|
625
|
+
'GENERATOR_MCP_SERVER_ERROR_MESSAGE', // type: string
|
|
626
|
+
],
|
|
627
|
+
onClientClose: [
|
|
628
|
+
'GENERATOR_MCP_SERVER_CLIENT_ADDRESS', // type: string
|
|
629
|
+
'GENERATOR_MCP_SERVER_SESSION_ID', // type: string
|
|
630
|
+
],
|
|
631
|
+
onRequestResource: [
|
|
632
|
+
'GENERATOR_MCP_SERVER_REQUEST', // type: object
|
|
633
|
+
],
|
|
634
|
+
onCallTool: [
|
|
635
|
+
'GENERATOR_MCP_SERVER_REQUEST', // type: object
|
|
636
|
+
],
|
|
637
|
+
},
|
|
638
|
+
GENERATOR_MCP: {
|
|
639
|
+
onConnectionError: [
|
|
640
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
641
|
+
],
|
|
642
|
+
onListResources: [
|
|
643
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
644
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
645
|
+
],
|
|
646
|
+
onListResourcesError: [
|
|
647
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
648
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
649
|
+
],
|
|
650
|
+
onListResourceTemplates: [
|
|
651
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
652
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
653
|
+
],
|
|
654
|
+
onListResourceTemplatesError: [
|
|
655
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
656
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
657
|
+
],
|
|
658
|
+
onReadResource: [
|
|
659
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
660
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
661
|
+
],
|
|
662
|
+
onReadResourceError: [
|
|
663
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
664
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
665
|
+
],
|
|
666
|
+
onListTools: [
|
|
667
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
668
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
669
|
+
],
|
|
670
|
+
onListToolsError: [
|
|
671
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
672
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
673
|
+
],
|
|
674
|
+
onCallTool: [
|
|
675
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
676
|
+
'GENERATOR_MCP_RESPONSE', // type: object
|
|
677
|
+
],
|
|
678
|
+
onCallToolError: [
|
|
679
|
+
'GENERATOR_MCP_REQUEST_ID', // type: string
|
|
680
|
+
'GENERATOR_MCP_ERROR_MESSAGE', // type: string
|
|
681
|
+
],
|
|
682
|
+
},
|
|
618
683
|
GENERATOR_TTS: {
|
|
619
684
|
onContextStateChange: [
|
|
620
685
|
'GENERATOR_TTS_CONTEXT_STATE', // type: string
|
|
@@ -699,6 +764,14 @@ export const templateEventPropsMap = {
|
|
|
699
764
|
'GENERATOR_OPENAI_LLM_COMPLETION_FUNCTION_ARGUMENTS', // type: string
|
|
700
765
|
],
|
|
701
766
|
},
|
|
767
|
+
GENERATOR_OPENAI_TTS: {
|
|
768
|
+
onContextStateChange: [
|
|
769
|
+
'GENERATOR_OPENAI_TTS_CONTEXT_STATE', // type: string
|
|
770
|
+
],
|
|
771
|
+
onError: [
|
|
772
|
+
'GENERATOR_OPENAI_TTS_ERROR', // type: string
|
|
773
|
+
],
|
|
774
|
+
},
|
|
702
775
|
GENERATOR_ASSISTANT: {
|
|
703
776
|
onError: [
|
|
704
777
|
'GENERATOR_ASSISTANT_ERROR', // type: string
|