@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
package/utils/calc.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DataCommand,
|
|
3
|
+
DataCalculationMap,
|
|
4
|
+
DataCalculationData,
|
|
5
|
+
} from '../types/data-calc-command'
|
|
6
|
+
|
|
7
|
+
const GRID = {
|
|
8
|
+
WIDTH: 300, // Distance between columns
|
|
9
|
+
HEIGHT: 150, // Distance between rows
|
|
10
|
+
PADDING: 15, // Edge padding
|
|
11
|
+
COLUMNS: 4, // Max columns in grid
|
|
12
|
+
ROWS: 3, // Max rows in grid
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// TODO: Improve the algorithm to minimize crossing lines
|
|
16
|
+
|
|
17
|
+
// If we are too lazy to describe nodes in the editing interface,
|
|
18
|
+
// we can let it generate it automatically
|
|
19
|
+
export const generateDataCalculationMapEditorInfo = (
|
|
20
|
+
nodes: Array<DataCalculationData | DataCommand>,
|
|
21
|
+
) => {
|
|
22
|
+
const editorInfo: DataCalculationMap['editorInfo'] = []
|
|
23
|
+
|
|
24
|
+
// Track node relationships
|
|
25
|
+
const inputCounts = new Map<DataCalculationData | DataCommand, number>()
|
|
26
|
+
const outputCounts = new Map<DataCalculationData | DataCommand, number>()
|
|
27
|
+
const connectedTo = new Map<
|
|
28
|
+
DataCalculationData | DataCommand,
|
|
29
|
+
Set<DataCalculationData | DataCommand>
|
|
30
|
+
>()
|
|
31
|
+
|
|
32
|
+
// Analyze node connections
|
|
33
|
+
nodes.forEach((node) => {
|
|
34
|
+
// Count and track inputs
|
|
35
|
+
if ('inputs' in node) {
|
|
36
|
+
let inputs = 0
|
|
37
|
+
for (const input of node.inputs) {
|
|
38
|
+
if (input === null) continue
|
|
39
|
+
if (Array.isArray(input)) inputs += input.length
|
|
40
|
+
else inputs += 1
|
|
41
|
+
}
|
|
42
|
+
inputCounts.set(node, inputs)
|
|
43
|
+
|
|
44
|
+
// Track connections
|
|
45
|
+
node.inputs.forEach((input) => {
|
|
46
|
+
if (Array.isArray(input)) {
|
|
47
|
+
input.forEach((conn) => {
|
|
48
|
+
if (!connectedTo.has(node)) {
|
|
49
|
+
connectedTo.set(node, new Set())
|
|
50
|
+
}
|
|
51
|
+
const sourceNode = nodes.find((n) => 'id' in n && n.id === conn.id)
|
|
52
|
+
if (sourceNode) {
|
|
53
|
+
connectedTo.get(node)!.add(sourceNode)
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
} else {
|
|
59
|
+
inputCounts.set(node, 0)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Count outputs
|
|
63
|
+
if ('outputs' in node) {
|
|
64
|
+
let outputs = 0
|
|
65
|
+
for (const output of node.outputs) {
|
|
66
|
+
if (output === null) continue
|
|
67
|
+
if (Array.isArray(output)) outputs += output.length
|
|
68
|
+
else outputs += 1
|
|
69
|
+
}
|
|
70
|
+
outputCounts.set(node, outputs)
|
|
71
|
+
} else {
|
|
72
|
+
outputCounts.set(node, 0)
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// Calculate layers
|
|
77
|
+
const layers: Array<Array<DataCalculationData | DataCommand>> = [[], [], [], []]
|
|
78
|
+
|
|
79
|
+
nodes.forEach((node) => {
|
|
80
|
+
const inputs = inputCounts.get(node) || 0
|
|
81
|
+
const outputs = outputCounts.get(node) || 0
|
|
82
|
+
const connections = connectedTo.get(node)?.size || 0
|
|
83
|
+
|
|
84
|
+
if (inputs === 0) {
|
|
85
|
+
// Input nodes (leftmost)
|
|
86
|
+
layers[0].push(node)
|
|
87
|
+
} else if (outputs === 0) {
|
|
88
|
+
// Output nodes (rightmost)
|
|
89
|
+
layers[3].push(node)
|
|
90
|
+
} else if (connections > 1) {
|
|
91
|
+
// Nodes with multiple connections (middle-right)
|
|
92
|
+
layers[2].push(node)
|
|
93
|
+
} else {
|
|
94
|
+
// Processing nodes (middle-left)
|
|
95
|
+
layers[1].push(node)
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
// Position nodes in each layer
|
|
100
|
+
layers.forEach((layerNodes, layerIndex) => {
|
|
101
|
+
// Sort nodes by their connections to try to minimize crossing lines
|
|
102
|
+
layerNodes.sort((a, b) => {
|
|
103
|
+
const aConns = connectedTo.get(a)?.size || 0
|
|
104
|
+
const bConns = connectedTo.get(b)?.size || 0
|
|
105
|
+
return bConns - aConns
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
// Position nodes in the layer
|
|
109
|
+
layerNodes.forEach((node, nodeIndex) => {
|
|
110
|
+
// Distribute nodes evenly within their layer
|
|
111
|
+
const row = nodeIndex % GRID.ROWS
|
|
112
|
+
const offset = Math.floor(nodeIndex / GRID.ROWS) * (GRID.HEIGHT / 2)
|
|
113
|
+
|
|
114
|
+
editorInfo.push({
|
|
115
|
+
node,
|
|
116
|
+
position: {
|
|
117
|
+
x: GRID.PADDING + layerIndex * GRID.WIDTH,
|
|
118
|
+
y: GRID.PADDING + row * GRID.HEIGHT + offset,
|
|
119
|
+
},
|
|
120
|
+
points: [],
|
|
121
|
+
})
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
return editorInfo
|
|
126
|
+
}
|
package/utils/data.ts
ADDED
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
/* Auto generated by build script */
|
|
2
|
+
import type { DataLink, Data, Canvas } from '../types'
|
|
3
|
+
import { makeId } from './id'
|
|
4
|
+
|
|
5
|
+
export const linkData: (dataGetter: () => Data) => DataLink = (dataGetter) => ({
|
|
6
|
+
__typename: 'DataLink',
|
|
7
|
+
data: dataGetter,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const idOpts = {
|
|
11
|
+
snapshotMode: process.env.BRICKS_SNAPSHOT_MODE === '1',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const createCanvasIdRef: (canvasGetter: () => Canvas) => Data<string> = (canvasGetter) => {
|
|
15
|
+
const data: Data<string> = {
|
|
16
|
+
__typename: 'Data',
|
|
17
|
+
id: makeId('data', idOpts),
|
|
18
|
+
type: 'string',
|
|
19
|
+
routing: 'read-only',
|
|
20
|
+
kind: {
|
|
21
|
+
type: 'auto-generated-item-id',
|
|
22
|
+
idType: 'canvas',
|
|
23
|
+
},
|
|
24
|
+
title: '',
|
|
25
|
+
value: '',
|
|
26
|
+
}
|
|
27
|
+
setImmediate(() => {
|
|
28
|
+
const canvas = canvasGetter()
|
|
29
|
+
data.title = `Canvas ID: ${canvas.title}`
|
|
30
|
+
data.value = canvas.id
|
|
31
|
+
})
|
|
32
|
+
return data
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type SystemDataName =
|
|
36
|
+
| 'isLocalSyncMainDevice'
|
|
37
|
+
| 'currentCanvasId'
|
|
38
|
+
| 'previousCanvasId'
|
|
39
|
+
| 'canvasIdHistory'
|
|
40
|
+
| 'rootSubspaceInfo'
|
|
41
|
+
| 'subspaceInfo'
|
|
42
|
+
| 'uniqueID'
|
|
43
|
+
| 'appVersion'
|
|
44
|
+
| 'lastUpdateTime'
|
|
45
|
+
| 'deviceName'
|
|
46
|
+
| 'deviceType'
|
|
47
|
+
| 'operationMode'
|
|
48
|
+
| 'operationVersion'
|
|
49
|
+
| 'screenWidth'
|
|
50
|
+
| 'screenHeight'
|
|
51
|
+
| 'screenScale'
|
|
52
|
+
| 'screenFontScale'
|
|
53
|
+
| 'orientation'
|
|
54
|
+
| 'touchAvailable'
|
|
55
|
+
| 'soundAvailable'
|
|
56
|
+
| 'cameraAvailable'
|
|
57
|
+
| 'audioInputAvailable'
|
|
58
|
+
| 'networkType'
|
|
59
|
+
| 'networkConnected'
|
|
60
|
+
| 'networkIpAddress'
|
|
61
|
+
| 'networkDetails'
|
|
62
|
+
| 'isInternetReachable'
|
|
63
|
+
| 'isWifiEnabled'
|
|
64
|
+
| 'deviceDisplayName'
|
|
65
|
+
| 'workspaceName'
|
|
66
|
+
| 'applicationInfo'
|
|
67
|
+
| 'applicationName'
|
|
68
|
+
| 'deviceID'
|
|
69
|
+
| 'macAddress'
|
|
70
|
+
| 'bindDeviceCode'
|
|
71
|
+
| 'bindDeviceCodeExpire'
|
|
72
|
+
| 'bindDeviceUrl'
|
|
73
|
+
| 'bindDeviceUseApplication'
|
|
74
|
+
| 'isApplicationPreview'
|
|
75
|
+
| 'isSupportAuthInDevice'
|
|
76
|
+
| 'env'
|
|
77
|
+
| 'isViewDebugModeEnabled'
|
|
78
|
+
| 'language'
|
|
79
|
+
| 'aiFilters'
|
|
80
|
+
| 'systemOpenAIApiKey'
|
|
81
|
+
| 'systemAnthropicApiKey'
|
|
82
|
+
| 'systemGeminiApiKey'
|
|
83
|
+
| 'ggmlBackendDevices'
|
|
84
|
+
|
|
85
|
+
type SystemDataInfo = {
|
|
86
|
+
name: SystemDataName
|
|
87
|
+
id: string
|
|
88
|
+
type: 'string' | 'number' | 'bool' | 'array' | 'object' | 'any'
|
|
89
|
+
title: string
|
|
90
|
+
description?: string
|
|
91
|
+
schema?: object
|
|
92
|
+
value?: any
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const systemDataList: Array<SystemDataInfo> = [
|
|
96
|
+
{
|
|
97
|
+
name: 'isLocalSyncMainDevice',
|
|
98
|
+
id: 'PROPERTY_BANK_DATA_NODE_325068e3-89b6-4c6a-942b-126d38c84a62',
|
|
99
|
+
title: 'SYSTEM: Is Local Sync Main Device',
|
|
100
|
+
description: 'The current device is main for local sync',
|
|
101
|
+
type: 'bool',
|
|
102
|
+
value: true,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'currentCanvasId',
|
|
106
|
+
id: 'PROPERTY_BANK_DATA_NODE_2dfeb635-deb4-481a-9d17-ea7b1fe19f74',
|
|
107
|
+
title: 'SYSTEM: Current Canvas ID',
|
|
108
|
+
description: 'ID for known current canvas',
|
|
109
|
+
type: 'string',
|
|
110
|
+
value: '',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'previousCanvasId',
|
|
114
|
+
id: 'PROPERTY_BANK_DATA_NODE_2971e463-0b0e-45b7-bbfb-a01d8fd49db3',
|
|
115
|
+
title: 'SYSTEM: Previous Canvas ID',
|
|
116
|
+
description: 'ID for known previous canvas',
|
|
117
|
+
type: 'string',
|
|
118
|
+
value: '',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'canvasIdHistory',
|
|
122
|
+
id: 'PROPERTY_BANK_DATA_NODE_1a086f39-817d-40ed-92f0-5a999535d3dd',
|
|
123
|
+
title: 'SYSTEM: Change Canvas History',
|
|
124
|
+
description: 'Change Canvas ID History (Limit: 10)',
|
|
125
|
+
schema: { type: 'string', allowNewItem: false, allowCustomProperty: false },
|
|
126
|
+
type: 'array',
|
|
127
|
+
value: [],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'rootSubspaceInfo',
|
|
131
|
+
id: 'PROPERTY_BANK_DATA_NODE_c0817f4a-1ff3-40ed-9cbf-71d8cefd2cd9',
|
|
132
|
+
title: 'SYSTEM: Root Subspace Info',
|
|
133
|
+
description: 'Root Subspace Information',
|
|
134
|
+
type: 'object',
|
|
135
|
+
value: {},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'subspaceInfo',
|
|
139
|
+
id: 'PROPERTY_BANK_DATA_NODE_2657ec09-7323-46c3-a96e-3d8b5a0f79b3',
|
|
140
|
+
title: 'SYSTEM: Current Subspace Info',
|
|
141
|
+
description: 'Current Subspace Information',
|
|
142
|
+
type: 'object',
|
|
143
|
+
value: {},
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'uniqueID',
|
|
147
|
+
id: 'PROPERTY_BANK_DATA_NODE_6f4a543f-a88a-4a83-bf53-223259263be3',
|
|
148
|
+
title: 'SYSTEM: Unique ID',
|
|
149
|
+
description: 'Unique ID of current device',
|
|
150
|
+
type: 'string',
|
|
151
|
+
value: 'unknown',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'appVersion',
|
|
155
|
+
id: 'PROPERTY_BANK_DATA_NODE_d614a258-2a45-4f91-9f6b-3936038cb2b1',
|
|
156
|
+
title: 'SYSTEM: App Version',
|
|
157
|
+
description: 'App Version of current installed BRICKS Foundation app',
|
|
158
|
+
type: 'string',
|
|
159
|
+
value: 'unknown',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'lastUpdateTime',
|
|
163
|
+
id: 'PROPERTY_BANK_DATA_NODE_956f3b3e-cb0b-47ca-8119-65663910d110',
|
|
164
|
+
title: 'SYSTEM: Last Update Time',
|
|
165
|
+
description: 'Last update time of current installed BRICKS Foundation app',
|
|
166
|
+
type: 'string',
|
|
167
|
+
value: '2019-07-09T03:32:27.058Z',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'deviceName',
|
|
171
|
+
id: 'PROPERTY_BANK_DATA_NODE_7b9d9ad4-e9a2-47cd-91d3-b64187895c16',
|
|
172
|
+
title: 'SYSTEM: Device Name',
|
|
173
|
+
description: 'Name of current device',
|
|
174
|
+
type: 'string',
|
|
175
|
+
value: 'Default Device Name',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'deviceType',
|
|
179
|
+
id: 'PROPERTY_BANK_DATA_NODE_b0beae12-e45e-4870-ae15-858eeac566fa',
|
|
180
|
+
title: 'SYSTEM: Device Type',
|
|
181
|
+
description: 'Type of current device (Handset, Tv, Tablet)',
|
|
182
|
+
type: 'string',
|
|
183
|
+
value: 'Tv',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'operationMode',
|
|
187
|
+
id: 'PROPERTY_BANK_DATA_NODE_2e715d3b-92bf-4761-b5c0-ca21f7c1ada8',
|
|
188
|
+
title: 'SYSTEM: Operation Mode',
|
|
189
|
+
description: 'Operation Mode of current device (android, ios, ...)',
|
|
190
|
+
type: 'string',
|
|
191
|
+
value: 'android',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'operationVersion',
|
|
195
|
+
id: 'PROPERTY_BANK_DATA_NODE_fa886963-0a16-4b5f-b4ea-6c25b049db03',
|
|
196
|
+
title: 'SYSTEM: Operation Version',
|
|
197
|
+
description: 'Operation Version of current device',
|
|
198
|
+
type: 'string',
|
|
199
|
+
value: '',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: 'screenWidth',
|
|
203
|
+
id: 'PROPERTY_BANK_DATA_NODE_2942470a-c3bc-413e-8f2c-30a89aded3f8',
|
|
204
|
+
title: 'SYSTEM: Screen Width',
|
|
205
|
+
description: 'Width of current device main screen',
|
|
206
|
+
type: 'number',
|
|
207
|
+
value: 1280,
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: 'screenHeight',
|
|
211
|
+
id: 'PROPERTY_BANK_DATA_NODE_4f031e27-f67b-40e0-a317-9f6c5215d97d',
|
|
212
|
+
title: 'SYSTEM: Screen Height',
|
|
213
|
+
description: 'Height of current device main screen',
|
|
214
|
+
type: 'number',
|
|
215
|
+
value: 768,
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'screenScale',
|
|
219
|
+
id: 'PROPERTY_BANK_DATA_NODE_c3c9b7aa-1dc1-4be1-8a4a-d9e299b9eeaa',
|
|
220
|
+
title: 'SYSTEM: Screen Scale',
|
|
221
|
+
description: 'Scale of current device main screen',
|
|
222
|
+
type: 'number',
|
|
223
|
+
value: 2,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: 'screenFontScale',
|
|
227
|
+
id: 'PROPERTY_BANK_DATA_NODE_0312f380-d525-4938-82d2-5b35ef8ef1e8',
|
|
228
|
+
title: 'SYSTEM: Screen Font Scale',
|
|
229
|
+
description: 'Font scale of current device main screen',
|
|
230
|
+
type: 'number',
|
|
231
|
+
value: 1,
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: 'orientation',
|
|
235
|
+
id: 'PROPERTY_BANK_DATA_NODE_4f584f51-a250-4f97-a2f8-d5e6a3affb4f',
|
|
236
|
+
title: 'SYSTEM: Orientation',
|
|
237
|
+
description: 'Orientation of current device main screen',
|
|
238
|
+
type: 'string',
|
|
239
|
+
value: 'landspace',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: 'touchAvailable',
|
|
243
|
+
id: 'PROPERTY_BANK_DATA_NODE_1fe7555f-df41-43ce-a268-3ea1b5efda6d',
|
|
244
|
+
title: 'SYSTEM: Touch Available',
|
|
245
|
+
description: 'Is touch available of current device main screen?',
|
|
246
|
+
type: 'bool',
|
|
247
|
+
value: true,
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: 'soundAvailable',
|
|
251
|
+
id: 'PROPERTY_BANK_DATA_NODE_bf839498-f7d6-4212-ac3a-b409e3ad77a5',
|
|
252
|
+
title: 'SYSTEM: Sound Available',
|
|
253
|
+
description: 'Is sound available of current device?',
|
|
254
|
+
type: 'bool',
|
|
255
|
+
value: true,
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: 'cameraAvailable',
|
|
259
|
+
id: 'PROPERTY_BANK_DATA_NODE_4878f3c2-8bb8-4c94-855c-06bda5a287d5',
|
|
260
|
+
title: 'SYSTEM: Camera Available',
|
|
261
|
+
description: 'Is camera available of current device?',
|
|
262
|
+
type: 'bool',
|
|
263
|
+
value: true,
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: 'audioInputAvailable',
|
|
267
|
+
id: 'PROPERTY_BANK_DATA_NODE_4854b259-96c1-40d7-b17b-47156b4698dc',
|
|
268
|
+
title: 'SYSTEM: Audio Input Available',
|
|
269
|
+
description: 'Is audio input available of current device?',
|
|
270
|
+
type: 'bool',
|
|
271
|
+
value: false,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: 'networkType',
|
|
275
|
+
id: 'PROPERTY_BANK_DATA_NODE_1cbb1756-e53c-45a9-be23-5d84a214e144',
|
|
276
|
+
title: 'SYSTEM: Network Type',
|
|
277
|
+
description: 'Network Type of current device',
|
|
278
|
+
type: 'string',
|
|
279
|
+
value: 'wifi',
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: 'networkConnected',
|
|
283
|
+
id: 'PROPERTY_BANK_DATA_NODE_687b62fe-ead5-417a-b415-9bd5233784a4',
|
|
284
|
+
title: 'SYSTEM: Network Connected',
|
|
285
|
+
description: 'Is Network connected of current device?',
|
|
286
|
+
type: 'bool',
|
|
287
|
+
value: true,
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: 'networkIpAddress',
|
|
291
|
+
id: 'PROPERTY_BANK_DATA_NODE_41971ba7-8294-4aa6-a425-ecd39853c3e6',
|
|
292
|
+
title: 'SYSTEM: Network IP Address',
|
|
293
|
+
description: 'Current network IP address',
|
|
294
|
+
type: 'string',
|
|
295
|
+
value: '',
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: 'networkDetails',
|
|
299
|
+
id: 'PROPERTY_BANK_DATA_NODE_9351fbfc-4ace-477a-b05d-41ac9b05087d',
|
|
300
|
+
title: 'SYSTEM: Network Details',
|
|
301
|
+
description: 'Network details, provide different data depends on Network Type',
|
|
302
|
+
type: 'object',
|
|
303
|
+
value: null,
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: 'isInternetReachable',
|
|
307
|
+
id: 'PROPERTY_BANK_DATA_NODE_e367ae7e-46ec-46d0-b87d-51e544591ff9',
|
|
308
|
+
title: 'SYSTEM: Internet Reachable',
|
|
309
|
+
description: 'Is Internet reachable?',
|
|
310
|
+
type: 'bool',
|
|
311
|
+
value: true,
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: 'isWifiEnabled',
|
|
315
|
+
id: 'PROPERTY_BANK_DATA_NODE_be395305-fb85-4d05-8506-22a4ae8c7b9e',
|
|
316
|
+
title: 'SYSTEM: Wifi Enabled',
|
|
317
|
+
description: 'Is WiFi enabled?',
|
|
318
|
+
type: 'bool',
|
|
319
|
+
value: true,
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
name: 'deviceDisplayName',
|
|
323
|
+
id: 'PROPERTY_BANK_DATA_NODE_76356a9a-fc46-11ec-9905-db53d6811cb7',
|
|
324
|
+
title: 'SYSTEM: Device Display Name',
|
|
325
|
+
description: 'Current device display name',
|
|
326
|
+
type: 'string',
|
|
327
|
+
value: '',
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: 'workspaceName',
|
|
331
|
+
id: 'PROPERTY_BANK_DATA_NODE_d857125e-0401-40f1-b768-56190aa8e147',
|
|
332
|
+
title: 'SYSTEM: Workspace Name',
|
|
333
|
+
description: 'Current workspace name',
|
|
334
|
+
type: 'string',
|
|
335
|
+
value: '',
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: 'applicationInfo',
|
|
339
|
+
id: 'PROPERTY_BANK_DATA_NODE_935d3322-84aa-4465-b1e7-241d1f024267',
|
|
340
|
+
title: 'SYSTEM: Application Info',
|
|
341
|
+
description: 'Current application info',
|
|
342
|
+
type: 'object',
|
|
343
|
+
value: {},
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: 'applicationName',
|
|
347
|
+
id: 'PROPERTY_BANK_DATA_NODE_df395fd6-a754-4b60-8bac-1360933e6707',
|
|
348
|
+
title: 'SYSTEM: Application Name',
|
|
349
|
+
description: 'Current application name',
|
|
350
|
+
type: 'string',
|
|
351
|
+
value: '',
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: 'deviceID',
|
|
355
|
+
id: 'PROPERTY_BANK_DATA_NODE_8b5c2d9e-f0a1-4b2c-8d3e-4f5a6b7c8d9e',
|
|
356
|
+
title: 'SYSTEM: Device ID',
|
|
357
|
+
description: 'Device ID of current device',
|
|
358
|
+
type: 'string',
|
|
359
|
+
value: 'unknown',
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: 'macAddress',
|
|
363
|
+
id: 'PROPERTY_BANK_DATA_NODE_f01fcc78-0723-11ed-ac00-877339de1030',
|
|
364
|
+
title: 'SYSTEM: MAC Address',
|
|
365
|
+
description: 'Network adapter MAC address of current device',
|
|
366
|
+
type: 'string',
|
|
367
|
+
value: '',
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
name: 'bindDeviceCode',
|
|
371
|
+
id: 'PROPERTY_BANK_DATA_NODE_1ca90262-3584-11ed-8c9a-174949844872',
|
|
372
|
+
title: 'SYSTEM: Bind Device Code',
|
|
373
|
+
description: 'The passcode to bind the device',
|
|
374
|
+
type: 'string',
|
|
375
|
+
value: '',
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
name: 'bindDeviceCodeExpire',
|
|
379
|
+
id: 'PROPERTY_BANK_DATA_NODE_5b52d204-3584-11ed-bb5e-abb4d270daf1',
|
|
380
|
+
title: 'SYSTEM: Bind Device Code Expire Time',
|
|
381
|
+
description: 'The expire time of bind passcode',
|
|
382
|
+
type: 'string',
|
|
383
|
+
value: '',
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: 'bindDeviceUrl',
|
|
387
|
+
id: 'PROPERTY_BANK_DATA_NODE_833a7db2-3584-11ed-88dd-3b3d3ff58855',
|
|
388
|
+
title: 'SYSTEM: Bind Device URL',
|
|
389
|
+
description: 'The URL to bind the device',
|
|
390
|
+
type: 'string',
|
|
391
|
+
value: '',
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: 'bindDeviceUseApplication',
|
|
395
|
+
id: 'PROPERTY_BANK_DATA_NODE_631bbce8-9c90-4590-b8ec-8b27f4a0e50b',
|
|
396
|
+
title: 'SYSTEM: Selected Application on Bind Device',
|
|
397
|
+
description: 'Current selected use application info on Bind Device',
|
|
398
|
+
type: 'object',
|
|
399
|
+
value: null,
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: 'isApplicationPreview',
|
|
403
|
+
id: 'PROPERTY_BANK_DATA_NODE_c673967a-3996-11ed-96d9-efbc3f7eac53',
|
|
404
|
+
title: 'SYSTEM: Is Preview Mode',
|
|
405
|
+
description: 'Is current in preview mode?',
|
|
406
|
+
type: 'bool',
|
|
407
|
+
value: '',
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
name: 'isSupportAuthInDevice',
|
|
411
|
+
id: 'PROPERTY_BANK_DATA_NODE_beb2a666-3e18-11ed-bdab-6f0cb082fa67',
|
|
412
|
+
title: 'SYSTEM: Is Support Auth In Device',
|
|
413
|
+
description: 'Is current device support auth in device?',
|
|
414
|
+
type: 'bool',
|
|
415
|
+
value: '',
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
name: 'env',
|
|
419
|
+
id: 'PROPERTY_BANK_DATA_NODE_74e7a574-1099-4fe5-b193-8a9ea7d20ed0',
|
|
420
|
+
title: 'SYSTEM: Environment Variables',
|
|
421
|
+
description: 'Environment Variables of the device',
|
|
422
|
+
type: 'object',
|
|
423
|
+
value: {},
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: 'isViewDebugModeEnabled',
|
|
427
|
+
id: 'PROPERTY_BANK_DATA_NODE_3f61c4f6-1e02-492e-8e4c-a8dc4a5bc101',
|
|
428
|
+
title: 'SYSTEM: Is View Debug mode Enabled',
|
|
429
|
+
description: 'Is View Debug mode enabled?',
|
|
430
|
+
type: 'bool',
|
|
431
|
+
value: false,
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
name: 'language',
|
|
435
|
+
id: 'PROPERTY_BANK_DATA_NODE_f0ed0a03-6195-459f-9ffe-bca61923f94e',
|
|
436
|
+
title: 'SYSTEM: Language',
|
|
437
|
+
description: 'Language of the device',
|
|
438
|
+
type: 'string',
|
|
439
|
+
value: '',
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
name: 'aiFilters',
|
|
443
|
+
id: 'PROPERTY_BANK_DATA_NODE_3ffc1e98-8f65-4cc8-a949-3da8d2092ccb',
|
|
444
|
+
title: 'SYSTEM: AI Filters',
|
|
445
|
+
description: 'AI filters configuration from the application',
|
|
446
|
+
type: 'array',
|
|
447
|
+
value: [],
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: 'systemOpenAIApiKey',
|
|
451
|
+
id: 'PROPERTY_BANK_DATA_NODE_a1b2c3d4-5e6f-7890-abcd-ef1234567890',
|
|
452
|
+
title: 'SYSTEM: OpenAI API Key',
|
|
453
|
+
description: 'System OpenAI API Key (only available if application enabled)',
|
|
454
|
+
type: 'string',
|
|
455
|
+
value: '',
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
name: 'systemAnthropicApiKey',
|
|
459
|
+
id: 'PROPERTY_BANK_DATA_NODE_b2c3d4e5-6f78-9012-bcde-f23456789012',
|
|
460
|
+
title: 'SYSTEM: Anthropic API Key',
|
|
461
|
+
description: 'System Anthropic API Key (only available if application enabled)',
|
|
462
|
+
type: 'string',
|
|
463
|
+
value: '',
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
name: 'systemGeminiApiKey',
|
|
467
|
+
id: 'PROPERTY_BANK_DATA_NODE_c3d4e5f6-7890-1234-cdef-345678901234',
|
|
468
|
+
title: 'SYSTEM: Gemini API Key',
|
|
469
|
+
description: 'System Gemini API Key (only available if application enabled)',
|
|
470
|
+
type: 'string',
|
|
471
|
+
value: '',
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
name: 'ggmlBackendDevices',
|
|
475
|
+
id: 'PROPERTY_BANK_DATA_NODE_9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b',
|
|
476
|
+
title: 'SYSTEM: GGML Backend Devices',
|
|
477
|
+
description: 'Available GGML backend devices with supported generators',
|
|
478
|
+
schema: { type: 'object', allowNewItem: false, allowCustomProperty: false },
|
|
479
|
+
type: 'array',
|
|
480
|
+
value: [],
|
|
481
|
+
},
|
|
482
|
+
]
|
|
483
|
+
|
|
484
|
+
export const useSystemData = (name: SystemDataName): Data => {
|
|
485
|
+
const info = systemDataList.find((data) => data.name === name)
|
|
486
|
+
if (!info) throw new Error(`System data '${name}' not found`)
|
|
487
|
+
return {
|
|
488
|
+
__typename: 'Data',
|
|
489
|
+
id: info.id,
|
|
490
|
+
type: info.type,
|
|
491
|
+
title: info.title,
|
|
492
|
+
description: info.description,
|
|
493
|
+
routing: 'read-only',
|
|
494
|
+
schema: info.schema,
|
|
495
|
+
value: info.value,
|
|
496
|
+
}
|
|
497
|
+
}
|