@fugood/bricks-project 2.23.0-beta.42 → 2.23.0-beta.45
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/api/instance.ts +37 -5
- package/compile/action-name-map.ts +4 -0
- package/compile/index.ts +2 -0
- package/package.json +2 -2
- package/tools/deploy.ts +33 -2
- package/tools/postinstall.ts +0 -6
- package/tools/pull.ts +1 -1
- package/types/bricks/Camera.ts +23 -8
- package/types/data.ts +2 -0
- package/types/generators/AlarmClock.ts +1 -0
- package/types/generators/Assistant.ts +6 -5
- package/types/generators/BleCentral.ts +1 -0
- package/types/generators/BlePeripheral.ts +1 -0
- package/types/generators/CanvasMap.ts +1 -0
- package/types/generators/CastlesPay.ts +1 -0
- package/types/generators/DataBank.ts +1 -0
- package/types/generators/File.ts +1 -0
- package/types/generators/GraphQl.ts +1 -0
- package/types/generators/Http.ts +1 -0
- package/types/generators/HttpServer.ts +1 -0
- package/types/generators/Information.ts +1 -0
- package/types/generators/Intent.ts +1 -0
- package/types/generators/Iterator.ts +1 -0
- package/types/generators/Keyboard.ts +1 -0
- package/types/generators/LlmAnthropicCompat.ts +1 -0
- package/types/generators/LlmAppleBuiltin.ts +1 -0
- package/types/generators/LlmGgml.ts +1 -0
- package/types/generators/LlmOnnx.ts +1 -0
- package/types/generators/LlmOpenAiCompat.ts +1 -0
- package/types/generators/LlmQualcommAiEngine.ts +1 -0
- package/types/generators/Mcp.ts +2 -1
- package/types/generators/McpServer.ts +7 -6
- package/types/generators/MediaFlow.ts +1 -0
- package/types/generators/MqttBroker.ts +1 -0
- package/types/generators/MqttClient.ts +1 -0
- package/types/generators/Question.ts +1 -0
- package/types/generators/RealtimeTranscription.ts +3 -2
- package/types/generators/RerankerGgml.ts +1 -0
- package/types/generators/SerialPort.ts +1 -0
- package/types/generators/SoundPlayer.ts +1 -0
- package/types/generators/SoundRecorder.ts +1 -0
- package/types/generators/SpeechToTextGgml.ts +1 -0
- package/types/generators/SpeechToTextOnnx.ts +1 -0
- package/types/generators/SpeechToTextPlatform.ts +1 -0
- package/types/generators/SqLite.ts +1 -0
- package/types/generators/Step.ts +1 -0
- package/types/generators/SttAppleBuiltin.ts +1 -0
- package/types/generators/Tcp.ts +1 -0
- package/types/generators/TcpServer.ts +1 -0
- package/types/generators/TextToSpeechAppleBuiltin.ts +1 -0
- package/types/generators/TextToSpeechGgml.ts +1 -0
- package/types/generators/TextToSpeechOnnx.ts +1 -0
- package/types/generators/TextToSpeechOpenAiLike.ts +1 -0
- package/types/generators/ThermalPrinter.ts +1 -0
- package/types/generators/Tick.ts +1 -0
- package/types/generators/Udp.ts +1 -0
- package/types/generators/VadGgml.ts +1 -0
- package/types/generators/VectorStore.ts +1 -0
- package/types/generators/Watchdog.ts +1 -0
- package/types/generators/WebCrawler.ts +1 -0
- package/types/generators/WebRtc.ts +3 -2
- package/types/generators/WebSocket.ts +1 -0
- package/utils/event-props.ts +1 -0
package/api/instance.ts
CHANGED
|
@@ -66,17 +66,31 @@ export const deployApp = async (
|
|
|
66
66
|
appId: string,
|
|
67
67
|
config: Config,
|
|
68
68
|
lastCommitId?: string,
|
|
69
|
+
changelogs?: string,
|
|
70
|
+
version?: string,
|
|
69
71
|
) => {
|
|
70
72
|
const app = await pullApp(stage, appId)
|
|
71
73
|
if (app.config?.bricks_project_last_commit_id === lastCommitId)
|
|
72
74
|
throw new Error('No changes to deploy')
|
|
73
75
|
|
|
76
|
+
const versionName = version || app.name || 'Untitled'
|
|
77
|
+
const releaseNote = changelogs
|
|
78
|
+
? `${changelogs}\n\nRelease by BRICKS Project`
|
|
79
|
+
: 'Release by BRICKS Project'
|
|
80
|
+
|
|
74
81
|
const { errors } = await doGQL(
|
|
75
82
|
stage,
|
|
76
|
-
`mutation
|
|
83
|
+
`mutation BRICKS_PROJECT_releaseApplication(
|
|
84
|
+
$id: ID!,
|
|
85
|
+
$config: String,
|
|
86
|
+
$releaseCurrentVersion: String,
|
|
87
|
+
$releaseCurrentVersionNote: String
|
|
88
|
+
) {
|
|
77
89
|
updateApplication(
|
|
78
90
|
id: $id,
|
|
79
|
-
config: $config
|
|
91
|
+
config: $config,
|
|
92
|
+
releaseCurrentVersion: $releaseCurrentVersion,
|
|
93
|
+
releaseCurrentVersionNote: $releaseCurrentVersionNote
|
|
80
94
|
) {
|
|
81
95
|
_id
|
|
82
96
|
name
|
|
@@ -86,9 +100,11 @@ export const deployApp = async (
|
|
|
86
100
|
id: appId,
|
|
87
101
|
config: JSON.stringify({
|
|
88
102
|
...config,
|
|
89
|
-
title:
|
|
103
|
+
title: versionName,
|
|
90
104
|
bricks_project_last_commit_id: lastCommitId,
|
|
91
105
|
}),
|
|
106
|
+
releaseCurrentVersion: versionName,
|
|
107
|
+
releaseCurrentVersionNote: releaseNote,
|
|
92
108
|
},
|
|
93
109
|
)
|
|
94
110
|
if (errors) throw new Error(errors[0].message)
|
|
@@ -137,18 +153,32 @@ export const deployModule = async (
|
|
|
137
153
|
modId: string,
|
|
138
154
|
config: Config,
|
|
139
155
|
lastCommitId?: string,
|
|
156
|
+
changelogs?: string,
|
|
157
|
+
version?: string,
|
|
140
158
|
) => {
|
|
141
159
|
const mod = await pullModule(stage, modId)
|
|
142
160
|
if (mod.config?.bricks_project_last_commit_id === lastCommitId)
|
|
143
161
|
throw new Error('No changes to deploy')
|
|
144
162
|
|
|
163
|
+
const versionName = version || mod.name || 'Untitled'
|
|
164
|
+
const releaseNote = changelogs
|
|
165
|
+
? `${changelogs}\n\nRelease by BRICKS Project`
|
|
166
|
+
: 'Release by BRICKS Project'
|
|
167
|
+
|
|
145
168
|
const { errors } = await doGQL(
|
|
146
169
|
stage,
|
|
147
|
-
`mutation
|
|
170
|
+
`mutation BRICKS_PROJECT_releaseModule(
|
|
171
|
+
$id: ID!,
|
|
172
|
+
$config: String,
|
|
173
|
+
$releaseCurrentVersion: String,
|
|
174
|
+
$releaseCurrentVersionNote: String
|
|
175
|
+
) {
|
|
148
176
|
updateModule(
|
|
149
177
|
id: $id
|
|
150
178
|
config: $config
|
|
151
179
|
validateConfig: true
|
|
180
|
+
releaseCurrentVersion: $releaseCurrentVersion
|
|
181
|
+
releaseCurrentVersionNote: $releaseCurrentVersionNote
|
|
152
182
|
) {
|
|
153
183
|
_id
|
|
154
184
|
name
|
|
@@ -158,9 +188,11 @@ export const deployModule = async (
|
|
|
158
188
|
id: modId,
|
|
159
189
|
config: JSON.stringify({
|
|
160
190
|
...config,
|
|
161
|
-
title:
|
|
191
|
+
title: versionName,
|
|
162
192
|
bricks_project_last_commit_id: lastCommitId,
|
|
163
193
|
}),
|
|
194
|
+
releaseCurrentVersion: versionName,
|
|
195
|
+
releaseCurrentVersionNote: releaseNote,
|
|
164
196
|
},
|
|
165
197
|
)
|
|
166
198
|
if (errors) throw new Error(errors[0].message)
|
|
@@ -304,6 +304,10 @@ export const templateActionNameMap = {
|
|
|
304
304
|
maxDuration: 'BRICK_CAMERA_MAX_DURATION',
|
|
305
305
|
maxFileSize: 'BRICK_CAMERA_MAX_FILE_SIZE',
|
|
306
306
|
},
|
|
307
|
+
BRICK_CAMERA_FOCUS: {
|
|
308
|
+
focusX: 'BRICK_CAMERA_FOCUS_X',
|
|
309
|
+
focusY: 'BRICK_CAMERA_FOCUS_Y',
|
|
310
|
+
},
|
|
307
311
|
},
|
|
308
312
|
|
|
309
313
|
GENERATOR_FILE: {
|
package/compile/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugood/bricks-project",
|
|
3
|
-
"version": "2.23.0-beta.
|
|
3
|
+
"version": "2.23.0-beta.45",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "bun scripts/build.js"
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"lodash": "^4.17.4",
|
|
15
15
|
"uuid": "^8.3.1"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "fa67a0c333ca6e372e7b7b01035d8e871b216b9f"
|
|
18
18
|
}
|
package/tools/deploy.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { $ } from 'bun'
|
|
2
|
+
import { parseArgs } from 'util'
|
|
2
3
|
import { deployApp, deployModule } from '../api'
|
|
3
4
|
|
|
4
5
|
const cwd = process.cwd()
|
|
5
6
|
|
|
7
|
+
// Parse command-line arguments
|
|
8
|
+
const {
|
|
9
|
+
values: { changelogs: changelogsArg, 'changelogs-file': changelogsFile },
|
|
10
|
+
} = parseArgs({
|
|
11
|
+
args: Bun.argv.slice(2),
|
|
12
|
+
options: {
|
|
13
|
+
changelogs: { type: 'string' },
|
|
14
|
+
'changelogs-file': { type: 'string' },
|
|
15
|
+
},
|
|
16
|
+
allowPositionals: true,
|
|
17
|
+
})
|
|
18
|
+
|
|
6
19
|
const { exitCode } = await $`cd ${cwd} && git status`.nothrow()
|
|
7
20
|
const isGitRepo = exitCode === 0
|
|
8
21
|
|
|
@@ -22,14 +35,32 @@ const app = await Bun.file(`${cwd}/application.json`).json()
|
|
|
22
35
|
const stage = app.stage || 'production'
|
|
23
36
|
const config = await Bun.file(`${cwd}/.bricks/build/application-config.json`).json()
|
|
24
37
|
|
|
38
|
+
// Get version from project's package.json
|
|
39
|
+
const pkgFile = Bun.file(`${cwd}/package.json`)
|
|
40
|
+
const version = (await pkgFile.exists()) ? (await pkgFile.json()).version : undefined
|
|
41
|
+
|
|
42
|
+
// Get changelog from flag, file, or prompt
|
|
43
|
+
let changelogs = ''
|
|
44
|
+
if (changelogsArg) {
|
|
45
|
+
changelogs = changelogsArg
|
|
46
|
+
} else if (changelogsFile) {
|
|
47
|
+
const file = Bun.file(changelogsFile)
|
|
48
|
+
if (!(await file.exists())) {
|
|
49
|
+
throw new Error(`Changelogs file not found: ${changelogsFile}`)
|
|
50
|
+
}
|
|
51
|
+
changelogs = await file.text()
|
|
52
|
+
} else {
|
|
53
|
+
changelogs = prompt('Enter changelogs (optional, press Enter to skip):') || ''
|
|
54
|
+
}
|
|
55
|
+
|
|
25
56
|
// ask for confirmation
|
|
26
57
|
const confirm = prompt('Are you sure you want to deploy? (y/n)')
|
|
27
58
|
if (confirm !== 'y') throw new Error('Deployment cancelled')
|
|
28
59
|
|
|
29
60
|
if (!app.type || app.type === 'application') {
|
|
30
|
-
await deployApp(stage, app.id, config, commitId)
|
|
61
|
+
await deployApp(stage, app.id, config, commitId, changelogs, version)
|
|
31
62
|
console.log('App deployed')
|
|
32
63
|
} else if (app.type === 'module') {
|
|
33
|
-
await deployModule(stage, app.id, config, commitId)
|
|
64
|
+
await deployModule(stage, app.id, config, commitId, changelogs, version)
|
|
34
65
|
console.log('Module deployed')
|
|
35
66
|
}
|
package/tools/postinstall.ts
CHANGED
|
@@ -55,13 +55,7 @@ const handleMcpConfigOverride = async (mcpConfigPath: string) => {
|
|
|
55
55
|
console.log(`Updated ${mcpConfigPath}`)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
if (await exists(`${cwd}/.cursor/rules/instructions.mdc`)) {
|
|
59
|
-
const cursorMcpConfigPath = `${cwd}/.cursor/mcp.json`
|
|
60
|
-
await handleMcpConfigOverride(cursorMcpConfigPath)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
58
|
if (await exists(`${cwd}/CLAUDE.md`)) {
|
|
64
|
-
await $`mkdir -p ${cwd}/.cursor`
|
|
65
59
|
const claudeCodeMcpConfigPath = `${cwd}/.mcp.json`
|
|
66
60
|
await handleMcpConfigOverride(claudeCodeMcpConfigPath)
|
|
67
61
|
}
|
package/tools/pull.ts
CHANGED
|
@@ -70,7 +70,7 @@ await Promise.all(
|
|
|
70
70
|
|
|
71
71
|
if (isGitRepo) {
|
|
72
72
|
await $`cd ${cwd} && git add .`
|
|
73
|
-
await $`cd ${cwd} && git commit -m '
|
|
73
|
+
await $`cd ${cwd} && git commit -m 'chore(project): apply file changes from BRICKS application'`
|
|
74
74
|
if (!useMain) {
|
|
75
75
|
await $`cd ${cwd} && git merge main`
|
|
76
76
|
}
|
package/types/bricks/Camera.ts
CHANGED
|
@@ -77,12 +77,27 @@ export type BrickCameraActionStopRecord = Action & {
|
|
|
77
77
|
__actionName: 'BRICK_CAMERA_STOP_RECORD'
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/* Focus the Camera at a specific point */
|
|
81
|
+
export type BrickCameraActionFocus = ActionWithParams & {
|
|
82
|
+
__actionName: 'BRICK_CAMERA_FOCUS'
|
|
83
|
+
params?: Array<
|
|
84
|
+
| {
|
|
85
|
+
input: 'focusX'
|
|
86
|
+
value?: number | DataLink | EventProperty
|
|
87
|
+
mapping?: string
|
|
88
|
+
}
|
|
89
|
+
| {
|
|
90
|
+
input: 'focusY'
|
|
91
|
+
value?: number | DataLink | EventProperty
|
|
92
|
+
mapping?: string
|
|
93
|
+
}
|
|
94
|
+
>
|
|
95
|
+
}
|
|
96
|
+
|
|
80
97
|
interface BrickCameraDef {
|
|
81
98
|
/*
|
|
82
99
|
Default property:
|
|
83
100
|
{
|
|
84
|
-
"autoFocusEnabled": false,
|
|
85
|
-
"focusDepth": 0.5,
|
|
86
101
|
"type": "back",
|
|
87
102
|
"flashMode": "off",
|
|
88
103
|
"captureAudio": false,
|
|
@@ -92,12 +107,10 @@ Default property:
|
|
|
92
107
|
}
|
|
93
108
|
*/
|
|
94
109
|
property?: BrickBasicProperty & {
|
|
95
|
-
/* Camera auto focus */
|
|
96
|
-
autoFocusEnabled?: boolean | DataLink
|
|
97
|
-
/* The auto focus feature of the camera to attempt to focus on the part of the image at this coordinate. */
|
|
98
|
-
focusDepth?: number | DataLink
|
|
99
110
|
/* Camera type (Ignore it if you are using external camera) */
|
|
100
111
|
type?: 'back' | 'front' | DataLink
|
|
112
|
+
/* Enable or disable camera */
|
|
113
|
+
isActive?: boolean | DataLink
|
|
101
114
|
/* Camera zoom */
|
|
102
115
|
zoom?: number | DataLink
|
|
103
116
|
/* Camera flash mode */
|
|
@@ -115,7 +128,7 @@ Default property:
|
|
|
115
128
|
| 'incandescent'
|
|
116
129
|
| 'fluorescent'
|
|
117
130
|
| DataLink
|
|
118
|
-
/* Enable face detection */
|
|
131
|
+
/* Enable face detection (Note: Barcode detection will be disabled when enabled) */
|
|
119
132
|
faceDetectionEnabled?: boolean | DataLink
|
|
120
133
|
/* Face detection event mode */
|
|
121
134
|
faceDetectionEventMode?: 'when-detected' | 'interval' | DataLink
|
|
@@ -153,6 +166,8 @@ Default property:
|
|
|
153
166
|
mountError?: Array<EventAction>
|
|
154
167
|
}
|
|
155
168
|
outlets?: {
|
|
169
|
+
/* Camera device and format information */
|
|
170
|
+
info?: () => Data
|
|
156
171
|
/* Picture taken result */
|
|
157
172
|
pictureTaken?: () => Data
|
|
158
173
|
/* Record video result */
|
|
@@ -187,7 +202,7 @@ export type BrickCamera = Brick &
|
|
|
187
202
|
| SwitchCondData
|
|
188
203
|
| {
|
|
189
204
|
__typename: 'SwitchCondInnerStateOutlet'
|
|
190
|
-
outlet: 'pictureTaken' | 'recordVideo' | 'barcodeRead' | 'faceDetected'
|
|
205
|
+
outlet: 'info' | 'pictureTaken' | 'recordVideo' | 'barcodeRead' | 'faceDetected'
|
|
191
206
|
value: any
|
|
192
207
|
}
|
|
193
208
|
}>
|
package/types/data.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
3
|
import type { Data, DataLink } from '../data'
|
|
4
4
|
import type {
|
|
5
|
+
Brick,
|
|
5
6
|
Generator,
|
|
6
7
|
EventAction,
|
|
7
8
|
ActionWithDataParams,
|
|
@@ -434,7 +435,7 @@ Default property:
|
|
|
434
435
|
/* Whether to cache messages */
|
|
435
436
|
cacheMessages?: boolean | DataLink
|
|
436
437
|
/* LLM Generator (Supports `LLM (GGML)` and `OpenAI LLM` generators) */
|
|
437
|
-
llmGeneratorId?: string | DataLink
|
|
438
|
+
llmGeneratorId?: string | DataLink | (() => Generator)
|
|
438
439
|
/* LLM Live Policy. If the policy is `only-in-use`, the LLM context will be released when the assistant is not in use.
|
|
439
440
|
|
|
440
441
|
Note: LLM (Qualcomm AI Engine) recommend use `manual` and loaded constantly. */
|
|
@@ -463,7 +464,7 @@ Default property:
|
|
|
463
464
|
/* File Search (Vector Store) Enabled */
|
|
464
465
|
fileSearchEnabled?: boolean | DataLink
|
|
465
466
|
/* File Search (Vector Store) Generator */
|
|
466
|
-
fileSearchGeneratorId?: string | DataLink
|
|
467
|
+
fileSearchGeneratorId?: string | DataLink | (() => Generator)
|
|
467
468
|
/* File Search (Vector Store) Live Policy. If the policy is `only-in-use`, the File Search (Vector Store) context will be released when the assistant is not in use. */
|
|
468
469
|
fileSearchLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
469
470
|
/* File Search Citation Count. (Default: 3) */
|
|
@@ -473,13 +474,13 @@ Default property:
|
|
|
473
474
|
/* File Search Ignore Threshold. (Default: false) */
|
|
474
475
|
fileSearchIgnoreThreshold?: boolean | DataLink
|
|
475
476
|
/* STT Generator use for transcribing audio message (Supports `STT (GGML)` generators) */
|
|
476
|
-
sttGeneratorId?: string | DataLink
|
|
477
|
+
sttGeneratorId?: string | DataLink | (() => Generator)
|
|
477
478
|
/* STT Enabled */
|
|
478
479
|
sttEnabled?: boolean | DataLink
|
|
479
480
|
/* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when the assistant is not in use. */
|
|
480
481
|
sttLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
481
482
|
/* TTS Generator use for generating LLM response audio message (Supports `TTS (ONNX)` and `OpenAI TTS` generators) */
|
|
482
|
-
ttsGeneratorId?: string | DataLink
|
|
483
|
+
ttsGeneratorId?: string | DataLink | (() => Generator)
|
|
483
484
|
/* TTS Enabled */
|
|
484
485
|
ttsEnabled?: boolean | DataLink
|
|
485
486
|
/* TTS Live Policy. If the policy is `only-in-use`, the TTS context will be released when the assistant is not in use. */
|
|
@@ -489,7 +490,7 @@ Default property:
|
|
|
489
490
|
| Array<
|
|
490
491
|
| DataLink
|
|
491
492
|
| {
|
|
492
|
-
generatorId?: string | DataLink
|
|
493
|
+
generatorId?: string | DataLink | (() => Generator)
|
|
493
494
|
generatorKey?: string | DataLink
|
|
494
495
|
name?: string | DataLink
|
|
495
496
|
enabled?: boolean | DataLink
|
package/types/generators/File.ts
CHANGED
package/types/generators/Http.ts
CHANGED
package/types/generators/Mcp.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
3
|
import type { Data, DataLink } from '../data'
|
|
4
4
|
import type {
|
|
5
|
+
Brick,
|
|
5
6
|
Generator,
|
|
6
7
|
EventAction,
|
|
7
8
|
ActionWithDataParams,
|
|
@@ -168,7 +169,7 @@ Default property:
|
|
|
168
169
|
/* Bearer token for authentication */
|
|
169
170
|
bearerToken?: string | DataLink
|
|
170
171
|
/* Generator MCP Server ID for direct link */
|
|
171
|
-
generatorId?: string | DataLink
|
|
172
|
+
generatorId?: string | DataLink | (() => Generator)
|
|
172
173
|
/* Application-scoped key of Generator MCP Server for direct link (If ID is not provided) */
|
|
173
174
|
generatorKey?: string | DataLink
|
|
174
175
|
/* Name of the MCP client */
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
3
|
import type { Data, DataLink } from '../data'
|
|
4
4
|
import type {
|
|
5
|
+
Brick,
|
|
5
6
|
Generator,
|
|
6
7
|
EventAction,
|
|
7
8
|
ActionWithDataParams,
|
|
@@ -68,7 +69,7 @@ Default property:
|
|
|
68
69
|
dataChangeConfig?:
|
|
69
70
|
| DataLink
|
|
70
71
|
| {
|
|
71
|
-
target?: string | DataLink
|
|
72
|
+
target?: string | DataLink | (() => Data)
|
|
72
73
|
timeout?: number | DataLink
|
|
73
74
|
additionalParams?: {} | DataLink
|
|
74
75
|
}
|
|
@@ -81,7 +82,7 @@ Default property:
|
|
|
81
82
|
| Array<
|
|
82
83
|
| DataLink
|
|
83
84
|
| {
|
|
84
|
-
handler?: string | DataLink
|
|
85
|
+
handler?: string | DataLink | (() => Generator)
|
|
85
86
|
varName?: string | DataLink
|
|
86
87
|
}
|
|
87
88
|
>
|
|
@@ -114,7 +115,7 @@ Default property:
|
|
|
114
115
|
dataChangeConfig?:
|
|
115
116
|
| DataLink
|
|
116
117
|
| {
|
|
117
|
-
target?: string | DataLink
|
|
118
|
+
target?: string | DataLink | (() => Data)
|
|
118
119
|
timeout?: number | DataLink
|
|
119
120
|
additionalParams?: {} | DataLink
|
|
120
121
|
}
|
|
@@ -127,7 +128,7 @@ Default property:
|
|
|
127
128
|
| Array<
|
|
128
129
|
| DataLink
|
|
129
130
|
| {
|
|
130
|
-
handler?: string | DataLink
|
|
131
|
+
handler?: string | DataLink | (() => Generator)
|
|
131
132
|
varName?: string | DataLink
|
|
132
133
|
}
|
|
133
134
|
>
|
|
@@ -160,7 +161,7 @@ Default property:
|
|
|
160
161
|
dataChangeConfig?:
|
|
161
162
|
| DataLink
|
|
162
163
|
| {
|
|
163
|
-
target?: string | DataLink
|
|
164
|
+
target?: string | DataLink | (() => Data)
|
|
164
165
|
timeout?: number | DataLink
|
|
165
166
|
additionalParams?: {} | DataLink
|
|
166
167
|
}
|
|
@@ -173,7 +174,7 @@ Default property:
|
|
|
173
174
|
| Array<
|
|
174
175
|
| DataLink
|
|
175
176
|
| {
|
|
176
|
-
handler?: string | DataLink
|
|
177
|
+
handler?: string | DataLink | (() => Generator)
|
|
177
178
|
varName?: string | DataLink
|
|
178
179
|
}
|
|
179
180
|
>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
3
|
import type { Data, DataLink } from '../data'
|
|
4
4
|
import type {
|
|
5
|
+
Brick,
|
|
5
6
|
Generator,
|
|
6
7
|
EventAction,
|
|
7
8
|
ActionWithDataParams,
|
|
@@ -57,11 +58,11 @@ Default property:
|
|
|
57
58
|
*/
|
|
58
59
|
property?: {
|
|
59
60
|
/* STT Generator for Whisper context */
|
|
60
|
-
sttGeneratorId?: string | DataLink
|
|
61
|
+
sttGeneratorId?: string | DataLink | (() => Generator)
|
|
61
62
|
/* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when not in use. */
|
|
62
63
|
sttLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
63
64
|
/* VAD Inference Generator for voice activity detection */
|
|
64
|
-
vadInferenceGeneratorId?: string | DataLink
|
|
65
|
+
vadInferenceGeneratorId?: string | DataLink | (() => Generator)
|
|
65
66
|
/* VAD Inference Live Policy. If the policy is `only-in-use`, the VAD Inference context will be released when not in use. */
|
|
66
67
|
vadInferenceLivePolicy?: 'only-in-use' | 'manual' | DataLink
|
|
67
68
|
/* Enable VAD (Voice Activity Detection) */
|
package/types/generators/Step.ts
CHANGED
package/types/generators/Tcp.ts
CHANGED
package/types/generators/Tick.ts
CHANGED
package/types/generators/Udp.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
3
3
|
import type { Data, DataLink } from '../data'
|
|
4
4
|
import type {
|
|
5
|
+
Brick,
|
|
5
6
|
Generator,
|
|
6
7
|
EventAction,
|
|
7
8
|
ActionWithDataParams,
|
|
@@ -59,9 +60,9 @@ Default property:
|
|
|
59
60
|
/* Calee ID, to ilter caller signal */
|
|
60
61
|
calleeId?: string | DataLink
|
|
61
62
|
/* Target local WebRTC stream preview brick ID */
|
|
62
|
-
localVideoTarget?: string | DataLink
|
|
63
|
+
localVideoTarget?: string | DataLink | (() => Brick)
|
|
63
64
|
/* Target remote WebRTC stream brick ID */
|
|
64
|
-
remoteVideoTarget?: string | DataLink
|
|
65
|
+
remoteVideoTarget?: string | DataLink | (() => Brick)
|
|
65
66
|
/* ICE Server list
|
|
66
67
|
Default use Google public STUN servers if not setted. */
|
|
67
68
|
iceServers?:
|
package/utils/event-props.ts
CHANGED
|
@@ -968,6 +968,7 @@ export const templateEventPropsMap = {
|
|
|
968
968
|
'GENERATOR_ASSISTANT_LAST_MESSAGE', // type: object
|
|
969
969
|
'GENERATOR_ASSISTANT_IS_ERROR', // type: bool
|
|
970
970
|
'GENERATOR_ASSISTANT_FINISH_REASON', // type: string
|
|
971
|
+
'GENERATOR_ASSISTANT_TRANSFORMED_MESSAGES', // type: array
|
|
971
972
|
],
|
|
972
973
|
},
|
|
973
974
|
GENERATOR_VECTOR_STORE: {
|