@fugood/bricks-project 2.23.0-beta.3 → 2.23.0-beta.31

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 (91) hide show
  1. package/compile/action-name-map.ts +59 -0
  2. package/compile/index.ts +52 -60
  3. package/package.json +4 -4
  4. package/tools/mcp-server.ts +3 -3
  5. package/tools/postinstall.ts +2 -5
  6. package/tools/preview.ts +1 -1
  7. package/tools/pull.ts +1 -1
  8. package/types/brick-base.ts +1 -0
  9. package/types/bricks/Camera.ts +1 -0
  10. package/types/bricks/Chart.ts +1 -0
  11. package/types/bricks/GenerativeMedia.ts +21 -3
  12. package/types/bricks/Icon.ts +1 -0
  13. package/types/bricks/Image.ts +1 -0
  14. package/types/bricks/Items.ts +1 -0
  15. package/types/bricks/Lottie.ts +1 -0
  16. package/types/bricks/QrCode.ts +1 -0
  17. package/types/bricks/Rect.ts +1 -0
  18. package/types/bricks/RichText.ts +1 -0
  19. package/types/bricks/Rive.ts +1 -0
  20. package/types/bricks/Slideshow.ts +38 -2
  21. package/types/bricks/Svg.ts +1 -0
  22. package/types/bricks/Text.ts +1 -0
  23. package/types/bricks/TextInput.ts +1 -0
  24. package/types/bricks/Video.ts +1 -0
  25. package/types/bricks/VideoStreaming.ts +1 -0
  26. package/types/bricks/WebRtcStream.ts +1 -0
  27. package/types/bricks/WebView.ts +1 -0
  28. package/types/bricks/index.ts +1 -0
  29. package/types/canvas.ts +1 -0
  30. package/types/data-calc.ts +44 -0
  31. package/types/data.ts +1 -0
  32. package/types/generators/AlarmClock.ts +1 -0
  33. package/types/generators/Assistant.ts +11 -1
  34. package/types/generators/BleCentral.ts +1 -0
  35. package/types/generators/BlePeripheral.ts +1 -0
  36. package/types/generators/CanvasMap.ts +15 -3
  37. package/types/generators/CastlesPay.ts +1 -0
  38. package/types/generators/DataBank.ts +1 -0
  39. package/types/generators/File.ts +1 -0
  40. package/types/generators/GraphQl.ts +1 -0
  41. package/types/generators/Http.ts +75 -1
  42. package/types/generators/HttpServer.ts +1 -0
  43. package/types/generators/Information.ts +1 -0
  44. package/types/generators/Intent.ts +50 -0
  45. package/types/generators/Iterator.ts +10 -2
  46. package/types/generators/Keyboard.ts +1 -0
  47. package/types/generators/LlmAnthropicCompat.ts +1 -0
  48. package/types/generators/LlmAppleBuiltin.ts +143 -0
  49. package/types/generators/LlmGgml.ts +23 -5
  50. package/types/generators/LlmOnnx.ts +8 -0
  51. package/types/generators/LlmOpenAiCompat.ts +1 -0
  52. package/types/generators/LlmQualcommAiEngine.ts +1 -0
  53. package/types/generators/Mcp.ts +1 -0
  54. package/types/generators/McpServer.ts +1 -0
  55. package/types/generators/MediaFlow.ts +1 -0
  56. package/types/generators/MqttBroker.ts +1 -0
  57. package/types/generators/MqttClient.ts +1 -0
  58. package/types/generators/Question.ts +8 -0
  59. package/types/generators/RealtimeTranscription.ts +1 -0
  60. package/types/generators/RerankerGgml.ts +22 -16
  61. package/types/generators/SerialPort.ts +1 -0
  62. package/types/generators/SoundPlayer.ts +1 -0
  63. package/types/generators/SoundRecorder.ts +1 -0
  64. package/types/generators/SpeechToTextGgml.ts +13 -4
  65. package/types/generators/SpeechToTextOnnx.ts +1 -0
  66. package/types/generators/SpeechToTextPlatform.ts +1 -0
  67. package/types/generators/SqLite.ts +31 -1
  68. package/types/generators/Step.ts +1 -0
  69. package/types/generators/SttAppleBuiltin.ts +116 -0
  70. package/types/generators/Tcp.ts +1 -0
  71. package/types/generators/TcpServer.ts +1 -0
  72. package/types/generators/TextToSpeechApple.ts +113 -0
  73. package/types/generators/TextToSpeechAppleBuiltin.ts +113 -0
  74. package/types/generators/TextToSpeechGgml.ts +23 -3
  75. package/types/generators/TextToSpeechOnnx.ts +1 -0
  76. package/types/generators/TextToSpeechOpenAiLike.ts +1 -0
  77. package/types/generators/ThermalPrinter.ts +1 -0
  78. package/types/generators/Tick.ts +4 -1
  79. package/types/generators/TtsAppleBuiltin.ts +105 -0
  80. package/types/generators/Udp.ts +1 -0
  81. package/types/generators/VadGgml.ts +3 -2
  82. package/types/generators/VectorStore.ts +14 -2
  83. package/types/generators/Watchdog.ts +1 -0
  84. package/types/generators/WebCrawler.ts +1 -0
  85. package/types/generators/WebRtc.ts +1 -0
  86. package/types/generators/WebSocket.ts +1 -0
  87. package/types/generators/index.ts +3 -0
  88. package/types/system.ts +1 -0
  89. package/utils/data.ts +1 -0
  90. package/utils/event-props.ts +72 -3
  91. package/utils/id.ts +3 -1
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type { Animation, AnimationBasicEvents } from '../animation'
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  export * from './Rect'
2
3
  export * from './Text'
3
4
  export * from './TextInput'
package/types/canvas.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { Easing } from './animation'
2
3
  import type { Data, DataLink } from './data'
3
4
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from './switch'
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { Data } from './data'
2
3
 
3
4
  /* DataCalculation has two types: DataCalculationScript and DataCalculationMap */
@@ -3849,6 +3850,48 @@ export type DataCommandStringTitleCase = DataCommand & {
3849
3850
  }>
3850
3851
  }
3851
3852
 
3853
+ /*
3854
+ TOON Decode
3855
+ Decode TOON string. Return undefined if decode failed.
3856
+ */
3857
+ export type DataCommandStringToolDecode = DataCommand & {
3858
+ __commandName: 'STRING_TOOL_DECODE'
3859
+ inputs?: Array<{
3860
+ // Default value: "{}"
3861
+ key: 'subject'
3862
+ source: (() => DataCalculationData | DataCommand) | string
3863
+ sourceKey: string
3864
+ trigger?: boolean
3865
+ }>
3866
+ outputs?: Array<{
3867
+ key: 'result'
3868
+ // target type: any
3869
+ target: () => DataCalculationData | DataCommand
3870
+ targetKey: string
3871
+ }>
3872
+ }
3873
+
3874
+ /*
3875
+ TOON Encode
3876
+ Encode TOON string. Return undefined if encode failed.
3877
+ */
3878
+ export type DataCommandStringToolEncode = DataCommand & {
3879
+ __commandName: 'STRING_TOOL_ENCODE'
3880
+ inputs?: Array<{
3881
+ // Default value: {}
3882
+ key: 'subject'
3883
+ source: (() => DataCalculationData | DataCommand) | any
3884
+ sourceKey: string
3885
+ trigger?: boolean
3886
+ }>
3887
+ outputs?: Array<{
3888
+ key: 'result'
3889
+ // target type: string
3890
+ target: () => DataCalculationData | DataCommand
3891
+ targetKey: string
3892
+ }>
3893
+ }
3894
+
3852
3895
  /*
3853
3896
  Trim
3854
3897
  Removes whitespaces from left and right sides of the subject.
@@ -5058,6 +5101,7 @@ export type DataCommandSandboxGetReturnValue = DataCommand & {
5058
5101
  - coseVerify (cose.sign.verifySync from https://github.com/erdtman/COSE-JS)
5059
5102
  - fflate (Not support async, callback and stream)
5060
5103
  - iconv (Use iconv-lite)
5104
+ - OpenCC (Use opencc-js)
5061
5105
 
5062
5106
  Android: Running on the sandbox of Hermes engine
5063
5107
 
package/types/data.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SubspaceID, EventAction, LocalSyncStrategy } from './common'
2
3
 
3
4
  interface DataDef {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -411,7 +412,10 @@ Default property:
411
412
  "sttEnabled": true,
412
413
  "sttLivePolicy": "only-in-use",
413
414
  "ttsEnabled": false,
414
- "ttsLivePolicy": "only-in-use"
415
+ "ttsLivePolicy": "only-in-use",
416
+ "mcpResourceAnnotationEnabled": false,
417
+ "mcpResourceAnnotationKeyword": "@resource:",
418
+ "mcpResourceAnnotationFallback": ""
415
419
  }
416
420
  */
417
421
  property?: {
@@ -489,6 +493,12 @@ Default property:
489
493
  }
490
494
  >
491
495
  | DataLink
496
+ /* Enable MCP resource annotation in messages. When enabled, users can use keyboard shortcuts to include MCP resources using the format: @resource:<server-name>:<resource-uri> */
497
+ mcpResourceAnnotationEnabled?: boolean | DataLink
498
+ /* MCP resource annotation keyword (Default: @resource:) */
499
+ mcpResourceAnnotationKeyword?: string | DataLink
500
+ /* Fallback text when MCP server or resource is not found. If empty, an error will be thrown. */
501
+ mcpResourceAnnotationFallback?: string | DataLink
492
502
  }
493
503
  events?: {
494
504
  /* Error event */
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -31,10 +32,21 @@ Default property:
31
32
  >
32
33
  | DataLink
33
34
  }
34
- outlets?: {}
35
+ events?: {
36
+ /* Event triggered when a rule matches and canvas navigation occurs */
37
+ onNavigate?: Array<EventAction>
38
+ }
39
+ outlets?: {
40
+ /* Last matched trigger rule that caused canvas navigation */
41
+ lastMatchedRule?: () => Data
42
+ /* Index of the last matched rule in triggerList */
43
+ lastMatchedIndex?: () => Data
44
+ /* Total count of canvas navigations triggered by this generator */
45
+ navigationCount?: () => Data
46
+ }
35
47
  }
36
48
 
37
- /* Trigger change canvas by setup rules */
49
+ /* Trigger canvas navigation by setup rules */
38
50
  export type GeneratorCanvasMap = Generator &
39
51
  GeneratorCanvasMapDef & {
40
52
  templateKey: 'GENERATOR_CANVAS_MAP'
@@ -48,7 +60,7 @@ export type GeneratorCanvasMap = Generator &
48
60
  | SwitchCondData
49
61
  | {
50
62
  __typename: 'SwitchCondInnerStateOutlet'
51
- outlet: ''
63
+ outlet: 'lastMatchedRule' | 'lastMatchedIndex' | 'navigationCount'
52
64
  value: any
53
65
  }
54
66
  }>
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -10,8 +11,81 @@ import type {
10
11
  } from '../common'
11
12
 
12
13
  /* Run HTTP request with defined properties */
13
- export type GeneratorHTTPActionRunRequest = Action & {
14
+ export type GeneratorHTTPActionRunRequest = ActionWithParams & {
14
15
  __actionName: 'GENERATOR_HTTP_RUN_REQUEST'
16
+ params?: Array<
17
+ | {
18
+ input: 'url'
19
+ value?: string | DataLink | EventProperty
20
+ mapping?: string
21
+ }
22
+ | {
23
+ input: 'method'
24
+ value?:
25
+ | 'GET'
26
+ | 'POST'
27
+ | 'PUT'
28
+ | 'DELETE'
29
+ | 'HEAD'
30
+ | 'PATCH'
31
+ | 'OPTIONS'
32
+ | 'CONNECT'
33
+ | 'TRACE'
34
+ | DataLink
35
+ | EventProperty
36
+ mapping?: string
37
+ }
38
+ | {
39
+ input: 'headers'
40
+ value?: {} | DataLink | EventProperty
41
+ mapping?: string
42
+ }
43
+ | {
44
+ input: 'body'
45
+ value?: any | EventProperty
46
+ mapping?: string
47
+ }
48
+ | {
49
+ input: 'timeout'
50
+ value?: number | DataLink | EventProperty
51
+ mapping?: string
52
+ }
53
+ | {
54
+ input: 'mode'
55
+ value?: 'same-origin' | 'no-cors' | 'cors' | DataLink | EventProperty
56
+ mapping?: string
57
+ }
58
+ | {
59
+ input: 'credentials'
60
+ value?: 'include' | 'same-origin' | 'omit' | DataLink | EventProperty
61
+ mapping?: string
62
+ }
63
+ | {
64
+ input: 'redirect'
65
+ value?: 'manual' | 'follow' | 'error' | DataLink | EventProperty
66
+ mapping?: string
67
+ }
68
+ | {
69
+ input: 'referrer'
70
+ value?: 'no-referrer' | 'client' | DataLink | EventProperty
71
+ mapping?: string
72
+ }
73
+ | {
74
+ input: 'resType'
75
+ value?: 'json' | 'text' | 'xml' | 'csv' | DataLink | EventProperty
76
+ mapping?: string
77
+ }
78
+ | {
79
+ input: 'eventStream'
80
+ value?: boolean | DataLink | EventProperty
81
+ mapping?: string
82
+ }
83
+ | {
84
+ input: 'eventName'
85
+ value?: string | DataLink | EventProperty
86
+ mapping?: string
87
+ }
88
+ >
15
89
  }
16
90
 
17
91
  /* Abort HTTP request or SSE */
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -51,6 +52,53 @@ export type GeneratorIntentActionSendIntent = ActionWithParams & {
51
52
  >
52
53
  }
53
54
 
55
+ /* Start intent service */
56
+ export type GeneratorIntentActionStartService = ActionWithParams & {
57
+ __actionName: 'GENERATOR_INTENT_START_SERVICE'
58
+ params?: Array<
59
+ | {
60
+ input: 'action'
61
+ value?: string | DataLink | EventProperty
62
+ mapping?: string
63
+ }
64
+ | {
65
+ input: 'data'
66
+ value?: string | DataLink | EventProperty
67
+ mapping?: string
68
+ }
69
+ | {
70
+ input: 'type'
71
+ value?: string | DataLink | EventProperty
72
+ mapping?: string
73
+ }
74
+ | {
75
+ input: 'extra'
76
+ value?: {} | DataLink | EventProperty
77
+ mapping?: string
78
+ }
79
+ | {
80
+ input: 'className'
81
+ value?: string | DataLink | EventProperty
82
+ mapping?: string
83
+ }
84
+ | {
85
+ input: 'packageName'
86
+ value?: string | DataLink | EventProperty
87
+ mapping?: string
88
+ }
89
+ | {
90
+ input: 'category'
91
+ value?: string | DataLink | EventProperty
92
+ mapping?: string
93
+ }
94
+ | {
95
+ input: 'foreground'
96
+ value?: boolean | DataLink | EventProperty
97
+ mapping?: string
98
+ }
99
+ >
100
+ }
101
+
54
102
  interface GeneratorIntentDef {
55
103
  /*
56
104
  Default property:
@@ -71,6 +119,8 @@ Default property:
71
119
  packageName?: string | DataLink
72
120
  /* Intent category */
73
121
  category?: string | DataLink
122
+ /* Intent start foreground service */
123
+ foregroundService?: boolean | DataLink
74
124
  }
75
125
  events?: {
76
126
  /* On intent return a result trigger */
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -19,6 +20,11 @@ export type GeneratorIteratorActionPrevious = Action & {
19
20
  __actionName: 'GENERATOR_ITERATOR_PREVIOUS'
20
21
  }
21
22
 
23
+ /* Jump to the first iteration element */
24
+ export type GeneratorIteratorActionFirst = Action & {
25
+ __actionName: 'GENERATOR_ITERATOR_FIRST'
26
+ }
27
+
22
28
  /* Jump to the last iteration element (ignoring the loop setting) */
23
29
  export type GeneratorIteratorActionLast = Action & {
24
30
  __actionName: 'GENERATOR_ITERATOR_LAST'
@@ -39,13 +45,13 @@ Default property:
39
45
  }
40
46
  */
41
47
  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. */
48
+ /* 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
49
  data?: any
44
50
  /* Starting element position */
45
51
  start?: number | DataLink
46
52
  /* Step size for each iteration */
47
53
  step?: number | DataLink
48
- /* Maximum number of iterations (can be set to -1 for unlimited) */
54
+ /* Maximum number of iterations (can be set to -1 for unlimited). When reached, further iteration actions will be silently ignored. */
49
55
  maxQuantity?: number | DataLink
50
56
  /* Whether to loop the iteration */
51
57
  loop?: boolean | DataLink
@@ -57,6 +63,8 @@ Default property:
57
63
  first?: Array<EventAction>
58
64
  /* Event triggered on the last iteration of a round */
59
65
  end?: Array<EventAction>
66
+ /* Event triggered when data type is invalid or unexpected */
67
+ error?: Array<EventAction>
60
68
  }
61
69
  outlets?: {
62
70
  /* Elements that have been iterated (including current one) */
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -0,0 +1,143 @@
1
+ /* Auto generated by build script */
2
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
+ import type { Data, DataLink } from '../data'
4
+ import type {
5
+ Generator,
6
+ EventAction,
7
+ ActionWithDataParams,
8
+ ActionWithParams,
9
+ Action,
10
+ EventProperty,
11
+ } from '../common'
12
+
13
+ /* Load model */
14
+ export type GeneratorAppleLLMActionLoadModel = Action & {
15
+ __actionName: 'GENERATOR_APPLE_LLM_LOAD_MODEL'
16
+ }
17
+
18
+ /* Run text completion */
19
+ export type GeneratorAppleLLMActionCompletion = ActionWithParams & {
20
+ __actionName: 'GENERATOR_APPLE_LLM_COMPLETION'
21
+ params?: Array<
22
+ | {
23
+ input: 'messages'
24
+ value?: Array<any> | DataLink | EventProperty
25
+ mapping?: string
26
+ }
27
+ | {
28
+ input: 'maxTokens'
29
+ value?: number | DataLink | EventProperty
30
+ mapping?: string
31
+ }
32
+ | {
33
+ input: 'temperature'
34
+ value?: number | DataLink | EventProperty
35
+ mapping?: string
36
+ }
37
+ | {
38
+ input: 'topP'
39
+ value?: number | DataLink | EventProperty
40
+ mapping?: string
41
+ }
42
+ >
43
+ }
44
+
45
+ /* Stop text completion */
46
+ export type GeneratorAppleLLMActionStopCompletion = Action & {
47
+ __actionName: 'GENERATOR_APPLE_LLM_STOP_COMPLETION'
48
+ }
49
+
50
+ interface GeneratorAppleLLMDef {
51
+ /*
52
+ Default property:
53
+ {
54
+ "init": false,
55
+ "completionMessages": [
56
+ {
57
+ "role": "system",
58
+ "content": "You are a helpful assistant."
59
+ },
60
+ {
61
+ "role": "user",
62
+ "content": "Hello"
63
+ }
64
+ ],
65
+ "completionMaxTokens": 1024,
66
+ "completionTemperature": 0.7,
67
+ "completionTopP": 0.9
68
+ }
69
+ */
70
+ property?: {
71
+ /* Initialize model on generator init */
72
+ init?: boolean | DataLink
73
+ /* Chat messages (if first message has role 'system', it will be used as system prompt) */
74
+ completionMessages?:
75
+ | Array<
76
+ | DataLink
77
+ | {
78
+ role?: string | DataLink
79
+ content?: string | DataLink
80
+ }
81
+ >
82
+ | DataLink
83
+ /* Maximum tokens to generate */
84
+ completionMaxTokens?: number | DataLink
85
+ /* Temperature (0.0 to 1.0) */
86
+ completionTemperature?: number | DataLink
87
+ /* Top P sampling */
88
+ completionTopP?: number | DataLink
89
+ }
90
+ events?: {
91
+ /* Error event */
92
+ onError?: Array<EventAction>
93
+ /* Model loaded event */
94
+ onModelLoaded?: Array<EventAction>
95
+ /* Completion event */
96
+ onCompletion?: Array<EventAction>
97
+ /* Completion finished event */
98
+ onCompletionFinished?: Array<EventAction>
99
+ }
100
+ outlets?: {
101
+ /* Context state outlet */
102
+ contextState?: () => Data
103
+ /* Evaluating outlet */
104
+ isEvaluating?: () => Data
105
+ /* Completion result outlet */
106
+ completionResult?: () => Data
107
+ /* Last token outlet */
108
+ completionLastToken?: () => Data
109
+ }
110
+ }
111
+
112
+ /* LLM inference using Apple Intelligence on iOS/tvOS 26+
113
+
114
+ ## Features
115
+ - Native Apple Intelligence integration
116
+ - No model download required
117
+ - Privacy-focused on-device processing
118
+ - Optimized for Apple Silicon
119
+ - Requires iOS 26+ or tvOS 26+ */
120
+ export type GeneratorAppleLLM = Generator &
121
+ GeneratorAppleLLMDef & {
122
+ templateKey: 'GENERATOR_APPLE_LLM'
123
+ switches: Array<
124
+ SwitchDef &
125
+ GeneratorAppleLLMDef & {
126
+ conds?: Array<{
127
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
128
+ cond:
129
+ | SwitchCondInnerStateCurrentCanvas
130
+ | SwitchCondData
131
+ | {
132
+ __typename: 'SwitchCondInnerStateOutlet'
133
+ outlet:
134
+ | 'contextState'
135
+ | 'isEvaluating'
136
+ | 'completionResult'
137
+ | 'completionLastToken'
138
+ value: any
139
+ }
140
+ }>
141
+ }
142
+ >
143
+ }
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -382,6 +383,11 @@ export type GeneratorLLMActionStopCompletion = Action & {
382
383
  __actionName: 'GENERATOR_LLM_STOP_COMPLETION'
383
384
  }
384
385
 
386
+ /* Clear KV cache */
387
+ export type GeneratorLLMActionClearCache = Action & {
388
+ __actionName: 'GENERATOR_LLM_CLEAR_CACHE'
389
+ }
390
+
385
391
  /* Clear downloaded models & current jobs */
386
392
  export type GeneratorLLMActionClearDownload = Action & {
387
393
  __actionName: 'GENERATOR_LLM_CLEAR_DOWNLOAD'
@@ -483,8 +489,16 @@ Default property:
483
489
  /* Accelerator variant (Only for desktop)
484
490
  `default` - CPU / Metal (macOS)
485
491
  `vulkan` - Use Vulkan
486
- `cuda` - Use CUDA */
487
- accelVariant?: 'default' | 'vulkan' | 'cuda' | DataLink
492
+ `cuda` - Use CUDA
493
+ `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
494
+ accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
495
+ /* Devices. For example:
496
+
497
+ Metal or CPU for iOS/tvOS/MacOS
498
+ OpenCL or CPU for Android
499
+ - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices)
500
+ For Desktop, you may want to include/exclude GPUs */
501
+ devices?: Array<string | DataLink> | DataLink
488
502
  /* Main GPU index */
489
503
  mainGpu?: number | DataLink
490
504
  /* Number of GPU layers */
@@ -637,9 +651,10 @@ Default property:
637
651
  buttressConnectionSettings?:
638
652
  | DataLink
639
653
  | {
654
+ enabled?: boolean | DataLink
640
655
  url?: string | DataLink
641
- trpcPath?: string | DataLink
642
656
  fallbackType?: 'use-local' | 'no-op' | DataLink
657
+ strategy?: 'prefer-local' | 'prefer-buttress' | 'prefer-best' | DataLink
643
658
  }
644
659
  }
645
660
  events?: {
@@ -690,8 +705,11 @@ Default property:
690
705
  - The device RAM must be larger than 8GB
691
706
  - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
692
707
  - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
693
- - Android: Recommended use Android 13+ system. Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
694
- - Linux / Windows: Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property */
708
+ - Android: Recommended use Android 13+ system.
709
+ - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
710
+ - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 1+ GPUs.
711
+ - Linux / Windows [@nextline - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
712
+ - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux) */
695
713
  export type GeneratorLLM = Generator &
696
714
  GeneratorLLMDef & {
697
715
  templateKey: 'GENERATOR_LLM'
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -33,6 +34,11 @@ export type GeneratorOnnxLLMActionInfer = ActionWithParams & {
33
34
  value?: Array<any> | DataLink | EventProperty
34
35
  mapping?: string
35
36
  }
37
+ | {
38
+ input: 'audios'
39
+ value?: Array<any> | DataLink | EventProperty
40
+ mapping?: string
41
+ }
36
42
  | {
37
43
  input: 'tools'
38
44
  value?: Array<any> | DataLink | EventProperty
@@ -99,6 +105,8 @@ Default property:
99
105
  messages?: Array<DataLink | {}> | DataLink
100
106
  /* Images with message to inference */
101
107
  images?: Array<string | DataLink> | DataLink
108
+ /* Audios with message to inference */
109
+ audios?: Array<string | DataLink> | DataLink
102
110
  /* Tool call parser */
103
111
  toolCallParser?: 'llama3_json' | 'mistral' | 'hermes' | 'internlm' | 'phi4' | DataLink
104
112
  /* Tools for chat mode using OpenAI-compatible function calling format
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {