@fugood/bricks-project 2.24.0-beta.4 → 2.24.0-beta.40

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 (125) hide show
  1. package/compile/action-name-map.ts +38 -0
  2. package/compile/index.ts +429 -160
  3. package/compile/util.ts +2 -0
  4. package/package.json +7 -3
  5. package/package.json.bak +27 -0
  6. package/skills/bricks-design/LICENSE.txt +180 -0
  7. package/skills/bricks-design/SKILL.md +66 -0
  8. package/skills/bricks-project/SKILL.md +2 -2
  9. package/skills/bricks-project/rules/animation.md +1 -1
  10. package/skills/bricks-project/rules/architecture-patterns.md +7 -0
  11. package/skills/bricks-project/rules/automations.md +74 -28
  12. package/skills/bricks-project/rules/buttress.md +10 -7
  13. package/skills/bricks-project/rules/data-calculation.md +1 -1
  14. package/skills/bricks-project/rules/local-sync.md +2 -2
  15. package/skills/bricks-project/rules/media-flow.md +3 -3
  16. package/skills/bricks-project/rules/remote-data-bank.md +6 -6
  17. package/skills/bricks-project/rules/standby-transition.md +1 -1
  18. package/tools/deploy.ts +66 -12
  19. package/tools/icons/fa6pro-meta.json +3669 -26125
  20. package/tools/mcp-server.ts +11 -878
  21. package/tools/mcp-tools/compile.ts +91 -0
  22. package/tools/mcp-tools/huggingface.ts +762 -0
  23. package/tools/mcp-tools/icons.ts +70 -0
  24. package/tools/mcp-tools/lottie.ts +102 -0
  25. package/tools/mcp-tools/media.ts +110 -0
  26. package/tools/postinstall.ts +137 -40
  27. package/tools/preview-main.mjs +146 -9
  28. package/tools/preview.ts +30 -2
  29. package/tools/pull.ts +37 -19
  30. package/tsconfig.json +16 -0
  31. package/types/animation.ts +4 -0
  32. package/types/automation.ts +4 -1
  33. package/types/brick-base.ts +1 -1
  34. package/types/bricks/Camera.ts +48 -13
  35. package/types/bricks/Chart.ts +10 -4
  36. package/types/bricks/GenerativeMedia.ts +30 -14
  37. package/types/bricks/Icon.ts +9 -5
  38. package/types/bricks/Image.ts +10 -6
  39. package/types/bricks/Items.ts +29 -15
  40. package/types/bricks/Lottie.ts +15 -7
  41. package/types/bricks/Maps.ts +16 -8
  42. package/types/bricks/QrCode.ts +9 -5
  43. package/types/bricks/Rect.ts +45 -6
  44. package/types/bricks/RichText.ts +9 -5
  45. package/types/bricks/Rive.ts +21 -11
  46. package/types/bricks/Slideshow.ts +20 -10
  47. package/types/bricks/Svg.ts +8 -4
  48. package/types/bricks/Text.ts +9 -5
  49. package/types/bricks/TextInput.ts +23 -13
  50. package/types/bricks/Video.ts +11 -7
  51. package/types/bricks/VideoStreaming.ts +8 -4
  52. package/types/bricks/WebRtcStream.ts +7 -3
  53. package/types/bricks/WebView.ts +12 -8
  54. package/types/canvas.ts +4 -2
  55. package/types/common.ts +19 -12
  56. package/types/data-calc-command.ts +2 -0
  57. package/types/data-calc.ts +1 -0
  58. package/types/data.ts +2 -0
  59. package/types/generators/AlarmClock.ts +17 -11
  60. package/types/generators/Assistant.ts +69 -18
  61. package/types/generators/BleCentral.ts +31 -11
  62. package/types/generators/BlePeripheral.ts +11 -7
  63. package/types/generators/CanvasMap.ts +10 -6
  64. package/types/generators/CastlesPay.ts +15 -7
  65. package/types/generators/DataBank.ts +44 -9
  66. package/types/generators/File.ts +109 -30
  67. package/types/generators/GraphQl.ts +12 -6
  68. package/types/generators/Http.ts +33 -10
  69. package/types/generators/HttpServer.ts +23 -15
  70. package/types/generators/Information.ts +9 -5
  71. package/types/generators/Intent.ts +15 -5
  72. package/types/generators/Iterator.ts +15 -11
  73. package/types/generators/Keyboard.ts +27 -13
  74. package/types/generators/LlmAnthropicCompat.ts +33 -11
  75. package/types/generators/LlmAppleBuiltin.ts +25 -10
  76. package/types/generators/LlmGgml.ts +140 -31
  77. package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
  78. package/types/generators/LlmMlx.ts +227 -0
  79. package/types/generators/LlmOnnx.ts +34 -14
  80. package/types/generators/LlmOpenAiCompat.ts +47 -11
  81. package/types/generators/LlmQualcommAiEngine.ts +45 -13
  82. package/types/generators/Mcp.ts +375 -34
  83. package/types/generators/McpServer.ts +58 -19
  84. package/types/generators/MediaFlow.ts +38 -12
  85. package/types/generators/MqttBroker.ts +29 -11
  86. package/types/generators/MqttClient.ts +19 -9
  87. package/types/generators/Question.ts +13 -9
  88. package/types/generators/RealtimeTranscription.ts +108 -19
  89. package/types/generators/RerankerGgml.ts +43 -12
  90. package/types/generators/SerialPort.ts +18 -10
  91. package/types/generators/SoundPlayer.ts +10 -4
  92. package/types/generators/SoundRecorder.ts +24 -9
  93. package/types/generators/SpeechToTextGgml.ts +52 -18
  94. package/types/generators/SpeechToTextOnnx.ts +18 -11
  95. package/types/generators/SpeechToTextPlatform.ts +15 -7
  96. package/types/generators/SqLite.ts +20 -10
  97. package/types/generators/Step.ts +9 -5
  98. package/types/generators/SttAppleBuiltin.ts +22 -9
  99. package/types/generators/Tcp.ts +13 -9
  100. package/types/generators/TcpServer.ts +20 -14
  101. package/types/generators/TextToSpeechAppleBuiltin.ts +21 -8
  102. package/types/generators/TextToSpeechGgml.ts +29 -11
  103. package/types/generators/TextToSpeechOnnx.ts +19 -12
  104. package/types/generators/TextToSpeechOpenAiLike.ts +14 -8
  105. package/types/generators/ThermalPrinter.ts +13 -9
  106. package/types/generators/Tick.ts +11 -7
  107. package/types/generators/Udp.ts +17 -8
  108. package/types/generators/VadGgml.ts +51 -14
  109. package/types/generators/VadOnnx.ts +42 -12
  110. package/types/generators/VadTraditional.ts +28 -13
  111. package/types/generators/VectorStore.ts +33 -12
  112. package/types/generators/Watchdog.ts +19 -10
  113. package/types/generators/WebCrawler.ts +11 -7
  114. package/types/generators/WebRtc.ts +30 -16
  115. package/types/generators/WebSocket.ts +11 -7
  116. package/types/generators/index.ts +2 -0
  117. package/types/subspace.ts +3 -0
  118. package/types/system.ts +1 -1
  119. package/utils/calc.ts +12 -8
  120. package/utils/event-props.ts +833 -1022
  121. package/utils/id.ts +4 -0
  122. package/api/index.ts +0 -1
  123. package/api/instance.ts +0 -213
  124. package/types/generators/TextToSpeechApple.ts +0 -113
  125. package/types/generators/TtsAppleBuiltin.ts +0 -105
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Embedded HTTP/HTTPS server with route matching, CORS, auth (Basic/Bearer), SSE streaming, file upload, and async response mode
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Start HTTP server */
15
19
  export type GeneratorHTTPServerActionStart = Action & {
@@ -70,7 +74,7 @@ Default property:
70
74
  idleTimeout?: number | DataLink
71
75
  /* HTTP request body limit, 0 is unlimited */
72
76
  bodyLimit?: number | DataLink
73
- /* CORS allowed origins
77
+ /* CORS allowed origins
74
78
  You can use wildcard like `*`, `*.example.com`, `http://*.example.com` */
75
79
  corsOrigins?: Array<string | DataLink> | DataLink
76
80
  /* Authorization type of HTTP request */
@@ -81,15 +85,15 @@ Default property:
81
85
  basicAuthPassword?: string | DataLink
82
86
  /* Token of bearer auth */
83
87
  bearerToken?: string | DataLink
84
- /* Asynchronous response mode
88
+ /* Asynchronous response mode
85
89
  Will block connection until Response Body update. */
86
90
  asyncMode?: boolean | DataLink
87
- /* Save request body as file
91
+ /* Save request body as file
88
92
  Only work on `application/octet-stream` or `multipart/form-data`. */
89
93
  saveBodyAsFile?: boolean | DataLink
90
94
  /* Response status code */
91
95
  resStatusCode?: number | DataLink
92
- /* Response Content-Type
96
+ /* Response Content-Type
93
97
  `text/*` will not convert body.
94
98
  `application/xml` convert object to XML, [example object struct](https://github.com/davidcalhoun/jstoxml#example-10-podcast-rss-feed)
95
99
  `application/octet-stream` body should be Base64 string or file path. */
@@ -123,33 +127,37 @@ Default property:
123
127
  /* Event of HTTP server is ready */
124
128
  onReady?: Array<EventAction>
125
129
  /* Event of HTTP server accept the request */
126
- onRequest?: Array<EventAction>
130
+ onRequest?: Array<EventAction<string & keyof TemplateEventPropsMap['HttpServer']['onRequest']>>
127
131
  /* Event of client close connection */
128
- onClientClose?: Array<EventAction>
132
+ onClientClose?: Array<
133
+ EventAction<string & keyof TemplateEventPropsMap['HttpServer']['onClientClose']>
134
+ >
129
135
  /* Event of client error */
130
- onClientError?: Array<EventAction>
136
+ onClientError?: Array<
137
+ EventAction<string & keyof TemplateEventPropsMap['HttpServer']['onClientError']>
138
+ >
131
139
  /* Event of server close */
132
140
  onClose?: Array<EventAction>
133
141
  /* Event of server error */
134
- onError?: Array<EventAction>
142
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['HttpServer']['onError']>>
135
143
  }
136
144
  outlets?: {
137
145
  /* Server is listening */
138
- isListening?: () => Data
146
+ isListening?: () => Data<boolean>
139
147
  /* Query of request */
140
- requestQuery?: () => Data
148
+ requestQuery?: () => Data<{ [key: string]: any }>
141
149
  /* Body of request */
142
- requestBody?: () => Data
150
+ requestBody?: () => Data<any>
143
151
  /* Remote address of request */
144
- clientAddress?: () => Data
152
+ clientAddress?: () => Data<string>
145
153
  }
146
154
  }
147
155
 
148
- /* HTTP Server */
156
+ /* Embedded HTTP/HTTPS server with route matching, CORS, auth (Basic/Bearer), SSE streaming, file upload, and async response mode */
149
157
  export type GeneratorHTTPServer = Generator &
150
158
  GeneratorHTTPServerDef & {
151
159
  templateKey: 'GENERATOR_HTTP_SERVER'
152
- switches: Array<
160
+ switches?: Array<
153
161
  SwitchDef &
154
162
  GeneratorHTTPServerDef & {
155
163
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Display informational dialog or toast messages to the user
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Show information */
15
19
  export type GeneratorInformationActionShow = ActionWithParams & {
@@ -68,19 +72,19 @@ Default property:
68
72
  /* Trigger when user confirms the information */
69
73
  onConfirm?: Array<EventAction>
70
74
  /* Trigger when error occurs */
71
- onError?: Array<EventAction>
75
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Information']['onError']>>
72
76
  }
73
77
  outlets?: {
74
78
  /* Error message */
75
- errorMessage?: () => Data
79
+ errorMessage?: () => Data<string>
76
80
  }
77
81
  }
78
82
 
79
- /* Show information */
83
+ /* Display informational dialog or toast messages to the user */
80
84
  export type GeneratorInformation = Generator &
81
85
  GeneratorInformationDef & {
82
86
  templateKey: 'GENERATOR_INFORMATION'
83
- switches: Array<
87
+ switches?: Array<
84
88
  SwitchDef &
85
89
  GeneratorInformationDef & {
86
90
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Send intent to app and get result (Android only)
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Read stats */
15
19
  export type GeneratorIntentActionSendIntent = ActionWithParams & {
@@ -125,13 +129,19 @@ Default property:
125
129
  }
126
130
  events?: {
127
131
  /* On intent return a result trigger */
128
- onResult?: Array<EventAction>
132
+ onResult?: Array<EventAction<string & keyof TemplateEventPropsMap['Intent']['onResult']>>
129
133
  /* On intent error trigger */
130
- onError?: Array<EventAction>
134
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Intent']['onError']>>
131
135
  }
132
136
  outlets?: {
133
137
  /* Last intent result */
134
- result?: () => Data
138
+ result?: () => Data<{
139
+ action?: string
140
+ data?: string
141
+ type?: string
142
+ extras?: { [key: string]: any }
143
+ [key: string]: any
144
+ }>
135
145
  }
136
146
  }
137
147
 
@@ -139,7 +149,7 @@ Default property:
139
149
  export type GeneratorIntent = Generator &
140
150
  GeneratorIntentDef & {
141
151
  templateKey: 'GENERATOR_INTENT'
142
- switches: Array<
152
+ switches?: Array<
143
153
  SwitchDef &
144
154
  GeneratorIntentDef & {
145
155
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Iterate through values (Array, Object, Number, String)
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  /* Proceed to next iteration */
15
19
  export type GeneratorIteratorActionNext = Action & {
@@ -59,25 +63,25 @@ Default property:
59
63
  }
60
64
  events?: {
61
65
  /* Event triggered on each iteration */
62
- iterate?: Array<EventAction>
66
+ iterate?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['iterate']>>
63
67
  /* Event triggered on the first iteration of a round */
64
- first?: Array<EventAction>
68
+ first?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['first']>>
65
69
  /* Event triggered on the last iteration of a round */
66
- end?: Array<EventAction>
70
+ end?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['end']>>
67
71
  /* Event triggered when data type is invalid or unexpected */
68
- error?: Array<EventAction>
72
+ error?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['error']>>
69
73
  }
70
74
  outlets?: {
71
75
  /* Elements that have been iterated (including current one) */
72
- iteratedArray?: () => Data
76
+ iteratedArray?: () => Data<Array<any>>
73
77
  /* Elements that will be iterated but have not been iterated yet */
74
- upcomingArray?: () => Data
78
+ upcomingArray?: () => Data<Array<any>>
75
79
  /* Current iteration element */
76
- value?: () => Data
80
+ value?: () => Data<any>
77
81
  /* Key of the current iteration element (for number: same as value, for array/string: index, for object: string key) */
78
- key?: () => Data
82
+ key?: () => Data<any>
79
83
  /* Current iteration count (if data is 6 and step is 2, this will return: 1,2,3 in sequence) */
80
- index?: () => Data
84
+ index?: () => Data<number>
81
85
  }
82
86
  }
83
87
 
@@ -85,7 +89,7 @@ Default property:
85
89
  export type GeneratorIterator = Generator &
86
90
  GeneratorIteratorDef & {
87
91
  templateKey: 'GENERATOR_ITERATOR'
88
- switches: Array<
92
+ switches?: Array<
89
93
  SwitchDef &
90
94
  GeneratorIteratorDef & {
91
95
  conds?: Array<{
@@ -1,4 +1,7 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * Listen to keyboard and remote control key events (keyDown, keyUp)
4
+ */
2
5
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
6
  import type { Data, DataLink } from '../data'
4
7
  import type {
@@ -10,6 +13,7 @@ import type {
10
13
  Action,
11
14
  EventProperty,
12
15
  } from '../common'
16
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
17
 
14
18
  interface GeneratorKeyboardDef {
15
19
  /*
@@ -27,13 +31,13 @@ Default property:
27
31
  property?: {
28
32
  /* Enable listening for input */
29
33
  enabled?: boolean | DataLink
30
- /* Key map to transform key or key code to the designated content
34
+ /* Key map to transform key or key code to the designated content
31
35
  Example: { 37: 'left', 38: 'up', 39: 'right', 40: 'down', 'Enter': 'confirm' }
32
36
  Supports both key codes (numbers) and key names (strings) as keys */
33
37
  keyMap?: {} | DataLink
34
38
  /* Key outlet preference use key code or key. */
35
39
  keyOutletPrefer?: 'auto' | 'key-code' | 'key' | DataLink
36
- /* Key or code to finish batch input
40
+ /* Key or code to finish batch input
37
41
  Common values: 13 (Enter), 27 (Escape), 'Enter', 'Escape' */
38
42
  batchStopKeys?: Array<string | DataLink | number | DataLink | DataLink> | DataLink
39
43
  /* Debounce time (ms) to finish batch input */
@@ -43,31 +47,41 @@ Default property:
43
47
  }
44
48
  events?: {
45
49
  /* Event on key press */
46
- onDown?: Array<EventAction>
50
+ onDown?: Array<EventAction<string & keyof TemplateEventPropsMap['Keyboard']['onDown']>>
47
51
  /* Event on key up */
48
- onUp?: Array<EventAction>
52
+ onUp?: Array<EventAction<string & keyof TemplateEventPropsMap['Keyboard']['onUp']>>
49
53
  /* Event on batch input complete */
50
- onBatch?: Array<EventAction>
54
+ onBatch?: Array<EventAction<string & keyof TemplateEventPropsMap['Keyboard']['onBatch']>>
51
55
  }
52
56
  outlets?: {
53
57
  /* Last key code pressed */
54
- lastKeyDown?: () => Data
58
+ lastKeyDown?: () => Data<string | number>
55
59
  /* Modifier key information on last key press */
56
- lastKeyDownFlags?: () => Data
60
+ lastKeyDownFlags?: () => Data<{ [key: string]: any }>
57
61
  /* Last key code released */
58
- lastKeyUp?: () => Data
62
+ lastKeyUp?: () => Data<string | number>
59
63
  /* Modifier key information on last key release */
60
- lastKeyUpFlags?: () => Data
64
+ lastKeyUpFlags?: () => Data<{ [key: string]: any }>
61
65
  /* Last batch event */
62
- lastBatchEvents?: () => Data
66
+ lastBatchEvents?: () => Data<
67
+ Array<{
68
+ event?: string
69
+ key?: any
70
+ keyNoMapping?: any
71
+ keyCode?: any
72
+ keyCodeNoMapping?: any
73
+ flags?: { [key: string]: any }
74
+ [key: string]: any
75
+ }>
76
+ >
63
77
  }
64
78
  }
65
79
 
66
- /* Access keyboard (remote control) events */
80
+ /* Listen to keyboard and remote control key events (keyDown, keyUp) */
67
81
  export type GeneratorKeyboard = Generator &
68
82
  GeneratorKeyboardDef & {
69
83
  templateKey: 'GENERATOR_KEYBOARD'
70
- switches: Array<
84
+ switches?: Array<
71
85
  SwitchDef &
72
86
  GeneratorKeyboardDef & {
73
87
  conds?: Array<{
@@ -1,4 +1,13 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * LLM inference using Anthropic-compatible API endpoints
4
+ *
5
+ * ## Features
6
+ * - Compatible with Anthropic API format
7
+ * - Supports function calling (tools)
8
+ * - Streaming responses
9
+ * - Custom API endpoints (Default to https://api.anthropic.com/v1/messages)
10
+ */
2
11
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
12
  import type { Data, DataLink } from '../data'
4
13
  import type {
@@ -10,6 +19,7 @@ import type {
10
19
  Action,
11
20
  EventProperty,
12
21
  } from '../common'
22
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
23
 
14
24
  /* Run text completion */
15
25
  export type GeneratorAnthropicLLMActionCompletion = ActionWithParams & {
@@ -119,7 +129,7 @@ Default property:
119
129
  }
120
130
  >
121
131
  | DataLink
122
- /* Tools for function calling following Anthropic format
132
+ /* Tools for function calling following Anthropic format
123
133
  Format: Array of objects with {name, description, input_schema} structure
124
134
  See: https://docs.anthropic.com/en/docs/tool-use */
125
135
  completionTools?: Array<{} | DataLink> | DataLink
@@ -143,25 +153,37 @@ Default property:
143
153
  }
144
154
  events?: {
145
155
  /* Error event */
146
- onError?: Array<EventAction>
156
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onError']>>
147
157
  /* Completion event */
148
- onCompletion?: Array<EventAction>
158
+ onCompletion?: Array<
159
+ EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onCompletion']>
160
+ >
149
161
  /* Completion finished event */
150
- onCompletionFinished?: Array<EventAction>
162
+ onCompletionFinished?: Array<
163
+ EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onCompletionFinished']>
164
+ >
151
165
  /* Tool use event */
152
- onToolUse?: Array<EventAction>
166
+ onToolUse?: Array<
167
+ EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onToolUse']>
168
+ >
153
169
  }
154
170
  outlets?: {
155
171
  /* Evaluating outlet */
156
- isEvaluating?: () => Data
172
+ isEvaluating?: () => Data<boolean>
157
173
  /* Completion result outlet */
158
- completionResult?: () => Data
174
+ completionResult?: () => Data<string>
159
175
  /* Completion details outlet */
160
- completionDetails?: () => Data
176
+ completionDetails?: () => Data<{
177
+ model?: string
178
+ stop_reason?: string
179
+ usage?: { [key: string]: any }
180
+ content?: Array<any>
181
+ [key: string]: any
182
+ }>
161
183
  }
162
184
  }
163
185
 
164
- /* LLM inference using Anthropic-compatible API endpoints
186
+ /* LLM inference using Anthropic-compatible API endpoints
165
187
 
166
188
  ## Features
167
189
  - Compatible with Anthropic API format
@@ -171,7 +193,7 @@ Default property:
171
193
  export type GeneratorAnthropicLLM = Generator &
172
194
  GeneratorAnthropicLLMDef & {
173
195
  templateKey: 'GENERATOR_ANTHROPIC_LLM'
174
- switches: Array<
196
+ switches?: Array<
175
197
  SwitchDef &
176
198
  GeneratorAnthropicLLMDef & {
177
199
  conds?: Array<{
@@ -1,4 +1,14 @@
1
- /* Auto generated by build script */
1
+ /* Auto generated by build script
2
+ *
3
+ * LLM inference using Apple Intelligence on iOS/tvOS 26+
4
+ *
5
+ * ## Features
6
+ * - Native Apple Intelligence integration
7
+ * - No model download required
8
+ * - Privacy-focused on-device processing
9
+ * - Optimized for Apple Silicon
10
+ * - Requires iOS 26+ or tvOS 26+
11
+ */
2
12
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
13
  import type { Data, DataLink } from '../data'
4
14
  import type {
@@ -10,6 +20,7 @@ import type {
10
20
  Action,
11
21
  EventProperty,
12
22
  } from '../common'
23
+ import type { TemplateEventPropsMap } from '../../utils/event-props'
13
24
 
14
25
  /* Load model */
15
26
  export type GeneratorAppleLLMActionLoadModel = Action & {
@@ -90,27 +101,31 @@ Default property:
90
101
  }
91
102
  events?: {
92
103
  /* Error event */
93
- onError?: Array<EventAction>
104
+ onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AppleLlm']['onError']>>
94
105
  /* Model loaded event */
95
106
  onModelLoaded?: Array<EventAction>
96
107
  /* Completion event */
97
- onCompletion?: Array<EventAction>
108
+ onCompletion?: Array<
109
+ EventAction<string & keyof TemplateEventPropsMap['AppleLlm']['onCompletion']>
110
+ >
98
111
  /* Completion finished event */
99
- onCompletionFinished?: Array<EventAction>
112
+ onCompletionFinished?: Array<
113
+ EventAction<string & keyof TemplateEventPropsMap['AppleLlm']['onCompletionFinished']>
114
+ >
100
115
  }
101
116
  outlets?: {
102
117
  /* Context state outlet */
103
- contextState?: () => Data
118
+ contextState?: () => Data<string>
104
119
  /* Evaluating outlet */
105
- isEvaluating?: () => Data
120
+ isEvaluating?: () => Data<boolean>
106
121
  /* Completion result outlet */
107
- completionResult?: () => Data
122
+ completionResult?: () => Data<string>
108
123
  /* Last token outlet */
109
- completionLastToken?: () => Data
124
+ completionLastToken?: () => Data<string>
110
125
  }
111
126
  }
112
127
 
113
- /* LLM inference using Apple Intelligence on iOS/tvOS 26+
128
+ /* LLM inference using Apple Intelligence on iOS/tvOS 26+
114
129
 
115
130
  ## Features
116
131
  - Native Apple Intelligence integration
@@ -121,7 +136,7 @@ Default property:
121
136
  export type GeneratorAppleLLM = Generator &
122
137
  GeneratorAppleLLMDef & {
123
138
  templateKey: 'GENERATOR_APPLE_LLM'
124
- switches: Array<
139
+ switches?: Array<
125
140
  SwitchDef &
126
141
  GeneratorAppleLLMDef & {
127
142
  conds?: Array<{