@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,640 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Conversational AI agent orchestrating LLM (GGML/MLX/OpenAI/QNN/ONNX/Anthropic/NeuroPilot), STT, TTS, MCP tool-use, and file search (RAG) with auto-summary
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
- /* Add a message to the assistant */
19
- export type GeneratorAssistantActionAddMessage = ActionWithParams & {
20
- __actionName: 'GENERATOR_ASSISTANT_ADD_MESSAGE'
21
- params?: Array<
22
- | {
23
- input: 'role'
24
- value?: string | DataLink | EventProperty
25
- mapping?: string
26
- }
27
- | {
28
- input: 'content'
29
- value?: string | DataLink | EventProperty
30
- mapping?: string
31
- }
32
- | {
33
- input: 'image'
34
- value?: string | DataLink | EventProperty
35
- mapping?: string
36
- }
37
- | {
38
- input: 'payload'
39
- value?: {} | DataLink | EventProperty
40
- mapping?: string
41
- }
42
- | {
43
- input: 'useFileSearch'
44
- value?: boolean | DataLink | EventProperty
45
- mapping?: string
46
- }
47
- | {
48
- input: 'filePath'
49
- value?: string | DataLink | EventProperty
50
- mapping?: string
51
- }
52
- | {
53
- input: 'fileName'
54
- value?: string | DataLink | EventProperty
55
- mapping?: string
56
- }
57
- | {
58
- input: 'fileExtension'
59
- value?: string | DataLink | EventProperty
60
- mapping?: string
61
- }
62
- | {
63
- input: 'filePayload'
64
- value?: {} | DataLink | EventProperty
65
- mapping?: string
66
- }
67
- | {
68
- input: 'fileSearchCitationCount'
69
- value?: number | DataLink | EventProperty
70
- mapping?: string
71
- }
72
- | {
73
- input: 'fileSearchInsertMethod'
74
- value?: 'in-user-message' | 'new-assistant-message' | DataLink | EventProperty
75
- mapping?: string
76
- }
77
- >
78
- }
79
-
80
- /* Initialize messages from MCP prompt */
81
- export type GeneratorAssistantActionInitMcpPrompt = ActionWithParams & {
82
- __actionName: 'GENERATOR_ASSISTANT_INIT_MCP_PROMPT'
83
- params?: Array<
84
- | {
85
- input: 'mcpClientName'
86
- value?: string | DataLink | EventProperty
87
- mapping?: string
88
- }
89
- | {
90
- input: 'mcpPromptName'
91
- value?: string | DataLink | EventProperty
92
- mapping?: string
93
- }
94
- | {
95
- input: 'mcpArguments'
96
- value?: {} | DataLink | EventProperty
97
- mapping?: string
98
- }
99
- | {
100
- input: 'firstMessageAsSystem'
101
- value?: boolean | DataLink | EventProperty
102
- mapping?: string
103
- }
104
- >
105
- }
106
-
107
- /* Add messages from MCP prompt */
108
- export type GeneratorAssistantActionAddMcpPromptMessage = ActionWithParams & {
109
- __actionName: 'GENERATOR_ASSISTANT_ADD_MCP_PROMPT_MESSAGE'
110
- params?: Array<
111
- | {
112
- input: 'mcpClientName'
113
- value?: string | DataLink | EventProperty
114
- mapping?: string
115
- }
116
- | {
117
- input: 'mcpPromptName'
118
- value?: string | DataLink | EventProperty
119
- mapping?: string
120
- }
121
- | {
122
- input: 'mcpArguments'
123
- value?: {} | DataLink | EventProperty
124
- mapping?: string
125
- }
126
- >
127
- }
128
-
129
- /* Update a message at a specific index */
130
- export type GeneratorAssistantActionUpdateMessageAtIndex = ActionWithParams & {
131
- __actionName: 'GENERATOR_ASSISTANT_UPDATE_MESSAGE_AT_INDEX'
132
- params?: Array<
133
- | {
134
- input: 'index'
135
- value?: number | DataLink | EventProperty
136
- mapping?: string
137
- }
138
- | {
139
- input: 'content'
140
- value?: string | DataLink | EventProperty
141
- mapping?: string
142
- }
143
- | {
144
- input: 'image'
145
- value?: string | DataLink | EventProperty
146
- mapping?: string
147
- }
148
- | {
149
- input: 'payload'
150
- value?: {} | DataLink | EventProperty
151
- mapping?: string
152
- }
153
- >
154
- }
155
-
156
- /* Add an audio message and convert it to text to the assistant (if STT enabled) */
157
- export type GeneratorAssistantActionAddAudioMessage = ActionWithParams & {
158
- __actionName: 'GENERATOR_ASSISTANT_ADD_AUDIO_MESSAGE'
159
- params?: Array<
160
- | {
161
- input: 'role'
162
- value?: string | DataLink | EventProperty
163
- mapping?: string
164
- }
165
- | {
166
- input: 'contentFile'
167
- value?: string | DataLink | EventProperty
168
- mapping?: string
169
- }
170
- | {
171
- input: 'contentBase64'
172
- value?: string | DataLink | EventProperty
173
- mapping?: string
174
- }
175
- | {
176
- input: 'image'
177
- value?: string | DataLink | EventProperty
178
- mapping?: string
179
- }
180
- | {
181
- input: 'useFileSearch'
182
- value?: boolean | DataLink | EventProperty
183
- mapping?: string
184
- }
185
- | {
186
- input: 'payload'
187
- value?: {} | DataLink | EventProperty
188
- mapping?: string
189
- }
190
- | {
191
- input: 'filePath'
192
- value?: string | DataLink | EventProperty
193
- mapping?: string
194
- }
195
- | {
196
- input: 'fileName'
197
- value?: string | DataLink | EventProperty
198
- mapping?: string
199
- }
200
- | {
201
- input: 'fileExtension'
202
- value?: string | DataLink | EventProperty
203
- mapping?: string
204
- }
205
- | {
206
- input: 'filePayload'
207
- value?: {} | DataLink | EventProperty
208
- mapping?: string
209
- }
210
- | {
211
- input: 'fileSearchCitationCount'
212
- value?: number | DataLink | EventProperty
213
- mapping?: string
214
- }
215
- | {
216
- input: 'fileSearchInsertMethod'
217
- value?: 'in-user-message' | 'new-assistant-message' | DataLink | EventProperty
218
- mapping?: string
219
- }
220
- >
221
- }
222
-
223
- /* Add a file to File Search (Vector Store) */
224
- export type GeneratorAssistantActionAddFile = ActionWithParams & {
225
- __actionName: 'GENERATOR_ASSISTANT_ADD_FILE'
226
- params?: Array<
227
- | {
228
- input: 'filePath'
229
- value?: string | DataLink | EventProperty
230
- mapping?: string
231
- }
232
- | {
233
- input: 'fileName'
234
- value?: string | DataLink | EventProperty
235
- mapping?: string
236
- }
237
- | {
238
- input: 'fileExtension'
239
- value?: string | DataLink | EventProperty
240
- mapping?: string
241
- }
242
- | {
243
- input: 'filePayload'
244
- value?: {} | DataLink | EventProperty
245
- mapping?: string
246
- }
247
- >
248
- }
249
-
250
- /* Remove a file from File Search (Vector Store) */
251
- export type GeneratorAssistantActionRemoveFile = ActionWithParams & {
252
- __actionName: 'GENERATOR_ASSISTANT_REMOVE_FILE'
253
- params?: Array<{
254
- input: 'fileName'
255
- value?: string | DataLink | EventProperty
256
- mapping?: string
257
- }>
258
- }
259
-
260
- /* Update a audio message at a specific index */
261
- export type GeneratorAssistantActionUpdateAudioMessageAtIndex = ActionWithParams & {
262
- __actionName: 'GENERATOR_ASSISTANT_UPDATE_AUDIO_MESSAGE_AT_INDEX'
263
- params?: Array<
264
- | {
265
- input: 'index'
266
- value?: number | DataLink | EventProperty
267
- mapping?: string
268
- }
269
- | {
270
- input: 'contentFile'
271
- value?: string | DataLink | EventProperty
272
- mapping?: string
273
- }
274
- | {
275
- input: 'contentBase64'
276
- value?: string | DataLink | EventProperty
277
- mapping?: string
278
- }
279
- | {
280
- input: 'image'
281
- value?: string | DataLink | EventProperty
282
- mapping?: string
283
- }
284
- | {
285
- input: 'payload'
286
- value?: {} | DataLink | EventProperty
287
- mapping?: string
288
- }
289
- >
290
- }
291
-
292
- /* Remove a message at a specific index */
293
- export type GeneratorAssistantActionRemoveMessageAtIndex = ActionWithParams & {
294
- __actionName: 'GENERATOR_ASSISTANT_REMOVE_MESSAGE_AT_INDEX'
295
- params?: Array<{
296
- input: 'index'
297
- value?: number | DataLink | EventProperty
298
- mapping?: string
299
- }>
300
- }
301
-
302
- /* Reset all messages of the assistant */
303
- export type GeneratorAssistantActionResetMessages = Action & {
304
- __actionName: 'GENERATOR_ASSISTANT_RESET_MESSAGES'
305
- }
306
-
307
- /* Reset assistant (Reset all messages and files) */
308
- export type GeneratorAssistantActionReset = Action & {
309
- __actionName: 'GENERATOR_ASSISTANT_RESET'
310
- }
311
-
312
- /* Submit the assistant */
313
- export type GeneratorAssistantActionSubmit = ActionWithParams & {
314
- __actionName: 'GENERATOR_ASSISTANT_SUBMIT'
315
- params?: Array<
316
- | {
317
- input: 'continueOnToolCallConfirm'
318
- value?: boolean | DataLink | EventProperty
319
- mapping?: string
320
- }
321
- | {
322
- input: 'continueOnToolCallStrategy'
323
- value?: 'never' | 'success' | 'always' | DataLink | EventProperty
324
- mapping?: string
325
- }
326
- | {
327
- input: 'continueOnToolCallLimit'
328
- value?: number | DataLink | EventProperty
329
- mapping?: string
330
- }
331
- >
332
- }
333
-
334
- /* Cancel the assistant responding */
335
- export type GeneratorAssistantActionCancel = Action & {
336
- __actionName: 'GENERATOR_ASSISTANT_CANCEL'
337
- }
338
-
339
- /* Check the enabled MCP clients connection status and available tools */
340
- export type GeneratorAssistantActionCheckMcpServers = Action & {
341
- __actionName: 'GENERATOR_ASSISTANT_CHECK_MCP_SERVERS'
342
- }
343
-
344
- /* Insert an MCP resource as a new assistant message */
345
- export type GeneratorAssistantActionInsertMcpResource = ActionWithParams & {
346
- __actionName: 'GENERATOR_ASSISTANT_INSERT_MCP_RESOURCE'
347
- params?: Array<
348
- | {
349
- input: 'mcpClientName'
350
- value?: string | DataLink | EventProperty
351
- mapping?: string
352
- }
353
- | {
354
- input: 'mcpResourceUri'
355
- value?: string | DataLink | EventProperty
356
- mapping?: string
357
- }
358
- | {
359
- input: 'mcpVariables'
360
- value?: {} | DataLink | EventProperty
361
- mapping?: string
362
- }
363
- | {
364
- input: 'role'
365
- value?: string | DataLink | EventProperty
366
- mapping?: string
367
- }
368
- >
369
- }
370
-
371
- /* Summarize messages based on the conversation
372
-
373
- Note: Summary uses the same LLM context size, so it is recommended only to use it when the system prompt (in Initial Messages) is long, otherwise it may still fail when the context is full (Ctx Shift is NO). */
374
- export type GeneratorAssistantActionSummaryMessages = ActionWithParams & {
375
- __actionName: 'GENERATOR_ASSISTANT_SUMMARY_MESSAGES'
376
- params?: Array<
377
- | {
378
- input: 'summaryMessages'
379
- value?: Array<any> | DataLink | EventProperty
380
- mapping?: string
381
- }
382
- | {
383
- input: 'summarySessionKey'
384
- value?: string | DataLink | EventProperty
385
- mapping?: string
386
- }
387
- >
388
- }
389
-
390
- interface GeneratorAssistantDef {
391
- /*
392
- Default property:
393
- {
394
- "initialMessages": [
395
- {
396
- "role": "system",
397
- "content": "You are a helpful assistant."
398
- }
399
- ],
400
- "cacheMessages": false,
401
- "llmLivePolicy": "only-in-use",
402
- "llmSessionKey": "default-assistant",
403
- "llmAutoSummaryMessages": false,
404
- "llmSummaryMessages": [
405
- {
406
- "role": "system",
407
- "content": "You are a helpful assistant specialized in summarizing conversations. Create a concise summary of the conversation that captures the key points while maintaining important context. The summary should be clear, accurate, and briefer than the original conversation."
408
- },
409
- {
410
- "role": "user",
411
- "content": "Please summarize the following conversation into a concise system message that can replace the previous conversation context while maintaining all important information. Here is the conversation to summarize:\n\n"
412
- }
413
- ],
414
- "llmSummarySessionKey": "assistant-default-summary",
415
- "fileSearchEnabled": false,
416
- "fileSearchLivePolicy": "only-in-use",
417
- "sttEnabled": true,
418
- "sttLivePolicy": "only-in-use",
419
- "ttsEnabled": false,
420
- "ttsLivePolicy": "only-in-use",
421
- "mcpResourceAnnotationEnabled": false,
422
- "mcpResourceAnnotationKeyword": "@resource:",
423
- "mcpResourceAnnotationFallback": ""
424
- }
425
- */
426
- property?: {
427
- /* Whether to heat up generators on initialization for better performance */
428
- heatup?: boolean | DataLink
429
- /* Messages */
430
- initialMessages?:
431
- | Array<
432
- | DataLink
433
- | {
434
- role?: string | DataLink
435
- content?: string | DataLink
436
- }
437
- >
438
- | DataLink
439
- /* Whether to cache messages */
440
- cacheMessages?: boolean | DataLink
441
- /* LLM Generator (Supports `LLM (GGML)`, `LLM (MLX)`, `OpenAI LLM`, `LLM (Qualcomm AI Engine)`, `LLM (ONNX)`, `LLM (Anthropic-compat)`, and `LLM (MediaTek NeuroPilot)` generators) */
442
- llmGeneratorId?: string | DataLink | (() => Generator)
443
- /* LLM Live Policy. If the policy is `only-in-use`, the LLM context will be released when the assistant is not in use.
444
-
445
- Note: LLM (Qualcomm AI Engine) recommend use `manual` and loaded constantly. */
446
- llmLivePolicy?: 'only-in-use' | 'manual' | DataLink
447
- /* LLM main session key */
448
- llmSessionKey?: string | DataLink
449
- /* Auto Summary Messages (Automatically summarize messages when the LLM context is full or content gets truncated, currently only supported with LLM (GGML) generators)
450
-
451
- Note: Summary uses the same LLM context size, so it is recommended only to use it when the system prompt (in Initial Messages) is long, otherwise it may still fail when the context is full (Ctx Shift is NO). */
452
- llmAutoSummaryMessages?: boolean | DataLink
453
- /* Summary Messages (Messages used for summarization prompt, conversation will be appended to the last message) */
454
- llmSummaryMessages?:
455
- | Array<
456
- | DataLink
457
- | {
458
- role?: string | DataLink
459
- content?: string | DataLink
460
- }
461
- >
462
- | DataLink
463
- /* Summary Session Key (Custom session key for summarization) */
464
- llmSummarySessionKey?: string | DataLink
465
- /* Generate fallback content for tool calls when LLM returns tool calls without text content. When enabled, creates a message like "Call:
466
- functionName(args)" to keep the conversation readable. */
467
- llmToolCallFallbackContent?: boolean | DataLink
468
- /* File Search (Vector Store) Enabled */
469
- fileSearchEnabled?: boolean | DataLink
470
- /* File Search (Vector Store) Generator */
471
- fileSearchGeneratorId?: string | DataLink | (() => Generator)
472
- /* File Search (Vector Store) Live Policy. If the policy is `only-in-use`, the File Search (Vector Store) context will be released when the assistant is not in use. */
473
- fileSearchLivePolicy?: 'only-in-use' | 'manual' | DataLink
474
- /* File Search Citation Count. (Default: 3) */
475
- fileSearchCitationCount?: number | DataLink
476
- /* File Search Threshold. (Default: 1.0) */
477
- fileSearchThreshold?: number | DataLink
478
- /* File Search Ignore Threshold. (Default: false) */
479
- fileSearchIgnoreThreshold?: boolean | DataLink
480
- /* STT Generator use for transcribing audio message (Supports `STT (GGML)` generators) */
481
- sttGeneratorId?: string | DataLink | (() => Generator)
482
- /* STT Enabled */
483
- sttEnabled?: boolean | DataLink
484
- /* STT Live Policy. If the policy is `only-in-use`, the STT context will be released when the assistant is not in use. */
485
- sttLivePolicy?: 'only-in-use' | 'manual' | DataLink
486
- /* TTS Generator use for generating LLM response audio message (Supports `TTS (ONNX)` and `OpenAI TTS` generators) */
487
- ttsGeneratorId?: string | DataLink | (() => Generator)
488
- /* TTS Enabled */
489
- ttsEnabled?: boolean | DataLink
490
- /* TTS Live Policy. If the policy is `only-in-use`, the TTS context will be released when the assistant is not in use. */
491
- ttsLivePolicy?: 'only-in-use' | 'manual' | DataLink
492
- /* MCP Generators (Add a unique name if generator name property are duplicate) */
493
- mcpGenerators?:
494
- | Array<
495
- | DataLink
496
- | {
497
- generatorId?: string | DataLink | (() => Generator)
498
- generatorKey?: string | DataLink
499
- name?: string | DataLink
500
- enabled?: boolean | DataLink
501
- includeTools?: Array<string | DataLink> | DataLink
502
- excludeTools?: Array<string | DataLink> | DataLink
503
- blockTools?: Array<string | DataLink> | DataLink
504
- blockToolMessage?: string | DataLink
505
- }
506
- >
507
- | DataLink
508
- /* Enable MCP resource annotation in messages. When enabled, users can use keyboard shortcuts to include MCP resources using the format: @resource:<server-name>:<resource-uri> */
509
- mcpResourceAnnotationEnabled?: boolean | DataLink
510
- /* MCP resource annotation keyword (Default: @resource:) */
511
- mcpResourceAnnotationKeyword?: string | DataLink
512
- /* Fallback text when MCP server or resource is not found. If empty, an error will be thrown. */
513
- mcpResourceAnnotationFallback?: string | DataLink
514
- /* Guardrails — safety checks applied at specific pipeline hook points. Each entry runs a `pattern` regex or `llm` verdict check at the specified `on` hook, and fires the configured `action` when triggered. Jinja template kwargs for `llmUserPromptTemplate` / `llmSystemPrompt`: `input` (string) — last user message text `output` (string) — LLM response text `tool_call` (string) — tool function name `tool_args` (object) — tool call arguments (use `{{ tool_args | tojson }}` for JSON string, `{{ tool_args.key }}` for field access) `tool_result` (string) — tool execution result `messages` (array) — conversation history as `[{role, content}, ...]` Legacy `{var}` format is auto-upgraded to `{{ var }}`. For `action: 'redact'` with `kind: 'llm'`, `llmSystemPrompt` is also used as the sanitiser system prompt (defaults to a built-in rewrite instruction when omitted). `redactReplacement` — custom replacement string for pattern redaction (defaults to `[REDACTED]`). Hook semantics: `before-llm` only fires on initial user submissions (skipped on tool-result continuations). `after-llm` fires on all non-tool-call responses (skipped only on tool-call-only responses). */
515
- guardrails?:
516
- | Array<
517
- | DataLink
518
- | {
519
- id?: string | DataLink
520
- on?: 'before-llm' | 'after-llm' | 'before-tool' | 'after-tool' | DataLink
521
- kind?: 'pattern' | 'llm' | DataLink
522
- patternMatch?: string | DataLink
523
- llmGeneratorId?: string | DataLink | (() => Generator)
524
- llmLivePolicy?: 'only-in-use' | 'manual' | DataLink
525
- llmSystemPrompt?: string | DataLink
526
- llmUserPromptTemplate?: string | DataLink
527
- llmResultMatch?: string | DataLink
528
- action?: 'block' | 'redact' | 'log-only' | DataLink
529
- redactReplacement?: string | DataLink
530
- }
531
- >
532
- | DataLink
533
- }
534
- events?: {
535
- /* Error event */
536
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Assistant']['onError']>>
537
- /* Log event */
538
- onLogs?: Array<EventAction<string & keyof TemplateEventPropsMap['Assistant']['onLogs']>>
539
- /* Messages update event */
540
- onMessagesUpdate?: Array<
541
- EventAction<string & keyof TemplateEventPropsMap['Assistant']['onMessagesUpdate']>
542
- >
543
- /* Heatup finished event */
544
- onHeatupFinished?: Array<EventAction>
545
- /* Generating event (triggered when assistant starts generating response) */
546
- onGenerating?: Array<EventAction>
547
- /* Finished event (triggered when assistant finishes generating response) */
548
- onFinished?: Array<EventAction<string & keyof TemplateEventPropsMap['Assistant']['onFinished']>>
549
- }
550
- outlets?: {
551
- /* Whether the assistant is heating up */
552
- isHeatingUp?: () => Data<boolean>
553
- /* Whether the assistant is file processing */
554
- isFileProcessing?: () => Data<boolean>
555
- /* Whether the assistant is responding */
556
- isResponding?: () => Data<boolean>
557
- /* Whether the assistant is busy */
558
- isBusy?: () => Data<boolean>
559
- /* Embedding files of the assistant */
560
- files?: () => Data<Array<any>>
561
- /* Messages of the assistant */
562
- messages?: () => Data<
563
- Array<{
564
- role?: string
565
- name?: string
566
- content?: any
567
- tool_call_id?: string
568
- tool_calls?: Array<{
569
- id?: string
570
- type?: string
571
- function?: {
572
- name?: string
573
- arguments?: string
574
- [key: string]: any
575
- }
576
- [key: string]: any
577
- }>
578
- reasoning_content?: string
579
- audio?: {
580
- generating?: boolean
581
- [key: string]: any
582
- }
583
- last_generated_at?: number
584
- responding?: boolean
585
- is_summary?: boolean
586
- summary_created_at?: number
587
- [key: string]: any
588
- }>
589
- >
590
- /* MCP servers status and available tools */
591
- mcpServers?: () => Data<
592
- Array<{
593
- generatorId?: string
594
- generatorKey?: string
595
- name?: string
596
- version?: string
597
- connected?: boolean
598
- error?: string
599
- resources?: Array<{
600
- name?: string
601
- [key: string]: any
602
- }>
603
- tools?: Array<{
604
- name?: string
605
- [key: string]: any
606
- }>
607
- [key: string]: any
608
- }>
609
- >
610
- }
611
- }
612
-
613
- /* Conversational AI agent orchestrating LLM (GGML/MLX/OpenAI/QNN/ONNX/Anthropic/NeuroPilot), STT, TTS, MCP tool-use, and file search (RAG) with auto-summary */
614
- export type GeneratorAssistant = Generator &
615
- GeneratorAssistantDef & {
616
- templateKey: 'GENERATOR_ASSISTANT'
617
- switches?: Array<
618
- SwitchDef &
619
- GeneratorAssistantDef & {
620
- conds?: Array<{
621
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
622
- cond:
623
- | SwitchCondInnerStateCurrentCanvas
624
- | SwitchCondData
625
- | {
626
- __typename: 'SwitchCondInnerStateOutlet'
627
- outlet:
628
- | 'isHeatingUp'
629
- | 'isFileProcessing'
630
- | 'isResponding'
631
- | 'isBusy'
632
- | 'files'
633
- | 'messages'
634
- | 'mcpServers'
635
- value: any
636
- }
637
- }>
638
- }
639
- >
640
- }