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

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 (192) hide show
  1. package/package.json +4 -28
  2. package/tools/__tests__/legacy-forwarder.test.js +91 -0
  3. package/tools/_forward.ts +26 -0
  4. package/tools/deploy.ts +3 -175
  5. package/tools/mcp-server.ts +3 -35
  6. package/tools/postinstall.ts +3 -291
  7. package/tools/pull.ts +3 -198
  8. package/tools/push-config.ts +3 -113
  9. package/tools/simulator.ts +3 -149
  10. package/compile/__tests__/config-diff.test.js +0 -100
  11. package/compile/__tests__/index.test.js +0 -461
  12. package/compile/__tests__/util.test.js +0 -450
  13. package/compile/action-name-map.ts +0 -1079
  14. package/compile/config-diff.ts +0 -155
  15. package/compile/index.ts +0 -1594
  16. package/compile/util.ts +0 -482
  17. package/index.ts +0 -6
  18. package/skills/bricks-ctor/SKILL.md +0 -38
  19. package/skills/bricks-ctor/references/animation.md +0 -160
  20. package/skills/bricks-ctor/references/architecture-patterns.md +0 -88
  21. package/skills/bricks-ctor/references/automations.md +0 -232
  22. package/skills/bricks-ctor/references/buttress.md +0 -245
  23. package/skills/bricks-ctor/references/data-calculation.md +0 -252
  24. package/skills/bricks-ctor/references/local-sync.md +0 -129
  25. package/skills/bricks-ctor/references/media-flow.md +0 -165
  26. package/skills/bricks-ctor/references/remote-data-bank.md +0 -196
  27. package/skills/bricks-ctor/references/simulator.md +0 -132
  28. package/skills/bricks-ctor/references/source-editing-tools.md +0 -81
  29. package/skills/bricks-ctor/references/standby-transition.md +0 -124
  30. package/skills/bricks-ctor/references/verification-toolchain.md +0 -200
  31. package/skills/bricks-design/SKILL.md +0 -171
  32. package/skills/bricks-design/references/architecture-truths.md +0 -132
  33. package/skills/bricks-design/references/avoiding-complexity.md +0 -91
  34. package/skills/bricks-design/references/design-critique.md +0 -195
  35. package/skills/bricks-design/references/design-languages.md +0 -265
  36. package/skills/bricks-design/references/performance.md +0 -116
  37. package/skills/bricks-design/references/presentation-and-slideshow.md +0 -137
  38. package/skills/bricks-design/references/translating-inputs.md +0 -152
  39. package/skills/bricks-design/references/variations-and-tweaks.md +0 -124
  40. package/skills/bricks-design/references/when-the-brief-is-branded.md +0 -284
  41. package/skills/bricks-design/references/when-the-brief-is-vague.md +0 -85
  42. package/skills/bricks-design/references/workflow.md +0 -134
  43. package/skills/bricks-ux/SKILL.md +0 -114
  44. package/skills/bricks-ux/references/accessibility.md +0 -162
  45. package/skills/bricks-ux/references/flow-states.md +0 -175
  46. package/skills/bricks-ux/references/interaction-archetypes.md +0 -189
  47. package/skills/bricks-ux/references/monitoring-screens.md +0 -153
  48. package/skills/bricks-ux/references/pressable-composition.md +0 -126
  49. package/skills/bricks-ux/references/user-journey.md +0 -168
  50. package/skills/bricks-ux/references/ux-critique.md +0 -256
  51. package/skills/rive-marketplace/SKILL.md +0 -99
  52. package/tools/__tests__/_cli-error.test.ts +0 -35
  53. package/tools/__tests__/_mcp-config.test.ts +0 -67
  54. package/tools/__tests__/pull.test.ts +0 -108
  55. package/tools/_cli-error.ts +0 -17
  56. package/tools/_edits-log.ts +0 -41
  57. package/tools/_git-author.ts +0 -37
  58. package/tools/_last-pushed-commit.ts +0 -28
  59. package/tools/_mcp-config.ts +0 -42
  60. package/tools/_shell.ts +0 -180
  61. package/tools/icons/.gitattributes +0 -1
  62. package/tools/icons/fa6pro-glyphmap.json +0 -4686
  63. package/tools/icons/fa6pro-meta.json +0 -1
  64. package/tools/mcp-env.ts +0 -13
  65. package/tools/mcp-tools/__tests__/data-calc-editing.test.js +0 -516
  66. package/tools/mcp-tools/__tests__/entry-editing.test.js +0 -866
  67. package/tools/mcp-tools/__tests__/huggingface.test.ts +0 -49
  68. package/tools/mcp-tools/__tests__/icons.test.ts +0 -21
  69. package/tools/mcp-tools/__tests__/mcp-env.test.js +0 -19
  70. package/tools/mcp-tools/_editing-helpers.ts +0 -98
  71. package/tools/mcp-tools/_verify.ts +0 -50
  72. package/tools/mcp-tools/compile.ts +0 -104
  73. package/tools/mcp-tools/data-calc-editing.ts +0 -1311
  74. package/tools/mcp-tools/entry-editing.ts +0 -2297
  75. package/tools/mcp-tools/huggingface.ts +0 -772
  76. package/tools/mcp-tools/icons.ts +0 -97
  77. package/tools/mcp-tools/lottie.ts +0 -102
  78. package/tools/mcp-tools/media.ts +0 -113
  79. package/tools/simulator-main.mjs +0 -488
  80. package/tools/simulator-preload.cjs +0 -16
  81. package/types/animation.d.ts +0 -116
  82. package/types/automation.d.ts +0 -231
  83. package/types/brick-base.d.ts +0 -80
  84. package/types/bricks/Camera.d.ts +0 -246
  85. package/types/bricks/Chart.d.ts +0 -372
  86. package/types/bricks/GenerativeMedia.d.ts +0 -290
  87. package/types/bricks/Icon.d.ts +0 -98
  88. package/types/bricks/Image.d.ts +0 -126
  89. package/types/bricks/Items.d.ts +0 -480
  90. package/types/bricks/Lottie.d.ts +0 -168
  91. package/types/bricks/Maps.d.ts +0 -262
  92. package/types/bricks/QrCode.d.ts +0 -117
  93. package/types/bricks/Rect.d.ts +0 -150
  94. package/types/bricks/RichText.d.ts +0 -131
  95. package/types/bricks/Rive.d.ts +0 -220
  96. package/types/bricks/Scene3D.d.ts +0 -676
  97. package/types/bricks/Sketch.d.ts +0 -256
  98. package/types/bricks/Slideshow.d.ts +0 -201
  99. package/types/bricks/Svg.d.ts +0 -99
  100. package/types/bricks/Text.d.ts +0 -148
  101. package/types/bricks/TextInput.d.ts +0 -242
  102. package/types/bricks/Video.d.ts +0 -242
  103. package/types/bricks/VideoStreaming.d.ts +0 -112
  104. package/types/bricks/WebRtcStream.d.ts +0 -65
  105. package/types/bricks/WebView.d.ts +0 -168
  106. package/types/bricks/index.d.ts +0 -23
  107. package/types/canvas.d.ts +0 -82
  108. package/types/common.d.ts +0 -141
  109. package/types/data-calc-command/base.d.ts +0 -57
  110. package/types/data-calc-command/collection.d.ts +0 -418
  111. package/types/data-calc-command/color.d.ts +0 -432
  112. package/types/data-calc-command/constant.d.ts +0 -50
  113. package/types/data-calc-command/datetime.d.ts +0 -147
  114. package/types/data-calc-command/file.d.ts +0 -129
  115. package/types/data-calc-command/index.d.ts +0 -13
  116. package/types/data-calc-command/iteratee.d.ts +0 -23
  117. package/types/data-calc-command/logictype.d.ts +0 -190
  118. package/types/data-calc-command/math.d.ts +0 -275
  119. package/types/data-calc-command/object.d.ts +0 -119
  120. package/types/data-calc-command/sandbox.d.ts +0 -66
  121. package/types/data-calc-command/string.d.ts +0 -407
  122. package/types/data-calc-script.d.ts +0 -21
  123. package/types/data-calc.d.ts +0 -12
  124. package/types/data.d.ts +0 -97
  125. package/types/generators/AlarmClock.d.ts +0 -110
  126. package/types/generators/Assistant.d.ts +0 -640
  127. package/types/generators/BleCentral.d.ts +0 -247
  128. package/types/generators/BlePeripheral.d.ts +0 -208
  129. package/types/generators/CanvasMap.d.ts +0 -74
  130. package/types/generators/CastlesPay.d.ts +0 -87
  131. package/types/generators/DataBank.d.ts +0 -160
  132. package/types/generators/File.d.ts +0 -432
  133. package/types/generators/GraphQl.d.ts +0 -132
  134. package/types/generators/Http.d.ts +0 -222
  135. package/types/generators/HttpServer.d.ts +0 -230
  136. package/types/generators/Information.d.ts +0 -103
  137. package/types/generators/Intent.d.ts +0 -168
  138. package/types/generators/Iterator.d.ts +0 -108
  139. package/types/generators/Keyboard.d.ts +0 -105
  140. package/types/generators/LlmAnthropicCompat.d.ts +0 -212
  141. package/types/generators/LlmAppleBuiltin.d.ts +0 -159
  142. package/types/generators/LlmGgml.d.ts +0 -903
  143. package/types/generators/LlmMediaTekNeuroPilot.d.ts +0 -235
  144. package/types/generators/LlmMlx.d.ts +0 -228
  145. package/types/generators/LlmOnnx.d.ts +0 -213
  146. package/types/generators/LlmOpenAiCompat.d.ts +0 -312
  147. package/types/generators/LlmQualcommAiEngine.d.ts +0 -247
  148. package/types/generators/Mcp.d.ts +0 -637
  149. package/types/generators/McpServer.d.ts +0 -289
  150. package/types/generators/MediaFlow.d.ts +0 -170
  151. package/types/generators/MqttBroker.d.ts +0 -141
  152. package/types/generators/MqttClient.d.ts +0 -141
  153. package/types/generators/Question.d.ts +0 -408
  154. package/types/generators/RealtimeTranscription.d.ts +0 -287
  155. package/types/generators/RerankerGgml.d.ts +0 -195
  156. package/types/generators/SerialPort.d.ts +0 -151
  157. package/types/generators/SoundPlayer.d.ts +0 -94
  158. package/types/generators/SoundRecorder.d.ts +0 -139
  159. package/types/generators/SpeechToTextGgml.d.ts +0 -424
  160. package/types/generators/SpeechToTextOnnx.d.ts +0 -236
  161. package/types/generators/SpeechToTextPlatform.d.ts +0 -85
  162. package/types/generators/SqLite.d.ts +0 -159
  163. package/types/generators/Step.d.ts +0 -107
  164. package/types/generators/SttAppleBuiltin.d.ts +0 -153
  165. package/types/generators/Tcp.d.ts +0 -126
  166. package/types/generators/TcpServer.d.ts +0 -147
  167. package/types/generators/TextToSpeechAppleBuiltin.d.ts +0 -127
  168. package/types/generators/TextToSpeechGgml.d.ts +0 -221
  169. package/types/generators/TextToSpeechOnnx.d.ts +0 -178
  170. package/types/generators/TextToSpeechOpenAiLike.d.ts +0 -121
  171. package/types/generators/ThermalPrinter.d.ts +0 -193
  172. package/types/generators/Tick.d.ts +0 -83
  173. package/types/generators/Udp.d.ts +0 -120
  174. package/types/generators/VadGgml.d.ts +0 -260
  175. package/types/generators/VadOnnx.d.ts +0 -231
  176. package/types/generators/VadTraditional.d.ts +0 -138
  177. package/types/generators/VectorStore.d.ts +0 -257
  178. package/types/generators/Watchdog.d.ts +0 -107
  179. package/types/generators/WebCrawler.d.ts +0 -103
  180. package/types/generators/WebRtc.d.ts +0 -181
  181. package/types/generators/WebSocket.d.ts +0 -148
  182. package/types/generators/index.d.ts +0 -57
  183. package/types/index.d.ts +0 -13
  184. package/types/subspace.d.ts +0 -60
  185. package/types/switch.d.ts +0 -51
  186. package/types/system.d.ts +0 -707
  187. package/utils/__tests__/calc.test.js +0 -25
  188. package/utils/__tests__/id.test.js +0 -154
  189. package/utils/calc.ts +0 -130
  190. package/utils/data.ts +0 -495
  191. package/utils/event-props.ts +0 -912
  192. package/utils/id.ts +0 -133
@@ -1,312 +0,0 @@
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
- * - OpenResponses and OpenAI Responses API support
10
- * - Custom API endpoints, like
11
- * - OpenAI API: https://platform.openai.com/docs/guides/text?api-mode=chat
12
- * - OpenAI Responses API: https://platform.openai.com/docs/api-reference/responses/create
13
- * - OpenResponses API: https://www.openresponses.org/reference
14
- * - Anthropic API: https://docs.anthropic.com/en/api/openai-sdk
15
- * - Gemini API: https://ai.google.dev/gemini-api/docs/openai
16
- * - llama.cpp server: https://github.com/ggml-org/llama.cpp/tree/master/tools/server
17
- */
18
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
19
- import type { Data, DataLink } from '../data'
20
- import type {
21
- Brick,
22
- Generator,
23
- EventAction,
24
- ActionWithDataParams,
25
- ActionWithParams,
26
- Action,
27
- EventProperty,
28
- } from '../common'
29
- import type { TemplateEventPropsMap } from '../../utils/event-props'
30
-
31
- /* Run text completion */
32
- export type GeneratorOpenAILLMActionCompletion = ActionWithParams & {
33
- __actionName: 'GENERATOR_OPENAI_LLM_COMPLETION'
34
- params?: Array<
35
- | {
36
- input: 'apiMode'
37
- value?: string | DataLink | EventProperty
38
- mapping?: string
39
- }
40
- | {
41
- input: 'previousResponseId'
42
- value?: string | DataLink | EventProperty
43
- mapping?: string
44
- }
45
- | {
46
- input: 'promptCacheKey'
47
- value?: string | DataLink | EventProperty
48
- mapping?: string
49
- }
50
- | {
51
- input: 'responseOptions'
52
- value?: {} | DataLink | EventProperty
53
- mapping?: string
54
- }
55
- | {
56
- input: 'messages'
57
- value?: Array<any> | DataLink | EventProperty
58
- mapping?: string
59
- }
60
- | {
61
- input: 'maxTokens'
62
- value?: number | DataLink | EventProperty
63
- mapping?: string
64
- }
65
- | {
66
- input: 'temperature'
67
- value?: number | DataLink | EventProperty
68
- mapping?: string
69
- }
70
- | {
71
- input: 'topP'
72
- value?: number | DataLink | EventProperty
73
- mapping?: string
74
- }
75
- | {
76
- input: 'frequencyPenalty'
77
- value?: number | DataLink | EventProperty
78
- mapping?: string
79
- }
80
- | {
81
- input: 'presencePenalty'
82
- value?: number | DataLink | EventProperty
83
- mapping?: string
84
- }
85
- | {
86
- input: 'stop'
87
- value?: Array<any> | DataLink | EventProperty
88
- mapping?: string
89
- }
90
- | {
91
- input: 'tools'
92
- value?: {} | DataLink | EventProperty
93
- mapping?: string
94
- }
95
- | {
96
- input: 'toolChoice'
97
- value?: string | DataLink | EventProperty
98
- mapping?: string
99
- }
100
- | {
101
- input: 'parallelToolCalls'
102
- value?: boolean | DataLink | EventProperty
103
- mapping?: string
104
- }
105
- | {
106
- input: 'responseFormat'
107
- value?: {} | DataLink | EventProperty
108
- mapping?: string
109
- }
110
- >
111
- }
112
-
113
- /* Stop text completion */
114
- export type GeneratorOpenAILLMActionStopCompletion = Action & {
115
- __actionName: 'GENERATOR_OPENAI_LLM_STOP_COMPLETION'
116
- }
117
-
118
- interface GeneratorOpenAILLMDef {
119
- /*
120
- Default property:
121
- {
122
- "apiEndpoint": "https://api.openai.com/v1",
123
- "model": "gpt-4o",
124
- "apiMode": "chat_completions",
125
- "completionMessages": [
126
- {
127
- "role": "system",
128
- "content": "You are a helpful assistant."
129
- }
130
- ],
131
- "completionMaxTokens": 1024,
132
- "completionTemperature": 1,
133
- "completionTopP": 1,
134
- "completionStop": []
135
- }
136
- */
137
- property?: {
138
- /* API endpoint URL */
139
- apiEndpoint?: string | DataLink
140
- /* API key */
141
- apiKey?: string | DataLink
142
- /* Model name (Default: gpt-4o-mini) */
143
- model?: string | DataLink
144
- /* API mode. Keep chat_completions for legacy OpenAI-compatible endpoints, or use responses for OpenResponses/OpenAI Responses endpoints. */
145
- apiMode?: 'chat_completions' | 'responses' | DataLink
146
- /* Previous response ID for continuing a Responses/OpenResponses conversation. */
147
- previousResponseId?: string | DataLink
148
- /* Prompt cache key for Responses/OpenResponses prompt cache optimization. */
149
- promptCacheKey?: string | DataLink
150
- /* Additional Responses/OpenResponses request options merged into the /responses payload, such as instructions, metadata, reasoning, truncation, service_tier, store, and text. */
151
- responseOptions?: {} | DataLink
152
- /* Chat messages */
153
- completionMessages?:
154
- | Array<
155
- | DataLink
156
- | {
157
- role?: string | DataLink
158
- content?:
159
- | string
160
- | DataLink
161
- | DataLink
162
- | {
163
- type?: string | DataLink
164
- text?: string | DataLink
165
- image_url?: string | DataLink
166
- }
167
- | DataLink
168
- }
169
- >
170
- | DataLink
171
- /* Tools for chat mode following OpenAI function calling format
172
- Format: Array of objects with {type, function: {name, description, parameters}} structure
173
- See: https://platform.openai.com/docs/guides/function-calling */
174
- completionTools?: Array<{} | DataLink> | DataLink
175
- /* Enable parallel tool calls */
176
- completionParallelToolCalls?: boolean | DataLink
177
- /* Tool choice for chat mode */
178
- completionToolChoice?: 'none' | 'auto' | 'required' | DataLink
179
- /* Response format */
180
- completionResponseFormat?:
181
- | DataLink
182
- | {
183
- type?: 'text' | 'json_schema' | 'json_object' | DataLink
184
- json_schema?:
185
- | DataLink
186
- | {
187
- strict?: boolean | DataLink
188
- schema?: {} | DataLink
189
- }
190
- }
191
- /* Maximum tokens to generate */
192
- completionMaxTokens?: number | DataLink
193
- /* Temperature */
194
- completionTemperature?: number | DataLink
195
- /* Top P sampling */
196
- completionTopP?: number | DataLink
197
- /* Frequency penalty. Only sent in chat_completions mode. */
198
- completionFrequencyPenalty?: number | DataLink
199
- /* Presence penalty. Only sent in chat_completions mode. */
200
- completionPresencePenalty?: number | DataLink
201
- /* Stop sequences. Only sent in chat_completions mode. */
202
- completionStop?: Array<string | DataLink> | DataLink
203
- }
204
- events?: {
205
- /* Error event */
206
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onError']>>
207
- /* Completion event */
208
- onCompletion?: Array<
209
- EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onCompletion']>
210
- >
211
- /* Completion finished event */
212
- onCompletionFinished?: Array<
213
- EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onCompletionFinished']>
214
- >
215
- /* Completion function call event */
216
- onCompletionFunctionCall?: Array<
217
- EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onCompletionFunctionCall']>
218
- >
219
- /* Response created event */
220
- onResponseCreated?: Array<
221
- EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onResponseCreated']>
222
- >
223
- /* Output item added event */
224
- onOutputItemAdded?: Array<
225
- EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onOutputItemAdded']>
226
- >
227
- /* Output text delta event */
228
- onOutputTextDelta?: Array<
229
- EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onOutputTextDelta']>
230
- >
231
- /* Output item done event */
232
- onOutputItemDone?: Array<
233
- EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onOutputItemDone']>
234
- >
235
- /* Response completed event */
236
- onResponseCompleted?: Array<
237
- EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onResponseCompleted']>
238
- >
239
- /* Response failed event */
240
- onResponseFailed?: Array<
241
- EventAction<string & keyof TemplateEventPropsMap['OpenaiLlm']['onResponseFailed']>
242
- >
243
- }
244
- outlets?: {
245
- /* Evaluating outlet */
246
- isEvaluating?: () => Data<boolean>
247
- /* Completion result outlet */
248
- completionResult?: () => Data<string>
249
- /* Completion details outlet */
250
- completionDetails?: () => Data<{
251
- text?: string
252
- content?: string
253
- finish_reason?: string
254
- usage?: { [key: string]: any }
255
- tool_calls?: Array<{
256
- id?: string
257
- type?: string
258
- function?: {
259
- name?: string
260
- arguments?: string
261
- [key: string]: any
262
- }
263
- [key: string]: any
264
- }>
265
- [key: string]: any
266
- }>
267
- /* Response ID outlet */
268
- responseId?: () => Data<string>
269
- /* Output items outlet */
270
- outputItems?: () => Data<Array<any>>
271
- }
272
- }
273
-
274
- /* LLM inference using OpenAI-compatible API endpoints
275
-
276
- ## Features
277
- - Compatible with OpenAI API format
278
- - Supports function calling
279
- - Streaming responses
280
- - OpenResponses and OpenAI Responses API support
281
- - Custom API endpoints, like
282
- - OpenAI API: https://platform.openai.com/docs/guides/text?api-mode=chat
283
- - OpenAI Responses API: https://platform.openai.com/docs/api-reference/responses/create
284
- - OpenResponses API: https://www.openresponses.org/reference
285
- - Anthropic API: https://docs.anthropic.com/en/api/openai-sdk
286
- - Gemini API: https://ai.google.dev/gemini-api/docs/openai
287
- - llama.cpp server: https://github.com/ggml-org/llama.cpp/tree/master/tools/server */
288
- export type GeneratorOpenAILLM = Generator &
289
- GeneratorOpenAILLMDef & {
290
- templateKey: 'GENERATOR_OPENAI_LLM'
291
- switches?: Array<
292
- SwitchDef &
293
- GeneratorOpenAILLMDef & {
294
- conds?: Array<{
295
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
296
- cond:
297
- | SwitchCondInnerStateCurrentCanvas
298
- | SwitchCondData
299
- | {
300
- __typename: 'SwitchCondInnerStateOutlet'
301
- outlet:
302
- | 'isEvaluating'
303
- | 'completionResult'
304
- | 'completionDetails'
305
- | 'responseId'
306
- | 'outputItems'
307
- value: any
308
- }
309
- }>
310
- }
311
- >
312
- }
@@ -1,247 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Local LLM inference using Qualcomm AI Engine
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
- import type { TemplateEventPropsMap } from '../../utils/event-props'
17
-
18
- /* Load the model */
19
- export type GeneratorQnnLlmActionLoadModel = Action & {
20
- __actionName: 'GENERATOR_QNN_LLM_LOAD_MODEL'
21
- }
22
-
23
- /* Abort model download */
24
- export type GeneratorQnnLlmActionAbortModelDownload = Action & {
25
- __actionName: 'GENERATOR_QNN_LLM_ABORT_MODEL_DOWNLOAD'
26
- }
27
-
28
- /* Pre-process the prompt, to prepare KV cache */
29
- export type GeneratorQnnLlmActionProcess = ActionWithParams & {
30
- __actionName: 'GENERATOR_QNN_LLM_PROCESS'
31
- params?: Array<
32
- | {
33
- input: 'prompt'
34
- value?: string | DataLink | EventProperty
35
- mapping?: string
36
- }
37
- | {
38
- input: 'messages'
39
- value?: Array<any> | DataLink | EventProperty
40
- mapping?: string
41
- }
42
- | {
43
- input: 'tools'
44
- value?: Array<any> | DataLink | EventProperty
45
- mapping?: string
46
- }
47
- >
48
- }
49
-
50
- /* Generate text */
51
- export type GeneratorQnnLlmActionGenerate = ActionWithParams & {
52
- __actionName: 'GENERATOR_QNN_LLM_GENERATE'
53
- params?: Array<
54
- | {
55
- input: 'prompt'
56
- value?: string | DataLink | EventProperty
57
- mapping?: string
58
- }
59
- | {
60
- input: 'messages'
61
- value?: Array<any> | DataLink | EventProperty
62
- mapping?: string
63
- }
64
- | {
65
- input: 'tools'
66
- value?: Array<any> | DataLink | EventProperty
67
- mapping?: string
68
- }
69
- >
70
- }
71
-
72
- /* Abort generation */
73
- export type GeneratorQnnLlmActionAbortGeneration = Action & {
74
- __actionName: 'GENERATOR_QNN_LLM_ABORT_GENERATION'
75
- }
76
-
77
- /* Release context */
78
- export type GeneratorQnnLlmActionReleaseContext = Action & {
79
- __actionName: 'GENERATOR_QNN_LLM_RELEASE_CONTEXT'
80
- }
81
-
82
- interface GeneratorQnnLlmDef {
83
- /*
84
- Default property:
85
- {
86
- "modelType": "Llama 3.2 3B Chat",
87
- "chatFormat": "Llama 3.x",
88
- "toolsInUserMessage": true,
89
- "toolCallParser": "llama3_json",
90
- "toolChoice": "auto",
91
- "parallelToolCalls": false,
92
- "temperature": 0.8,
93
- "seed": 42,
94
- "topK": 40,
95
- "topP": 0.95,
96
- "greedy": false
97
- }
98
- */
99
- property?: {
100
- /* Load model context when generator is initialized */
101
- init?: boolean | DataLink
102
- /* Model type */
103
- modelType?:
104
- | 'Llama 3 8B Chat'
105
- | 'Llama 3.1 8B Chat'
106
- | 'Llama 3.2 3B Chat'
107
- | 'Mistral 7B Instruct v0.3'
108
- | 'Qwen 2 7B Chat'
109
- | 'Phi 3.5 Mini'
110
- | 'Granite v3.1 8B Instruct'
111
- | 'Custom'
112
- | DataLink
113
- /* SOC model */
114
- socModel?: 'X Elite' | 'X Plus' | '8 Elite' | '8 Gen 3' | 'QCS8550' | DataLink
115
- /* Custom model base URL
116
- The model should be bundled, for details see https://github.com/mybigday/node-qnn-llm?tab=readme-ov-file#bundled-file */
117
- customModelUrl?: string | DataLink
118
- /* Custom model MD5 */
119
- customModelMd5?: string | DataLink
120
- /* Chat format */
121
- chatFormat?:
122
- | 'Llama 2'
123
- | 'Llama 3'
124
- | 'Llama 3.x'
125
- | 'Mistral v0.3'
126
- | 'Qwen 2'
127
- | 'Custom'
128
- | DataLink
129
- /* Custom chat format template */
130
- customChatFormat?: string | DataLink
131
- /* Put tools in user message */
132
- toolsInUserMessage?: boolean | DataLink
133
- /* Prompt to generate */
134
- prompt?: string | DataLink
135
- /* Chat messages */
136
- messages?:
137
- | Array<
138
- | DataLink
139
- | {
140
- role?: string | DataLink
141
- content?: string | DataLink
142
- }
143
- >
144
- | DataLink
145
- /* Stop words */
146
- stopWords?: Array<string | DataLink> | DataLink
147
- /* Tool call parser */
148
- toolCallParser?: 'llama3_json' | 'mistral' | 'hermes' | 'internlm' | 'phi4' | DataLink
149
- /* Tools for chat mode using OpenAI-compatible function calling format
150
- Format: Array of objects with {type, function: {name, description, parameters}} structure
151
- See: https://platform.openai.com/docs/guides/function-calling */
152
- tools?: Array<{} | DataLink> | DataLink
153
- /* Tool choice for chat mode */
154
- toolChoice?: 'none' | 'auto' | 'required' | DataLink
155
- /* Enable parallel tool calls */
156
- parallelToolCalls?: boolean | DataLink
157
- /* Number of threads, -1 to use n-threads from model config */
158
- nThreads?: number | DataLink
159
- /* Temperature, -1 to use temperature from model config */
160
- temperature?: number | DataLink
161
- /* Seed, -1 to use seed from model config */
162
- seed?: number | DataLink
163
- /* Top K, -1 to use top-k from model config */
164
- topK?: number | DataLink
165
- /* Top P, -1 to use top-p from model config */
166
- topP?: number | DataLink
167
- /* Greedy, use greedy sampling */
168
- greedy?: boolean | DataLink
169
- }
170
- events?: {
171
- /* Event triggered when context state changes */
172
- onContextStateChange?: Array<
173
- EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onContextStateChange']>
174
- >
175
- /* Event triggered when generate is done */
176
- onGenerate?: Array<EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onGenerate']>>
177
- /* Event triggered on get function call request */
178
- onFunctionCall?: Array<
179
- EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onFunctionCall']>
180
- >
181
- /* Event triggered when error occurs */
182
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['QnnLlm']['onError']>>
183
- }
184
- outlets?: {
185
- /* Context state */
186
- contextState?: () => Data<string>
187
- /* Generation result */
188
- result?: () => Data<string>
189
- /* Full context (Prompt + Generation Result) */
190
- fullContext?: () => Data<string>
191
- /* Last function call details */
192
- lastFunctionCall?: () => Data<{
193
- id?: string
194
- type?: string
195
- function?: {
196
- name?: string
197
- arguments?: string
198
- [key: string]: any
199
- }
200
- [key: string]: any
201
- }>
202
- /* Completion details */
203
- completionDetails?: () => Data<{
204
- text?: string
205
- content?: string
206
- reasoning_content?: string
207
- tool_calls?: Array<{
208
- id?: string
209
- type?: string
210
- function?: {
211
- name?: string
212
- arguments?: string
213
- [key: string]: any
214
- }
215
- [key: string]: any
216
- }>
217
- [key: string]: any
218
- }>
219
- }
220
- }
221
-
222
- /* Local LLM inference using Qualcomm AI Engine */
223
- export type GeneratorQnnLlm = Generator &
224
- GeneratorQnnLlmDef & {
225
- templateKey: 'GENERATOR_QNN_LLM'
226
- switches?: Array<
227
- SwitchDef &
228
- GeneratorQnnLlmDef & {
229
- conds?: Array<{
230
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
231
- cond:
232
- | SwitchCondInnerStateCurrentCanvas
233
- | SwitchCondData
234
- | {
235
- __typename: 'SwitchCondInnerStateOutlet'
236
- outlet:
237
- | 'contextState'
238
- | 'result'
239
- | 'fullContext'
240
- | 'lastFunctionCall'
241
- | 'completionDetails'
242
- value: any
243
- }
244
- }>
245
- }
246
- >
247
- }