@fugood/bricks-project 2.23.0-beta.24 → 2.23.0-beta.26

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 (91) hide show
  1. package/compile/action-name-map.ts +25 -0
  2. package/compile/index.ts +52 -60
  3. package/package.json +4 -4
  4. package/tools/mcp-server.ts +3 -3
  5. package/tools/postinstall.ts +2 -5
  6. package/tools/preview.ts +1 -1
  7. package/tools/pull.ts +1 -1
  8. package/types/brick-base.ts +1 -0
  9. package/types/bricks/Camera.ts +1 -0
  10. package/types/bricks/Chart.ts +1 -0
  11. package/types/bricks/GenerativeMedia.ts +1 -0
  12. package/types/bricks/Icon.ts +1 -0
  13. package/types/bricks/Image.ts +1 -0
  14. package/types/bricks/Items.ts +1 -0
  15. package/types/bricks/Lottie.ts +1 -0
  16. package/types/bricks/QrCode.ts +1 -0
  17. package/types/bricks/Rect.ts +1 -0
  18. package/types/bricks/RichText.ts +1 -0
  19. package/types/bricks/Rive.ts +1 -0
  20. package/types/bricks/Slideshow.ts +1 -0
  21. package/types/bricks/Svg.ts +1 -0
  22. package/types/bricks/Text.ts +1 -0
  23. package/types/bricks/TextInput.ts +1 -0
  24. package/types/bricks/Video.ts +1 -0
  25. package/types/bricks/VideoStreaming.ts +1 -0
  26. package/types/bricks/WebRtcStream.ts +1 -0
  27. package/types/bricks/WebView.ts +1 -0
  28. package/types/bricks/index.ts +1 -0
  29. package/types/canvas.ts +1 -0
  30. package/types/data-calc.ts +1 -0
  31. package/types/data.ts +1 -0
  32. package/types/generators/AlarmClock.ts +1 -0
  33. package/types/generators/Assistant.ts +1 -0
  34. package/types/generators/BleCentral.ts +1 -0
  35. package/types/generators/BlePeripheral.ts +1 -0
  36. package/types/generators/CanvasMap.ts +1 -0
  37. package/types/generators/CastlesPay.ts +1 -0
  38. package/types/generators/DataBank.ts +1 -0
  39. package/types/generators/File.ts +1 -0
  40. package/types/generators/GraphQl.ts +1 -0
  41. package/types/generators/Http.ts +1 -0
  42. package/types/generators/HttpServer.ts +1 -0
  43. package/types/generators/Information.ts +1 -0
  44. package/types/generators/Intent.ts +1 -0
  45. package/types/generators/Iterator.ts +1 -0
  46. package/types/generators/Keyboard.ts +1 -0
  47. package/types/generators/LlmAnthropicCompat.ts +1 -0
  48. package/types/generators/LlmAppleBuiltin.ts +143 -0
  49. package/types/generators/LlmGgml.ts +1 -0
  50. package/types/generators/LlmOnnx.ts +1 -0
  51. package/types/generators/LlmOpenAiCompat.ts +1 -0
  52. package/types/generators/LlmQualcommAiEngine.ts +1 -0
  53. package/types/generators/Mcp.ts +1 -0
  54. package/types/generators/McpServer.ts +1 -0
  55. package/types/generators/MediaFlow.ts +1 -0
  56. package/types/generators/MqttBroker.ts +1 -0
  57. package/types/generators/MqttClient.ts +1 -0
  58. package/types/generators/Question.ts +1 -0
  59. package/types/generators/RealtimeTranscription.ts +1 -0
  60. package/types/generators/RerankerGgml.ts +1 -0
  61. package/types/generators/SerialPort.ts +1 -0
  62. package/types/generators/SoundPlayer.ts +1 -0
  63. package/types/generators/SoundRecorder.ts +1 -0
  64. package/types/generators/SpeechToTextGgml.ts +1 -0
  65. package/types/generators/SpeechToTextOnnx.ts +1 -0
  66. package/types/generators/SpeechToTextPlatform.ts +1 -0
  67. package/types/generators/SqLite.ts +1 -0
  68. package/types/generators/Step.ts +1 -0
  69. package/types/generators/SttAppleBuiltin.ts +116 -0
  70. package/types/generators/Tcp.ts +1 -0
  71. package/types/generators/TcpServer.ts +1 -0
  72. package/types/generators/TextToSpeechApple.ts +113 -0
  73. package/types/generators/TextToSpeechAppleBuiltin.ts +113 -0
  74. package/types/generators/TextToSpeechGgml.ts +1 -0
  75. package/types/generators/TextToSpeechOnnx.ts +1 -0
  76. package/types/generators/TextToSpeechOpenAiLike.ts +1 -0
  77. package/types/generators/ThermalPrinter.ts +1 -0
  78. package/types/generators/Tick.ts +1 -0
  79. package/types/generators/TtsAppleBuiltin.ts +105 -0
  80. package/types/generators/Udp.ts +1 -0
  81. package/types/generators/VadGgml.ts +1 -0
  82. package/types/generators/VectorStore.ts +1 -0
  83. package/types/generators/Watchdog.ts +1 -0
  84. package/types/generators/WebCrawler.ts +1 -0
  85. package/types/generators/WebRtc.ts +1 -0
  86. package/types/generators/WebSocket.ts +1 -0
  87. package/types/generators/index.ts +3 -0
  88. package/types/system.ts +1 -0
  89. package/utils/data.ts +1 -0
  90. package/utils/event-props.ts +33 -0
  91. package/utils/id.ts +3 -1
@@ -0,0 +1,143 @@
1
+ /* Auto generated by build script */
2
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
+ import type { Data, DataLink } from '../data'
4
+ import type {
5
+ Generator,
6
+ EventAction,
7
+ ActionWithDataParams,
8
+ ActionWithParams,
9
+ Action,
10
+ EventProperty,
11
+ } from '../common'
12
+
13
+ /* Load model */
14
+ export type GeneratorAppleLLMActionLoadModel = Action & {
15
+ __actionName: 'GENERATOR_APPLE_LLM_LOAD_MODEL'
16
+ }
17
+
18
+ /* Run text completion */
19
+ export type GeneratorAppleLLMActionCompletion = ActionWithParams & {
20
+ __actionName: 'GENERATOR_APPLE_LLM_COMPLETION'
21
+ params?: Array<
22
+ | {
23
+ input: 'messages'
24
+ value?: Array<any> | DataLink | EventProperty
25
+ mapping?: string
26
+ }
27
+ | {
28
+ input: 'maxTokens'
29
+ value?: number | DataLink | EventProperty
30
+ mapping?: string
31
+ }
32
+ | {
33
+ input: 'temperature'
34
+ value?: number | DataLink | EventProperty
35
+ mapping?: string
36
+ }
37
+ | {
38
+ input: 'topP'
39
+ value?: number | DataLink | EventProperty
40
+ mapping?: string
41
+ }
42
+ >
43
+ }
44
+
45
+ /* Stop text completion */
46
+ export type GeneratorAppleLLMActionStopCompletion = Action & {
47
+ __actionName: 'GENERATOR_APPLE_LLM_STOP_COMPLETION'
48
+ }
49
+
50
+ interface GeneratorAppleLLMDef {
51
+ /*
52
+ Default property:
53
+ {
54
+ "init": false,
55
+ "completionMessages": [
56
+ {
57
+ "role": "system",
58
+ "content": "You are a helpful assistant."
59
+ },
60
+ {
61
+ "role": "user",
62
+ "content": "Hello"
63
+ }
64
+ ],
65
+ "completionMaxTokens": 1024,
66
+ "completionTemperature": 0.7,
67
+ "completionTopP": 0.9
68
+ }
69
+ */
70
+ property?: {
71
+ /* Initialize model on generator init */
72
+ init?: boolean | DataLink
73
+ /* Chat messages (if first message has role 'system', it will be used as system prompt) */
74
+ completionMessages?:
75
+ | Array<
76
+ | DataLink
77
+ | {
78
+ role?: string | DataLink
79
+ content?: string | DataLink
80
+ }
81
+ >
82
+ | DataLink
83
+ /* Maximum tokens to generate */
84
+ completionMaxTokens?: number | DataLink
85
+ /* Temperature (0.0 to 1.0) */
86
+ completionTemperature?: number | DataLink
87
+ /* Top P sampling */
88
+ completionTopP?: number | DataLink
89
+ }
90
+ events?: {
91
+ /* Error event */
92
+ onError?: Array<EventAction>
93
+ /* Model loaded event */
94
+ onModelLoaded?: Array<EventAction>
95
+ /* Completion event */
96
+ onCompletion?: Array<EventAction>
97
+ /* Completion finished event */
98
+ onCompletionFinished?: Array<EventAction>
99
+ }
100
+ outlets?: {
101
+ /* Context state outlet */
102
+ contextState?: () => Data
103
+ /* Evaluating outlet */
104
+ isEvaluating?: () => Data
105
+ /* Completion result outlet */
106
+ completionResult?: () => Data
107
+ /* Last token outlet */
108
+ completionLastToken?: () => Data
109
+ }
110
+ }
111
+
112
+ /* LLM inference using Apple Intelligence on iOS/tvOS 26+
113
+
114
+ ## Features
115
+ - Native Apple Intelligence integration
116
+ - No model download required
117
+ - Privacy-focused on-device processing
118
+ - Optimized for Apple Silicon
119
+ - Requires iOS 26+ or tvOS 26+ */
120
+ export type GeneratorAppleLLM = Generator &
121
+ GeneratorAppleLLMDef & {
122
+ templateKey: 'GENERATOR_APPLE_LLM'
123
+ switches: Array<
124
+ SwitchDef &
125
+ GeneratorAppleLLMDef & {
126
+ conds?: Array<{
127
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
128
+ cond:
129
+ | SwitchCondInnerStateCurrentCanvas
130
+ | SwitchCondData
131
+ | {
132
+ __typename: 'SwitchCondInnerStateOutlet'
133
+ outlet:
134
+ | 'contextState'
135
+ | 'isEvaluating'
136
+ | 'completionResult'
137
+ | 'completionLastToken'
138
+ value: any
139
+ }
140
+ }>
141
+ }
142
+ >
143
+ }
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -0,0 +1,116 @@
1
+ /* Auto generated by build script */
2
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
+ import type { Data, DataLink } from '../data'
4
+ import type {
5
+ Generator,
6
+ EventAction,
7
+ ActionWithDataParams,
8
+ ActionWithParams,
9
+ Action,
10
+ EventProperty,
11
+ } from '../common'
12
+
13
+ /* Initialize STT */
14
+ export type GeneratorAppleSTTActionInit = Action & {
15
+ __actionName: 'GENERATOR_APPLE_STT_INIT'
16
+ }
17
+
18
+ /* Transcribe audio file. You can provide `File URL` property, if not provided, it will use the default `File URL` */
19
+ export type GeneratorAppleSTTActionTranscribeFile = ActionWithParams & {
20
+ __actionName: 'GENERATOR_APPLE_STT_TRANSCRIBE_FILE'
21
+ params?: Array<
22
+ | {
23
+ input: 'fileUrl'
24
+ value?: string | DataLink | EventProperty
25
+ mapping?: string
26
+ }
27
+ | {
28
+ input: 'language'
29
+ value?: string | DataLink | EventProperty
30
+ mapping?: string
31
+ }
32
+ >
33
+ }
34
+
35
+ /* Transcribe audio data (base64 encoded audio data or ArrayBuffer) */
36
+ export type GeneratorAppleSTTActionTranscribeData = ActionWithParams & {
37
+ __actionName: 'GENERATOR_APPLE_STT_TRANSCRIBE_DATA'
38
+ params?: Array<
39
+ | {
40
+ input: 'data'
41
+ value?: any | EventProperty
42
+ mapping?: string
43
+ }
44
+ | {
45
+ input: 'language'
46
+ value?: string | DataLink | EventProperty
47
+ mapping?: string
48
+ }
49
+ >
50
+ }
51
+
52
+ interface GeneratorAppleSTTDef {
53
+ /*
54
+ Default property:
55
+ {
56
+ "init": false,
57
+ "language": "en-US",
58
+ "enablePartialResults": true
59
+ }
60
+ */
61
+ property?: {
62
+ /* Initialize the STT engine on generator initialization */
63
+ init?: boolean | DataLink
64
+ /* Language/locale for recognition (e.g., 'en-US') */
65
+ language?: string | DataLink
66
+ /* Enable partial results during transcription */
67
+ enablePartialResults?: boolean | DataLink
68
+ /* The file URL or path to be transcribed */
69
+ fileUrl?: string | DataLink
70
+ }
71
+ events?: {
72
+ /* Error event */
73
+ onError?: Array<EventAction>
74
+ /* Event triggered when got transcribe result */
75
+ onTranscribed?: Array<EventAction>
76
+ }
77
+ outlets?: {
78
+ /* State outlet (loading, ready, error) */
79
+ state?: () => Data
80
+ /* Is transcribing */
81
+ isTranscribing?: () => Data
82
+ /* Transcribe result */
83
+ transcribeResult?: () => Data
84
+ /* Transcribe result details (result, segments, time, startTime, endTime, duration) */
85
+ transcribeDetails?: () => Data
86
+ }
87
+ }
88
+
89
+ /* Speech recognition on iOS 26+ (Not supported on tvOS)
90
+
91
+ ## Features
92
+ - Native Apple speech recognition
93
+ - High accuracy transcription
94
+ - Privacy-focused on-device processing
95
+ - Supports file and data transcription
96
+ - Requires iOS 26+ (Not supported on tvOS) */
97
+ export type GeneratorAppleSTT = Generator &
98
+ GeneratorAppleSTTDef & {
99
+ templateKey: 'GENERATOR_APPLE_STT'
100
+ switches: Array<
101
+ SwitchDef &
102
+ GeneratorAppleSTTDef & {
103
+ conds?: Array<{
104
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
105
+ cond:
106
+ | SwitchCondInnerStateCurrentCanvas
107
+ | SwitchCondData
108
+ | {
109
+ __typename: 'SwitchCondInnerStateOutlet'
110
+ outlet: 'state' | 'isTranscribing' | 'transcribeResult' | 'transcribeDetails'
111
+ value: any
112
+ }
113
+ }>
114
+ }
115
+ >
116
+ }
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -0,0 +1,113 @@
1
+ /* Auto generated by build script */
2
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
+ import type { Data, DataLink } from '../data'
4
+ import type {
5
+ Generator,
6
+ EventAction,
7
+ ActionWithDataParams,
8
+ ActionWithParams,
9
+ Action,
10
+ EventProperty,
11
+ } from '../common'
12
+
13
+ /* Load the TTS model */
14
+ export type GeneratorAppleTTSActionLoadModel = Action & {
15
+ __actionName: 'GENERATOR_APPLE_TTS_LOAD_MODEL'
16
+ }
17
+
18
+ /* Generate audio */
19
+ export type GeneratorAppleTTSActionGenerate = ActionWithParams & {
20
+ __actionName: 'GENERATOR_APPLE_TTS_GENERATE'
21
+ params?: Array<{
22
+ input: 'text'
23
+ value?: string | DataLink | EventProperty
24
+ mapping?: string
25
+ }>
26
+ }
27
+
28
+ /* Clean cache */
29
+ export type GeneratorAppleTTSActionCleanCache = Action & {
30
+ __actionName: 'GENERATOR_APPLE_TTS_CLEAN_CACHE'
31
+ }
32
+
33
+ /* Cancel current generation and clear queue */
34
+ export type GeneratorAppleTTSActionCancel = Action & {
35
+ __actionName: 'GENERATOR_APPLE_TTS_CANCEL'
36
+ }
37
+
38
+ interface GeneratorAppleTTSDef {
39
+ /*
40
+ Default property:
41
+ {
42
+ "language": "en-US",
43
+ "outputType": "play",
44
+ "cacheGenerated": true,
45
+ "autoInferEnable": false,
46
+ "softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
47
+ "hardBreakTime": 500
48
+ }
49
+ */
50
+ property?: {
51
+ /* Initialize the TTS context on generator initialization */
52
+ init?: boolean | DataLink
53
+ /* Voice identifier */
54
+ voice?: string | DataLink
55
+ /* Language/locale (e.g., 'en-US') */
56
+ language?: string | DataLink
57
+ /* Output mode */
58
+ outputType?: 'play' | 'file' | DataLink
59
+ /* Enable cache for generated audio */
60
+ cacheGenerated?: boolean | DataLink
61
+ /* Text to generate */
62
+ prompt?: string | DataLink
63
+ /* Auto inference when prompt changes */
64
+ autoInferEnable?: boolean | DataLink
65
+ /* Segmentation rule for auto inference */
66
+ softBreakRegex?: string | DataLink
67
+ /* Time to force inference when softBreakRegex is not satisfied */
68
+ hardBreakTime?: number | DataLink
69
+ }
70
+ events?: {
71
+ /* Event triggered when state change */
72
+ onContextStateChange?: Array<EventAction>
73
+ /* Event triggered when error occurs */
74
+ onError?: Array<EventAction>
75
+ }
76
+ outlets?: {
77
+ /* Context state */
78
+ contextState?: () => Data
79
+ /* Generated audio file */
80
+ generatedAudio?: () => Data
81
+ /* Generated audio file is playing */
82
+ generatedAudioPlaying?: () => Data
83
+ }
84
+ }
85
+
86
+ /* Text-to-speech synthesis using Apple's native speech synthesis
87
+
88
+ ## Features
89
+ - Native Apple speech synthesis
90
+ - Natural sounding voices
91
+ - Privacy-focused on-device processing
92
+ - Multiple voice options
93
+ - Requires iOS 13+ (native speech synthesis) */
94
+ export type GeneratorAppleTTS = Generator &
95
+ GeneratorAppleTTSDef & {
96
+ templateKey: 'GENERATOR_APPLE_TTS'
97
+ switches: Array<
98
+ SwitchDef &
99
+ GeneratorAppleTTSDef & {
100
+ conds?: Array<{
101
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
102
+ cond:
103
+ | SwitchCondInnerStateCurrentCanvas
104
+ | SwitchCondData
105
+ | {
106
+ __typename: 'SwitchCondInnerStateOutlet'
107
+ outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
108
+ value: any
109
+ }
110
+ }>
111
+ }
112
+ >
113
+ }
@@ -0,0 +1,113 @@
1
+ /* Auto generated by build script */
2
+ import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
3
+ import type { Data, DataLink } from '../data'
4
+ import type {
5
+ Generator,
6
+ EventAction,
7
+ ActionWithDataParams,
8
+ ActionWithParams,
9
+ Action,
10
+ EventProperty,
11
+ } from '../common'
12
+
13
+ /* Load the TTS model */
14
+ export type GeneratorAppleTTSActionLoadModel = Action & {
15
+ __actionName: 'GENERATOR_APPLE_TTS_LOAD_MODEL'
16
+ }
17
+
18
+ /* Generate audio */
19
+ export type GeneratorAppleTTSActionGenerate = ActionWithParams & {
20
+ __actionName: 'GENERATOR_APPLE_TTS_GENERATE'
21
+ params?: Array<{
22
+ input: 'text'
23
+ value?: string | DataLink | EventProperty
24
+ mapping?: string
25
+ }>
26
+ }
27
+
28
+ /* Clean cache */
29
+ export type GeneratorAppleTTSActionCleanCache = Action & {
30
+ __actionName: 'GENERATOR_APPLE_TTS_CLEAN_CACHE'
31
+ }
32
+
33
+ /* Cancel current generation and clear queue */
34
+ export type GeneratorAppleTTSActionCancel = Action & {
35
+ __actionName: 'GENERATOR_APPLE_TTS_CANCEL'
36
+ }
37
+
38
+ interface GeneratorAppleTTSDef {
39
+ /*
40
+ Default property:
41
+ {
42
+ "language": "en-US",
43
+ "outputType": "play",
44
+ "cacheGenerated": true,
45
+ "autoInferEnable": false,
46
+ "softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
47
+ "hardBreakTime": 500
48
+ }
49
+ */
50
+ property?: {
51
+ /* Initialize the TTS context on generator initialization */
52
+ init?: boolean | DataLink
53
+ /* Voice identifier */
54
+ voice?: string | DataLink
55
+ /* Language/locale (e.g., 'en-US') */
56
+ language?: string | DataLink
57
+ /* Output mode */
58
+ outputType?: 'play' | 'file' | DataLink
59
+ /* Enable cache for generated audio */
60
+ cacheGenerated?: boolean | DataLink
61
+ /* Text to generate */
62
+ prompt?: string | DataLink
63
+ /* Auto inference when prompt changes */
64
+ autoInferEnable?: boolean | DataLink
65
+ /* Segmentation rule for auto inference */
66
+ softBreakRegex?: string | DataLink
67
+ /* Time to force inference when softBreakRegex is not satisfied */
68
+ hardBreakTime?: number | DataLink
69
+ }
70
+ events?: {
71
+ /* Event triggered when state change */
72
+ onContextStateChange?: Array<EventAction>
73
+ /* Event triggered when error occurs */
74
+ onError?: Array<EventAction>
75
+ }
76
+ outlets?: {
77
+ /* Context state */
78
+ contextState?: () => Data
79
+ /* Generated audio file */
80
+ generatedAudio?: () => Data
81
+ /* Generated audio file is playing */
82
+ generatedAudioPlaying?: () => Data
83
+ }
84
+ }
85
+
86
+ /* Text-to-speech synthesis using Apple's native speech synthesis
87
+
88
+ ## Features
89
+ - Native Apple speech synthesis
90
+ - Natural sounding voices
91
+ - Privacy-focused on-device processing
92
+ - Multiple voice options
93
+ - Requires iOS 13+ (native speech synthesis) */
94
+ export type GeneratorAppleTTS = Generator &
95
+ GeneratorAppleTTSDef & {
96
+ templateKey: 'GENERATOR_APPLE_TTS'
97
+ switches: Array<
98
+ SwitchDef &
99
+ GeneratorAppleTTSDef & {
100
+ conds?: Array<{
101
+ method: '==' | '!=' | '>' | '<' | '>=' | '<='
102
+ cond:
103
+ | SwitchCondInnerStateCurrentCanvas
104
+ | SwitchCondData
105
+ | {
106
+ __typename: 'SwitchCondInnerStateOutlet'
107
+ outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
108
+ value: any
109
+ }
110
+ }>
111
+ }
112
+ >
113
+ }
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {
@@ -1,3 +1,4 @@
1
+ /* Auto generated by build script */
1
2
  import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
2
3
  import type { Data, DataLink } from '../data'
3
4
  import type {