@fugood/bricks-ctor 2.25.0-beta.60 → 2.25.0-beta.61

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 (190) hide show
  1. package/package.json +4 -28
  2. package/tools/deploy.ts +19 -176
  3. package/tools/mcp-server.ts +16 -33
  4. package/tools/postinstall.ts +21 -292
  5. package/tools/pull.ts +15 -195
  6. package/tools/push-config.ts +18 -113
  7. package/tools/simulator.ts +19 -148
  8. package/compile/__tests__/config-diff.test.js +0 -100
  9. package/compile/__tests__/index.test.js +0 -461
  10. package/compile/__tests__/util.test.js +0 -450
  11. package/compile/action-name-map.ts +0 -1079
  12. package/compile/config-diff.ts +0 -155
  13. package/compile/index.ts +0 -1594
  14. package/compile/util.ts +0 -482
  15. package/index.ts +0 -6
  16. package/skills/bricks-ctor/SKILL.md +0 -38
  17. package/skills/bricks-ctor/references/animation.md +0 -160
  18. package/skills/bricks-ctor/references/architecture-patterns.md +0 -88
  19. package/skills/bricks-ctor/references/automations.md +0 -232
  20. package/skills/bricks-ctor/references/buttress.md +0 -245
  21. package/skills/bricks-ctor/references/data-calculation.md +0 -252
  22. package/skills/bricks-ctor/references/local-sync.md +0 -129
  23. package/skills/bricks-ctor/references/media-flow.md +0 -165
  24. package/skills/bricks-ctor/references/remote-data-bank.md +0 -196
  25. package/skills/bricks-ctor/references/simulator.md +0 -132
  26. package/skills/bricks-ctor/references/source-editing-tools.md +0 -81
  27. package/skills/bricks-ctor/references/standby-transition.md +0 -124
  28. package/skills/bricks-ctor/references/verification-toolchain.md +0 -200
  29. package/skills/bricks-design/SKILL.md +0 -171
  30. package/skills/bricks-design/references/architecture-truths.md +0 -132
  31. package/skills/bricks-design/references/avoiding-complexity.md +0 -91
  32. package/skills/bricks-design/references/design-critique.md +0 -195
  33. package/skills/bricks-design/references/design-languages.md +0 -265
  34. package/skills/bricks-design/references/performance.md +0 -116
  35. package/skills/bricks-design/references/presentation-and-slideshow.md +0 -137
  36. package/skills/bricks-design/references/translating-inputs.md +0 -152
  37. package/skills/bricks-design/references/variations-and-tweaks.md +0 -124
  38. package/skills/bricks-design/references/when-the-brief-is-branded.md +0 -284
  39. package/skills/bricks-design/references/when-the-brief-is-vague.md +0 -85
  40. package/skills/bricks-design/references/workflow.md +0 -134
  41. package/skills/bricks-ux/SKILL.md +0 -114
  42. package/skills/bricks-ux/references/accessibility.md +0 -162
  43. package/skills/bricks-ux/references/flow-states.md +0 -175
  44. package/skills/bricks-ux/references/interaction-archetypes.md +0 -189
  45. package/skills/bricks-ux/references/monitoring-screens.md +0 -153
  46. package/skills/bricks-ux/references/pressable-composition.md +0 -126
  47. package/skills/bricks-ux/references/user-journey.md +0 -168
  48. package/skills/bricks-ux/references/ux-critique.md +0 -256
  49. package/skills/rive-marketplace/SKILL.md +0 -99
  50. package/tools/__tests__/_cli-error.test.ts +0 -35
  51. package/tools/__tests__/_mcp-config.test.ts +0 -67
  52. package/tools/__tests__/pull.test.ts +0 -108
  53. package/tools/_cli-error.ts +0 -17
  54. package/tools/_edits-log.ts +0 -41
  55. package/tools/_git-author.ts +0 -37
  56. package/tools/_last-pushed-commit.ts +0 -28
  57. package/tools/_mcp-config.ts +0 -42
  58. package/tools/_shell.ts +0 -180
  59. package/tools/icons/.gitattributes +0 -1
  60. package/tools/icons/fa6pro-glyphmap.json +0 -4686
  61. package/tools/icons/fa6pro-meta.json +0 -1
  62. package/tools/mcp-env.ts +0 -13
  63. package/tools/mcp-tools/__tests__/data-calc-editing.test.js +0 -516
  64. package/tools/mcp-tools/__tests__/entry-editing.test.js +0 -866
  65. package/tools/mcp-tools/__tests__/huggingface.test.ts +0 -49
  66. package/tools/mcp-tools/__tests__/icons.test.ts +0 -21
  67. package/tools/mcp-tools/__tests__/mcp-env.test.js +0 -19
  68. package/tools/mcp-tools/_editing-helpers.ts +0 -98
  69. package/tools/mcp-tools/_verify.ts +0 -50
  70. package/tools/mcp-tools/compile.ts +0 -104
  71. package/tools/mcp-tools/data-calc-editing.ts +0 -1311
  72. package/tools/mcp-tools/entry-editing.ts +0 -2297
  73. package/tools/mcp-tools/huggingface.ts +0 -772
  74. package/tools/mcp-tools/icons.ts +0 -97
  75. package/tools/mcp-tools/lottie.ts +0 -102
  76. package/tools/mcp-tools/media.ts +0 -113
  77. package/tools/simulator-main.mjs +0 -488
  78. package/tools/simulator-preload.cjs +0 -16
  79. package/types/animation.d.ts +0 -116
  80. package/types/automation.d.ts +0 -231
  81. package/types/brick-base.d.ts +0 -80
  82. package/types/bricks/Camera.d.ts +0 -246
  83. package/types/bricks/Chart.d.ts +0 -372
  84. package/types/bricks/GenerativeMedia.d.ts +0 -290
  85. package/types/bricks/Icon.d.ts +0 -98
  86. package/types/bricks/Image.d.ts +0 -126
  87. package/types/bricks/Items.d.ts +0 -480
  88. package/types/bricks/Lottie.d.ts +0 -168
  89. package/types/bricks/Maps.d.ts +0 -262
  90. package/types/bricks/QrCode.d.ts +0 -117
  91. package/types/bricks/Rect.d.ts +0 -150
  92. package/types/bricks/RichText.d.ts +0 -131
  93. package/types/bricks/Rive.d.ts +0 -220
  94. package/types/bricks/Scene3D.d.ts +0 -676
  95. package/types/bricks/Sketch.d.ts +0 -256
  96. package/types/bricks/Slideshow.d.ts +0 -201
  97. package/types/bricks/Svg.d.ts +0 -99
  98. package/types/bricks/Text.d.ts +0 -148
  99. package/types/bricks/TextInput.d.ts +0 -242
  100. package/types/bricks/Video.d.ts +0 -242
  101. package/types/bricks/VideoStreaming.d.ts +0 -112
  102. package/types/bricks/WebRtcStream.d.ts +0 -65
  103. package/types/bricks/WebView.d.ts +0 -168
  104. package/types/bricks/index.d.ts +0 -23
  105. package/types/canvas.d.ts +0 -82
  106. package/types/common.d.ts +0 -141
  107. package/types/data-calc-command/base.d.ts +0 -57
  108. package/types/data-calc-command/collection.d.ts +0 -418
  109. package/types/data-calc-command/color.d.ts +0 -432
  110. package/types/data-calc-command/constant.d.ts +0 -50
  111. package/types/data-calc-command/datetime.d.ts +0 -147
  112. package/types/data-calc-command/file.d.ts +0 -129
  113. package/types/data-calc-command/index.d.ts +0 -13
  114. package/types/data-calc-command/iteratee.d.ts +0 -23
  115. package/types/data-calc-command/logictype.d.ts +0 -190
  116. package/types/data-calc-command/math.d.ts +0 -275
  117. package/types/data-calc-command/object.d.ts +0 -119
  118. package/types/data-calc-command/sandbox.d.ts +0 -66
  119. package/types/data-calc-command/string.d.ts +0 -407
  120. package/types/data-calc-script.d.ts +0 -21
  121. package/types/data-calc.d.ts +0 -12
  122. package/types/data.d.ts +0 -97
  123. package/types/generators/AlarmClock.d.ts +0 -110
  124. package/types/generators/Assistant.d.ts +0 -640
  125. package/types/generators/BleCentral.d.ts +0 -247
  126. package/types/generators/BlePeripheral.d.ts +0 -208
  127. package/types/generators/CanvasMap.d.ts +0 -74
  128. package/types/generators/CastlesPay.d.ts +0 -87
  129. package/types/generators/DataBank.d.ts +0 -160
  130. package/types/generators/File.d.ts +0 -432
  131. package/types/generators/GraphQl.d.ts +0 -132
  132. package/types/generators/Http.d.ts +0 -222
  133. package/types/generators/HttpServer.d.ts +0 -230
  134. package/types/generators/Information.d.ts +0 -103
  135. package/types/generators/Intent.d.ts +0 -168
  136. package/types/generators/Iterator.d.ts +0 -108
  137. package/types/generators/Keyboard.d.ts +0 -105
  138. package/types/generators/LlmAnthropicCompat.d.ts +0 -212
  139. package/types/generators/LlmAppleBuiltin.d.ts +0 -159
  140. package/types/generators/LlmGgml.d.ts +0 -903
  141. package/types/generators/LlmMediaTekNeuroPilot.d.ts +0 -235
  142. package/types/generators/LlmMlx.d.ts +0 -228
  143. package/types/generators/LlmOnnx.d.ts +0 -213
  144. package/types/generators/LlmOpenAiCompat.d.ts +0 -312
  145. package/types/generators/LlmQualcommAiEngine.d.ts +0 -247
  146. package/types/generators/Mcp.d.ts +0 -637
  147. package/types/generators/McpServer.d.ts +0 -289
  148. package/types/generators/MediaFlow.d.ts +0 -170
  149. package/types/generators/MqttBroker.d.ts +0 -141
  150. package/types/generators/MqttClient.d.ts +0 -141
  151. package/types/generators/Question.d.ts +0 -408
  152. package/types/generators/RealtimeTranscription.d.ts +0 -287
  153. package/types/generators/RerankerGgml.d.ts +0 -195
  154. package/types/generators/SerialPort.d.ts +0 -151
  155. package/types/generators/SoundPlayer.d.ts +0 -94
  156. package/types/generators/SoundRecorder.d.ts +0 -139
  157. package/types/generators/SpeechToTextGgml.d.ts +0 -424
  158. package/types/generators/SpeechToTextOnnx.d.ts +0 -236
  159. package/types/generators/SpeechToTextPlatform.d.ts +0 -85
  160. package/types/generators/SqLite.d.ts +0 -159
  161. package/types/generators/Step.d.ts +0 -107
  162. package/types/generators/SttAppleBuiltin.d.ts +0 -153
  163. package/types/generators/Tcp.d.ts +0 -126
  164. package/types/generators/TcpServer.d.ts +0 -147
  165. package/types/generators/TextToSpeechAppleBuiltin.d.ts +0 -127
  166. package/types/generators/TextToSpeechGgml.d.ts +0 -221
  167. package/types/generators/TextToSpeechOnnx.d.ts +0 -178
  168. package/types/generators/TextToSpeechOpenAiLike.d.ts +0 -121
  169. package/types/generators/ThermalPrinter.d.ts +0 -193
  170. package/types/generators/Tick.d.ts +0 -83
  171. package/types/generators/Udp.d.ts +0 -120
  172. package/types/generators/VadGgml.d.ts +0 -260
  173. package/types/generators/VadOnnx.d.ts +0 -231
  174. package/types/generators/VadTraditional.d.ts +0 -138
  175. package/types/generators/VectorStore.d.ts +0 -257
  176. package/types/generators/Watchdog.d.ts +0 -107
  177. package/types/generators/WebCrawler.d.ts +0 -103
  178. package/types/generators/WebRtc.d.ts +0 -181
  179. package/types/generators/WebSocket.d.ts +0 -148
  180. package/types/generators/index.d.ts +0 -57
  181. package/types/index.d.ts +0 -13
  182. package/types/subspace.d.ts +0 -60
  183. package/types/switch.d.ts +0 -51
  184. package/types/system.d.ts +0 -707
  185. package/utils/__tests__/calc.test.js +0 -25
  186. package/utils/__tests__/id.test.js +0 -154
  187. package/utils/calc.ts +0 -130
  188. package/utils/data.ts +0 -495
  189. package/utils/event-props.ts +0 -912
  190. package/utils/id.ts +0 -133
@@ -1,903 +0,0 @@
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
- * - Web: Supported with CPU and WebGPU acceleration.
15
- * - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable.
16
- */
17
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
18
- import type { Data, DataLink } from '../data'
19
- import type {
20
- Brick,
21
- Generator,
22
- EventAction,
23
- ActionWithDataParams,
24
- ActionWithParams,
25
- Action,
26
- EventProperty,
27
- } from '../common'
28
- import type { TemplateEventPropsMap } from '../../utils/event-props'
29
-
30
- /* Load the model */
31
- export type GeneratorLLMActionLoadModel = Action & {
32
- __actionName: 'GENERATOR_LLM_LOAD_MODEL'
33
- }
34
-
35
- /* Load multimodal (vision) model (PREVIEW FEATURE) */
36
- export type GeneratorLLMActionLoadMultimodalModel = Action & {
37
- __actionName: 'GENERATOR_LLM_LOAD_MULTIMODAL_MODEL'
38
- }
39
-
40
- /* Tokenize the prompt */
41
- export type GeneratorLLMActionTokenize = ActionWithParams & {
42
- __actionName: 'GENERATOR_LLM_TOKENIZE'
43
- params?: Array<
44
- | {
45
- input: 'mode'
46
- value?: string | DataLink | EventProperty
47
- mapping?: string
48
- }
49
- | {
50
- input: 'prompt'
51
- value?: string | DataLink | EventProperty
52
- mapping?: string
53
- }
54
- | {
55
- input: 'promptMediaPaths'
56
- value?: Array<any> | DataLink | EventProperty
57
- mapping?: string
58
- }
59
- | {
60
- input: 'messages'
61
- value?: Array<any> | DataLink | EventProperty
62
- mapping?: string
63
- }
64
- >
65
- }
66
-
67
- /* Detokenize the tokens to text */
68
- export type GeneratorLLMActionDetokenize = ActionWithParams & {
69
- __actionName: 'GENERATOR_LLM_DETOKENIZE'
70
- params?: Array<{
71
- input: 'tokens'
72
- value?: Array<any> | DataLink | EventProperty
73
- mapping?: string
74
- }>
75
- }
76
-
77
- /* Pre-process the prompt, this can speed up the completion action */
78
- export type GeneratorLLMActionProcessPrompt = ActionWithParams & {
79
- __actionName: 'GENERATOR_LLM_PROCESS_PROMPT'
80
- params?: Array<
81
- | {
82
- input: 'sessionKey'
83
- value?: string | DataLink | EventProperty
84
- mapping?: string
85
- }
86
- | {
87
- input: 'mode'
88
- value?: string | DataLink | EventProperty
89
- mapping?: string
90
- }
91
- | {
92
- input: 'messages'
93
- value?: Array<any> | DataLink | EventProperty
94
- mapping?: string
95
- }
96
- | {
97
- input: 'tools'
98
- value?: Array<any> | DataLink | EventProperty
99
- mapping?: string
100
- }
101
- | {
102
- input: 'parallelToolCalls'
103
- value?: boolean | DataLink | EventProperty
104
- mapping?: string
105
- }
106
- | {
107
- input: 'toolChoice'
108
- value?: string | DataLink | EventProperty
109
- mapping?: string
110
- }
111
- | {
112
- input: 'enableThinking'
113
- value?: boolean | DataLink | EventProperty
114
- mapping?: string
115
- }
116
- | {
117
- input: 'thinkingBudgetTokens'
118
- value?: number | DataLink | EventProperty
119
- mapping?: string
120
- }
121
- | {
122
- input: 'thinkingBudgetMessage'
123
- value?: string | DataLink | EventProperty
124
- mapping?: string
125
- }
126
- | {
127
- input: 'prompt'
128
- value?: string | DataLink | EventProperty
129
- mapping?: string
130
- }
131
- | {
132
- input: 'promptMediaPaths'
133
- value?: Array<any> | DataLink | EventProperty
134
- mapping?: string
135
- }
136
- | {
137
- input: 'promptTemplateData'
138
- value?: {} | DataLink | EventProperty
139
- mapping?: string
140
- }
141
- | {
142
- input: 'promptTemplateType'
143
- value?: string | DataLink | EventProperty
144
- mapping?: string
145
- }
146
- | {
147
- input: 'responseFormat'
148
- value?: {} | DataLink | EventProperty
149
- mapping?: string
150
- }
151
- | {
152
- input: 'chatTemplateKwargs'
153
- value?: {} | DataLink | EventProperty
154
- mapping?: string
155
- }
156
- | {
157
- input: 'addGenerationPrompt'
158
- value?: boolean | DataLink | EventProperty
159
- mapping?: string
160
- }
161
- | {
162
- input: 'now'
163
- value?: string | DataLink | EventProperty
164
- mapping?: string
165
- }
166
- | {
167
- input: 'forcePureContent'
168
- value?: boolean | DataLink | EventProperty
169
- mapping?: string
170
- }
171
- >
172
- }
173
-
174
- /* Run text completion */
175
- export type GeneratorLLMActionCompletion = ActionWithParams & {
176
- __actionName: 'GENERATOR_LLM_COMPLETION'
177
- params?: Array<
178
- | {
179
- input: 'sessionKey'
180
- value?: string | DataLink | EventProperty
181
- mapping?: string
182
- }
183
- | {
184
- input: 'mode'
185
- value?: string | DataLink | EventProperty
186
- mapping?: string
187
- }
188
- | {
189
- input: 'messages'
190
- value?: Array<any> | DataLink | EventProperty
191
- mapping?: string
192
- }
193
- | {
194
- input: 'tools'
195
- value?: Array<any> | DataLink | EventProperty
196
- mapping?: string
197
- }
198
- | {
199
- input: 'parallelToolCalls'
200
- value?: boolean | DataLink | EventProperty
201
- mapping?: string
202
- }
203
- | {
204
- input: 'toolChoice'
205
- value?: string | DataLink | EventProperty
206
- mapping?: string
207
- }
208
- | {
209
- input: 'enableThinking'
210
- value?: boolean | DataLink | EventProperty
211
- mapping?: string
212
- }
213
- | {
214
- input: 'thinkingBudgetTokens'
215
- value?: number | DataLink | EventProperty
216
- mapping?: string
217
- }
218
- | {
219
- input: 'thinkingBudgetMessage'
220
- value?: string | DataLink | EventProperty
221
- mapping?: string
222
- }
223
- | {
224
- input: 'useReasoningFormat'
225
- value?: string | DataLink | EventProperty
226
- mapping?: string
227
- }
228
- | {
229
- input: 'prompt'
230
- value?: string | DataLink | EventProperty
231
- mapping?: string
232
- }
233
- | {
234
- input: 'promptMediaPaths'
235
- value?: Array<any> | DataLink | EventProperty
236
- mapping?: string
237
- }
238
- | {
239
- input: 'promptTemplateData'
240
- value?: {} | DataLink | EventProperty
241
- mapping?: string
242
- }
243
- | {
244
- input: 'promptTemplateType'
245
- value?: string | DataLink | EventProperty
246
- mapping?: string
247
- }
248
- | {
249
- input: 'responseFormat'
250
- value?: {} | DataLink | EventProperty
251
- mapping?: string
252
- }
253
- | {
254
- input: 'chatTemplateKwargs'
255
- value?: {} | DataLink | EventProperty
256
- mapping?: string
257
- }
258
- | {
259
- input: 'addGenerationPrompt'
260
- value?: boolean | DataLink | EventProperty
261
- mapping?: string
262
- }
263
- | {
264
- input: 'now'
265
- value?: string | DataLink | EventProperty
266
- mapping?: string
267
- }
268
- | {
269
- input: 'forcePureContent'
270
- value?: boolean | DataLink | EventProperty
271
- mapping?: string
272
- }
273
- | {
274
- input: 'grammar'
275
- value?: string | DataLink | EventProperty
276
- mapping?: string
277
- }
278
- | {
279
- input: 'stopWords'
280
- value?: Array<any> | DataLink | EventProperty
281
- mapping?: string
282
- }
283
- | {
284
- input: 'predict'
285
- value?: number | DataLink | EventProperty
286
- mapping?: string
287
- }
288
- | {
289
- input: 'temperature'
290
- value?: number | DataLink | EventProperty
291
- mapping?: string
292
- }
293
- | {
294
- input: 'probs'
295
- value?: number | DataLink | EventProperty
296
- mapping?: string
297
- }
298
- | {
299
- input: 'topK'
300
- value?: number | DataLink | EventProperty
301
- mapping?: string
302
- }
303
- | {
304
- input: 'topP'
305
- value?: number | DataLink | EventProperty
306
- mapping?: string
307
- }
308
- | {
309
- input: 'xtcThreshold'
310
- value?: number | DataLink | EventProperty
311
- mapping?: string
312
- }
313
- | {
314
- input: 'xtcProbability'
315
- value?: number | DataLink | EventProperty
316
- mapping?: string
317
- }
318
- | {
319
- input: 'dryMultiplier'
320
- value?: number | DataLink | EventProperty
321
- mapping?: string
322
- }
323
- | {
324
- input: 'dryBase'
325
- value?: number | DataLink | EventProperty
326
- mapping?: string
327
- }
328
- | {
329
- input: 'dryAllowedLength'
330
- value?: number | DataLink | EventProperty
331
- mapping?: string
332
- }
333
- | {
334
- input: 'dryPenaltyLastN'
335
- value?: number | DataLink | EventProperty
336
- mapping?: string
337
- }
338
- | {
339
- input: 'drySequenceBreakers'
340
- value?: Array<any> | DataLink | EventProperty
341
- mapping?: string
342
- }
343
- | {
344
- input: 'mirostat'
345
- value?: number | DataLink | EventProperty
346
- mapping?: string
347
- }
348
- | {
349
- input: 'mirostatTau'
350
- value?: number | DataLink | EventProperty
351
- mapping?: string
352
- }
353
- | {
354
- input: 'mirostatEta'
355
- value?: number | DataLink | EventProperty
356
- mapping?: string
357
- }
358
- | {
359
- input: 'penaltyLastN'
360
- value?: number | DataLink | EventProperty
361
- mapping?: string
362
- }
363
- | {
364
- input: 'penaltyRepeat'
365
- value?: number | DataLink | EventProperty
366
- mapping?: string
367
- }
368
- | {
369
- input: 'penaltyFrequency'
370
- value?: number | DataLink | EventProperty
371
- mapping?: string
372
- }
373
- | {
374
- input: 'penaltyPresent'
375
- value?: number | DataLink | EventProperty
376
- mapping?: string
377
- }
378
- | {
379
- input: 'penalizeNewline'
380
- value?: boolean | DataLink | EventProperty
381
- mapping?: string
382
- }
383
- | {
384
- input: 'seed'
385
- value?: number | DataLink | EventProperty
386
- mapping?: string
387
- }
388
- | {
389
- input: 'typicalP'
390
- value?: number | DataLink | EventProperty
391
- mapping?: string
392
- }
393
- | {
394
- input: 'ignoreEos'
395
- value?: boolean | DataLink | EventProperty
396
- mapping?: string
397
- }
398
- | {
399
- input: 'mtpSpeculativeDecoding'
400
- value?: boolean | DataLink | EventProperty
401
- mapping?: string
402
- }
403
- | {
404
- input: 'mtpDraftTokens'
405
- value?: number | DataLink | EventProperty
406
- mapping?: string
407
- }
408
- | {
409
- input: 'mtpDraftMinTokens'
410
- value?: number | DataLink | EventProperty
411
- mapping?: string
412
- }
413
- | {
414
- input: 'mtpDraftMinProbability'
415
- value?: number | DataLink | EventProperty
416
- mapping?: string
417
- }
418
- | {
419
- input: 'mtpDraftSplitProbability'
420
- value?: number | DataLink | EventProperty
421
- mapping?: string
422
- }
423
- | {
424
- input: 'functionCallEnabled'
425
- value?: boolean | DataLink | EventProperty
426
- mapping?: string
427
- }
428
- | {
429
- input: 'functionCallSchema'
430
- value?: Array<any> | DataLink | EventProperty
431
- mapping?: string
432
- }
433
- >
434
- }
435
-
436
- /* Clear session with session key or session ID */
437
- export type GeneratorLLMActionClearSession = ActionWithParams & {
438
- __actionName: 'GENERATOR_LLM_CLEAR_SESSION'
439
- params?: Array<
440
- | {
441
- input: 'sessionId'
442
- value?: string | DataLink | EventProperty
443
- mapping?: string
444
- }
445
- | {
446
- input: 'sessionCustomKey'
447
- value?: string | DataLink | EventProperty
448
- mapping?: string
449
- }
450
- >
451
- }
452
-
453
- /* Stop text completion */
454
- export type GeneratorLLMActionStopCompletion = Action & {
455
- __actionName: 'GENERATOR_LLM_STOP_COMPLETION'
456
- }
457
-
458
- /* Clear KV cache */
459
- export type GeneratorLLMActionClearCache = Action & {
460
- __actionName: 'GENERATOR_LLM_CLEAR_CACHE'
461
- }
462
-
463
- /* Clear downloaded models & current jobs */
464
- export type GeneratorLLMActionClearDownload = Action & {
465
- __actionName: 'GENERATOR_LLM_CLEAR_DOWNLOAD'
466
- }
467
-
468
- /* Release multimodal (vision) context (PREVIEW FEATURE) */
469
- export type GeneratorLLMActionReleaseMultimodalContext = Action & {
470
- __actionName: 'GENERATOR_LLM_RELEASE_MULTIMODAL_CONTEXT'
471
- }
472
-
473
- /* Release context */
474
- export type GeneratorLLMActionReleaseContext = Action & {
475
- __actionName: 'GENERATOR_LLM_RELEASE_CONTEXT'
476
- }
477
-
478
- interface GeneratorLLMDef {
479
- /*
480
- Default property:
481
- {
482
- "init": false,
483
- "contextSize": 512,
484
- "batchSize": 512,
485
- "uBatchSize": 512,
486
- "accelVariant": "default",
487
- "mainGpu": 0,
488
- "gpuLayers": 0,
489
- "useMlock": true,
490
- "useMmap": true,
491
- "cacheKType": "f16",
492
- "cacheVType": "f16",
493
- "ctxShift": true,
494
- "cpuMoeLayers": 0,
495
- "mtpSpeculativeDecoding": false,
496
- "mtpDraftTokens": 3,
497
- "transformScriptEnabled": false,
498
- "transformScriptCode": "\/\* Global variable: inputs = { prompt, messages, variables }, members = { llmUtils } \*\/\nreturn inputs.prompt",
499
- "transformScriptVariables": {},
500
- "sessionMinSaveSize": 50,
501
- "sessionRemain": 10,
502
- "completionMode": "auto",
503
- "completionPrompt": "",
504
- "completionPromptTemplateType": "${}",
505
- "completionEnableThinking": true,
506
- "completionAddGenerationPrompt": true,
507
- "completionChatTemplateKwargs": {},
508
- "completionForcePureContent": false,
509
- "completionUseReasoningFormat": "auto",
510
- "completionStopWords": [],
511
- "completionPredict": 400,
512
- "completionTopK": 40,
513
- "completionTopP": 0.95,
514
- "completionMinP": 0.05,
515
- "completionDryMultiplier": 0,
516
- "completionDryBase": 1.75,
517
- "completionDryAllowedLength": 2,
518
- "completionDrySequenceBreakers": [
519
- "\n",
520
- ":",
521
- "\"",
522
- "*"
523
- ],
524
- "completionMirostat": 0,
525
- "completionMirostatTau": 5,
526
- "completionMirostatEta": 0.1,
527
- "completionPenaltyLastN": 64,
528
- "completionPenaltyRepeat": 1,
529
- "completionPenaltyFrequency": 0,
530
- "completionPenaltyPresent": 0,
531
- "completionPenalizeNewline": false,
532
- "completionTypicalP": 1
533
- }
534
- */
535
- property?: {
536
- /* Initialize the Llama context on generator initialization
537
- Please note that it will take some RAM depending on the model size */
538
- init?: boolean | DataLink
539
- /* The URL or path of model
540
- We used GGUF format model, please refer to https://github.com/ggerganov/llama.cpp/tree/master#description */
541
- modelUrl?: string | DataLink
542
- /* Hash type of model */
543
- modelHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
544
- /* Hash of model */
545
- modelHash?: string | DataLink
546
- /* Load multimodal (vision) context after model loaded (PREVIEW FEATURE) */
547
- initMultimodal?: boolean | DataLink
548
- /* The URL or path of mmproj file for multimodal vision support (PREVIEW FEATURE) */
549
- mmprojUrl?: string | DataLink
550
- /* Hash type of mmproj file (PREVIEW FEATURE) */
551
- mmprojHashType?: 'md5' | 'sha256' | 'sha1' | DataLink
552
- /* Hash of mmproj file (PREVIEW FEATURE) */
553
- mmprojHash?: string | DataLink
554
- /* Minimum tokens for image encoding in multimodal (PREVIEW FEATURE)
555
- Useful for dynamic resolution models (e.g. Qwen-VL). Default: -1 (auto) */
556
- imageMinTokens?: number | DataLink
557
- /* Maximum tokens for image encoding in multimodal (PREVIEW FEATURE)
558
- Limit tokens for dynamic resolution models to balance speed vs. detail. Default: -1 (auto) */
559
- imageMaxTokens?: number | DataLink
560
- /* Chat Template (Jinja format) to override the default template from model */
561
- chatTemplate?: string | DataLink
562
- /* Context size (0 ~ 4096) (Default to 512) */
563
- contextSize?: number | DataLink
564
- /* Logical batch size for prompt processing */
565
- batchSize?: number | DataLink
566
- /* Physical batch size for prompt processing */
567
- uBatchSize?: number | DataLink
568
- /* Number of threads */
569
- maxThreads?: number | DataLink
570
- /* Accelerator variant (Only for desktop)
571
- `default` - CPU / Metal (macOS)
572
- `vulkan` - Use Vulkan
573
- `cuda` - Use CUDA
574
- `snapdragon` - Use OpenCL/Hexagon of Qualcomm Snapdragon */
575
- accelVariant?: 'default' | 'vulkan' | 'cuda' | 'snapdragon' | DataLink
576
- /* Devices. For example:
577
-
578
- Metal or CPU for iOS/tvOS/MacOS
579
- OpenCL or CPU for Android
580
- - Add `HTP0`, `HTP1`, `...` for OpenCL/Hexagon devices (Use HTP* for all HTP devices)
581
- For Desktop, you may want to include/exclude GPUs */
582
- devices?: Array<string | DataLink> | DataLink
583
- /* Main GPU index */
584
- mainGpu?: number | DataLink
585
- /* Number of GPU layers */
586
- gpuLayers?: number | DataLink
587
- /* Use memory lock */
588
- useMlock?: boolean | DataLink
589
- /* Use mmap */
590
- useMmap?: boolean | DataLink
591
- /* Disable extra buffer types for weight repacking. Reduces memory usage at the cost of slower prompt processing. */
592
- noExtraBuffs?: boolean | DataLink
593
- /* Use Flash Attention for inference (Recommended with GPU enabled) */
594
- useFlashAttn?: 'auto' | 'on' | 'off' | DataLink
595
- /* KV cache data type for the K (Default: f16) */
596
- cacheKType?: 'f16' | 'f32' | 'q8_0' | 'q4_0' | 'q4_1' | 'iq4_nl' | 'q5_0' | 'q5_1' | DataLink
597
- /* KV cache data type for the V (Default: f16) */
598
- cacheVType?: 'f16' | 'f32' | 'q8_0' | 'q4_0' | 'q4_1' | 'iq4_nl' | 'q5_0' | 'q5_1' | DataLink
599
- /* Use a unified buffer across the input sequences when computing the attention */
600
- useKVUnified?: boolean | DataLink
601
- /* Use full-size SWA cache. May improve performance for multiple sequences but uses more memory. */
602
- useSwaFull?: boolean | DataLink
603
- /* Enable context shift */
604
- ctxShift?: boolean | DataLink
605
- /* Number of layers to keep MoE weights on CPU */
606
- cpuMoeLayers?: number | DataLink
607
- /* Enable MTP speculative decoding for GGUF models that contain MTP / NextN layers */
608
- mtpSpeculativeDecoding?: boolean | DataLink
609
- /* Maximum number of MTP draft tokens */
610
- mtpDraftTokens?: number | DataLink
611
- /* Minimum number of MTP draft tokens */
612
- mtpDraftMinTokens?: number | DataLink
613
- /* Minimum probability for greedy MTP draft tokens */
614
- mtpDraftMinProbability?: number | DataLink
615
- /* Split probability for MTP speculative decoding */
616
- mtpDraftSplitProbability?: number | DataLink
617
- /* Enable Transform Script for processing the prompt */
618
- transformScriptEnabled?: boolean | DataLink
619
- /* Code of Transform Script */
620
- transformScriptCode?: string | DataLink
621
- /* Variables used in Transform Script (object) */
622
- transformScriptVariables?: {} | DataLink
623
- /* Session save mode
624
- `none` - No session saving
625
- `prompt` - Save session when prompt processed
626
- `completion` - Save session when completion finished
627
- `all` - Save session when prompt processed and completion finished */
628
- sessionSaveMode?: 'none' | 'prompt' | 'completion' | 'all' | DataLink
629
- /* Minimum processed/generated size to determine whether to save session (Unit: token) */
630
- sessionMinSaveSize?: number | DataLink
631
- /* Session file remain count (Default to 10) */
632
- sessionRemain?: number | DataLink
633
- /* TODO:loran_gqarms_norm_epsrope_freq_baserope_freq_scale */
634
- completionMode?: 'auto' | 'chat' | 'text' | DataLink
635
- /* Tools for chat mode using OpenAI-compatible function calling format
636
- Format: Array of objects with {type, function: {name, description, parameters}} structure
637
- See: https://platform.openai.com/docs/guides/function-calling */
638
- completionTools?: Array<{} | DataLink> | DataLink
639
- /* Enable parallel tool calls */
640
- completionParallelToolCalls?: boolean | DataLink
641
- /* Tool choice for chat mode */
642
- completionToolChoice?: 'none' | 'auto' | 'required' | DataLink
643
- /* Messages (chat mode) */
644
- completionMessages?:
645
- | Array<
646
- | DataLink
647
- | {
648
- role?: string | DataLink
649
- content?: string | DataLink
650
- }
651
- >
652
- | DataLink
653
- /* Prompt (text mode) */
654
- completionPrompt?: string | DataLink
655
- /* Media paths to be used in the prompt template (PREVIEW FEATURE)
656
- In prompt, use `<__media__>` for position of media content */
657
- completionPromptMediaPaths?: Array<string | DataLink> | DataLink
658
- /* Data to be used in the prompt template (e.g. `Hello ${name}`). Supports nested data, such as `Hello ${user.name}`. */
659
- completionPromptTemplateData?: {} | DataLink
660
- /* The prompt template type */
661
- completionPromptTemplateType?: '${}' | '{{}}' | DataLink
662
- /* Response format */
663
- completionResponseFormat?:
664
- | DataLink
665
- | {
666
- type?: 'text' | 'json_schema' | 'json_object' | DataLink
667
- json_schema?:
668
- | DataLink
669
- | {
670
- strict?: boolean | DataLink
671
- schema?: {} | DataLink
672
- }
673
- schema?: {} | DataLink
674
- }
675
- /* Enable thinking */
676
- completionEnableThinking?: boolean | DataLink
677
- /* Maximum tokens allowed inside the model's thinking block before forcing it closed. Only applies when chat formatting exposes thinking tags. */
678
- completionThinkingBudgetTokens?: number | DataLink
679
- /* Message injected before the thinking end tag when the thinking budget is exhausted. */
680
- completionThinkingBudgetMessage?: string | DataLink
681
- /* Add generation prompt */
682
- completionAddGenerationPrompt?: boolean | DataLink
683
- /* Now (for fill current date in chat template if supported) */
684
- completionNow?: string | DataLink
685
- /* Additional keyword arguments for chat template (object) */
686
- completionChatTemplateKwargs?: {} | DataLink
687
- /* Force pure content (accept any model that has a chat_template without requiring template validation) */
688
- completionForcePureContent?: boolean | DataLink
689
- /* Use reasoning format for enhanced response structure
690
- `auto` - Auto-determine the reasoning format of the model
691
- `none` - Disable reasoning format */
692
- completionUseReasoningFormat?: 'auto' | 'none' | DataLink
693
- /* Stop words */
694
- completionStopWords?: Array<string | DataLink> | DataLink
695
- /* Number of tokens to predict */
696
- completionPredict?: number | DataLink
697
- /* Throttle time for completion result (in milliseconds) */
698
- completionResultThrottle?: number | DataLink
699
- /* Grammar (GBNF: Please refer to https://github.com/ggerganov/llama.cpp/tree/master/grammars) */
700
- completionGrammar?: string | DataLink
701
- /* Temperature */
702
- completionTemperature?: number | DataLink
703
- /* Number of probablites to show for each token in the completion details */
704
- completionProbs?: number | DataLink
705
- /* Top K sampling */
706
- completionTopK?: number | DataLink
707
- /* Top P sampling */
708
- completionTopP?: number | DataLink
709
- /* Min P sampling */
710
- completionMinP?: number | DataLink
711
- /* Sets a minimum probability threshold for tokens to be removed */
712
- completionXtcThreshold?: number | DataLink
713
- /* Sets the chance for token removal (checked once on sampler start) */
714
- completionXtcProbability?: number | DataLink
715
- /* Set the DRY (Don't Repeat Yourself) repetition penalty multiplier. Default: `0.0`, which is disabled. */
716
- completionDryMultiplier?: number | DataLink
717
- /* Set the DRY repetition penalty base value. Default: `1.75` */
718
- completionDryBase?: number | DataLink
719
- /* Tokens that extend repetition beyond this receive exponentially increasing penalty: multiplier * base ^ (length of repeating sequence before token - allowed length). Default: `2` */
720
- completionDryAllowedLength?: number | DataLink
721
- /* How many tokens to scan for repetitions. Default: `-1`, where `0` is disabled and `-1` is context size. */
722
- completionDryPenaltyLastN?: number | DataLink
723
- /* Specify an array of sequence breakers for DRY sampling. Only a JSON array of strings is accepted. Default: `['\n', ':', '"', '*']` */
724
- completionDrySequenceBreakers?: Array<string | DataLink> | DataLink
725
- /* Top n sigma sampling as described in academic paper "Top-nσ: Not All Logits Are You Need" https://arxiv.org/pdf/2411.07641. Default: `-1.0` (Disabled) */
726
- completionTopNSigma?: number | DataLink
727
- /* Use Mirostat sampling. Top K, Nucleus, Tail Free and Locally Typical samplers are ignored if used. */
728
- completionMirostat?: number | DataLink
729
- /* Mirostat target entropy, parameter tau */
730
- completionMirostatTau?: number | DataLink
731
- /* Mirostat learning rate, parameter eta */
732
- completionMirostatEta?: number | DataLink
733
- /* Last n tokens to consider for penalize */
734
- completionPenaltyLastN?: number | DataLink
735
- /* Penalize repeat sequence of tokens (default: 0.1, 1.0 = disabled) */
736
- completionPenaltyRepeat?: number | DataLink
737
- /* Repeat alpha frequency penalty (default: 0.1, 0.0 = disabled) */
738
- completionPenaltyFrequency?: number | DataLink
739
- /* Repeat alpha presence penalty (default: 0.1, 0.0 = disabled) */
740
- completionPenaltyPresent?: number | DataLink
741
- /* Penalize newline tokens when applying the repeat penalty (default: true) */
742
- completionPenalizeNewline?: boolean | DataLink
743
- /* Set the random number generator (RNG) seed (default: -1, -1 = random seed) */
744
- completionSeed?: number | DataLink
745
- /* locally typical sampling, parameter p (default: 0.1, 1.0 = disabled) */
746
- completionTypicalP?: number | DataLink
747
- /* Repeat alpha frequency penalty (default: 0.1, 0.0 = disabled) */
748
- completionIgnoreEOS?: boolean | DataLink
749
- /* Buttress connection settings for remote inference */
750
- buttressConnectionSettings?:
751
- | DataLink
752
- | {
753
- enabled?: boolean | DataLink
754
- url?: string | DataLink
755
- autoDiscoverType?: 'manual' | 'auto' | DataLink
756
- fallbackType?: 'use-local' | 'no-op' | DataLink
757
- strategy?: 'prefer-local' | 'prefer-buttress' | 'prefer-best' | DataLink
758
- }
759
- }
760
- events?: {
761
- /* Event triggered when context state changes */
762
- onContextStateChange?: Array<
763
- EventAction<string & keyof TemplateEventPropsMap['Llm']['onContextStateChange']>
764
- >
765
- /* Event triggered when error occurs */
766
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Llm']['onError']>>
767
- /* Event triggered when completion */
768
- onCompletion?: Array<EventAction<string & keyof TemplateEventPropsMap['Llm']['onCompletion']>>
769
- /* Event triggered when completion finished */
770
- onCompletionFinished?: Array<
771
- EventAction<string & keyof TemplateEventPropsMap['Llm']['onCompletionFinished']>
772
- >
773
- /* Event triggered on get function call request */
774
- onCompletionFunctionCall?: Array<
775
- EventAction<string & keyof TemplateEventPropsMap['Llm']['onCompletionFunctionCall']>
776
- >
777
- }
778
- outlets?: {
779
- /* Context state */
780
- contextState?: () => Data<string>
781
- /* Context load progress (0-100) */
782
- contextLoadProgress?: () => Data<number>
783
- /* Context details */
784
- contextDetails?: () => Data<{
785
- state?: string
786
- contextId?: string
787
- gpu?: string
788
- reasonNoGPU?: string
789
- model?: { [key: string]: any }
790
- isMultimodalEnabled?: boolean
791
- [key: string]: any
792
- }>
793
- /* Session details */
794
- sessions?: () => Data<{
795
- last_session_id?: string
796
- sessions?: Array<{
797
- id?: string
798
- type?: string
799
- prompt?: string
800
- sessionKey?: string
801
- model_instance_id?: string
802
- tokens_evaluated?: number
803
- t?: number
804
- [key: string]: any
805
- }>
806
- last_custom_session_id?: string
807
- custom_sessions?: Array<{
808
- id?: string
809
- type?: string
810
- prompt?: string
811
- sessionKey?: string
812
- model_instance_id?: string
813
- tokens_evaluated?: number
814
- t?: number
815
- [key: string]: any
816
- }>
817
- [key: string]: any
818
- }>
819
- /* Is evaluating */
820
- isEvaluating?: () => Data<boolean>
821
- /* Tokenize result */
822
- tokenizeResult?: () => Data<Array<number>>
823
- /* Detokenize result */
824
- detokenizeResult?: () => Data<string>
825
- /* Last formatted prompt (messages or prompt) */
826
- completionLastFormattedPrompt?: () => Data<string>
827
- /* Last completion token */
828
- completionLastToken?: () => Data<string>
829
- /* Completion result */
830
- completionResult?: () => Data<string>
831
- /* Reasoning content from model responses */
832
- completionReasoningContent?: () => Data<string>
833
- /* Full context (Prompt + Completion) */
834
- completionFullContext?: () => Data<string>
835
- /* Inference result details */
836
- completionResultDetails?: () => Data<{
837
- prompt?: string
838
- full_context?: string
839
- text?: string
840
- content?: string
841
- reasoning_content?: string
842
- token?: string
843
- tool_calls?: Array<{
844
- id?: string
845
- type?: string
846
- function?: {
847
- name?: string
848
- arguments?: string
849
- [key: string]: any
850
- }
851
- [key: string]: any
852
- }>
853
- [key: string]: any
854
- }>
855
- }
856
- }
857
-
858
- /* Local Large Language Model (LLM) inference based on GGML and [llama.cpp](https://github.com/ggerganov/llama.cpp)
859
-
860
- ## Notice
861
- - The device RAM must be larger than 8GB
862
- - iOS: Recommended use M1+ / A17+ chip device. Supported GPU acceleration by Metal.
863
- - macOS: Recommended use M1+ chip device. Supported GPU acceleration by Metal.
864
- - Android: Recommended use Android 13+ system.
865
- - Supported GPU acceleration by OpenCL, currently only for Qualcomm Adreno 700+ GPUs, other GPUs are not supported.
866
- - Supported Hexagon NPU for Qualcomm Snapdragon 8 Gen 1+ GPUs.
867
- - Linux / Windows [@nextline - Supported GPU acceleration, you can choose `vulkan` or `cuda` backend in Accel Variant property
868
- - Supported Hexagon NPU for Qualcomm Dragonwing IQ9 series+ (Linux)
869
- - Web: Supported with CPU and WebGPU acceleration.
870
- - Single thread only in the current web preview (no SharedArrayBuffer due to cross-origin isolation / CORP), so multi-thread is unavailable. */
871
- export type GeneratorLLM = Generator &
872
- GeneratorLLMDef & {
873
- templateKey: 'GENERATOR_LLM'
874
- switches?: Array<
875
- SwitchDef &
876
- GeneratorLLMDef & {
877
- conds?: Array<{
878
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
879
- cond:
880
- | SwitchCondInnerStateCurrentCanvas
881
- | SwitchCondData
882
- | {
883
- __typename: 'SwitchCondInnerStateOutlet'
884
- outlet:
885
- | 'contextState'
886
- | 'contextLoadProgress'
887
- | 'contextDetails'
888
- | 'sessions'
889
- | 'isEvaluating'
890
- | 'tokenizeResult'
891
- | 'detokenizeResult'
892
- | 'completionLastFormattedPrompt'
893
- | 'completionLastToken'
894
- | 'completionResult'
895
- | 'completionReasoningContent'
896
- | 'completionFullContext'
897
- | 'completionResultDetails'
898
- value: any
899
- }
900
- }>
901
- }
902
- >
903
- }