@fugood/bricks-project 2.22.8 → 2.22.9

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.
Files changed (60) hide show
  1. package/api/instance.ts +37 -5
  2. package/compile/action-name-map.ts +1 -0
  3. package/compile/index.ts +2 -0
  4. package/package.json +1 -1
  5. package/tools/deploy.ts +33 -2
  6. package/tools/postinstall.ts +0 -6
  7. package/tools/pull.ts +1 -1
  8. package/types/bricks/WebView.ts +7 -1
  9. package/types/data.ts +2 -0
  10. package/types/generators/AlarmClock.ts +1 -0
  11. package/types/generators/Assistant.ts +13 -5
  12. package/types/generators/BleCentral.ts +1 -0
  13. package/types/generators/BlePeripheral.ts +1 -0
  14. package/types/generators/CanvasMap.ts +1 -0
  15. package/types/generators/CastlesPay.ts +1 -0
  16. package/types/generators/DataBank.ts +1 -0
  17. package/types/generators/File.ts +1 -0
  18. package/types/generators/GraphQl.ts +1 -0
  19. package/types/generators/Http.ts +10 -2
  20. package/types/generators/HttpServer.ts +4 -1
  21. package/types/generators/Information.ts +1 -0
  22. package/types/generators/Intent.ts +1 -0
  23. package/types/generators/Iterator.ts +1 -0
  24. package/types/generators/Keyboard.ts +1 -0
  25. package/types/generators/LlmAnthropicCompat.ts +1 -0
  26. package/types/generators/LlmGgml.ts +1 -0
  27. package/types/generators/LlmOnnx.ts +1 -0
  28. package/types/generators/LlmOpenAiCompat.ts +1 -0
  29. package/types/generators/LlmQualcommAiEngine.ts +1 -0
  30. package/types/generators/Mcp.ts +2 -1
  31. package/types/generators/McpServer.ts +7 -6
  32. package/types/generators/MediaFlow.ts +1 -0
  33. package/types/generators/MqttBroker.ts +1 -0
  34. package/types/generators/MqttClient.ts +1 -0
  35. package/types/generators/Question.ts +1 -0
  36. package/types/generators/RealtimeTranscription.ts +3 -2
  37. package/types/generators/RerankerGgml.ts +1 -0
  38. package/types/generators/SerialPort.ts +1 -0
  39. package/types/generators/SoundPlayer.ts +1 -0
  40. package/types/generators/SoundRecorder.ts +1 -0
  41. package/types/generators/SpeechToTextGgml.ts +1 -0
  42. package/types/generators/SpeechToTextOnnx.ts +1 -0
  43. package/types/generators/SpeechToTextPlatform.ts +1 -0
  44. package/types/generators/SqLite.ts +1 -0
  45. package/types/generators/Step.ts +1 -0
  46. package/types/generators/Tcp.ts +1 -0
  47. package/types/generators/TcpServer.ts +4 -1
  48. package/types/generators/TextToSpeechGgml.ts +1 -0
  49. package/types/generators/TextToSpeechOnnx.ts +1 -0
  50. package/types/generators/TextToSpeechOpenAiLike.ts +1 -0
  51. package/types/generators/ThermalPrinter.ts +1 -0
  52. package/types/generators/Tick.ts +1 -0
  53. package/types/generators/Udp.ts +1 -0
  54. package/types/generators/VadGgml.ts +1 -0
  55. package/types/generators/VectorStore.ts +1 -0
  56. package/types/generators/Watchdog.ts +1 -0
  57. package/types/generators/WebCrawler.ts +1 -0
  58. package/types/generators/WebRtc.ts +3 -2
  59. package/types/generators/WebSocket.ts +1 -0
  60. 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 BRICKS_PROJECT_updateApplication($id: ID!, $config: String) {
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: `${config.title || app.name || 'Untitled'} (${Date.now()})`,
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 BRICKS_PROJECT_updateModule($id: ID!, $config: String) {
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: `${config.title || mod.name || 'Untitled'} (${Date.now()})`,
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)
@@ -384,6 +384,7 @@ export const templateActionNameMap = {
384
384
  redirect: 'GENERATOR_HTTP_REDIRECT',
385
385
  referrer: 'GENERATOR_HTTP_REFERRER',
386
386
  resType: 'GENERATOR_HTTP_RES_TYPE',
387
+ resSelector: 'GENERATOR_HTTP_RES_SELECTOR',
387
388
  eventStream: 'GENERATOR_HTTP_EVENT_STREAM',
388
389
  eventName: 'GENERATOR_HTTP_EVENT_NAME',
389
390
  },
package/compile/index.ts CHANGED
@@ -677,6 +677,8 @@ export const compile = async (app: Application) => {
677
677
  camelCase: false,
678
678
  errorReference: `(data: ${data.id}, subspace ${subspace.id})`,
679
679
  }),
680
+ hit_equal: data.hit_equal,
681
+ hit_regex: data.hit_regex,
680
682
  }
681
683
  return map
682
684
  }, {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.22.8",
3
+ "version": "2.22.9",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "node scripts/build.js"
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
  }
@@ -58,13 +58,7 @@ const handleMcpConfigOverride = async (mcpConfigPath: string) => {
58
58
  console.log(`Updated ${mcpConfigPath}`)
59
59
  }
60
60
 
61
- if (await exists(`${cwd}/.cursor/rules/instructions.mdc`)) {
62
- const cursorMcpConfigPath = `${cwd}/.cursor/mcp.json`
63
- await handleMcpConfigOverride(cursorMcpConfigPath)
64
- }
65
-
66
61
  if (await exists(`${cwd}/CLAUDE.md`)) {
67
- await $`mkdir -p ${cwd}/.cursor`
68
62
  const claudeCodeMcpConfigPath = `${cwd}/.mcp.json`
69
63
  await handleMcpConfigOverride(claudeCodeMcpConfigPath)
70
64
  }
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 'Apply ${app.name} file changes'`
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
  }
@@ -69,7 +69,9 @@ Default property:
69
69
  "cacheEnabled": true,
70
70
  "geolocationEnabled": true,
71
71
  "thirdPartyCookiesEnabled": true,
72
- "javaScriptEnabled": true
72
+ "javaScriptEnabled": true,
73
+ "scrollEnabled": true,
74
+ "nestedScrollEnabled": true
73
75
  }
74
76
  */
75
77
  property?: BrickBasicProperty & {
@@ -113,6 +115,10 @@ Default property:
113
115
  forMainFrameOnly?: boolean | DataLink
114
116
  /* Inject JavaScript code before content loaded for main frame only (only `YES` supported for Android) */
115
117
  beforeContentLoadedForMainFrameOnly?: boolean | DataLink
118
+ /* Enable scroll in WebView */
119
+ scrollEnabled?: boolean | DataLink
120
+ /* Enable nested scroll in WebView (Android only) */
121
+ nestedScrollEnabled?: boolean | DataLink
116
122
  }
117
123
  events?: BrickBasicEvents & {
118
124
  /* Event of the WebView on load */
package/types/data.ts CHANGED
@@ -32,6 +32,8 @@ export type Data<T = any> = DataDef & {
32
32
  localSyncUpdateMode?: LocalSyncStrategy
33
33
  type: 'string' | 'number' | 'bool' | 'array' | 'object' | 'any'
34
34
  schema?: object
35
+ hit_equal?: any
36
+ hit_regex?: string
35
37
  kind?:
36
38
  | {
37
39
  type: 'id'
@@ -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,
@@ -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. */
@@ -457,10 +458,13 @@ Default property:
457
458
  | DataLink
458
459
  /* Summary Session Key (Custom session key for summarization) */
459
460
  llmSummarySessionKey?: string | DataLink
461
+ /* Generate fallback content for tool calls when LLM returns tool calls without text content. When enabled, creates a message like "Call:
462
+ functionName(args)" to keep the conversation readable. */
463
+ llmToolCallFallbackContent?: boolean | DataLink
460
464
  /* File Search (Vector Store) Enabled */
461
465
  fileSearchEnabled?: boolean | DataLink
462
466
  /* File Search (Vector Store) Generator */
463
- fileSearchGeneratorId?: string | DataLink
467
+ fileSearchGeneratorId?: string | DataLink | (() => Generator)
464
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. */
465
469
  fileSearchLivePolicy?: 'only-in-use' | 'manual' | DataLink
466
470
  /* File Search Citation Count. (Default: 3) */
@@ -470,13 +474,13 @@ Default property:
470
474
  /* File Search Ignore Threshold. (Default: false) */
471
475
  fileSearchIgnoreThreshold?: boolean | DataLink
472
476
  /* STT Generator use for transcribing audio message (Supports `STT (GGML)` generators) */
473
- sttGeneratorId?: string | DataLink
477
+ sttGeneratorId?: string | DataLink | (() => Generator)
474
478
  /* STT Enabled */
475
479
  sttEnabled?: boolean | DataLink
476
480
  /* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when the assistant is not in use. */
477
481
  sttLivePolicy?: 'only-in-use' | 'manual' | DataLink
478
482
  /* TTS Generator use for generating LLM response audio message (Supports `TTS (ONNX)` and `OpenAI TTS` generators) */
479
- ttsGeneratorId?: string | DataLink
483
+ ttsGeneratorId?: string | DataLink | (() => Generator)
480
484
  /* TTS Enabled */
481
485
  ttsEnabled?: boolean | DataLink
482
486
  /* TTS Live Policy. If the policy is `only-in-use`, the TTS context will be released when the assistant is not in use. */
@@ -486,10 +490,14 @@ Default property:
486
490
  | Array<
487
491
  | DataLink
488
492
  | {
489
- generatorId?: string | DataLink
493
+ generatorId?: string | DataLink | (() => Generator)
490
494
  generatorKey?: string | DataLink
491
495
  name?: string | DataLink
492
496
  enabled?: boolean | DataLink
497
+ includeTools?: Array<string | DataLink> | DataLink
498
+ excludeTools?: Array<string | DataLink> | DataLink
499
+ blockTools?: Array<string | DataLink> | DataLink
500
+ blockToolMessage?: string | DataLink
493
501
  }
494
502
  >
495
503
  | DataLink
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -42,7 +43,7 @@ export type GeneratorHTTPActionRunRequest = ActionWithParams & {
42
43
  }
43
44
  | {
44
45
  input: 'body'
45
- value?: any | EventProperty
46
+ value?: {} | DataLink | EventProperty
46
47
  mapping?: string
47
48
  }
48
49
  | {
@@ -75,6 +76,11 @@ export type GeneratorHTTPActionRunRequest = ActionWithParams & {
75
76
  value?: 'json' | 'text' | 'xml' | 'csv' | DataLink | EventProperty
76
77
  mapping?: string
77
78
  }
79
+ | {
80
+ input: 'resSelector'
81
+ value?: string | DataLink | EventProperty
82
+ mapping?: string
83
+ }
78
84
  | {
79
85
  input: 'eventStream'
80
86
  value?: boolean | DataLink | EventProperty
@@ -137,9 +143,11 @@ Default property:
137
143
  referrer?: 'no-referrer' | 'client' | DataLink
138
144
  /* HTTP request body, it will transform depends on `headers.Content-Type` (`application/json`, `application/x-www-form-urlencoded` or `multipart/form-data`)
139
145
  The multipart schema like `{ file: { uri: File, type: File MIME, name: File Name }, field: "value" }` */
140
- body?: any
146
+ body?: {} | DataLink
141
147
  /* HTTP response type */
142
148
  resType?: 'json' | 'text' | 'xml' | 'csv' | DataLink
149
+ /* Response selector path to extract specific data from parsed response (e.g., "data.items" for JSON, "root.element" for XML) */
150
+ resSelector?: string | DataLink
143
151
  /* Receive event stream (SSE) */
144
152
  eventStream?: boolean | DataLink
145
153
  /* Event name to listen on SSE */
@@ -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,
@@ -133,6 +134,8 @@ Default property:
133
134
  onError?: Array<EventAction>
134
135
  }
135
136
  outlets?: {
137
+ /* Server is listening */
138
+ isListening?: () => Data
136
139
  /* Query of request */
137
140
  requestQuery?: () => Data
138
141
  /* Body of request */
@@ -156,7 +159,7 @@ export type GeneratorHTTPServer = Generator &
156
159
  | SwitchCondData
157
160
  | {
158
161
  __typename: 'SwitchCondInnerStateOutlet'
159
- outlet: 'requestQuery' | 'requestBody' | 'clientAddress'
162
+ outlet: 'isListening' | 'requestQuery' | 'requestBody' | 'clientAddress'
160
163
  value: any
161
164
  }
162
165
  }>
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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) */
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -104,6 +105,8 @@ Default property:
104
105
  onError?: Array<EventAction>
105
106
  }
106
107
  outlets?: {
108
+ /* Server is listening */
109
+ isListening?: () => Data
107
110
  /* Is server started */
108
111
  started?: () => Data
109
112
  /* Accepted connections */
@@ -129,7 +132,7 @@ export type GeneratorTCPServer = Generator &
129
132
  | SwitchCondData
130
133
  | {
131
134
  __typename: 'SwitchCondInnerStateOutlet'
132
- outlet: 'started' | 'connections' | 'lastData' | 'errorMessage'
135
+ outlet: 'isListening' | 'started' | 'connections' | 'lastData' | 'errorMessage'
133
136
  value: any
134
137
  }
135
138
  }>
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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?:
@@ -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,
@@ -952,6 +952,7 @@ export const templateEventPropsMap = {
952
952
  'GENERATOR_ASSISTANT_MESSAGES', // type: array
953
953
  'GENERATOR_ASSISTANT_LAST_MESSAGE', // type: object
954
954
  'GENERATOR_ASSISTANT_IS_ERROR', // type: bool
955
+ 'GENERATOR_ASSISTANT_FINISH_REASON', // type: string
955
956
  ],
956
957
  },
957
958
  GENERATOR_VECTOR_STORE: {