@fugood/bricks-project 2.23.5 → 2.23.7

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 (86) hide show
  1. package/compile/action-name-map.ts +24 -0
  2. package/compile/index.ts +26 -20
  3. package/compile/util.ts +2 -0
  4. package/package.json +2 -2
  5. package/tools/deploy.ts +27 -2
  6. package/tools/preview.ts +1 -1
  7. package/types/bricks/Camera.ts +5 -2
  8. package/types/bricks/Chart.ts +4 -1
  9. package/types/bricks/GenerativeMedia.ts +4 -1
  10. package/types/bricks/Icon.ts +5 -2
  11. package/types/bricks/Image.ts +5 -2
  12. package/types/bricks/Items.ts +5 -2
  13. package/types/bricks/Lottie.ts +4 -1
  14. package/types/bricks/Maps.ts +5 -2
  15. package/types/bricks/QrCode.ts +5 -2
  16. package/types/bricks/Rect.ts +5 -2
  17. package/types/bricks/RichText.ts +5 -2
  18. package/types/bricks/Rive.ts +4 -1
  19. package/types/bricks/Slideshow.ts +5 -2
  20. package/types/bricks/Svg.ts +4 -1
  21. package/types/bricks/Text.ts +5 -2
  22. package/types/bricks/TextInput.ts +5 -2
  23. package/types/bricks/Video.ts +5 -2
  24. package/types/bricks/VideoStreaming.ts +4 -1
  25. package/types/bricks/WebRtcStream.ts +5 -2
  26. package/types/bricks/WebView.ts +4 -1
  27. package/types/generators/AlarmClock.ts +5 -2
  28. package/types/generators/Assistant.ts +6 -3
  29. package/types/generators/BleCentral.ts +5 -2
  30. package/types/generators/BlePeripheral.ts +5 -2
  31. package/types/generators/CanvasMap.ts +4 -1
  32. package/types/generators/CastlesPay.ts +5 -2
  33. package/types/generators/DataBank.ts +5 -2
  34. package/types/generators/File.ts +5 -2
  35. package/types/generators/GraphQl.ts +4 -1
  36. package/types/generators/Http.ts +4 -1
  37. package/types/generators/HttpServer.ts +4 -1
  38. package/types/generators/Information.ts +5 -2
  39. package/types/generators/Intent.ts +4 -1
  40. package/types/generators/Iterator.ts +4 -1
  41. package/types/generators/Keyboard.ts +5 -2
  42. package/types/generators/LlmAnthropicCompat.ts +10 -1
  43. package/types/generators/LlmAppleBuiltin.ts +11 -1
  44. package/types/generators/LlmGgml.ts +53 -1
  45. package/types/generators/LlmMediaTekNeuroPilot.ts +228 -0
  46. package/types/generators/LlmMlx.ts +11 -1
  47. package/types/generators/LlmOnnx.ts +5 -1
  48. package/types/generators/LlmOpenAiCompat.ts +14 -1
  49. package/types/generators/LlmQualcommAiEngine.ts +4 -1
  50. package/types/generators/Mcp.ts +4 -1
  51. package/types/generators/McpServer.ts +4 -1
  52. package/types/generators/MediaFlow.ts +4 -1
  53. package/types/generators/MqttBroker.ts +4 -1
  54. package/types/generators/MqttClient.ts +4 -1
  55. package/types/generators/Question.ts +5 -2
  56. package/types/generators/RealtimeTranscription.ts +16 -1
  57. package/types/generators/RerankerGgml.ts +15 -1
  58. package/types/generators/SerialPort.ts +5 -2
  59. package/types/generators/SoundPlayer.ts +4 -1
  60. package/types/generators/SoundRecorder.ts +16 -2
  61. package/types/generators/SpeechToTextGgml.ts +10 -1
  62. package/types/generators/SpeechToTextOnnx.ts +5 -1
  63. package/types/generators/SpeechToTextPlatform.ts +4 -1
  64. package/types/generators/SqLite.ts +5 -2
  65. package/types/generators/Step.ts +4 -1
  66. package/types/generators/SttAppleBuiltin.ts +11 -1
  67. package/types/generators/Tcp.ts +5 -2
  68. package/types/generators/TcpServer.ts +4 -1
  69. package/types/generators/TextToSpeechAppleBuiltin.ts +11 -1
  70. package/types/generators/TextToSpeechGgml.ts +16 -1
  71. package/types/generators/TextToSpeechOnnx.ts +5 -1
  72. package/types/generators/TextToSpeechOpenAiLike.ts +4 -1
  73. package/types/generators/ThermalPrinter.ts +5 -2
  74. package/types/generators/Tick.ts +5 -2
  75. package/types/generators/Udp.ts +5 -2
  76. package/types/generators/VadGgml.ts +4 -1
  77. package/types/generators/VadOnnx.ts +5 -1
  78. package/types/generators/VadTraditional.ts +5 -1
  79. package/types/generators/VectorStore.ts +5 -2
  80. package/types/generators/Watchdog.ts +5 -2
  81. package/types/generators/WebCrawler.ts +4 -1
  82. package/types/generators/WebRtc.ts +5 -2
  83. package/types/generators/WebSocket.ts +4 -1
  84. package/types/generators/index.ts +1 -0
  85. package/types/subspace.ts +2 -0
  86. package/utils/event-props.ts +20 -0
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Payment processing integration for Castles payment terminals
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -56,7 +59,7 @@ Default property:
56
59
  }
57
60
  }
58
61
 
59
- /* Castles Pay */
62
+ /* Payment processing integration for Castles payment terminals */
60
63
  export type GeneratorCastlesPay = Generator &
61
64
  GeneratorCastlesPayDef & {
62
65
  templateKey: 'GENERATOR_CASTLES_PAY'
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Access and subscribe to shared Data properties from the project Data Bank
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -129,7 +132,7 @@ Default property:
129
132
  }
130
133
  }
131
134
 
132
- /* Get Data or subscribe to Data changes from Data Bank */
135
+ /* Access and subscribe to shared Data properties from the project Data Bank */
133
136
  export type GeneratorDataBank = Generator &
134
137
  GeneratorDataBankDef & {
135
138
  templateKey: 'GENERATOR_DATA_BANK'
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * File system operations: read, write, copy, delete, and list files
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -366,7 +369,7 @@ Default property:
366
369
  }
367
370
  }
368
371
 
369
- /* File handling */
372
+ /* File system operations: read, write, copy, delete, and list files */
370
373
  export type GeneratorFile = Generator &
371
374
  GeneratorFileDef & {
372
375
  templateKey: 'GENERATOR_FILE'
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Execute GraphQL Query / Mutation / Subscriptions
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Execute HTTP requests
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * HTTP Server
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Display informational dialog or toast messages to the user
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -76,7 +79,7 @@ Default property:
76
79
  }
77
80
  }
78
81
 
79
- /* Show information */
82
+ /* Display informational dialog or toast messages to the user */
80
83
  export type GeneratorInformation = Generator &
81
84
  GeneratorInformationDef & {
82
85
  templateKey: 'GENERATOR_INFORMATION'
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Send intent to app and get result (Android only)
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Iterate through values (Array, Object, Number, String)
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Listen to keyboard and remote control key events (keyDown, keyUp)
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -73,7 +76,7 @@ Default property:
73
76
  }
74
77
  }
75
78
 
76
- /* Access keyboard (remote control) events */
79
+ /* Listen to keyboard and remote control key events (keyDown, keyUp) */
77
80
  export type GeneratorKeyboard = Generator &
78
81
  GeneratorKeyboardDef & {
79
82
  templateKey: 'GENERATOR_KEYBOARD'
@@ -1,4 +1,13 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * LLM inference using Anthropic-compatible API endpoints
4
+ *
5
+ * ## Features
6
+ * - Compatible with Anthropic API format
7
+ * - Supports function calling (tools)
8
+ * - Streaming responses
9
+ * - Custom API endpoints (Default to https://api.anthropic.com/v1/messages)
10
+ */
2
11
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
12
  import type { Data, DataLink } from '../data'
4
13
  import type {
@@ -1,4 +1,14 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * LLM inference using Apple Intelligence on iOS/tvOS 26+
4
+ *
5
+ * ## Features
6
+ * - Native Apple Intelligence integration
7
+ * - No model download required
8
+ * - Privacy-focused on-device processing
9
+ * - Optimized for Apple Silicon
10
+ * - Requires iOS 26+ or tvOS 26+
11
+ */
2
12
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
13
  import type { Data, DataLink } from '../data'
4
14
  import type {
@@ -1,4 +1,17 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Local Large Language Model (LLM) inference based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
4
+ *
5
+ * ## Notice
6
+ * - The device RAM must be larger than 8GB
7
+ * - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
8
+ * - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
9
+ * - Android: Recommended use Android 13+ system.
10
+ * - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
11
+ * - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 1+ GPUs.
12
+ * - Linux / Windows [@nextline - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
13
+ * - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux)
14
+ */
2
15
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
16
  import type { Data, DataLink } from '../data'
4
17
  import type {
@@ -97,6 +110,16 @@ export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
97
110
  value?: boolean | DataLink | EventProperty
98
111
  mapping?: string
99
112
  }
113
+ | {
114
+ input: 'thinkingBudgetTokens'
115
+ value?: number | DataLink | EventProperty
116
+ mapping?: string
117
+ }
118
+ | {
119
+ input: 'thinkingBudgetMessage'
120
+ value?: string | DataLink | EventProperty
121
+ mapping?: string
122
+ }
100
123
  | {
101
124
  input: 'prompt'
102
125
  value?: string | DataLink | EventProperty
@@ -137,6 +160,11 @@ export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
137
160
  value?: string | DataLink | EventProperty
138
161
  mapping?: string
139
162
  }
163
+ | {
164
+ input: 'forcePureContent'
165
+ value?: boolean | DataLink | EventProperty
166
+ mapping?: string
167
+ }
140
168
  >
141
169
  }
142
170
 
@@ -179,6 +207,16 @@ export type GeneratorLLMActionCompletion = ActionWithParams & {
179
207
  value?: boolean | DataLink | EventProperty
180
208
  mapping?: string
181
209
  }
210
+ | {
211
+ input: 'thinkingBudgetTokens'
212
+ value?: number | DataLink | EventProperty
213
+ mapping?: string
214
+ }
215
+ | {
216
+ input: 'thinkingBudgetMessage'
217
+ value?: string | DataLink | EventProperty
218
+ mapping?: string
219
+ }
182
220
  | {
183
221
  input: 'useReasoningFormat'
184
222
  value?: string | DataLink | EventProperty
@@ -224,6 +262,11 @@ export type GeneratorLLMActionCompletion = ActionWithParams & {
224
262
  value?: string | DataLink | EventProperty
225
263
  mapping?: string
226
264
  }
265
+ | {
266
+ input: 'forcePureContent'
267
+ value?: boolean | DataLink | EventProperty
268
+ mapping?: string
269
+ }
227
270
  | {
228
271
  input: 'grammar'
229
272
  value?: string | DataLink | EventProperty
@@ -432,6 +475,7 @@ Default property:
432
475
  "completionEnableThinking": true,
433
476
  "completionAddGenerationPrompt": true,
434
477
  "completionChatTemplateKwargs": {},
478
+ "completionForcePureContent": false,
435
479
  "completionUseReasoningFormat": "auto",
436
480
  "completionStopWords": [],
437
481
  "completionPredict": 400,
@@ -514,6 +558,8 @@ Default property:
514
558
  useMlock?: boolean | DataLink
515
559
  /* Use mmap */
516
560
  useMmap?: boolean | DataLink
561
+ /* Disable extra buffer types for weight repacking. Reduces memory usage at the cost of slower prompt processing. */
562
+ noExtraBuffs?: boolean | DataLink
517
563
  /* Use Flash Attention for inference (Recommended with GPU enabled) */
518
564
  useFlashAttn?: 'auto' | 'on' | 'off' | DataLink
519
565
  /* KV cache data type for the K (Default: f16) */
@@ -588,12 +634,18 @@ Default property:
588
634
  }
589
635
  /* Enable thinking */
590
636
  completionEnableThinking?: boolean | DataLink
637
+ /* Maximum tokens allowed inside the model's thinking block before forcing it closed. Only applies when chat formatting exposes thinking tags. */
638
+ completionThinkingBudgetTokens?: number | DataLink
639
+ /* Message injected before the thinking end tag when the thinking budget is exhausted. */
640
+ completionThinkingBudgetMessage?: string | DataLink
591
641
  /* Add generation prompt */
592
642
  completionAddGenerationPrompt?: boolean | DataLink
593
643
  /* Now (for fill current date in chat template if supported) */
594
644
  completionNow?: string | DataLink
595
645
  /* Additional keyword arguments for chat template (object) */
596
646
  completionChatTemplateKwargs?: {} | DataLink
647
+ /* Force pure content (accept any model that has a chat_template without requiring template validation) */
648
+ completionForcePureContent?: boolean | DataLink
597
649
  /* Use reasoning format for enhanced response structure
598
650
  `auto` - Auto-determine the reasoning format of the model
599
651
  `none` - Disable reasoning format */
@@ -0,0 +1,228 @@
1
+ /* Auto generated by build script
2
+ *
3
+ * On-device LLM inference using MediaTek NeuroPilot native SDK integration on Android
4
+ */
5
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
6
+ import type { Data, DataLink } from '../data'
7
+ import type {
8
+ Brick,
9
+ Generator,
10
+ EventAction,
11
+ ActionWithDataParams,
12
+ ActionWithParams,
13
+ Action,
14
+ EventProperty,
15
+ } from '../common'
16
+
17
+ /* Load or validate the NeuroPilot model context */
18
+ export type GeneratorNeuropilotLlmActionLoadModel = ActionWithParams & {
19
+ __actionName: 'GENERATOR_NEUROPILOT_LLM_LOAD_MODEL'
20
+ params?: Array<
21
+ | {
22
+ input: 'runnerPath'
23
+ value?: string | DataLink | EventProperty
24
+ mapping?: string
25
+ }
26
+ | {
27
+ input: 'configPath'
28
+ value?: string | DataLink | EventProperty
29
+ mapping?: string
30
+ }
31
+ | {
32
+ input: 'workingDirectory'
33
+ value?: string | DataLink | EventProperty
34
+ mapping?: string
35
+ }
36
+ | {
37
+ input: 'libraryPaths'
38
+ value?: Array<any> | DataLink | EventProperty
39
+ mapping?: string
40
+ }
41
+ | {
42
+ input: 'daemonHost'
43
+ value?: string | DataLink | EventProperty
44
+ mapping?: string
45
+ }
46
+ | {
47
+ input: 'daemonPort'
48
+ value?: number | DataLink | EventProperty
49
+ mapping?: string
50
+ }
51
+ | {
52
+ input: 'daemonSocketName'
53
+ value?: string | DataLink | EventProperty
54
+ mapping?: string
55
+ }
56
+ | {
57
+ input: 'daemonSocketNamespace'
58
+ value?: string | DataLink | EventProperty
59
+ mapping?: string
60
+ }
61
+ >
62
+ }
63
+
64
+ /* Run text generation with the current NeuroPilot context */
65
+ export type GeneratorNeuropilotLlmActionGenerate = ActionWithParams & {
66
+ __actionName: 'GENERATOR_NEUROPILOT_LLM_GENERATE'
67
+ params?: Array<
68
+ | {
69
+ input: 'prompt'
70
+ value?: string | DataLink | EventProperty
71
+ mapping?: string
72
+ }
73
+ | {
74
+ input: 'messages'
75
+ value?: Array<any> | DataLink | EventProperty
76
+ mapping?: string
77
+ }
78
+ | {
79
+ input: 'maxNewTokens'
80
+ value?: number | DataLink | EventProperty
81
+ mapping?: string
82
+ }
83
+ | {
84
+ input: 'preformatter'
85
+ value?: string | DataLink | EventProperty
86
+ mapping?: string
87
+ }
88
+ >
89
+ }
90
+
91
+ /* Abort an in-flight NeuroPilot generation request */
92
+ export type GeneratorNeuropilotLlmActionAbortGeneration = Action & {
93
+ __actionName: 'GENERATOR_NEUROPILOT_LLM_ABORT_GENERATION'
94
+ }
95
+
96
+ /* Release the current NeuroPilot context */
97
+ export type GeneratorNeuropilotLlmActionReleaseContext = Action & {
98
+ __actionName: 'GENERATOR_NEUROPILOT_LLM_RELEASE_CONTEXT'
99
+ }
100
+
101
+ interface GeneratorNeuropilotLlmDef {
102
+ /*
103
+ Default property:
104
+ {
105
+ "runnerPath": "/data/local/tmp/llm_sdk/main",
106
+ "configPath": "/data/local/tmp/llm_sdk/config_gemma2_2b_instruct.yaml",
107
+ "workingDirectory": "/data/local/tmp/llm_sdk",
108
+ "libraryPaths": [
109
+ "/vendor/lib64",
110
+ "/system_ext/lib64",
111
+ "/vendor/lib",
112
+ "/system_ext/lib"
113
+ ],
114
+ "runtimeMode": "auto",
115
+ "preformatter": "GemmaNoInput",
116
+ "maxNewTokens": 128
117
+ }
118
+ */
119
+ property?: {
120
+ /* Preloadable NeuroPilot model bundle preset */
121
+ modelBundle?:
122
+ | 'Gemma 2 2B Instruct'
123
+ | 'Gemma 2 2B Instruct (Tailpatched)'
124
+ | 'Gemma 2 2B Instruct (Tailpatched MDLA53)'
125
+ | 'Qwen 2.5 0.5B Instruct'
126
+ | 'Qwen 2.5 1.5B Instruct'
127
+ | 'Llama 3 8B Instruct'
128
+ | DataLink
129
+ /* Override base URL for NeuroPilot model bundle downloads */
130
+ modelBaseUrl?: string | DataLink
131
+ /* Validate runner/config paths on generator initialization */
132
+ init?: boolean | DataLink
133
+ /* Runner binary path on device */
134
+ runnerPath?: string | DataLink
135
+ /* YAML config path on device */
136
+ configPath?: string | DataLink
137
+ /* Working directory for the runner process */
138
+ workingDirectory?: string | DataLink
139
+ /* Extra library search paths for the runner process */
140
+ libraryPaths?: Array<string | DataLink> | DataLink
141
+ /* Daemon host for a preloaded NeuroPilot service */
142
+ daemonHost?: string | DataLink
143
+ /* Daemon TCP port for a preloaded NeuroPilot service */
144
+ daemonPort?: number | DataLink
145
+ /* Android local socket name for a privileged NeuroPilot service */
146
+ daemonSocketName?: string | DataLink
147
+ /* Android local socket namespace used by the privileged NeuroPilot service */
148
+ daemonSocketNamespace?: 'abstract' | 'reserved' | 'filesystem' | DataLink
149
+ /* Runtime selection strategy for MediaTek execution */
150
+ runtimeMode?: 'auto' | 'daemon' | 'root-runner' | 'native' | DataLink
151
+ /* Prompt preformatter used by the vendor runner */
152
+ preformatter?:
153
+ | 'AlpacaNoInput'
154
+ | 'OneShotConversation'
155
+ | 'VicunaNoInput'
156
+ | 'QwenNoInput'
157
+ | 'Qwen3NoInput'
158
+ | 'Qwen3NoInputNoThink'
159
+ | 'Llama3NoInput'
160
+ | 'Phi3NoInput'
161
+ | 'MinicpmNoInput'
162
+ | 'MinicpmNoInputZh'
163
+ | 'InternLM2'
164
+ | 'GemmaNoInput'
165
+ | DataLink
166
+ /* Prompt to run */
167
+ prompt?: string | DataLink
168
+ /* Chat messages to flatten into a prompt */
169
+ messages?: Array<DataLink | {}> | DataLink
170
+ /* Maximum tokens requested from the runner */
171
+ maxNewTokens?: number | DataLink
172
+ }
173
+ events?: {
174
+ /* Event triggered when the NeuroPilot context state changes */
175
+ onContextStateChange?: Array<EventAction>
176
+ /* Event triggered when a completion token or partial result is emitted */
177
+ onCompletion?: Array<EventAction>
178
+ /* Event triggered when generation finishes */
179
+ onCompletionFinished?: Array<EventAction>
180
+ /* Event triggered when a NeuroPilot error occurs */
181
+ onError?: Array<EventAction>
182
+ }
183
+ outlets?: {
184
+ /* Current NeuroPilot context state */
185
+ contextState?: () => Data<string>
186
+ /* Final generated result text */
187
+ result?: () => Data<string>
188
+ /* Full context returned by the runner */
189
+ fullContext?: () => Data<string>
190
+ /* Last emitted token or chunk */
191
+ lastToken?: () => Data<string>
192
+ /* Raw output captured from the NeuroPilot runner */
193
+ rawOutput?: () => Data<string>
194
+ /* Prompt-phase performance in tokens per second */
195
+ promptTokensPerSec?: () => Data<string>
196
+ /* Generation-phase performance in tokens per second */
197
+ generationTokensPerSec?: () => Data<string>
198
+ }
199
+ }
200
+
201
+ /* On-device LLM inference using MediaTek NeuroPilot native SDK integration on Android */
202
+ export type GeneratorNeuropilotLlm = Generator &
203
+ GeneratorNeuropilotLlmDef & {
204
+ templateKey: 'GENERATOR_NEUROPILOT_LLM'
205
+ switches?: Array<
206
+ SwitchDef &
207
+ GeneratorNeuropilotLlmDef & {
208
+ conds?: Array<{
209
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
210
+ cond:
211
+ | SwitchCondInnerStateCurrentCanvas
212
+ | SwitchCondData
213
+ | {
214
+ __typename: 'SwitchCondInnerStateOutlet'
215
+ outlet:
216
+ | 'contextState'
217
+ | 'result'
218
+ | 'fullContext'
219
+ | 'lastToken'
220
+ | 'rawOutput'
221
+ | 'promptTokensPerSec'
222
+ | 'generationTokensPerSec'
223
+ value: any
224
+ }
225
+ }>
226
+ }
227
+ >
228
+ }
@@ -1,4 +1,14 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * On-device LLM inference using Apple MLX framework on iOS/tvOS
4
+ *
5
+ * ## Features
6
+ * - Powered by MLX (Apple's ML framework optimized for Apple Silicon)
7
+ * - Download models directly from HuggingFace Hub
8
+ * - Streaming token generation
9
+ * - Supports LLM and VLM (Vision Language Models)
10
+ * - Requires iOS 17+ or tvOS 17+
11
+ */
2
12
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
13
  import type { Data, DataLink } from '../data'
4
14
  import type {
@@ -1,4 +1,8 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Local LLM inference based on [transformers.js](https://huggingface.co/docs/transformers.js)
4
+ * You can use any converted model on HuggingFace.
5
+ */
2
6
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
7
  import type { Data, DataLink } from '../data'
4
8
  import type {
@@ -1,4 +1,17 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * LLM inference using OpenAI-compatible API endpoints
4
+ *
5
+ * ## Features
6
+ * - Compatible with OpenAI API format
7
+ * - Supports function calling
8
+ * - Streaming responses
9
+ * - Custom API endpoints, like
10
+ * - OpenAI API: https://platform.openai.com/docs/guides/text?api-mode=chat
11
+ * - Anthropic API: https://docs.anthropic.com/en/api/openai-sdk
12
+ * - Gemini API: https://ai.google.dev/gemini-api/docs/openai
13
+ * - llama.cpp server: https://github.com/ggml-org/llama.cpp/tree/master/tools/server
14
+ */
2
15
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
16
  import type { Data, DataLink } from '../data'
4
17
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Local LLM inference using Qualcomm AI Engine
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Model Context Protocol (MCP) Client, support SSE and Generator MCPServer direct link
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Model Context Protocol (MCP) Server (https://docs.anthropic.com/en/docs/agents-and-tools/mcp)
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Fetch box's file list from Media Flow
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * MQTT Broker server
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * MQTT protocol messaging
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Prompt user for input via dialog and return the response
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -381,7 +384,7 @@ Default property:
381
384
  }
382
385
  }
383
386
 
384
- /* Question inquirer */
387
+ /* Prompt user for input via dialog and return the response */
385
388
  export type GeneratorQuestion = Generator &
386
389
  GeneratorQuestionDef & {
387
390
  templateKey: 'GENERATOR_QUESTION'