@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,168 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Send intent to app and get result (Android only)
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
- /* Read stats */
19
- export type GeneratorIntentActionSendIntent = ActionWithParams & {
20
- __actionName: 'GENERATOR_INTENT_SEND_INTENT'
21
- params?: Array<
22
- | {
23
- input: 'action'
24
- value?: string | DataLink | EventProperty
25
- mapping?: string
26
- }
27
- | {
28
- input: 'data'
29
- value?: string | DataLink | EventProperty
30
- mapping?: string
31
- }
32
- | {
33
- input: 'type'
34
- value?: string | DataLink | EventProperty
35
- mapping?: string
36
- }
37
- | {
38
- input: 'extra'
39
- value?: {} | DataLink | EventProperty
40
- mapping?: string
41
- }
42
- | {
43
- input: 'className'
44
- value?: string | DataLink | EventProperty
45
- mapping?: string
46
- }
47
- | {
48
- input: 'packageName'
49
- value?: string | DataLink | EventProperty
50
- mapping?: string
51
- }
52
- | {
53
- input: 'category'
54
- value?: string | DataLink | EventProperty
55
- mapping?: string
56
- }
57
- >
58
- }
59
-
60
- /* Start intent service */
61
- export type GeneratorIntentActionStartService = ActionWithParams & {
62
- __actionName: 'GENERATOR_INTENT_START_SERVICE'
63
- params?: Array<
64
- | {
65
- input: 'action'
66
- value?: string | DataLink | EventProperty
67
- mapping?: string
68
- }
69
- | {
70
- input: 'data'
71
- value?: string | DataLink | EventProperty
72
- mapping?: string
73
- }
74
- | {
75
- input: 'type'
76
- value?: string | DataLink | EventProperty
77
- mapping?: string
78
- }
79
- | {
80
- input: 'extra'
81
- value?: {} | DataLink | EventProperty
82
- mapping?: string
83
- }
84
- | {
85
- input: 'className'
86
- value?: string | DataLink | EventProperty
87
- mapping?: string
88
- }
89
- | {
90
- input: 'packageName'
91
- value?: string | DataLink | EventProperty
92
- mapping?: string
93
- }
94
- | {
95
- input: 'category'
96
- value?: string | DataLink | EventProperty
97
- mapping?: string
98
- }
99
- | {
100
- input: 'foreground'
101
- value?: boolean | DataLink | EventProperty
102
- mapping?: string
103
- }
104
- >
105
- }
106
-
107
- interface GeneratorIntentDef {
108
- /*
109
- Default property:
110
- {}
111
- */
112
- property?: {
113
- /* Intent action */
114
- action?: string | DataLink
115
- /* Intent data */
116
- data?: string | DataLink
117
- /* Intent type */
118
- type?: string | DataLink
119
- /* Extra data */
120
- extra?: {} | DataLink
121
- /* Intent target class name in package */
122
- className?: string | DataLink
123
- /* Intent target package name */
124
- packageName?: string | DataLink
125
- /* Intent category */
126
- category?: string | DataLink
127
- /* Intent start foreground service */
128
- foregroundService?: boolean | DataLink
129
- }
130
- events?: {
131
- /* On intent return a result trigger */
132
- onResult?: Array<EventAction<string & keyof TemplateEventPropsMap['Intent']['onResult']>>
133
- /* On intent error trigger */
134
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Intent']['onError']>>
135
- }
136
- outlets?: {
137
- /* Last intent result */
138
- result?: () => Data<{
139
- action?: string
140
- data?: string
141
- type?: string
142
- extras?: { [key: string]: any }
143
- [key: string]: any
144
- }>
145
- }
146
- }
147
-
148
- /* Send intent to app and get result (Android only) */
149
- export type GeneratorIntent = Generator &
150
- GeneratorIntentDef & {
151
- templateKey: 'GENERATOR_INTENT'
152
- switches?: Array<
153
- SwitchDef &
154
- GeneratorIntentDef & {
155
- conds?: Array<{
156
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
157
- cond:
158
- | SwitchCondInnerStateCurrentCanvas
159
- | SwitchCondData
160
- | {
161
- __typename: 'SwitchCondInnerStateOutlet'
162
- outlet: 'result'
163
- value: any
164
- }
165
- }>
166
- }
167
- >
168
- }
@@ -1,108 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Iterate through values (Array, Object, Number, String)
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
- /* Proceed to next iteration */
19
- export type GeneratorIteratorActionNext = Action & {
20
- __actionName: 'GENERATOR_ITERATOR_NEXT'
21
- }
22
-
23
- /* Go back to previous iteration */
24
- export type GeneratorIteratorActionPrevious = Action & {
25
- __actionName: 'GENERATOR_ITERATOR_PREVIOUS'
26
- }
27
-
28
- /* Jump to the first iteration element */
29
- export type GeneratorIteratorActionFirst = Action & {
30
- __actionName: 'GENERATOR_ITERATOR_FIRST'
31
- }
32
-
33
- /* Jump to the last iteration element (ignoring the loop setting) */
34
- export type GeneratorIteratorActionLast = Action & {
35
- __actionName: 'GENERATOR_ITERATOR_LAST'
36
- }
37
-
38
- /* Reset iteration state */
39
- export type GeneratorIteratorActionReset = Action & {
40
- __actionName: 'GENERATOR_ITERATOR_RESET'
41
- }
42
-
43
- interface GeneratorIteratorDef {
44
- /*
45
- Default property:
46
- {
47
- "data": [],
48
- "start": 0,
49
- "step": 1
50
- }
51
- */
52
- property?: {
53
- /* Data source for iteration. If it's an Array, it will iterate through elements. If it's an Object, it will use Object.entries() to get key-value pairs. If it's a String, it will iterate through characters. If it's a Number, it represents count from 1 to N. */
54
- data?: any
55
- /* Starting element position */
56
- start?: number | DataLink
57
- /* Step size for each iteration */
58
- step?: number | DataLink
59
- /* Maximum number of iterations (can be set to -1 for unlimited). When reached, further iteration actions will be silently ignored. */
60
- maxQuantity?: number | DataLink
61
- /* Whether to loop the iteration */
62
- loop?: boolean | DataLink
63
- }
64
- events?: {
65
- /* Event triggered on each iteration */
66
- iterate?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['iterate']>>
67
- /* Event triggered on the first iteration of a round */
68
- first?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['first']>>
69
- /* Event triggered on the last iteration of a round */
70
- end?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['end']>>
71
- /* Event triggered when data type is invalid or unexpected */
72
- error?: Array<EventAction<string & keyof TemplateEventPropsMap['Iterator']['error']>>
73
- }
74
- outlets?: {
75
- /* Elements that have been iterated (including current one) */
76
- iteratedArray?: () => Data<Array<any>>
77
- /* Elements that will be iterated but have not been iterated yet */
78
- upcomingArray?: () => Data<Array<any>>
79
- /* Current iteration element */
80
- value?: () => Data<any>
81
- /* Key of the current iteration element (for number: same as value, for array/string: index, for object: string key) */
82
- key?: () => Data<any>
83
- /* Current iteration count (if data is 6 and step is 2, this will return: 1,2,3 in sequence) */
84
- index?: () => Data<number>
85
- }
86
- }
87
-
88
- /* Iterate through values (Array, Object, Number, String) */
89
- export type GeneratorIterator = Generator &
90
- GeneratorIteratorDef & {
91
- templateKey: 'GENERATOR_ITERATOR'
92
- switches?: Array<
93
- SwitchDef &
94
- GeneratorIteratorDef & {
95
- conds?: Array<{
96
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
97
- cond:
98
- | SwitchCondInnerStateCurrentCanvas
99
- | SwitchCondData
100
- | {
101
- __typename: 'SwitchCondInnerStateOutlet'
102
- outlet: 'iteratedArray' | 'upcomingArray' | 'value' | 'key' | 'index'
103
- value: any
104
- }
105
- }>
106
- }
107
- >
108
- }
@@ -1,105 +0,0 @@
1
- /* Auto generated by build script
2
- *
3
- * Listen to keyboard and remote control key events (keyDown, keyUp)
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
- interface GeneratorKeyboardDef {
19
- /*
20
- Default property:
21
- {
22
- "enabled": true,
23
- "keyMap": {},
24
- "keyOutletPrefer": "auto",
25
- "batchStopKeys": [
26
- 13
27
- ],
28
- "batchDebounce": 500
29
- }
30
- */
31
- property?: {
32
- /* Enable listening for input */
33
- enabled?: boolean | DataLink
34
- /* Key map to transform key or key code to the designated content
35
- Example: { 37: 'left', 38: 'up', 39: 'right', 40: 'down', 'Enter': 'confirm' }
36
- Supports both key codes (numbers) and key names (strings) as keys */
37
- keyMap?: {} | DataLink
38
- /* Key outlet preference use key code or key. */
39
- keyOutletPrefer?: 'auto' | 'key-code' | 'key' | DataLink
40
- /* Key or code to finish batch input
41
- Common values: 13 (Enter), 27 (Escape), 'Enter', 'Escape' */
42
- batchStopKeys?: Array<string | DataLink | number | DataLink | DataLink> | DataLink
43
- /* Debounce time (ms) to finish batch input */
44
- batchDebounce?: number | DataLink
45
- /* Maximum wait time (ms) to finish batch input (default: unlimited) */
46
- batchDebounceMaxWait?: number | DataLink
47
- }
48
- events?: {
49
- /* Event on key press */
50
- onDown?: Array<EventAction<string & keyof TemplateEventPropsMap['Keyboard']['onDown']>>
51
- /* Event on key up */
52
- onUp?: Array<EventAction<string & keyof TemplateEventPropsMap['Keyboard']['onUp']>>
53
- /* Event on batch input complete */
54
- onBatch?: Array<EventAction<string & keyof TemplateEventPropsMap['Keyboard']['onBatch']>>
55
- }
56
- outlets?: {
57
- /* Last key code pressed */
58
- lastKeyDown?: () => Data<string | number>
59
- /* Modifier key information on last key press */
60
- lastKeyDownFlags?: () => Data<{ [key: string]: any }>
61
- /* Last key code released */
62
- lastKeyUp?: () => Data<string | number>
63
- /* Modifier key information on last key release */
64
- lastKeyUpFlags?: () => Data<{ [key: string]: any }>
65
- /* Last batch event */
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
- >
77
- }
78
- }
79
-
80
- /* Listen to keyboard and remote control key events (keyDown, keyUp) */
81
- export type GeneratorKeyboard = Generator &
82
- GeneratorKeyboardDef & {
83
- templateKey: 'GENERATOR_KEYBOARD'
84
- switches?: Array<
85
- SwitchDef &
86
- GeneratorKeyboardDef & {
87
- conds?: Array<{
88
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
89
- cond:
90
- | SwitchCondInnerStateCurrentCanvas
91
- | SwitchCondData
92
- | {
93
- __typename: 'SwitchCondInnerStateOutlet'
94
- outlet:
95
- | 'lastKeyDown'
96
- | 'lastKeyDownFlags'
97
- | 'lastKeyUp'
98
- | 'lastKeyUpFlags'
99
- | 'lastBatchEvents'
100
- value: any
101
- }
102
- }>
103
- }
104
- >
105
- }
@@ -1,212 +0,0 @@
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
- */
11
- import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
12
- import type { Data, DataLink } from '../data'
13
- import type {
14
- Brick,
15
- Generator,
16
- EventAction,
17
- ActionWithDataParams,
18
- ActionWithParams,
19
- Action,
20
- EventProperty,
21
- } from '../common'
22
- import type { TemplateEventPropsMap } from '../../utils/event-props'
23
-
24
- /* Run text completion */
25
- export type GeneratorAnthropicLLMActionCompletion = ActionWithParams & {
26
- __actionName: 'GENERATOR_ANTHROPIC_LLM_COMPLETION'
27
- params?: Array<
28
- | {
29
- input: 'systemMessage'
30
- value?: string | DataLink | EventProperty
31
- mapping?: string
32
- }
33
- | {
34
- input: 'messages'
35
- value?: Array<any> | DataLink | EventProperty
36
- mapping?: string
37
- }
38
- | {
39
- input: 'maxTokens'
40
- value?: number | DataLink | EventProperty
41
- mapping?: string
42
- }
43
- | {
44
- input: 'temperature'
45
- value?: number | DataLink | EventProperty
46
- mapping?: string
47
- }
48
- | {
49
- input: 'topP'
50
- value?: number | DataLink | EventProperty
51
- mapping?: string
52
- }
53
- | {
54
- input: 'topK'
55
- value?: number | DataLink | EventProperty
56
- mapping?: string
57
- }
58
- | {
59
- input: 'stopSequences'
60
- value?: Array<any> | DataLink | EventProperty
61
- mapping?: string
62
- }
63
- | {
64
- input: 'tools'
65
- value?: Array<any> | DataLink | EventProperty
66
- mapping?: string
67
- }
68
- | {
69
- input: 'toolChoice'
70
- value?: {} | DataLink | EventProperty
71
- mapping?: string
72
- }
73
- >
74
- }
75
-
76
- /* Stop text completion */
77
- export type GeneratorAnthropicLLMActionStopCompletion = Action & {
78
- __actionName: 'GENERATOR_ANTHROPIC_LLM_STOP_COMPLETION'
79
- }
80
-
81
- interface GeneratorAnthropicLLMDef {
82
- /*
83
- Default property:
84
- {
85
- "apiEndpoint": "https://api.anthropic.com/v1/messages",
86
- "model": "claude-3-5-sonnet-20241022",
87
- "systemMessage": "You are a helpful assistant.",
88
- "completionMessages": [],
89
- "completionMaxTokens": 1024,
90
- "completionTemperature": 1,
91
- "completionTopP": 1,
92
- "completionStopSequences": []
93
- }
94
- */
95
- property?: {
96
- /* API endpoint URL */
97
- apiEndpoint?: string | DataLink
98
- /* API key */
99
- apiKey?: string | DataLink
100
- /* Model name (Default: claude-3-5-sonnet-20241022) */
101
- model?: string | DataLink
102
- /* System message content */
103
- systemMessage?: string | DataLink
104
- /* Chat messages (user/assistant only) */
105
- completionMessages?:
106
- | Array<
107
- | DataLink
108
- | {
109
- role?: 'user' | 'assistant' | DataLink
110
- content?:
111
- | string
112
- | DataLink
113
- | Array<
114
- | DataLink
115
- | {
116
- type?: 'text' | 'image' | DataLink
117
- text?: string | DataLink
118
- source?:
119
- | DataLink
120
- | {
121
- type?: string | DataLink
122
- media_type?: string | DataLink
123
- data?: string | DataLink
124
- }
125
- }
126
- >
127
- | DataLink
128
- | DataLink
129
- }
130
- >
131
- | DataLink
132
- /* Tools for function calling following Anthropic format
133
- Format: Array of objects with {name, description, input_schema} structure
134
- See: https://docs.anthropic.com/en/docs/tool-use */
135
- completionTools?: Array<{} | DataLink> | DataLink
136
- /* Tool choice for function calling */
137
- completionToolChoice?:
138
- | DataLink
139
- | {
140
- type?: 'auto' | 'any' | 'tool' | DataLink
141
- name?: string | DataLink
142
- }
143
- /* Maximum tokens to generate */
144
- completionMaxTokens?: number | DataLink
145
- /* Temperature */
146
- completionTemperature?: number | DataLink
147
- /* Top P sampling */
148
- completionTopP?: number | DataLink
149
- /* Top K sampling */
150
- completionTopK?: number | DataLink
151
- /* Stop sequences */
152
- completionStopSequences?: Array<string | DataLink> | DataLink
153
- }
154
- events?: {
155
- /* Error event */
156
- onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onError']>>
157
- /* Completion event */
158
- onCompletion?: Array<
159
- EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onCompletion']>
160
- >
161
- /* Completion finished event */
162
- onCompletionFinished?: Array<
163
- EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onCompletionFinished']>
164
- >
165
- /* Tool use event */
166
- onToolUse?: Array<
167
- EventAction<string & keyof TemplateEventPropsMap['AnthropicLlm']['onToolUse']>
168
- >
169
- }
170
- outlets?: {
171
- /* Evaluating outlet */
172
- isEvaluating?: () => Data<boolean>
173
- /* Completion result outlet */
174
- completionResult?: () => Data<string>
175
- /* Completion details outlet */
176
- completionDetails?: () => Data<{
177
- model?: string
178
- stop_reason?: string
179
- usage?: { [key: string]: any }
180
- content?: Array<any>
181
- [key: string]: any
182
- }>
183
- }
184
- }
185
-
186
- /* LLM inference using Anthropic-compatible API endpoints
187
-
188
- ## Features
189
- - Compatible with Anthropic API format
190
- - Supports function calling (tools)
191
- - Streaming responses
192
- - Custom API endpoints (Default to https://api.anthropic.com/v1/messages) */
193
- export type GeneratorAnthropicLLM = Generator &
194
- GeneratorAnthropicLLMDef & {
195
- templateKey: 'GENERATOR_ANTHROPIC_LLM'
196
- switches?: Array<
197
- SwitchDef &
198
- GeneratorAnthropicLLMDef & {
199
- conds?: Array<{
200
- method: '==' | '!=' | '>' | '<' | '>=' | '<='
201
- cond:
202
- | SwitchCondInnerStateCurrentCanvas
203
- | SwitchCondData
204
- | {
205
- __typename: 'SwitchCondInnerStateOutlet'
206
- outlet: 'isEvaluating' | 'completionResult' | 'completionDetails'
207
- value: any
208
- }
209
- }>
210
- }
211
- >
212
- }