@fugood/bricks-project 2.23.0-beta.1 → 2.23.0-beta.11

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.
@@ -512,6 +512,13 @@ export const templateActionNameMap = {
512
512
  params: 'GENERATOR_SQLITE_PARAMS',
513
513
  paramsString: 'GENERATOR_SQLITE_PARAMS_STRING',
514
514
  },
515
+ GENERATOR_SQLITE_TRANSACTION: {
516
+ statements: 'GENERATOR_SQLITE_STATEMENTS',
517
+ },
518
+ GENERATOR_SQLITE_BATCH_EXECUTE: {
519
+ sql: 'GENERATOR_SQLITE_SQL',
520
+ batchParams: 'GENERATOR_SQLITE_BATCH_PARAMS',
521
+ },
515
522
  },
516
523
 
517
524
  GENERATOR_MCP: {
@@ -553,6 +560,7 @@ export const templateActionNameMap = {
553
560
  prompt: 'GENERATOR_ONNX_LLM_PROMPT',
554
561
  chat: 'GENERATOR_ONNX_LLM_CHAT',
555
562
  images: 'GENERATOR_ONNX_LLM_IMAGES',
563
+ audios: 'GENERATOR_ONNX_LLM_AUDIOS',
556
564
  tools: 'GENERATOR_ONNX_LLM_TOOLS',
557
565
  toolChoice: 'GENERATOR_ONNX_LLM_TOOL_CHOICE',
558
566
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.23.0-beta.1",
3
+ "version": "2.23.0-beta.11",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "build": "node scripts/build.js"
@@ -14,5 +14,5 @@
14
14
  "lodash": "^4.17.4",
15
15
  "uuid": "^8.3.1"
16
16
  },
17
- "gitHead": "8d613e8b77ae47fde21212b9e9f77a3cc4e7278d"
17
+ "gitHead": "a9e8e4b1458d40ed74c388d01400f2eecf30cd86"
18
18
  }
@@ -34,6 +34,26 @@ export type BrickSlideshowActionJumpToIndex = ActionWithParams & {
34
34
  >
35
35
  }
36
36
 
37
+ /* Play the slideshow (resume if paused) */
38
+ export type BrickSlideshowActionPlay = Action & {
39
+ __actionName: 'BRICK_SLIDESHOW_PLAY'
40
+ }
41
+
42
+ /* Pause the slideshow */
43
+ export type BrickSlideshowActionPause = Action & {
44
+ __actionName: 'BRICK_SLIDESHOW_PAUSE'
45
+ }
46
+
47
+ /* Go to next slide */
48
+ export type BrickSlideshowActionNext = Action & {
49
+ __actionName: 'BRICK_SLIDESHOW_NEXT'
50
+ }
51
+
52
+ /* Go to previous slide */
53
+ export type BrickSlideshowActionPrev = Action & {
54
+ __actionName: 'BRICK_SLIDESHOW_PREV'
55
+ }
56
+
37
57
  interface BrickSlideshowDef {
38
58
  /*
39
59
  Default property:
@@ -41,17 +61,28 @@ Default property:
41
61
  "countdown": 2000,
42
62
  "loop": true,
43
63
  "shuffle": false,
64
+ "photoResizeMode": "contain",
65
+ "photoLoadSystemIos": "auto",
66
+ "photoLoadSystemAndroid": "auto",
67
+ "videoResizeMode": "contain",
68
+ "videoAutoAspectRatio": false,
44
69
  "videoVolume": 100,
70
+ "videoMuted": false,
71
+ "videoRenderMode": "auto",
72
+ "fadeDuration": 0,
45
73
  "emptyViewText": "no available image item to show",
46
74
  "emptyViewTextSize": 44,
47
75
  "emptyViewTextColor": "#fff",
76
+ "enableBlurBackground": false,
48
77
  "blurBackgroundRadius": 8
49
78
  }
50
79
  */
51
80
  property?: BrickBasicProperty & {
52
81
  /* The time interval of show for each photo */
53
82
  countdown?: number | DataLink
54
- /* The slideshow media path list (File, URL) */
83
+ /* The slideshow media path list (File, URL)
84
+ Each path object can override global photo/video settings.
85
+ Item-level properties take precedence over brick-level properties. */
55
86
  paths?:
56
87
  | Array<
57
88
  | DataLink
@@ -70,7 +101,8 @@ Default property:
70
101
  }
71
102
  >
72
103
  | DataLink
73
- /* Multiple slideshow media path lists to combine (Array of path arrays) */
104
+ /* Multiple slideshow media path lists to combine (Array of path arrays).
105
+ All arrays are flattened and combined: [...paths, ...pathsList[0], ...pathsList[1], ...] */
74
106
  pathsList?: Array<Array<any> | DataLink | DataLink> | DataLink
75
107
  /* Loop the slideshow */
76
108
  loop?: boolean | DataLink
@@ -122,6 +154,8 @@ Default property:
122
154
  roundEnd?: Array<EventAction>
123
155
  /* Event of the slideshow on load */
124
156
  mediaOnLoad?: Array<EventAction>
157
+ /* Event of the slideshow media loading error */
158
+ mediaOnError?: Array<EventAction>
125
159
  }
126
160
  animation?: AnimationBasicEvents & {
127
161
  changeStart?: Animation
@@ -129,6 +163,7 @@ Default property:
129
163
  contentChange?: Animation
130
164
  roundEnd?: Animation
131
165
  mediaOnLoad?: Animation
166
+ mediaOnError?: Animation
132
167
  }
133
168
  }
134
169
 
@@ -5058,6 +5058,7 @@ export type DataCommandSandboxGetReturnValue = DataCommand & {
5058
5058
  - coseVerify (cose.sign.verifySync from https://github.com/erdtman/COSE-JS)
5059
5059
  - fflate (Not support async, callback and stream)
5060
5060
  - iconv (Use iconv-lite)
5061
+ - OpenCC (Use opencc-js)
5061
5062
 
5062
5063
  Android: Running on the sandbox of Hermes engine
5063
5064
 
@@ -31,10 +31,21 @@ Default property:
31
31
  >
32
32
  | DataLink
33
33
  }
34
- outlets?: {}
34
+ events?: {
35
+ /* Event triggered when a rule matches and canvas navigation occurs */
36
+ onNavigate?: Array<EventAction>
37
+ }
38
+ outlets?: {
39
+ /* Last matched trigger rule that caused canvas navigation */
40
+ lastMatchedRule?: () => Data
41
+ /* Index of the last matched rule in triggerList */
42
+ lastMatchedIndex?: () => Data
43
+ /* Total count of canvas navigations triggered by this generator */
44
+ navigationCount?: () => Data
45
+ }
35
46
  }
36
47
 
37
- /* Trigger change canvas by setup rules */
48
+ /* Trigger canvas navigation by setup rules */
38
49
  export type GeneratorCanvasMap = Generator &
39
50
  GeneratorCanvasMapDef & {
40
51
  templateKey: 'GENERATOR_CANVAS_MAP'
@@ -48,7 +59,7 @@ export type GeneratorCanvasMap = Generator &
48
59
  | SwitchCondData
49
60
  | {
50
61
  __typename: 'SwitchCondInnerStateOutlet'
51
- outlet: ''
62
+ outlet: 'lastMatchedRule' | 'lastMatchedIndex' | 'navigationCount'
52
63
  value: any
53
64
  }
54
65
  }>
@@ -19,6 +19,11 @@ export type GeneratorIteratorActionPrevious = Action & {
19
19
  __actionName: 'GENERATOR_ITERATOR_PREVIOUS'
20
20
  }
21
21
 
22
+ /* Jump to the first iteration element */
23
+ export type GeneratorIteratorActionFirst = Action & {
24
+ __actionName: 'GENERATOR_ITERATOR_FIRST'
25
+ }
26
+
22
27
  /* Jump to the last iteration element (ignoring the loop setting) */
23
28
  export type GeneratorIteratorActionLast = Action & {
24
29
  __actionName: 'GENERATOR_ITERATOR_LAST'
@@ -39,13 +44,13 @@ Default property:
39
44
  }
40
45
  */
41
46
  property?: {
42
- /* Data source for iteration. If it's an Array, it will iterate through elements. If it's an Object, it will use Object.values() as data source. If it's a String, it will iterate through characters. If it's a Number, it represents count from 1 to N. */
47
+ /* Data source for iteration. If it's an Array, it will iterate through elements. If it's an Object, it will use Object.entries() to get key-value pairs. If it's a String, it will iterate through characters. If it's a Number, it represents count from 1 to N. */
43
48
  data?: any
44
49
  /* Starting element position */
45
50
  start?: number | DataLink
46
51
  /* Step size for each iteration */
47
52
  step?: number | DataLink
48
- /* Maximum number of iterations (can be set to -1 for unlimited) */
53
+ /* Maximum number of iterations (can be set to -1 for unlimited). When reached, further iteration actions will be silently ignored. */
49
54
  maxQuantity?: number | DataLink
50
55
  /* Whether to loop the iteration */
51
56
  loop?: boolean | DataLink
@@ -57,6 +62,8 @@ Default property:
57
62
  first?: Array<EventAction>
58
63
  /* Event triggered on the last iteration of a round */
59
64
  end?: Array<EventAction>
65
+ /* Event triggered when data type is invalid or unexpected */
66
+ error?: Array<EventAction>
60
67
  }
61
68
  outlets?: {
62
69
  /* Elements that have been iterated (including current one) */
@@ -15,6 +15,7 @@ Default property:
15
15
  {
16
16
  "enabled": true,
17
17
  "keyMap": {},
18
+ "keyOutletPrefer": "auto",
18
19
  "batchStopKeys": [
19
20
  13
20
21
  ],
@@ -24,15 +25,18 @@ Default property:
24
25
  property?: {
25
26
  /* Enable listening for input */
26
27
  enabled?: boolean | DataLink
27
- /* Key map to transform key or key code to the designated content (e.g. { 37: 'left' }) */
28
+ /* Key map to transform key or key code to the designated content
29
+ Example: { 37: 'left', 38: 'up', 39: 'right', 40: 'down', 'Enter': 'confirm' }
30
+ Supports both key codes (numbers) and key names (strings) as keys */
28
31
  keyMap?: {} | DataLink
29
32
  /* Key outlet preference use key code or key. */
30
33
  keyOutletPrefer?: 'auto' | 'key-code' | 'key' | DataLink
31
- /* Key or code to finish continuous input */
34
+ /* Key or code to finish batch input
35
+ Common values: 13 (Enter), 27 (Escape), 'Enter', 'Escape' */
32
36
  batchStopKeys?: Array<string | DataLink | number | DataLink | DataLink> | DataLink
33
- /* Debounce time (ms) to finish continuous input */
37
+ /* Debounce time (ms) to finish batch input */
34
38
  batchDebounce?: number | DataLink
35
- /* Maximum wait time (ms) to finish continuous input (default: unlimited) */
39
+ /* Maximum wait time (ms) to finish batch input (default: unlimited) */
36
40
  batchDebounceMaxWait?: number | DataLink
37
41
  }
38
42
  events?: {
@@ -40,7 +44,7 @@ Default property:
40
44
  onDown?: Array<EventAction>
41
45
  /* Event on key up */
42
46
  onUp?: Array<EventAction>
43
- /* Event on continuous input complete */
47
+ /* Event on batch input complete */
44
48
  onBatch?: Array<EventAction>
45
49
  }
46
50
  outlets?: {
@@ -52,7 +56,7 @@ Default property:
52
56
  lastKeyUp?: () => Data
53
57
  /* Modifier key information on last key release */
54
58
  lastKeyUpFlags?: () => Data
55
- /* Last continuous event */
59
+ /* Last batch event */
56
60
  lastBatchEvents?: () => Data
57
61
  }
58
62
  }
@@ -633,6 +633,15 @@ Default property:
633
633
  completionTypicalP?: number | DataLink
634
634
  /* Repeat alpha frequency penalty (default: 0.1, 0.0 = disabled) */
635
635
  completionIgnoreEOS?: boolean | DataLink
636
+ /* Buttress connection settings for remote inference */
637
+ buttressConnectionSettings?:
638
+ | DataLink
639
+ | {
640
+ enabled?: boolean | DataLink
641
+ url?: string | DataLink
642
+ fallbackType?: 'use-local' | 'no-op' | DataLink
643
+ strategy?: 'prefer-local' | 'prefer-buttress' | 'prefer-best' | DataLink
644
+ }
636
645
  }
637
646
  events?: {
638
647
  /* Event triggered when context state changes */
@@ -33,6 +33,11 @@ export type GeneratorOnnxLLMActionInfer = ActionWithParams & {
33
33
  value?: Array<any> | DataLink | EventProperty
34
34
  mapping?: string
35
35
  }
36
+ | {
37
+ input: 'audios'
38
+ value?: Array<any> | DataLink | EventProperty
39
+ mapping?: string
40
+ }
36
41
  | {
37
42
  input: 'tools'
38
43
  value?: Array<any> | DataLink | EventProperty
@@ -99,6 +104,8 @@ Default property:
99
104
  messages?: Array<DataLink | {}> | DataLink
100
105
  /* Images with message to inference */
101
106
  images?: Array<string | DataLink> | DataLink
107
+ /* Audios with message to inference */
108
+ audios?: Array<string | DataLink> | DataLink
102
109
  /* Tool call parser */
103
110
  toolCallParser?: 'llama3_json' | 'mistral' | 'hermes' | 'internlm' | 'phi4' | DataLink
104
111
  /* Tools for chat mode using OpenAI-compatible function calling format
@@ -53,6 +53,33 @@ export type GeneratorSqliteActionQuery = ActionWithParams & {
53
53
  >
54
54
  }
55
55
 
56
+ /* Execute multiple SQL statements in transaction */
57
+ export type GeneratorSqliteActionTransaction = ActionWithParams & {
58
+ __actionName: 'GENERATOR_SQLITE_TRANSACTION'
59
+ params?: Array<{
60
+ input: 'statements'
61
+ value?: Array<any> | DataLink | EventProperty
62
+ mapping?: string
63
+ }>
64
+ }
65
+
66
+ /* Execute same SQL statement with multiple parameter sets */
67
+ export type GeneratorSqliteActionBatchExecute = ActionWithParams & {
68
+ __actionName: 'GENERATOR_SQLITE_BATCH_EXECUTE'
69
+ params?: Array<
70
+ | {
71
+ input: 'sql'
72
+ value?: string | DataLink | EventProperty
73
+ mapping?: string
74
+ }
75
+ | {
76
+ input: 'batchParams'
77
+ value?: Array<any> | DataLink | EventProperty
78
+ mapping?: string
79
+ }
80
+ >
81
+ }
82
+
56
83
  interface GeneratorSqliteDef {
57
84
  /*
58
85
  Default property:
@@ -92,6 +119,8 @@ Default property:
92
119
  error?: () => Data
93
120
  /* Last query result */
94
121
  lastResult?: () => Data
122
+ /* Last execute result with metadata */
123
+ lastExecuteResult?: () => Data
95
124
  }
96
125
  }
97
126
 
@@ -109,7 +138,7 @@ export type GeneratorSqlite = Generator &
109
138
  | SwitchCondData
110
139
  | {
111
140
  __typename: 'SwitchCondInnerStateOutlet'
112
- outlet: 'isReady' | 'dbPath' | 'error' | 'lastResult'
141
+ outlet: 'isReady' | 'dbPath' | 'error' | 'lastResult' | 'lastExecuteResult'
113
142
  value: any
114
143
  }
115
144
  }>
@@ -49,6 +49,8 @@ Default property:
49
49
  outlets?: {
50
50
  /* Countdown step value */
51
51
  countdown?: () => Data
52
+ /* Is tick running? */
53
+ running?: () => Data
52
54
  }
53
55
  }
54
56
 
@@ -66,7 +68,7 @@ export type GeneratorTick = Generator &
66
68
  | SwitchCondData
67
69
  | {
68
70
  __typename: 'SwitchCondInnerStateOutlet'
69
- outlet: 'countdown'
71
+ outlet: 'countdown' | 'running'
70
72
  value: any
71
73
  }
72
74
  }>
@@ -29,7 +29,7 @@ Default property:
29
29
  init?: boolean | DataLink
30
30
  /* URL of crawler request */
31
31
  url?: string | DataLink
32
- /* Timeout of crawler request
32
+ /* Method of crawler request
33
33
 
34
34
  Platform not supported for `webview`: tvOS, Desktop, Web */
35
35
  method?: 'webview' | 'http' | DataLink
package/utils/data.ts CHANGED
@@ -79,6 +79,7 @@ type SystemDataName =
79
79
  | 'systemOpenAIApiKey'
80
80
  | 'systemAnthropicApiKey'
81
81
  | 'systemGeminiApiKey'
82
+ | 'ggmlBackendDevices'
82
83
 
83
84
  type SystemDataInfo = {
84
85
  name: SystemDataName
@@ -468,6 +469,15 @@ export const systemDataList: Array<SystemDataInfo> = [
468
469
  type: 'string',
469
470
  value: '',
470
471
  },
472
+ {
473
+ name: 'ggmlBackendDevices',
474
+ id: 'PROPERTY_BANK_DATA_NODE_9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b',
475
+ title: 'SYSTEM: GGML Backend Devices',
476
+ description: 'Available GGML backend devices with supported generators',
477
+ schema: { type: 'object', allowNewItem: false, allowCustomProperty: false },
478
+ type: 'array',
479
+ value: [],
480
+ },
471
481
  ]
472
482
 
473
483
  export const useSystemData = (name: SystemDataName): Data => {
@@ -55,6 +55,11 @@ export const templateEventPropsMap = {
55
55
  'BRICK_SLIDESHOW_PAYLOAD_VALUE', // type: number
56
56
  'BRICK_SLIDESHOW_ORIGINAL_INDEX', // type: number
57
57
  ],
58
+ mediaOnError: [
59
+ 'BRICK_SLIDESHOW_ERROR_MESSAGE', // type: string
60
+ 'BRICK_SLIDESHOW_ERROR_URL', // type: string
61
+ 'BRICK_SLIDESHOW_ERROR_INDEX', // type: number
62
+ ],
58
63
  },
59
64
  BRICK_CHART: {
60
65
  onPress: [
@@ -234,7 +239,7 @@ export const templateEventPropsMap = {
234
239
  'GENERATOR_ALARM_CLOCK_CURRENT_TIME', // type: string
235
240
  'GENERATOR_ALARM_CLOCK_CURRENT_TIMESTAMP', // type: number
236
241
  'GENERATOR_ALARM_CLOCK_REASON', // type: string
237
- 'GENERATOR_ALARM_CLOCK_MAX_TRIGS', // type: nummber
242
+ 'GENERATOR_ALARM_CLOCK_MAX_TRIGS', // type: number
238
243
  'GENERATOR_ALARM_CLOCK_STOP_AT', // type: string
239
244
  ],
240
245
  },
@@ -371,7 +376,16 @@ export const templateEventPropsMap = {
371
376
  'GENERATOR_WEB_SOCKET_MESSAGE', // type: any
372
377
  ],
373
378
  },
374
-
379
+ GENERATOR_CANVAS_MAP: {
380
+ onNavigate: [
381
+ 'GENERATOR_CANVAS_MAP_MATCHED_RULE', // type: object
382
+ 'GENERATOR_CANVAS_MAP_MATCHED_INDEX', // type: number
383
+ 'GENERATOR_CANVAS_MAP_TARGET_CANVAS_ID', // type: string
384
+ 'GENERATOR_CANVAS_MAP_TARGET_CANVAS_TITLE_LIKE', // type: string
385
+ 'GENERATOR_CANVAS_MAP_PROPERTY_VALUE', // type: any
386
+ 'GENERATOR_CANVAS_MAP_PREVIOUS_VALUE', // type: any
387
+ ],
388
+ },
375
389
  GENERATOR_STEP: {
376
390
  onStep: [
377
391
  'GENERATOR_STEP_PAYLOAD', // type: string
@@ -382,7 +396,21 @@ export const templateEventPropsMap = {
382
396
  iterate: [
383
397
  'GENERATOR_ITERATOR_ITERATE_VALUE', // type: any
384
398
  'GENERATOR_ITERATOR_ITERATE_KEY', // type: any
385
- 'GENERATOR_ITERATOR_ITERATE_INDEX', // type: string
399
+ 'GENERATOR_ITERATOR_ITERATE_INDEX', // type: number
400
+ ],
401
+ first: [
402
+ 'GENERATOR_ITERATOR_ITERATE_VALUE', // type: any
403
+ 'GENERATOR_ITERATOR_ITERATE_KEY', // type: any
404
+ 'GENERATOR_ITERATOR_ITERATE_INDEX', // type: number
405
+ ],
406
+ end: [
407
+ 'GENERATOR_ITERATOR_ITERATE_VALUE', // type: any
408
+ 'GENERATOR_ITERATOR_ITERATE_KEY', // type: any
409
+ 'GENERATOR_ITERATOR_ITERATE_INDEX', // type: number
410
+ ],
411
+ error: [
412
+ 'GENERATOR_ITERATOR_ERROR_MESSAGE', // type: string
413
+ 'GENERATOR_ITERATOR_ERROR_DATA', // type: any
386
414
  ],
387
415
  },
388
416
  GENERATOR_WATCHDOG: {
@@ -821,7 +849,15 @@ export const templateEventPropsMap = {
821
849
  'GENERATOR_GGML_TTS_ERROR', // type: string
822
850
  ],
823
851
  },
824
- GENERATOR_RERANKER: {},
852
+ GENERATOR_RERANKER: {
853
+ onContextStateChange: [
854
+ 'GENERATOR_RERANKER_CONTEXT_STATE', // type: string
855
+ 'GENERATOR_RERANKER_CONTEXT_DETAILS', // type: object
856
+ ],
857
+ onError: [
858
+ 'GENERATOR_RERANKER_ERROR', // type: string
859
+ ],
860
+ },
825
861
  GENERATOR_QNN_LLM: {
826
862
  onContextStateChange: [
827
863
  'GENERATOR_QNN_LLM_CONTEXT_STATE', // type: string