@fugood/bricks-project 2.23.2 → 2.23.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.
Files changed (95) hide show
  1. package/compile/index.ts +343 -125
  2. package/package.json +4 -2
  3. package/skills/bricks-project/rules/automations.md +7 -7
  4. package/tools/deploy.ts +39 -10
  5. package/tools/mcp-server.ts +10 -877
  6. package/tools/mcp-tools/compile.ts +91 -0
  7. package/tools/mcp-tools/huggingface.ts +653 -0
  8. package/tools/mcp-tools/icons.ts +60 -0
  9. package/tools/mcp-tools/lottie.ts +102 -0
  10. package/tools/mcp-tools/media.ts +110 -0
  11. package/tools/postinstall.ts +11 -6
  12. package/tools/pull.ts +25 -9
  13. package/tsconfig.json +16 -0
  14. package/types/bricks/Camera.ts +1 -1
  15. package/types/bricks/Chart.ts +1 -1
  16. package/types/bricks/GenerativeMedia.ts +1 -1
  17. package/types/bricks/Icon.ts +1 -1
  18. package/types/bricks/Image.ts +1 -1
  19. package/types/bricks/Items.ts +1 -1
  20. package/types/bricks/Lottie.ts +1 -1
  21. package/types/bricks/Maps.ts +1 -1
  22. package/types/bricks/QrCode.ts +1 -1
  23. package/types/bricks/Rect.ts +1 -1
  24. package/types/bricks/RichText.ts +1 -1
  25. package/types/bricks/Rive.ts +1 -1
  26. package/types/bricks/Slideshow.ts +1 -1
  27. package/types/bricks/Svg.ts +1 -1
  28. package/types/bricks/Text.ts +1 -1
  29. package/types/bricks/TextInput.ts +1 -1
  30. package/types/bricks/Video.ts +1 -1
  31. package/types/bricks/VideoStreaming.ts +1 -1
  32. package/types/bricks/WebRtcStream.ts +1 -1
  33. package/types/bricks/WebView.ts +1 -1
  34. package/types/canvas.ts +2 -2
  35. package/types/common.ts +4 -4
  36. package/types/generators/AlarmClock.ts +1 -1
  37. package/types/generators/Assistant.ts +1 -1
  38. package/types/generators/BleCentral.ts +1 -1
  39. package/types/generators/BlePeripheral.ts +1 -1
  40. package/types/generators/CanvasMap.ts +1 -1
  41. package/types/generators/CastlesPay.ts +1 -1
  42. package/types/generators/DataBank.ts +1 -1
  43. package/types/generators/File.ts +1 -1
  44. package/types/generators/GraphQl.ts +1 -1
  45. package/types/generators/Http.ts +1 -1
  46. package/types/generators/HttpServer.ts +1 -1
  47. package/types/generators/Information.ts +1 -1
  48. package/types/generators/Intent.ts +1 -1
  49. package/types/generators/Iterator.ts +1 -1
  50. package/types/generators/Keyboard.ts +1 -1
  51. package/types/generators/LlmAnthropicCompat.ts +1 -1
  52. package/types/generators/LlmAppleBuiltin.ts +1 -1
  53. package/types/generators/LlmGgml.ts +1 -1
  54. package/types/generators/LlmOnnx.ts +1 -1
  55. package/types/generators/LlmOpenAiCompat.ts +1 -1
  56. package/types/generators/LlmQualcommAiEngine.ts +1 -1
  57. package/types/generators/Mcp.ts +1 -1
  58. package/types/generators/McpServer.ts +1 -1
  59. package/types/generators/MediaFlow.ts +1 -1
  60. package/types/generators/MqttBroker.ts +1 -1
  61. package/types/generators/MqttClient.ts +1 -1
  62. package/types/generators/Question.ts +1 -1
  63. package/types/generators/RealtimeTranscription.ts +1 -1
  64. package/types/generators/RerankerGgml.ts +1 -1
  65. package/types/generators/SerialPort.ts +1 -1
  66. package/types/generators/SoundPlayer.ts +1 -1
  67. package/types/generators/SoundRecorder.ts +1 -1
  68. package/types/generators/SpeechToTextGgml.ts +1 -1
  69. package/types/generators/SpeechToTextOnnx.ts +1 -1
  70. package/types/generators/SpeechToTextPlatform.ts +1 -1
  71. package/types/generators/SqLite.ts +1 -1
  72. package/types/generators/Step.ts +1 -1
  73. package/types/generators/SttAppleBuiltin.ts +1 -1
  74. package/types/generators/Tcp.ts +1 -1
  75. package/types/generators/TcpServer.ts +1 -1
  76. package/types/generators/TextToSpeechAppleBuiltin.ts +1 -1
  77. package/types/generators/TextToSpeechGgml.ts +1 -1
  78. package/types/generators/TextToSpeechOnnx.ts +1 -1
  79. package/types/generators/TextToSpeechOpenAiLike.ts +1 -1
  80. package/types/generators/ThermalPrinter.ts +1 -1
  81. package/types/generators/Tick.ts +1 -1
  82. package/types/generators/Udp.ts +1 -1
  83. package/types/generators/VadGgml.ts +1 -1
  84. package/types/generators/VadOnnx.ts +1 -1
  85. package/types/generators/VadTraditional.ts +1 -1
  86. package/types/generators/VectorStore.ts +1 -1
  87. package/types/generators/Watchdog.ts +1 -1
  88. package/types/generators/WebCrawler.ts +1 -1
  89. package/types/generators/WebRtc.ts +1 -1
  90. package/types/generators/WebSocket.ts +1 -1
  91. package/types/system.ts +1 -1
  92. package/utils/calc.ts +16 -10
  93. package/utils/id.ts +4 -0
  94. package/api/index.ts +0 -1
  95. package/api/instance.ts +0 -213
@@ -0,0 +1,102 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
2
+ import { z } from 'zod'
3
+ import * as TOON from '@toon-format/toon'
4
+
5
+ const LOTTIEFILES_API_URL = 'https://lottiefiles.com/api'
6
+
7
+ export function register(server: McpServer) {
8
+ server.tool(
9
+ 'lottie_search',
10
+ {
11
+ query: z.string().describe('Search keywords for animations'),
12
+ page: z.number().min(1).optional().default(1),
13
+ limit: z.number().min(1).max(100).optional().default(10),
14
+ },
15
+ async ({ query, page, limit }) => {
16
+ try {
17
+ const url = new URL(`${LOTTIEFILES_API_URL}/search/get-animations`)
18
+ url.searchParams.set('query', query)
19
+ url.searchParams.set('page', String(page))
20
+ url.searchParams.set('limit', String(limit))
21
+ url.searchParams.set('format', 'json')
22
+
23
+ const response = await fetch(url.toString())
24
+ const data = await response.json()
25
+ const animations = data?.data?.data ?? []
26
+
27
+ return {
28
+ content: [
29
+ {
30
+ type: 'text',
31
+ text: TOON.encode({ count: animations.length, animations }),
32
+ },
33
+ ],
34
+ }
35
+ } catch (err: any) {
36
+ return {
37
+ content: [{ type: 'text', text: `Failed to search animations: ${err.message}` }],
38
+ }
39
+ }
40
+ },
41
+ )
42
+
43
+ server.tool(
44
+ 'lottie_get_details',
45
+ {
46
+ id: z.string().describe('Animation file ID'),
47
+ },
48
+ async ({ id }) => {
49
+ try {
50
+ const url = new URL(`${LOTTIEFILES_API_URL}/animations/get-animation-data`)
51
+ url.searchParams.set('fileId', id)
52
+ url.searchParams.set('format', 'json')
53
+
54
+ const response = await fetch(url.toString())
55
+ const data = await response.json()
56
+
57
+ return {
58
+ content: [{ type: 'text', text: TOON.encode(data) }],
59
+ }
60
+ } catch (err: any) {
61
+ return {
62
+ content: [{ type: 'text', text: `Failed to get animation: ${err.message}` }],
63
+ }
64
+ }
65
+ },
66
+ )
67
+
68
+ server.tool(
69
+ 'lottie_popular',
70
+ {
71
+ page: z.number().min(1).optional().default(1),
72
+ limit: z.number().min(1).max(100).optional().default(10),
73
+ },
74
+ async ({ page, limit }) => {
75
+ try {
76
+ const url = new URL(
77
+ `${LOTTIEFILES_API_URL}/iconscout/popular-animations-weekly?api=%26sort%3Dpopular`,
78
+ )
79
+ url.searchParams.set('page', String(page))
80
+ url.searchParams.set('limit', String(limit))
81
+ url.searchParams.set('format', 'json')
82
+
83
+ const response = await fetch(url.toString())
84
+ const data = await response.json()
85
+ const animations = data?.popularWeeklyData?.data ?? []
86
+
87
+ return {
88
+ content: [
89
+ {
90
+ type: 'text',
91
+ text: TOON.encode({ count: animations.length, animations }),
92
+ },
93
+ ],
94
+ }
95
+ } catch (err: any) {
96
+ return {
97
+ content: [{ type: 'text', text: `Failed to get popular animations: ${err.message}` }],
98
+ }
99
+ }
100
+ },
101
+ )
102
+ }
@@ -0,0 +1,110 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
2
+ import { z } from 'zod'
3
+ import { $ } from 'bun'
4
+
5
+ const runBricks = async (projectDir: string, ...args: string[]) => {
6
+ try {
7
+ return await $`bunx bricks ${args}`.cwd(projectDir).text()
8
+ } catch (err: any) {
9
+ throw new Error(err.stderr?.toString() || err.message)
10
+ }
11
+ }
12
+
13
+ export function register(server: McpServer, projectDir: string) {
14
+ server.tool('media_boxes', {}, async () => {
15
+ try {
16
+ const output = await runBricks(projectDir, 'media', 'boxes')
17
+ return { content: [{ type: 'text', text: output }] }
18
+ } catch (err: any) {
19
+ return { content: [{ type: 'text', text: `Failed to list media boxes: ${err.message}` }] }
20
+ }
21
+ })
22
+
23
+ server.tool('media_get_box', { id: z.string().describe('Media box ID') }, async ({ id }) => {
24
+ try {
25
+ const output = await runBricks(projectDir, 'media', 'box', id)
26
+ return { content: [{ type: 'text', text: output }] }
27
+ } catch (err: any) {
28
+ return { content: [{ type: 'text', text: `Failed to get media box: ${err.message}` }] }
29
+ }
30
+ })
31
+
32
+ server.tool(
33
+ 'media_files',
34
+ {
35
+ boxId: z.string().describe('Media box ID'),
36
+ types: z.string().describe('Comma-separated file types to include').optional(),
37
+ userTag: z.array(z.string()).describe('Filter by user tags').optional(),
38
+ limit: z.number().describe('Limit results').optional(),
39
+ offset: z.number().describe('Offset results').optional(),
40
+ },
41
+ async ({ boxId, types, userTag, limit, offset }) => {
42
+ try {
43
+ const args = ['media', 'files', boxId]
44
+ if (types) args.push('-t', types)
45
+ if (userTag) userTag.forEach((tag) => args.push('-u', tag))
46
+ if (limit != null) args.push('-l', String(limit))
47
+ if (offset != null) args.push('-o', String(offset))
48
+ const output = await runBricks(projectDir, ...args)
49
+ return { content: [{ type: 'text', text: output }] }
50
+ } catch (err: any) {
51
+ return { content: [{ type: 'text', text: `Failed to list media files: ${err.message}` }] }
52
+ }
53
+ },
54
+ )
55
+
56
+ server.tool('media_file', { id: z.string().describe('Media file ID') }, async ({ id }) => {
57
+ try {
58
+ const output = await runBricks(projectDir, 'media', 'file', id)
59
+ return { content: [{ type: 'text', text: output }] }
60
+ } catch (err: any) {
61
+ return { content: [{ type: 'text', text: `Failed to get media file: ${err.message}` }] }
62
+ }
63
+ })
64
+
65
+ server.tool(
66
+ 'media_upload_files',
67
+ {
68
+ boxId: z.string().describe('Target media box ID'),
69
+ files: z.array(z.string()).min(1).describe('File paths to upload'),
70
+ description: z.string().describe('File description').optional(),
71
+ userTags: z.array(z.string()).max(15).describe('User tags (max 15)').optional(),
72
+ imageVersion: z
73
+ .array(z.string())
74
+ .describe('Image resize specs as WxH or WxH:STRATEGY')
75
+ .optional(),
76
+ imageVersionType: z.enum(['jpg', 'png']).describe('Image output format').optional(),
77
+ enableAiAnalysis: z.boolean().describe('Enable AI analysis').optional(),
78
+ aiInstruction: z.string().describe('Custom AI analysis instruction').optional(),
79
+ concurrency: z.number().min(1).describe('Max concurrent uploads').optional(),
80
+ },
81
+ async ({
82
+ boxId,
83
+ files,
84
+ description,
85
+ userTags,
86
+ imageVersion,
87
+ imageVersionType,
88
+ enableAiAnalysis,
89
+ aiInstruction,
90
+ concurrency,
91
+ }) => {
92
+ try {
93
+ const args = ['media', 'upload', boxId, ...files]
94
+ if (description) args.push('-d', description)
95
+ if (userTags) userTags.forEach((tag) => args.push('-t', tag))
96
+ if (imageVersion) imageVersion.forEach((spec) => args.push('--image-version', spec))
97
+ if (imageVersionType) args.push('--image-version-type', imageVersionType)
98
+ if (enableAiAnalysis) args.push('--enable-ai-analysis')
99
+ if (aiInstruction) args.push('--ai-instruction', aiInstruction)
100
+ if (concurrency != null) args.push('--concurrency', String(concurrency))
101
+ const output = await runBricks(projectDir, ...args)
102
+ return { content: [{ type: 'text', text: output }] }
103
+ } catch (err: any) {
104
+ return {
105
+ content: [{ type: 'text', text: `Failed to upload media files: ${err.message}` }],
106
+ }
107
+ }
108
+ },
109
+ )
110
+ }
@@ -30,6 +30,10 @@ const projectMcpServer = {
30
30
  args: [`${cwd}/node_modules/@fugood/bricks-project/tools/mcp-server.ts`],
31
31
  }
32
32
 
33
+ type CodexMcpConfig = {
34
+ mcp_servers: Record<string, typeof projectMcpServer>
35
+ }
36
+
33
37
  const defaultMcpConfig = {
34
38
  mcpServers: {
35
39
  'bricks-project': projectMcpServer,
@@ -44,7 +48,7 @@ const handleMcpConfigOverride = async (mcpConfigPath: string) => {
44
48
  mcpConfig = JSON.parse(configStr)
45
49
  if (!mcpConfig?.mcpServers) throw new Error('mcpServers is not defined')
46
50
  mcpConfig.mcpServers['bricks-project'] = projectMcpServer
47
- } catch (e) {
51
+ } catch {
48
52
  mcpConfig = defaultMcpConfig
49
53
  }
50
54
  } else {
@@ -104,21 +108,22 @@ if (hasAgentsMd) {
104
108
  }
105
109
 
106
110
  const handleCodexMcpConfigOverride = async (mcpConfigPath: string) => {
107
- let mcpConfig: { mcp_servers: Record<string, typeof projectMcpServer> } | null = null
111
+ let mcpConfig: CodexMcpConfig | null = null
108
112
  if (await exists(mcpConfigPath)) {
109
113
  const configStr = await readFile(mcpConfigPath, 'utf-8')
110
114
  try {
111
- mcpConfig = TOML.parse(configStr)
112
- if (!mcpConfig?.mcp_servers) throw new Error('mcp_servers is not defined')
115
+ const parsed = TOML.parse(configStr) as Partial<CodexMcpConfig>
116
+ if (!parsed?.mcp_servers) throw new Error('mcp_servers is not defined')
117
+ mcpConfig = { mcp_servers: parsed.mcp_servers }
113
118
  mcpConfig.mcp_servers['bricks-project'] = projectMcpServer
114
- } catch (e) {
119
+ } catch {
115
120
  mcpConfig = defaultCodexMcpConfig
116
121
  }
117
122
  } else {
118
123
  mcpConfig = defaultCodexMcpConfig
119
124
  }
120
125
 
121
- await writeFile(mcpConfigPath, `${TOML.stringify(mcpConfig, null, 2)}\n`)
126
+ await writeFile(mcpConfigPath, `${TOML.stringify(mcpConfig)}\n`)
122
127
 
123
128
  console.log(`Updated ${mcpConfigPath}`)
124
129
  }
package/tools/pull.ts CHANGED
@@ -2,6 +2,8 @@ import { $ } from 'bun'
2
2
  import { format } from 'prettier'
3
3
 
4
4
  const cwd = process.cwd()
5
+ const args = process.argv.slice(2)
6
+ const force = args.includes('--force') || args.includes('-f')
5
7
 
6
8
  // Check git status
7
9
  const { exitCode } = await $`cd ${cwd} && git status`.nothrow()
@@ -9,8 +11,15 @@ const isGitRepo = exitCode === 0
9
11
 
10
12
  if (isGitRepo) {
11
13
  const unstagedChanges = await $`cd ${cwd} && git diff --name-only --diff-filter=ACMR`.text()
12
- if (unstagedChanges)
13
- throw new Error('Unstaged changes found, please commit or stash your changes before pulling')
14
+ if (unstagedChanges) {
15
+ if (force) {
16
+ console.log('Force mode: committing unstaged changes before pull...')
17
+ await $`cd ${cwd} && git add .`
18
+ await $`cd ${cwd} && git commit -m ${'chore(force-pull): saved unstaged changes before pull'}`
19
+ } else {
20
+ throw new Error('Unstaged changes found, please commit or stash your changes before pulling')
21
+ }
22
+ }
14
23
  } else {
15
24
  const confirmContinue = prompt(
16
25
  'No git repository found, so it will not be safe to pull, continue? (y/n)',
@@ -25,6 +34,7 @@ const isModule = app.type === 'module'
25
34
  const command = isModule ? 'module' : 'app'
26
35
 
27
36
  // Fetch project files using CLI
37
+ console.log(`Pulling ${command} project (${app.id})...`)
28
38
  const result = await $`bricks ${command} project-pull ${app.id} --json`.quiet().nothrow()
29
39
 
30
40
  if (result.exitCode !== 0) {
@@ -40,7 +50,8 @@ if (result.exitCode !== 0) {
40
50
  const { files, lastCommitId } = JSON.parse(result.stdout.toString())
41
51
 
42
52
  let useMain = false
43
- if (isGitRepo) {
53
+ if (isGitRepo && !force) {
54
+ console.log(`Checking commit ${lastCommitId}...`)
44
55
  const found = (await $`cd ${cwd} && git rev-list -1 ${lastCommitId}`.nothrow().text())
45
56
  .trim()
46
57
  .match(/^[\da-f]{40}$/)
@@ -86,13 +97,18 @@ await Promise.all(
86
97
 
87
98
  if (isGitRepo) {
88
99
  await $`cd ${cwd} && git add .`
89
- const commitMsg = isModule
90
- ? 'chore(project): apply file changes from BRICKS module'
91
- : 'chore(project): apply file changes from BRICKS application'
92
- await $`cd ${cwd} && git commit -m ${commitMsg}`
93
- if (!useMain) {
100
+ const hasChanges = !!(await $`cd ${cwd} && git diff --cached --name-only`.text()).trim()
101
+ if (hasChanges) {
102
+ let commitMsg = 'chore(project): apply file changes from BRICKS application'
103
+ if (force) commitMsg = `chore(force-pull): apply force pull-${command}`
104
+ else if (isModule) commitMsg = 'chore(project): apply file changes from BRICKS module'
105
+ await $`cd ${cwd} && git commit -m ${commitMsg}`
106
+ }
107
+ if (!force && !useMain) {
94
108
  await $`cd ${cwd} && git merge main`
95
109
  }
96
110
  }
97
111
 
98
- console.log(`${isModule ? 'Module' : 'App'} project pulled: ${files.length} files`)
112
+ console.log(
113
+ `${isModule ? 'Module' : 'App'} project pulled: ${files.length} files${force ? ' (force)' : ''}`,
114
+ )
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["ESNext"],
4
+ "target": "ESNext",
5
+ "module": "ESNext",
6
+ "moduleDetection": "force",
7
+ "allowJs": true,
8
+ "resolveJsonModule": true,
9
+ "moduleResolution": "bundler",
10
+ "allowImportingTsExtensions": true,
11
+ "verbatimModuleSyntax": true,
12
+ "noEmit": true,
13
+ "skipLibCheck": true,
14
+ },
15
+ "exclude": ["node_modules"],
16
+ }
@@ -192,7 +192,7 @@ Default property:
192
192
  export type BrickCamera = Brick &
193
193
  BrickCameraDef & {
194
194
  templateKey: 'BRICK_CAMERA'
195
- switches: Array<
195
+ switches?: Array<
196
196
  SwitchDef &
197
197
  BrickCameraDef & {
198
198
  conds?: Array<{
@@ -347,7 +347,7 @@ Default property:
347
347
  export type BrickChart = Brick &
348
348
  BrickChartDef & {
349
349
  templateKey: 'BRICK_CHART'
350
- switches: Array<
350
+ switches?: Array<
351
351
  SwitchDef &
352
352
  BrickChartDef & {
353
353
  conds?: Array<{
@@ -241,7 +241,7 @@ Default property:
241
241
  export type GenerativeMedia = Brick &
242
242
  GenerativeMediaDef & {
243
243
  templateKey: 'BRICK_GENERATIVE_MEDIA'
244
- switches: Array<
244
+ switches?: Array<
245
245
  SwitchDef &
246
246
  GenerativeMediaDef & {
247
247
  conds?: Array<{
@@ -75,7 +75,7 @@ Default property:
75
75
  export type BrickIcon = Brick &
76
76
  BrickIconDef & {
77
77
  templateKey: 'BRICK_ICON'
78
- switches: Array<
78
+ switches?: Array<
79
79
  SwitchDef &
80
80
  BrickIconDef & {
81
81
  conds?: Array<{
@@ -91,7 +91,7 @@ Default property:
91
91
  export type BrickImage = Brick &
92
92
  BrickImageDef & {
93
93
  templateKey: 'BRICK_IMAGE'
94
- switches: Array<
94
+ switches?: Array<
95
95
  SwitchDef &
96
96
  BrickImageDef & {
97
97
  conds?: Array<{
@@ -437,7 +437,7 @@ Default property:
437
437
  export type BrickItems = Brick &
438
438
  BrickItemsDef & {
439
439
  templateKey: 'BRICK_ITEMS'
440
- switches: Array<
440
+ switches?: Array<
441
441
  SwitchDef &
442
442
  BrickItemsDef & {
443
443
  conds?: Array<{
@@ -141,7 +141,7 @@ Default property:
141
141
  export type BrickLottie = Brick &
142
142
  BrickLottieDef & {
143
143
  templateKey: 'BRICK_LOTTIE'
144
- switches: Array<
144
+ switches?: Array<
145
145
  SwitchDef &
146
146
  BrickLottieDef & {
147
147
  conds?: Array<{
@@ -235,7 +235,7 @@ Default property:
235
235
  export type BrickMaps = Brick &
236
236
  BrickMapsDef & {
237
237
  templateKey: 'BRICK_MAPS'
238
- switches: Array<
238
+ switches?: Array<
239
239
  SwitchDef &
240
240
  BrickMapsDef & {
241
241
  conds?: Array<{
@@ -94,7 +94,7 @@ Default property:
94
94
  export type BrickQrcode = Brick &
95
95
  BrickQrcodeDef & {
96
96
  templateKey: 'BRICK_QRCODE'
97
- switches: Array<
97
+ switches?: Array<
98
98
  SwitchDef &
99
99
  BrickQrcodeDef & {
100
100
  conds?: Array<{
@@ -92,7 +92,7 @@ Default property:
92
92
  export type BrickRect = Brick &
93
93
  BrickRectDef & {
94
94
  templateKey: 'BRICK_RECT'
95
- switches: Array<
95
+ switches?: Array<
96
96
  SwitchDef &
97
97
  BrickRectDef & {
98
98
  conds?: Array<{
@@ -105,7 +105,7 @@ Default property:
105
105
  export type BrickRichText = Brick &
106
106
  BrickRichTextDef & {
107
107
  templateKey: 'BRICK_RICH_TEXT'
108
- switches: Array<
108
+ switches?: Array<
109
109
  SwitchDef &
110
110
  BrickRichTextDef & {
111
111
  conds?: Array<{
@@ -191,7 +191,7 @@ Default property:
191
191
  export type BrickRive = Brick &
192
192
  BrickRiveDef & {
193
193
  templateKey: 'BRICK_RIVE'
194
- switches: Array<
194
+ switches?: Array<
195
195
  SwitchDef &
196
196
  BrickRiveDef & {
197
197
  conds?: Array<{
@@ -172,7 +172,7 @@ Default property:
172
172
  export type BrickSlideshow = Brick &
173
173
  BrickSlideshowDef & {
174
174
  templateKey: 'BRICK_SLIDESHOW'
175
- switches: Array<
175
+ switches?: Array<
176
176
  SwitchDef &
177
177
  BrickSlideshowDef & {
178
178
  conds?: Array<{
@@ -76,7 +76,7 @@ Default property:
76
76
  export type BrickSvg = Brick &
77
77
  BrickSvgDef & {
78
78
  templateKey: 'BRICK_SVG'
79
- switches: Array<
79
+ switches?: Array<
80
80
  SwitchDef &
81
81
  BrickSvgDef & {
82
82
  conds?: Array<{
@@ -125,7 +125,7 @@ Default property:
125
125
  export type BrickText = Brick &
126
126
  BrickTextDef & {
127
127
  templateKey: 'BRICK_TEXT'
128
- switches: Array<
128
+ switches?: Array<
129
129
  SwitchDef &
130
130
  BrickTextDef & {
131
131
  conds?: Array<{
@@ -213,7 +213,7 @@ Default property:
213
213
  export type BrickTextInput = Brick &
214
214
  BrickTextInputDef & {
215
215
  templateKey: 'BRICK_TEXT_INPUT'
216
- switches: Array<
216
+ switches?: Array<
217
217
  SwitchDef &
218
218
  BrickTextInputDef & {
219
219
  conds?: Array<{
@@ -152,7 +152,7 @@ Default property:
152
152
  export type BrickVideo = Brick &
153
153
  BrickVideoDef & {
154
154
  templateKey: 'BRICK_VIDEO'
155
- switches: Array<
155
+ switches?: Array<
156
156
  SwitchDef &
157
157
  BrickVideoDef & {
158
158
  conds?: Array<{
@@ -89,7 +89,7 @@ Default property:
89
89
  export type BrickVideoStreaming = Brick &
90
90
  BrickVideoStreamingDef & {
91
91
  templateKey: 'BRICK_VIDEO_STREAMING'
92
- switches: Array<
92
+ switches?: Array<
93
93
  SwitchDef &
94
94
  BrickVideoStreamingDef & {
95
95
  conds?: Array<{
@@ -42,7 +42,7 @@ Default property:
42
42
  export type BrickWebRTCStream = Brick &
43
43
  BrickWebRTCStreamDef & {
44
44
  templateKey: 'BRICK_WEBRTC_STREAM'
45
- switches: Array<
45
+ switches?: Array<
46
46
  SwitchDef &
47
47
  BrickWebRTCStreamDef & {
48
48
  conds?: Array<{
@@ -145,7 +145,7 @@ Default property:
145
145
  export type BrickWebView = Brick &
146
146
  BrickWebViewDef & {
147
147
  templateKey: 'BRICK_WEBVIEW'
148
- switches: Array<
148
+ switches?: Array<
149
149
  SwitchDef &
150
150
  BrickWebViewDef & {
151
151
  conds?: Array<{
package/types/canvas.ts CHANGED
@@ -36,9 +36,9 @@ interface CanvasDef {
36
36
  export type Canvas = CanvasDef & {
37
37
  __typename: 'Canvas'
38
38
  id: string
39
- title: string
39
+ title?: string
40
40
  description?: string
41
- switches: Array<
41
+ switches?: Array<
42
42
  SwitchDef &
43
43
  CanvasDef & {
44
44
  conds?: Array<{
package/types/common.ts CHANGED
@@ -7,8 +7,8 @@ export interface Brick {
7
7
  __typename: 'Brick'
8
8
  id: string
9
9
  templateKey: string
10
- title: string
11
- description: string
10
+ title?: string
11
+ description?: string
12
12
  property?: {}
13
13
  events: {}
14
14
  outlets?: {}
@@ -25,8 +25,8 @@ export interface Generator {
25
25
  __typename: 'Generator'
26
26
  id: string
27
27
  templateKey: string
28
- title: string
29
- description: string
28
+ title?: string
29
+ description?: string
30
30
  localSyncRunMode?: LocalSyncStrategy
31
31
  property?: {}
32
32
  events: {}
@@ -85,7 +85,7 @@ Default property:
85
85
  export type GeneratorAlarmClock = Generator &
86
86
  GeneratorAlarmClockDef & {
87
87
  templateKey: 'GENERATOR_ALARM_CLOCK'
88
- switches: Array<
88
+ switches?: Array<
89
89
  SwitchDef &
90
90
  GeneratorAlarmClockDef & {
91
91
  conds?: Array<{
@@ -544,7 +544,7 @@ Default property:
544
544
  export type GeneratorAssistant = Generator &
545
545
  GeneratorAssistantDef & {
546
546
  templateKey: 'GENERATOR_ASSISTANT'
547
- switches: Array<
547
+ switches?: Array<
548
548
  SwitchDef &
549
549
  GeneratorAssistantDef & {
550
550
  conds?: Array<{
@@ -208,7 +208,7 @@ Default property:
208
208
  export type GeneratorBleCentral = Generator &
209
209
  GeneratorBleCentralDef & {
210
210
  templateKey: 'GENERATOR_BLE_CENTRAL'
211
- switches: Array<
211
+ switches?: Array<
212
212
  SwitchDef &
213
213
  GeneratorBleCentralDef & {
214
214
  conds?: Array<{
@@ -185,7 +185,7 @@ Default property:
185
185
  export type GeneratorBlePeripheral = Generator &
186
186
  GeneratorBlePeripheralDef & {
187
187
  templateKey: 'GENERATOR_BLE_PERIPHERAL'
188
- switches: Array<
188
+ switches?: Array<
189
189
  SwitchDef &
190
190
  GeneratorBlePeripheralDef & {
191
191
  conds?: Array<{
@@ -51,7 +51,7 @@ Default property:
51
51
  export type GeneratorCanvasMap = Generator &
52
52
  GeneratorCanvasMapDef & {
53
53
  templateKey: 'GENERATOR_CANVAS_MAP'
54
- switches: Array<
54
+ switches?: Array<
55
55
  SwitchDef &
56
56
  GeneratorCanvasMapDef & {
57
57
  conds?: Array<{
@@ -60,7 +60,7 @@ Default property:
60
60
  export type GeneratorCastlesPay = Generator &
61
61
  GeneratorCastlesPayDef & {
62
62
  templateKey: 'GENERATOR_CASTLES_PAY'
63
- switches: Array<
63
+ switches?: Array<
64
64
  SwitchDef &
65
65
  GeneratorCastlesPayDef & {
66
66
  conds?: Array<{
@@ -106,7 +106,7 @@ Default property:
106
106
  export type GeneratorDataBank = Generator &
107
107
  GeneratorDataBankDef & {
108
108
  templateKey: 'GENERATOR_DATA_BANK'
109
- switches: Array<
109
+ switches?: Array<
110
110
  SwitchDef &
111
111
  GeneratorDataBankDef & {
112
112
  conds?: Array<{