@fugood/bricks-ctor 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.
- package/compile/action-name-map.ts +988 -0
- package/compile/index.ts +1245 -0
- package/compile/util.ts +358 -0
- package/index.ts +6 -0
- package/package.json +28 -0
- package/skills/bricks-design/LICENSE.txt +180 -0
- package/skills/bricks-design/SKILL.md +66 -0
- package/skills/bricks-project/SKILL.md +32 -0
- package/skills/bricks-project/rules/animation.md +159 -0
- package/skills/bricks-project/rules/architecture-patterns.md +69 -0
- package/skills/bricks-project/rules/automations.md +221 -0
- package/skills/bricks-project/rules/buttress.md +156 -0
- package/skills/bricks-project/rules/data-calculation.md +208 -0
- package/skills/bricks-project/rules/local-sync.md +129 -0
- package/skills/bricks-project/rules/media-flow.md +158 -0
- package/skills/bricks-project/rules/remote-data-bank.md +196 -0
- package/skills/bricks-project/rules/standby-transition.md +124 -0
- package/skills/rive-marketplace/SKILL.md +99 -0
- package/tools/deploy.ts +151 -0
- package/tools/icons/.gitattributes +1 -0
- package/tools/icons/fa6pro-glyphmap.json +4686 -0
- package/tools/icons/fa6pro-meta.json +3671 -0
- package/tools/mcp-server.ts +28 -0
- package/tools/mcp-tools/compile.ts +91 -0
- package/tools/mcp-tools/huggingface.ts +762 -0
- package/tools/mcp-tools/icons.ts +70 -0
- package/tools/mcp-tools/lottie.ts +102 -0
- package/tools/mcp-tools/media.ts +110 -0
- package/tools/postinstall.ts +229 -0
- package/tools/preview-main.mjs +293 -0
- package/tools/preview.ts +143 -0
- package/tools/pull.ts +116 -0
- package/tsconfig.json +16 -0
- package/types/animation.ts +100 -0
- package/types/automation.ts +235 -0
- package/types/brick-base.ts +80 -0
- package/types/bricks/Camera.ts +246 -0
- package/types/bricks/Chart.ts +372 -0
- package/types/bricks/GenerativeMedia.ts +276 -0
- package/types/bricks/Icon.ts +98 -0
- package/types/bricks/Image.ts +114 -0
- package/types/bricks/Items.ts +476 -0
- package/types/bricks/Lottie.ts +168 -0
- package/types/bricks/Maps.ts +262 -0
- package/types/bricks/QrCode.ts +117 -0
- package/types/bricks/Rect.ts +150 -0
- package/types/bricks/RichText.ts +128 -0
- package/types/bricks/Rive.ts +220 -0
- package/types/bricks/Slideshow.ts +201 -0
- package/types/bricks/Svg.ts +99 -0
- package/types/bricks/Text.ts +148 -0
- package/types/bricks/TextInput.ts +242 -0
- package/types/bricks/Video.ts +175 -0
- package/types/bricks/VideoStreaming.ts +112 -0
- package/types/bricks/WebRtcStream.ts +65 -0
- package/types/bricks/WebView.ts +168 -0
- package/types/bricks/index.ts +21 -0
- package/types/canvas.ts +82 -0
- package/types/common.ts +144 -0
- package/types/data-calc-command.ts +7005 -0
- package/types/data-calc-script.ts +21 -0
- package/types/data-calc.ts +11 -0
- package/types/data.ts +95 -0
- package/types/generators/AlarmClock.ts +110 -0
- package/types/generators/Assistant.ts +621 -0
- package/types/generators/BleCentral.ts +247 -0
- package/types/generators/BlePeripheral.ts +208 -0
- package/types/generators/CanvasMap.ts +74 -0
- package/types/generators/CastlesPay.ts +87 -0
- package/types/generators/DataBank.ts +160 -0
- package/types/generators/File.ts +432 -0
- package/types/generators/GraphQl.ts +132 -0
- package/types/generators/Http.ts +222 -0
- package/types/generators/HttpServer.ts +176 -0
- package/types/generators/Information.ts +103 -0
- package/types/generators/Intent.ts +168 -0
- package/types/generators/Iterator.ts +108 -0
- package/types/generators/Keyboard.ts +105 -0
- package/types/generators/LlmAnthropicCompat.ts +212 -0
- package/types/generators/LlmAppleBuiltin.ts +159 -0
- package/types/generators/LlmGgml.ts +861 -0
- package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
- package/types/generators/LlmMlx.ts +227 -0
- package/types/generators/LlmOnnx.ts +213 -0
- package/types/generators/LlmOpenAiCompat.ts +244 -0
- package/types/generators/LlmQualcommAiEngine.ts +247 -0
- package/types/generators/Mcp.ts +637 -0
- package/types/generators/McpServer.ts +289 -0
- package/types/generators/MediaFlow.ts +170 -0
- package/types/generators/MqttBroker.ts +141 -0
- package/types/generators/MqttClient.ts +141 -0
- package/types/generators/Question.ts +408 -0
- package/types/generators/RealtimeTranscription.ts +279 -0
- package/types/generators/RerankerGgml.ts +191 -0
- package/types/generators/SerialPort.ts +151 -0
- package/types/generators/SoundPlayer.ts +94 -0
- package/types/generators/SoundRecorder.ts +130 -0
- package/types/generators/SpeechToTextGgml.ts +415 -0
- package/types/generators/SpeechToTextOnnx.ts +236 -0
- package/types/generators/SpeechToTextPlatform.ts +85 -0
- package/types/generators/SqLite.ts +159 -0
- package/types/generators/Step.ts +107 -0
- package/types/generators/SttAppleBuiltin.ts +130 -0
- package/types/generators/Tcp.ts +126 -0
- package/types/generators/TcpServer.ts +147 -0
- package/types/generators/TextToSpeechAppleBuiltin.ts +127 -0
- package/types/generators/TextToSpeechGgml.ts +221 -0
- package/types/generators/TextToSpeechOnnx.ts +178 -0
- package/types/generators/TextToSpeechOpenAiLike.ts +121 -0
- package/types/generators/ThermalPrinter.ts +191 -0
- package/types/generators/Tick.ts +83 -0
- package/types/generators/Udp.ts +120 -0
- package/types/generators/VadGgml.ts +250 -0
- package/types/generators/VadOnnx.ts +231 -0
- package/types/generators/VadTraditional.ts +138 -0
- package/types/generators/VectorStore.ts +257 -0
- package/types/generators/Watchdog.ts +107 -0
- package/types/generators/WebCrawler.ts +103 -0
- package/types/generators/WebRtc.ts +181 -0
- package/types/generators/WebSocket.ts +148 -0
- package/types/generators/index.ts +57 -0
- package/types/index.ts +13 -0
- package/types/subspace.ts +59 -0
- package/types/switch.ts +51 -0
- package/types/system.ts +707 -0
- package/utils/calc.ts +126 -0
- package/utils/data.ts +497 -0
- package/utils/event-props.ts +836 -0
- package/utils/id.ts +80 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Speech recognition on iOS 26+ (Not supported on tvOS)
|
|
4
|
+
*
|
|
5
|
+
* ## Features
|
|
6
|
+
* - Native Apple speech recognition
|
|
7
|
+
* - High accuracy transcription
|
|
8
|
+
* - Privacy-focused on-device processing
|
|
9
|
+
* - Supports file and data transcription
|
|
10
|
+
* - Requires iOS 26+ (Not supported on tvOS)
|
|
11
|
+
*/
|
|
12
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
13
|
+
import type { Data, DataLink } from '../data'
|
|
14
|
+
import type {
|
|
15
|
+
Brick,
|
|
16
|
+
Generator,
|
|
17
|
+
EventAction,
|
|
18
|
+
ActionWithDataParams,
|
|
19
|
+
ActionWithParams,
|
|
20
|
+
Action,
|
|
21
|
+
EventProperty,
|
|
22
|
+
} from '../common'
|
|
23
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
24
|
+
|
|
25
|
+
/* Initialize STT */
|
|
26
|
+
export type GeneratorAppleSTTActionInit = Action & {
|
|
27
|
+
__actionName: 'GENERATOR_APPLE_STT_INIT'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Transcribe audio file. You can provide `File URL` property, if not provided, it will use the default `File URL` */
|
|
31
|
+
export type GeneratorAppleSTTActionTranscribeFile = ActionWithParams & {
|
|
32
|
+
__actionName: 'GENERATOR_APPLE_STT_TRANSCRIBE_FILE'
|
|
33
|
+
params?: Array<
|
|
34
|
+
| {
|
|
35
|
+
input: 'fileUrl'
|
|
36
|
+
value?: string | DataLink | EventProperty
|
|
37
|
+
mapping?: string
|
|
38
|
+
}
|
|
39
|
+
| {
|
|
40
|
+
input: 'language'
|
|
41
|
+
value?: string | DataLink | EventProperty
|
|
42
|
+
mapping?: string
|
|
43
|
+
}
|
|
44
|
+
>
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Transcribe audio data (base64 encoded audio data or ArrayBuffer) */
|
|
48
|
+
export type GeneratorAppleSTTActionTranscribeData = ActionWithParams & {
|
|
49
|
+
__actionName: 'GENERATOR_APPLE_STT_TRANSCRIBE_DATA'
|
|
50
|
+
params?: Array<
|
|
51
|
+
| {
|
|
52
|
+
input: 'data'
|
|
53
|
+
value?: any | EventProperty
|
|
54
|
+
mapping?: string
|
|
55
|
+
}
|
|
56
|
+
| {
|
|
57
|
+
input: 'language'
|
|
58
|
+
value?: string | DataLink | EventProperty
|
|
59
|
+
mapping?: string
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface GeneratorAppleSTTDef {
|
|
65
|
+
/*
|
|
66
|
+
Default property:
|
|
67
|
+
{
|
|
68
|
+
"init": false,
|
|
69
|
+
"language": "en-US",
|
|
70
|
+
"enablePartialResults": true
|
|
71
|
+
}
|
|
72
|
+
*/
|
|
73
|
+
property?: {
|
|
74
|
+
/* Initialize the STT engine on generator initialization */
|
|
75
|
+
init?: boolean | DataLink
|
|
76
|
+
/* Language/locale for recognition (e.g., 'en-US') */
|
|
77
|
+
language?: string | DataLink
|
|
78
|
+
/* Enable partial results during transcription */
|
|
79
|
+
enablePartialResults?: boolean | DataLink
|
|
80
|
+
/* The file URL or path to be transcribed */
|
|
81
|
+
fileUrl?: string | DataLink
|
|
82
|
+
}
|
|
83
|
+
events?: {
|
|
84
|
+
/* Error event */
|
|
85
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AppleStt']['onError']>>
|
|
86
|
+
/* Event triggered when got transcribe result */
|
|
87
|
+
onTranscribed?: Array<
|
|
88
|
+
EventAction<string & keyof TemplateEventPropsMap['AppleStt']['onTranscribed']>
|
|
89
|
+
>
|
|
90
|
+
}
|
|
91
|
+
outlets?: {
|
|
92
|
+
/* State outlet (loading, ready, error) */
|
|
93
|
+
state?: () => Data<string>
|
|
94
|
+
/* Is transcribing */
|
|
95
|
+
isTranscribing?: () => Data<boolean>
|
|
96
|
+
/* Transcribe result */
|
|
97
|
+
transcribeResult?: () => Data<string>
|
|
98
|
+
/* Transcribe result details (result, segments, time, startTime, endTime, duration) */
|
|
99
|
+
transcribeDetails?: () => Data<{ [key: string]: any }>
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Speech recognition on iOS 26+ (Not supported on tvOS)
|
|
104
|
+
|
|
105
|
+
## Features
|
|
106
|
+
- Native Apple speech recognition
|
|
107
|
+
- High accuracy transcription
|
|
108
|
+
- Privacy-focused on-device processing
|
|
109
|
+
- Supports file and data transcription
|
|
110
|
+
- Requires iOS 26+ (Not supported on tvOS) */
|
|
111
|
+
export type GeneratorAppleSTT = Generator &
|
|
112
|
+
GeneratorAppleSTTDef & {
|
|
113
|
+
templateKey: 'GENERATOR_APPLE_STT'
|
|
114
|
+
switches?: Array<
|
|
115
|
+
SwitchDef &
|
|
116
|
+
GeneratorAppleSTTDef & {
|
|
117
|
+
conds?: Array<{
|
|
118
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
119
|
+
cond:
|
|
120
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
121
|
+
| SwitchCondData
|
|
122
|
+
| {
|
|
123
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
124
|
+
outlet: 'state' | 'isTranscribing' | 'transcribeResult' | 'transcribeDetails'
|
|
125
|
+
value: any
|
|
126
|
+
}
|
|
127
|
+
}>
|
|
128
|
+
}
|
|
129
|
+
>
|
|
130
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* TCP socket client with data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), TLS, and keepalive support
|
|
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
|
+
/* Start connect */
|
|
19
|
+
export type GeneratorTCPActionConnect = Action & {
|
|
20
|
+
__actionName: 'GENERATOR_TCP_CONNECT'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Send data */
|
|
24
|
+
export type GeneratorTCPActionSend = ActionWithParams & {
|
|
25
|
+
__actionName: 'GENERATOR_TCP_SEND'
|
|
26
|
+
params?: Array<{
|
|
27
|
+
input: 'sendData'
|
|
28
|
+
value?: string | DataLink | EventProperty
|
|
29
|
+
mapping?: string
|
|
30
|
+
}>
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* End connection */
|
|
34
|
+
export type GeneratorTCPActionEnd = ActionWithParams & {
|
|
35
|
+
__actionName: 'GENERATOR_TCP_END'
|
|
36
|
+
params?: Array<{
|
|
37
|
+
input: 'endWithData'
|
|
38
|
+
value?: string | DataLink | EventProperty
|
|
39
|
+
mapping?: string
|
|
40
|
+
}>
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface GeneratorTCPDef {
|
|
44
|
+
/*
|
|
45
|
+
Default property:
|
|
46
|
+
{
|
|
47
|
+
"init": false,
|
|
48
|
+
"dataMode": "raw",
|
|
49
|
+
"encoding": "utf8",
|
|
50
|
+
"idleTimeout": 0,
|
|
51
|
+
"bufferSize": 1024,
|
|
52
|
+
"tls": false,
|
|
53
|
+
"tlsCheckValidity": false,
|
|
54
|
+
"tlsCert": ""
|
|
55
|
+
}
|
|
56
|
+
*/
|
|
57
|
+
property?: {
|
|
58
|
+
/* Start connect on generator initialized */
|
|
59
|
+
init?: boolean | DataLink
|
|
60
|
+
/* Connection target host or IP assress */
|
|
61
|
+
host?: string | DataLink
|
|
62
|
+
/* Connection target port */
|
|
63
|
+
port?: number | DataLink
|
|
64
|
+
/* Data mode
|
|
65
|
+
CRLF: Receive until CRLF
|
|
66
|
+
LF: Receive until LF
|
|
67
|
+
raw: Raw packet */
|
|
68
|
+
dataMode?: 'CRLF' | 'LF' | 'raw' | DataLink
|
|
69
|
+
/* Encoding of data */
|
|
70
|
+
encoding?: 'base64' | 'utf8' | 'ascii' | DataLink
|
|
71
|
+
/* Max connection idle time, 0 is disable */
|
|
72
|
+
idleTimeout?: number | DataLink
|
|
73
|
+
/* Enable keepalive */
|
|
74
|
+
keepAlive?: boolean | DataLink
|
|
75
|
+
/* Buffer size limit of receive plaintext line */
|
|
76
|
+
bufferSize?: number | DataLink
|
|
77
|
+
/* Enable TLS */
|
|
78
|
+
tls?: boolean | DataLink
|
|
79
|
+
/* Enable TLS certificate verify */
|
|
80
|
+
tlsCheckValidity?: boolean | DataLink
|
|
81
|
+
/* Trust certificate list (PEM format) */
|
|
82
|
+
tlsCert?: string | DataLink
|
|
83
|
+
}
|
|
84
|
+
events?: {
|
|
85
|
+
/* Event of connect successful */
|
|
86
|
+
onConnected?: Array<EventAction>
|
|
87
|
+
/* Event of receive data */
|
|
88
|
+
onData?: Array<EventAction<string & keyof TemplateEventPropsMap['Tcp']['onData']>>
|
|
89
|
+
/* Event of connection idle timeout */
|
|
90
|
+
onTimeout?: Array<EventAction>
|
|
91
|
+
/* Event of connection close */
|
|
92
|
+
onClose?: Array<EventAction>
|
|
93
|
+
/* Event of connection error */
|
|
94
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['Tcp']['onError']>>
|
|
95
|
+
}
|
|
96
|
+
outlets?: {
|
|
97
|
+
/* Connection status */
|
|
98
|
+
status?: () => Data<string>
|
|
99
|
+
/* Last received data */
|
|
100
|
+
lastData?: () => Data<string>
|
|
101
|
+
/* Error message */
|
|
102
|
+
errorMessage?: () => Data<string>
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* TCP socket client with data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), TLS, and keepalive support */
|
|
107
|
+
export type GeneratorTCP = Generator &
|
|
108
|
+
GeneratorTCPDef & {
|
|
109
|
+
templateKey: 'GENERATOR_TCP'
|
|
110
|
+
switches?: Array<
|
|
111
|
+
SwitchDef &
|
|
112
|
+
GeneratorTCPDef & {
|
|
113
|
+
conds?: Array<{
|
|
114
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
115
|
+
cond:
|
|
116
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
117
|
+
| SwitchCondData
|
|
118
|
+
| {
|
|
119
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
120
|
+
outlet: 'status' | 'lastData' | 'errorMessage'
|
|
121
|
+
value: any
|
|
122
|
+
}
|
|
123
|
+
}>
|
|
124
|
+
}
|
|
125
|
+
>
|
|
126
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* TCP server with multi-client support, data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), concurrent connection limit, and TLS
|
|
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
|
+
/* Start TCP server */
|
|
19
|
+
export type GeneratorTCPServerActionStart = Action & {
|
|
20
|
+
__actionName: 'GENERATOR_TCP_SERVER_START'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Send data to specify connection */
|
|
24
|
+
export type GeneratorTCPServerActionSend = ActionWithParams & {
|
|
25
|
+
__actionName: 'GENERATOR_TCP_SERVER_SEND'
|
|
26
|
+
params?: Array<
|
|
27
|
+
| {
|
|
28
|
+
input: 'remote'
|
|
29
|
+
value?: string | DataLink | EventProperty
|
|
30
|
+
mapping?: string
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
input: 'sendData'
|
|
34
|
+
value?: string | DataLink | EventProperty
|
|
35
|
+
mapping?: string
|
|
36
|
+
}
|
|
37
|
+
>
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* End specify connection */
|
|
41
|
+
export type GeneratorTCPServerActionEnd = ActionWithParams & {
|
|
42
|
+
__actionName: 'GENERATOR_TCP_SERVER_END'
|
|
43
|
+
params?: Array<
|
|
44
|
+
| {
|
|
45
|
+
input: 'remote'
|
|
46
|
+
value?: string | DataLink | EventProperty
|
|
47
|
+
mapping?: string
|
|
48
|
+
}
|
|
49
|
+
| {
|
|
50
|
+
input: 'generatorTcpClientEndWithData'
|
|
51
|
+
value?: string | DataLink | EventProperty
|
|
52
|
+
mapping?: string
|
|
53
|
+
}
|
|
54
|
+
>
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Stop TCP server */
|
|
58
|
+
export type GeneratorTCPServerActionStop = Action & {
|
|
59
|
+
__actionName: 'GENERATOR_TCP_SERVER_STOP'
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface GeneratorTCPServerDef {
|
|
63
|
+
/*
|
|
64
|
+
Default property:
|
|
65
|
+
{
|
|
66
|
+
"init": false,
|
|
67
|
+
"dataMode": "raw",
|
|
68
|
+
"encoding": "utf8",
|
|
69
|
+
"bufferSize": 1024,
|
|
70
|
+
"concurrent": 5,
|
|
71
|
+
"idleTimeout": 0
|
|
72
|
+
}
|
|
73
|
+
*/
|
|
74
|
+
property?: {
|
|
75
|
+
/* Start TCP server on generator initialized */
|
|
76
|
+
init?: boolean | DataLink
|
|
77
|
+
/* Bind port of TCP server */
|
|
78
|
+
port?: number | DataLink
|
|
79
|
+
/* Data mode
|
|
80
|
+
CRLF: Receive until CRLF
|
|
81
|
+
LF: Receive until LF
|
|
82
|
+
raw: Raw packet */
|
|
83
|
+
dataMode?: 'CRLF' | 'LF' | 'raw' | DataLink
|
|
84
|
+
/* Encoding of data */
|
|
85
|
+
encoding?: 'base64' | 'utf8' | 'ascii' | DataLink
|
|
86
|
+
/* Buffer size limit of receive plaintext line */
|
|
87
|
+
bufferSize?: number | DataLink
|
|
88
|
+
/* Max concurrent connection count */
|
|
89
|
+
concurrent?: number | DataLink
|
|
90
|
+
/* Max connection idle time, 0 is disable */
|
|
91
|
+
idleTimeout?: number | DataLink
|
|
92
|
+
/* Enable TLS */
|
|
93
|
+
tls?: boolean | DataLink
|
|
94
|
+
/* TLS key pair (Base64 encoded no password PKCS #12) */
|
|
95
|
+
tlsKeyPair?: string | DataLink
|
|
96
|
+
}
|
|
97
|
+
events?: {
|
|
98
|
+
/* Event of TCP server is ready */
|
|
99
|
+
onReady?: Array<EventAction>
|
|
100
|
+
/* Event of TCP server accept the connection */
|
|
101
|
+
onAcceptConnection?: Array<
|
|
102
|
+
EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onAcceptConnection']>
|
|
103
|
+
>
|
|
104
|
+
/* Event of receive data */
|
|
105
|
+
onData?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onData']>>
|
|
106
|
+
/* Event of connection idle timeout */
|
|
107
|
+
onTimeout?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onTimeout']>>
|
|
108
|
+
/* Event of connection close */
|
|
109
|
+
onClose?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onClose']>>
|
|
110
|
+
/* Event of server or connection error */
|
|
111
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['TcpServer']['onError']>>
|
|
112
|
+
}
|
|
113
|
+
outlets?: {
|
|
114
|
+
/* Server is listening */
|
|
115
|
+
isListening?: () => Data<boolean>
|
|
116
|
+
/* Is server started */
|
|
117
|
+
started?: () => Data<boolean>
|
|
118
|
+
/* Accepted connections */
|
|
119
|
+
connections?: () => Data<Array<string>>
|
|
120
|
+
/* Last received data */
|
|
121
|
+
lastData?: () => Data<string>
|
|
122
|
+
/* Error message */
|
|
123
|
+
errorMessage?: () => Data<string>
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* TCP server with multi-client support, data modes (CRLF/LF/raw), encodings (base64/utf8/ascii), concurrent connection limit, and TLS */
|
|
128
|
+
export type GeneratorTCPServer = Generator &
|
|
129
|
+
GeneratorTCPServerDef & {
|
|
130
|
+
templateKey: 'GENERATOR_TCP_SERVER'
|
|
131
|
+
switches?: Array<
|
|
132
|
+
SwitchDef &
|
|
133
|
+
GeneratorTCPServerDef & {
|
|
134
|
+
conds?: Array<{
|
|
135
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
136
|
+
cond:
|
|
137
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
138
|
+
| SwitchCondData
|
|
139
|
+
| {
|
|
140
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
141
|
+
outlet: 'isListening' | 'started' | 'connections' | 'lastData' | 'errorMessage'
|
|
142
|
+
value: any
|
|
143
|
+
}
|
|
144
|
+
}>
|
|
145
|
+
}
|
|
146
|
+
>
|
|
147
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/* Auto generated by build script
|
|
2
|
+
*
|
|
3
|
+
* Text-to-speech synthesis using Apple's native speech synthesis
|
|
4
|
+
*
|
|
5
|
+
* ## Features
|
|
6
|
+
* - Native Apple speech synthesis
|
|
7
|
+
* - Natural sounding voices
|
|
8
|
+
* - Privacy-focused on-device processing
|
|
9
|
+
* - Multiple voice options
|
|
10
|
+
* - Requires iOS 13+ (native speech synthesis)
|
|
11
|
+
*/
|
|
12
|
+
import type { SwitchCondInnerStateCurrentCanvas, SwitchCondData, SwitchDef } from '../switch'
|
|
13
|
+
import type { Data, DataLink } from '../data'
|
|
14
|
+
import type {
|
|
15
|
+
Brick,
|
|
16
|
+
Generator,
|
|
17
|
+
EventAction,
|
|
18
|
+
ActionWithDataParams,
|
|
19
|
+
ActionWithParams,
|
|
20
|
+
Action,
|
|
21
|
+
EventProperty,
|
|
22
|
+
} from '../common'
|
|
23
|
+
import type { TemplateEventPropsMap } from '../../utils/event-props'
|
|
24
|
+
|
|
25
|
+
/* Load the TTS model */
|
|
26
|
+
export type GeneratorAppleTTSActionLoadModel = Action & {
|
|
27
|
+
__actionName: 'GENERATOR_APPLE_TTS_LOAD_MODEL'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Generate audio */
|
|
31
|
+
export type GeneratorAppleTTSActionGenerate = ActionWithParams & {
|
|
32
|
+
__actionName: 'GENERATOR_APPLE_TTS_GENERATE'
|
|
33
|
+
params?: Array<{
|
|
34
|
+
input: 'text'
|
|
35
|
+
value?: string | DataLink | EventProperty
|
|
36
|
+
mapping?: string
|
|
37
|
+
}>
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Clean cache */
|
|
41
|
+
export type GeneratorAppleTTSActionCleanCache = Action & {
|
|
42
|
+
__actionName: 'GENERATOR_APPLE_TTS_CLEAN_CACHE'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Cancel current generation and clear queue */
|
|
46
|
+
export type GeneratorAppleTTSActionCancel = Action & {
|
|
47
|
+
__actionName: 'GENERATOR_APPLE_TTS_CANCEL'
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface GeneratorAppleTTSDef {
|
|
51
|
+
/*
|
|
52
|
+
Default property:
|
|
53
|
+
{
|
|
54
|
+
"language": "en-US",
|
|
55
|
+
"outputType": "play",
|
|
56
|
+
"cacheGenerated": true,
|
|
57
|
+
"autoInferEnable": false,
|
|
58
|
+
"softBreakRegex": "^[^\\r\\n\\t\\f\\v]*([\\r\\n]+|[。!?!?.]\\B)",
|
|
59
|
+
"hardBreakTime": 500
|
|
60
|
+
}
|
|
61
|
+
*/
|
|
62
|
+
property?: {
|
|
63
|
+
/* Initialize the TTS context on generator initialization */
|
|
64
|
+
init?: boolean | DataLink
|
|
65
|
+
/* Voice identifier */
|
|
66
|
+
voice?: string | DataLink
|
|
67
|
+
/* Language/locale (e.g., 'en-US') */
|
|
68
|
+
language?: string | DataLink
|
|
69
|
+
/* Output mode */
|
|
70
|
+
outputType?: 'play' | 'file' | DataLink
|
|
71
|
+
/* Enable cache for generated audio */
|
|
72
|
+
cacheGenerated?: boolean | DataLink
|
|
73
|
+
/* Text to generate */
|
|
74
|
+
prompt?: string | DataLink
|
|
75
|
+
/* Auto inference when prompt changes */
|
|
76
|
+
autoInferEnable?: boolean | DataLink
|
|
77
|
+
/* Segmentation rule for auto inference */
|
|
78
|
+
softBreakRegex?: string | DataLink
|
|
79
|
+
/* Time to force inference when softBreakRegex is not satisfied */
|
|
80
|
+
hardBreakTime?: number | DataLink
|
|
81
|
+
}
|
|
82
|
+
events?: {
|
|
83
|
+
/* Event triggered when state change */
|
|
84
|
+
onContextStateChange?: Array<
|
|
85
|
+
EventAction<string & keyof TemplateEventPropsMap['AppleTts']['onContextStateChange']>
|
|
86
|
+
>
|
|
87
|
+
/* Event triggered when error occurs */
|
|
88
|
+
onError?: Array<EventAction<string & keyof TemplateEventPropsMap['AppleTts']['onError']>>
|
|
89
|
+
}
|
|
90
|
+
outlets?: {
|
|
91
|
+
/* Context state */
|
|
92
|
+
contextState?: () => Data<string>
|
|
93
|
+
/* Generated audio file */
|
|
94
|
+
generatedAudio?: () => Data<string>
|
|
95
|
+
/* Generated audio file is playing */
|
|
96
|
+
generatedAudioPlaying?: () => Data<boolean>
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Text-to-speech synthesis using Apple's native speech synthesis
|
|
101
|
+
|
|
102
|
+
## Features
|
|
103
|
+
- Native Apple speech synthesis
|
|
104
|
+
- Natural sounding voices
|
|
105
|
+
- Privacy-focused on-device processing
|
|
106
|
+
- Multiple voice options
|
|
107
|
+
- Requires iOS 13+ (native speech synthesis) */
|
|
108
|
+
export type GeneratorAppleTTS = Generator &
|
|
109
|
+
GeneratorAppleTTSDef & {
|
|
110
|
+
templateKey: 'GENERATOR_APPLE_TTS'
|
|
111
|
+
switches?: Array<
|
|
112
|
+
SwitchDef &
|
|
113
|
+
GeneratorAppleTTSDef & {
|
|
114
|
+
conds?: Array<{
|
|
115
|
+
method: '==' | '!=' | '>' | '<' | '>=' | '<='
|
|
116
|
+
cond:
|
|
117
|
+
| SwitchCondInnerStateCurrentCanvas
|
|
118
|
+
| SwitchCondData
|
|
119
|
+
| {
|
|
120
|
+
__typename: 'SwitchCondInnerStateOutlet'
|
|
121
|
+
outlet: 'contextState' | 'generatedAudio' | 'generatedAudioPlaying'
|
|
122
|
+
value: any
|
|
123
|
+
}
|
|
124
|
+
}>
|
|
125
|
+
}
|
|
126
|
+
>
|
|
127
|
+
}
|