@fugood/bricks-ctor 2.25.0-beta.60 → 2.25.0-beta.61
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/package.json +4 -28
- package/tools/deploy.ts +19 -176
- package/tools/mcp-server.ts +16 -33
- package/tools/postinstall.ts +21 -292
- package/tools/pull.ts +15 -195
- package/tools/push-config.ts +18 -113
- package/tools/simulator.ts +19 -148
- package/compile/__tests__/config-diff.test.js +0 -100
- package/compile/__tests__/index.test.js +0 -461
- package/compile/__tests__/util.test.js +0 -450
- package/compile/action-name-map.ts +0 -1079
- package/compile/config-diff.ts +0 -155
- package/compile/index.ts +0 -1594
- package/compile/util.ts +0 -482
- package/index.ts +0 -6
- package/skills/bricks-ctor/SKILL.md +0 -38
- package/skills/bricks-ctor/references/animation.md +0 -160
- package/skills/bricks-ctor/references/architecture-patterns.md +0 -88
- package/skills/bricks-ctor/references/automations.md +0 -232
- package/skills/bricks-ctor/references/buttress.md +0 -245
- package/skills/bricks-ctor/references/data-calculation.md +0 -252
- package/skills/bricks-ctor/references/local-sync.md +0 -129
- package/skills/bricks-ctor/references/media-flow.md +0 -165
- package/skills/bricks-ctor/references/remote-data-bank.md +0 -196
- package/skills/bricks-ctor/references/simulator.md +0 -132
- package/skills/bricks-ctor/references/source-editing-tools.md +0 -81
- package/skills/bricks-ctor/references/standby-transition.md +0 -124
- package/skills/bricks-ctor/references/verification-toolchain.md +0 -200
- package/skills/bricks-design/SKILL.md +0 -171
- package/skills/bricks-design/references/architecture-truths.md +0 -132
- package/skills/bricks-design/references/avoiding-complexity.md +0 -91
- package/skills/bricks-design/references/design-critique.md +0 -195
- package/skills/bricks-design/references/design-languages.md +0 -265
- package/skills/bricks-design/references/performance.md +0 -116
- package/skills/bricks-design/references/presentation-and-slideshow.md +0 -137
- package/skills/bricks-design/references/translating-inputs.md +0 -152
- package/skills/bricks-design/references/variations-and-tweaks.md +0 -124
- package/skills/bricks-design/references/when-the-brief-is-branded.md +0 -284
- package/skills/bricks-design/references/when-the-brief-is-vague.md +0 -85
- package/skills/bricks-design/references/workflow.md +0 -134
- package/skills/bricks-ux/SKILL.md +0 -114
- package/skills/bricks-ux/references/accessibility.md +0 -162
- package/skills/bricks-ux/references/flow-states.md +0 -175
- package/skills/bricks-ux/references/interaction-archetypes.md +0 -189
- package/skills/bricks-ux/references/monitoring-screens.md +0 -153
- package/skills/bricks-ux/references/pressable-composition.md +0 -126
- package/skills/bricks-ux/references/user-journey.md +0 -168
- package/skills/bricks-ux/references/ux-critique.md +0 -256
- package/skills/rive-marketplace/SKILL.md +0 -99
- package/tools/__tests__/_cli-error.test.ts +0 -35
- package/tools/__tests__/_mcp-config.test.ts +0 -67
- package/tools/__tests__/pull.test.ts +0 -108
- package/tools/_cli-error.ts +0 -17
- package/tools/_edits-log.ts +0 -41
- package/tools/_git-author.ts +0 -37
- package/tools/_last-pushed-commit.ts +0 -28
- package/tools/_mcp-config.ts +0 -42
- package/tools/_shell.ts +0 -180
- package/tools/icons/.gitattributes +0 -1
- package/tools/icons/fa6pro-glyphmap.json +0 -4686
- package/tools/icons/fa6pro-meta.json +0 -1
- package/tools/mcp-env.ts +0 -13
- package/tools/mcp-tools/__tests__/data-calc-editing.test.js +0 -516
- package/tools/mcp-tools/__tests__/entry-editing.test.js +0 -866
- package/tools/mcp-tools/__tests__/huggingface.test.ts +0 -49
- package/tools/mcp-tools/__tests__/icons.test.ts +0 -21
- package/tools/mcp-tools/__tests__/mcp-env.test.js +0 -19
- package/tools/mcp-tools/_editing-helpers.ts +0 -98
- package/tools/mcp-tools/_verify.ts +0 -50
- package/tools/mcp-tools/compile.ts +0 -104
- package/tools/mcp-tools/data-calc-editing.ts +0 -1311
- package/tools/mcp-tools/entry-editing.ts +0 -2297
- package/tools/mcp-tools/huggingface.ts +0 -772
- package/tools/mcp-tools/icons.ts +0 -97
- package/tools/mcp-tools/lottie.ts +0 -102
- package/tools/mcp-tools/media.ts +0 -113
- package/tools/simulator-main.mjs +0 -488
- package/tools/simulator-preload.cjs +0 -16
- package/types/animation.d.ts +0 -116
- package/types/automation.d.ts +0 -231
- package/types/brick-base.d.ts +0 -80
- package/types/bricks/Camera.d.ts +0 -246
- package/types/bricks/Chart.d.ts +0 -372
- package/types/bricks/GenerativeMedia.d.ts +0 -290
- package/types/bricks/Icon.d.ts +0 -98
- package/types/bricks/Image.d.ts +0 -126
- package/types/bricks/Items.d.ts +0 -480
- package/types/bricks/Lottie.d.ts +0 -168
- package/types/bricks/Maps.d.ts +0 -262
- package/types/bricks/QrCode.d.ts +0 -117
- package/types/bricks/Rect.d.ts +0 -150
- package/types/bricks/RichText.d.ts +0 -131
- package/types/bricks/Rive.d.ts +0 -220
- package/types/bricks/Scene3D.d.ts +0 -676
- package/types/bricks/Sketch.d.ts +0 -256
- package/types/bricks/Slideshow.d.ts +0 -201
- package/types/bricks/Svg.d.ts +0 -99
- package/types/bricks/Text.d.ts +0 -148
- package/types/bricks/TextInput.d.ts +0 -242
- package/types/bricks/Video.d.ts +0 -242
- package/types/bricks/VideoStreaming.d.ts +0 -112
- package/types/bricks/WebRtcStream.d.ts +0 -65
- package/types/bricks/WebView.d.ts +0 -168
- package/types/bricks/index.d.ts +0 -23
- package/types/canvas.d.ts +0 -82
- package/types/common.d.ts +0 -141
- package/types/data-calc-command/base.d.ts +0 -57
- package/types/data-calc-command/collection.d.ts +0 -418
- package/types/data-calc-command/color.d.ts +0 -432
- package/types/data-calc-command/constant.d.ts +0 -50
- package/types/data-calc-command/datetime.d.ts +0 -147
- package/types/data-calc-command/file.d.ts +0 -129
- package/types/data-calc-command/index.d.ts +0 -13
- package/types/data-calc-command/iteratee.d.ts +0 -23
- package/types/data-calc-command/logictype.d.ts +0 -190
- package/types/data-calc-command/math.d.ts +0 -275
- package/types/data-calc-command/object.d.ts +0 -119
- package/types/data-calc-command/sandbox.d.ts +0 -66
- package/types/data-calc-command/string.d.ts +0 -407
- package/types/data-calc-script.d.ts +0 -21
- package/types/data-calc.d.ts +0 -12
- package/types/data.d.ts +0 -97
- package/types/generators/AlarmClock.d.ts +0 -110
- package/types/generators/Assistant.d.ts +0 -640
- package/types/generators/BleCentral.d.ts +0 -247
- package/types/generators/BlePeripheral.d.ts +0 -208
- package/types/generators/CanvasMap.d.ts +0 -74
- package/types/generators/CastlesPay.d.ts +0 -87
- package/types/generators/DataBank.d.ts +0 -160
- package/types/generators/File.d.ts +0 -432
- package/types/generators/GraphQl.d.ts +0 -132
- package/types/generators/Http.d.ts +0 -222
- package/types/generators/HttpServer.d.ts +0 -230
- package/types/generators/Information.d.ts +0 -103
- package/types/generators/Intent.d.ts +0 -168
- package/types/generators/Iterator.d.ts +0 -108
- package/types/generators/Keyboard.d.ts +0 -105
- package/types/generators/LlmAnthropicCompat.d.ts +0 -212
- package/types/generators/LlmAppleBuiltin.d.ts +0 -159
- package/types/generators/LlmGgml.d.ts +0 -903
- package/types/generators/LlmMediaTekNeuroPilot.d.ts +0 -235
- package/types/generators/LlmMlx.d.ts +0 -228
- package/types/generators/LlmOnnx.d.ts +0 -213
- package/types/generators/LlmOpenAiCompat.d.ts +0 -312
- package/types/generators/LlmQualcommAiEngine.d.ts +0 -247
- package/types/generators/Mcp.d.ts +0 -637
- package/types/generators/McpServer.d.ts +0 -289
- package/types/generators/MediaFlow.d.ts +0 -170
- package/types/generators/MqttBroker.d.ts +0 -141
- package/types/generators/MqttClient.d.ts +0 -141
- package/types/generators/Question.d.ts +0 -408
- package/types/generators/RealtimeTranscription.d.ts +0 -287
- package/types/generators/RerankerGgml.d.ts +0 -195
- package/types/generators/SerialPort.d.ts +0 -151
- package/types/generators/SoundPlayer.d.ts +0 -94
- package/types/generators/SoundRecorder.d.ts +0 -139
- package/types/generators/SpeechToTextGgml.d.ts +0 -424
- package/types/generators/SpeechToTextOnnx.d.ts +0 -236
- package/types/generators/SpeechToTextPlatform.d.ts +0 -85
- package/types/generators/SqLite.d.ts +0 -159
- package/types/generators/Step.d.ts +0 -107
- package/types/generators/SttAppleBuiltin.d.ts +0 -153
- package/types/generators/Tcp.d.ts +0 -126
- package/types/generators/TcpServer.d.ts +0 -147
- package/types/generators/TextToSpeechAppleBuiltin.d.ts +0 -127
- package/types/generators/TextToSpeechGgml.d.ts +0 -221
- package/types/generators/TextToSpeechOnnx.d.ts +0 -178
- package/types/generators/TextToSpeechOpenAiLike.d.ts +0 -121
- package/types/generators/ThermalPrinter.d.ts +0 -193
- package/types/generators/Tick.d.ts +0 -83
- package/types/generators/Udp.d.ts +0 -120
- package/types/generators/VadGgml.d.ts +0 -260
- package/types/generators/VadOnnx.d.ts +0 -231
- package/types/generators/VadTraditional.d.ts +0 -138
- package/types/generators/VectorStore.d.ts +0 -257
- package/types/generators/Watchdog.d.ts +0 -107
- package/types/generators/WebCrawler.d.ts +0 -103
- package/types/generators/WebRtc.d.ts +0 -181
- package/types/generators/WebSocket.d.ts +0 -148
- package/types/generators/index.d.ts +0 -57
- package/types/index.d.ts +0 -13
- package/types/subspace.d.ts +0 -60
- package/types/switch.d.ts +0 -51
- package/types/system.d.ts +0 -707
- package/utils/__tests__/calc.test.js +0 -25
- package/utils/__tests__/id.test.js +0 -154
- package/utils/calc.ts +0 -130
- package/utils/data.ts +0 -495
- package/utils/event-props.ts +0 -912
- package/utils/id.ts +0 -133
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
# Remote Data Bank
|
|
2
|
-
|
|
3
|
-
Cloud-synchronized Data Bank for real-time data sharing across devices and external API access.
|
|
4
|
-
|
|
5
|
-
## Remote Update Types
|
|
6
|
-
|
|
7
|
-
The `remoteUpdate` field configures cloud synchronization:
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
remoteUpdate?:
|
|
11
|
-
| { type: 'auto' } // Sync across all devices
|
|
12
|
-
| { type: 'device-specific' } // Isolated per device
|
|
13
|
-
| { type: 'global-data', id: string } // Cross-application global data
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
### Auto Sync
|
|
17
|
-
|
|
18
|
-
Sync across all devices using the same application.
|
|
19
|
-
|
|
20
|
-
```typescript
|
|
21
|
-
import { makeId } from 'bricks-ctor'
|
|
22
|
-
|
|
23
|
-
const data: Data = {
|
|
24
|
-
__typename: 'Data',
|
|
25
|
-
id: makeId('data'),
|
|
26
|
-
title: 'Announcement',
|
|
27
|
-
type: 'string',
|
|
28
|
-
value: '',
|
|
29
|
-
remoteUpdate: { type: 'auto' },
|
|
30
|
-
events: {},
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Global Data
|
|
35
|
-
|
|
36
|
-
Share data across different applications. Must create Global Data first on BANK page.
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
import { makeId } from 'bricks-ctor'
|
|
40
|
-
|
|
41
|
-
const data: Data = {
|
|
42
|
-
__typename: 'Data',
|
|
43
|
-
id: makeId('data'),
|
|
44
|
-
title: 'Global Config',
|
|
45
|
-
type: 'object',
|
|
46
|
-
value: {},
|
|
47
|
-
remoteUpdate: { type: 'global-data', id: 'workspace-global-config-id' },
|
|
48
|
-
events: {},
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Device Specific
|
|
53
|
-
|
|
54
|
-
Isolate data per device while still allowing web page control.
|
|
55
|
-
|
|
56
|
-
```typescript
|
|
57
|
-
import { makeId } from 'bricks-ctor'
|
|
58
|
-
|
|
59
|
-
const data: Data = {
|
|
60
|
-
__typename: 'Data',
|
|
61
|
-
id: makeId('data'),
|
|
62
|
-
title: 'Device Message',
|
|
63
|
-
type: 'string',
|
|
64
|
-
value: '',
|
|
65
|
-
remoteUpdate: { type: 'device-specific' },
|
|
66
|
-
events: {},
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Use case: Control individual displays from a shared web interface without affecting other devices.
|
|
71
|
-
|
|
72
|
-
## External Access
|
|
73
|
-
|
|
74
|
-
### Web Update Page
|
|
75
|
-
|
|
76
|
-
Generate a web page for non-technical users to update data:
|
|
77
|
-
|
|
78
|
-
1. Visit BANK page
|
|
79
|
-
2. Click `Manage Keys`
|
|
80
|
-
3. Select `Generate Key used by Update Page`
|
|
81
|
-
4. Share the generated link
|
|
82
|
-
|
|
83
|
-
The page has independent permissions and can be shared with content managers.
|
|
84
|
-
|
|
85
|
-
### API Access
|
|
86
|
-
|
|
87
|
-
Programmatic data updates via REST API.
|
|
88
|
-
|
|
89
|
-
**Setup:**
|
|
90
|
-
1. Visit BANK page → Manage Keys
|
|
91
|
-
2. Create API key with appropriate permissions
|
|
92
|
-
3. Use key in API requests
|
|
93
|
-
|
|
94
|
-
**Example API Usage:**
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Update a property
|
|
98
|
-
curl -X POST https://api.bricks.tools/v1/bank/update \
|
|
99
|
-
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
100
|
-
-H "Content-Type: application/json" \
|
|
101
|
-
-d '{
|
|
102
|
-
"applicationId": "app-id",
|
|
103
|
-
"propertyId": "announcement",
|
|
104
|
-
"value": "New announcement text"
|
|
105
|
-
}'
|
|
106
|
-
|
|
107
|
-
# Get property value
|
|
108
|
-
curl https://api.bricks.tools/v1/bank/get \
|
|
109
|
-
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
110
|
-
-G \
|
|
111
|
-
-d "applicationId=app-id" \
|
|
112
|
-
-d "propertyId=announcement"
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Data Routing
|
|
116
|
-
|
|
117
|
-
Cross-subspace data sharing with access control.
|
|
118
|
-
|
|
119
|
-
```typescript
|
|
120
|
-
const routedData: Data = {
|
|
121
|
-
__typename: 'Data',
|
|
122
|
-
id: 'shared-state',
|
|
123
|
-
type: 'object',
|
|
124
|
-
routing: 'read-only', // 'read-only' | default (read-write)
|
|
125
|
-
// When read-only: only accepts changes from same subspace
|
|
126
|
-
// Default: accepts changes from any subspace
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## Use Cases
|
|
131
|
-
|
|
132
|
-
### Digital Signage Content Management
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
import { makeId } from 'bricks-ctor'
|
|
136
|
-
|
|
137
|
-
// Remote-updated announcement
|
|
138
|
-
const announcement: Data = {
|
|
139
|
-
__typename: 'Data',
|
|
140
|
-
id: makeId('data'),
|
|
141
|
-
title: 'Announcement',
|
|
142
|
-
type: 'object',
|
|
143
|
-
value: { title: '', body: '', enabled: false },
|
|
144
|
-
remoteUpdate: { type: 'auto' },
|
|
145
|
-
events: {},
|
|
146
|
-
}
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Operator updates content via web page → All displays update in real-time.
|
|
150
|
-
|
|
151
|
-
### Multi-Location Coordination
|
|
152
|
-
|
|
153
|
-
```typescript
|
|
154
|
-
import { makeId } from 'bricks-ctor'
|
|
155
|
-
|
|
156
|
-
// Global data shared across locations
|
|
157
|
-
const globalConfig: Data = {
|
|
158
|
-
__typename: 'Data',
|
|
159
|
-
id: makeId('data'),
|
|
160
|
-
title: 'Brand Config',
|
|
161
|
-
type: 'object',
|
|
162
|
-
value: {},
|
|
163
|
-
remoteUpdate: { type: 'global-data', id: 'brand-config-global' },
|
|
164
|
-
events: {},
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
Update once → All locations receive update.
|
|
169
|
-
|
|
170
|
-
### Per-Device Customization
|
|
171
|
-
|
|
172
|
-
```typescript
|
|
173
|
-
import { makeId } from 'bricks-ctor'
|
|
174
|
-
|
|
175
|
-
// Device-specific greeting
|
|
176
|
-
const deviceGreeting: Data = {
|
|
177
|
-
__typename: 'Data',
|
|
178
|
-
id: makeId('data'),
|
|
179
|
-
title: 'Greeting',
|
|
180
|
-
type: 'string',
|
|
181
|
-
value: '',
|
|
182
|
-
remoteUpdate: { type: 'device-specific' },
|
|
183
|
-
events: {},
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Each display shows different greeting, controlled from single dashboard.
|
|
188
|
-
|
|
189
|
-
## Best Practices
|
|
190
|
-
|
|
191
|
-
1. **Minimize remote data**: Only enable for data that truly needs cloud sync
|
|
192
|
-
2. **Use device-specific wisely**: Good for personalization, not for shared state
|
|
193
|
-
3. **API key security**: Use scoped keys with minimal permissions
|
|
194
|
-
4. **Offline resilience**: Design for temporary disconnection
|
|
195
|
-
5. **Batch updates**: Group related changes to reduce API calls
|
|
196
|
-
6. **Global data governance**: Establish clear ownership for global data keys
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# Simulator
|
|
2
|
-
|
|
3
|
-
What the Simulator can and can't faithfully reproduce — so a passing Simulator run means what you think it means. This is the fidelity companion to Path 1 in [Verification Toolchain](verification-toolchain.md); read that for how to *drive* the Simulator (compile, screenshot, Automations).
|
|
4
|
-
|
|
5
|
-
## What it is
|
|
6
|
-
|
|
7
|
-
- The default Path 1 target: it renders your compiled project on your computer, with no device required.
|
|
8
|
-
- It runs in Chromium/Electron — a browser-class runtime, not the device runtime. Two consequences to design verification around: it has a browser's capabilities and limits (below), and its JavaScript engine differs from the device's (iOS runs JSC, Android runs Hermes), so engine-specific behavior won't surface here.
|
|
9
|
-
|
|
10
|
-
A Simulator screenshot proves **layout, navigation, Standby Transitions, Data wiring, and generator/Automation wiring**. It does *not* prove anything that depends on real hardware, real models, or capabilities the preview runtime lacks.
|
|
11
|
-
|
|
12
|
-
## Automation screenshots
|
|
13
|
-
|
|
14
|
-
`match_screenshot` stores Simulator automation artifacts at the project level:
|
|
15
|
-
|
|
16
|
-
```text
|
|
17
|
-
.bricks/automation_screenshots/
|
|
18
|
-
last/
|
|
19
|
-
failed/
|
|
20
|
-
diff/
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
There is no application-id subdirectory; in CTOR the project is the application. Generated project `.gitignore` files exclude this directory.
|
|
24
|
-
|
|
25
|
-
When a `match_screenshot` baseline is missing or updated, the baseline goes under `last/`. When a screenshot mismatch occurs, the current capture goes under `failed/` and the pixel diff goes under `diff/`. File names follow `<screenshotName>+local+<timestamp>.png`.
|
|
26
|
-
|
|
27
|
-
In CTOR Desktop, `simulator_invoke` reports any automation screenshot files created or changed by the invocation in an `Automation screenshots:` section. It still separately reports the ordinary preview capture at `.bricks/simulator-screenshot.jpg`.
|
|
28
|
-
|
|
29
|
-
## What the Simulator can't reproduce
|
|
30
|
-
|
|
31
|
-
Because it runs in a browser-class preview rather than on device hardware, the Simulator cannot exercise these — a green run says nothing about them. Verify on a real device (Path 2):
|
|
32
|
-
|
|
33
|
-
| Area | In the Simulator |
|
|
34
|
-
|------|------------------|
|
|
35
|
-
| BLE (Central / Peripheral), Video Streaming | Not available |
|
|
36
|
-
| Raw network sockets — UDP, TCP, TCP Server, MQTT Broker | Not available (also why Buttress LAN discovery is a no-op — see [Buttress](buttress.md)) |
|
|
37
|
-
| Android Intent | Not available (Android-only) |
|
|
38
|
-
| On-device database **persistence** (SQLite / Vector Store) | Not available — both run in-memory in the Simulator (see caveats below), so data never survives a reload |
|
|
39
|
-
| GGML Text-to-Speech | No vocoder in the preview — use an ONNX TTS model to hear speech |
|
|
40
|
-
|
|
41
|
-
These work, but with browser caveats:
|
|
42
|
-
|
|
43
|
-
| Area | Caveat |
|
|
44
|
-
|------|--------|
|
|
45
|
-
| Serial Port | Works via WebSerial — requires browser support and a user gesture |
|
|
46
|
-
| WebView / WebCrawler | Subject to browser CORS — a load/fetch that works on device may be blocked |
|
|
47
|
-
| On-device AI (LLM / STT / VAD / Vector Store / Reranker) | Runs **single-threaded** — far slower than the device, not representative of real latency. Also subject to the model fallbacks below |
|
|
48
|
-
| On-device database (SQLite — `GENERATOR_SQLITE`) | Runs for real on the in-memory WASM `sqlite-vec` build — `execute` / `query` / `transaction` / batch all work. `storageType: file` is transparently treated as in-memory, so nothing persists across reloads (see above) |
|
|
49
|
-
| Scene3D / Sketch / WebRTC | Supported |
|
|
50
|
-
|
|
51
|
-
Feature availability also varies across the device platforms themselves (iOS / tvOS / Android / the desktop OSes). When a deployment targets a specific platform's capability, confirm it on that platform.
|
|
52
|
-
|
|
53
|
-
## Network security
|
|
54
|
-
|
|
55
|
-
The Simulator blocks insecure connections from `applicationPreview` by default: `http://` and `ws://` requests fail, while `https://` and `wss://` are allowed. The Simulator internally allows its own preview host when running the development preview.
|
|
56
|
-
|
|
57
|
-
Generated projects include this project-level setting:
|
|
58
|
-
|
|
59
|
-
```json
|
|
60
|
-
{
|
|
61
|
-
"allowedInsecureHosts": []
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Add explicit entries only when you deliberately need to test an insecure endpoint in the Simulator. A bare `host:port` allows both `http://` and `ws://` for that host:
|
|
66
|
-
|
|
67
|
-
```json
|
|
68
|
-
{
|
|
69
|
-
"allowedInsecureHosts": ["localhost:8080"]
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Use a URL form when only one insecure protocol should be allowed:
|
|
74
|
-
|
|
75
|
-
```json
|
|
76
|
-
{
|
|
77
|
-
"allowedInsecureHosts": ["http://localhost:8080"]
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
In that example, `http://localhost:8080` is allowed and `ws://localhost:8080` remains blocked.
|
|
82
|
-
|
|
83
|
-
Prefer HTTPS/WSS for anything that is not local development.
|
|
84
|
-
|
|
85
|
-
## Feature fallbacks — what the Simulator fakes
|
|
86
|
-
|
|
87
|
-
So that camera and AI features are usable without device permissions, multi-gigabyte downloads, API keys, or a remote inference backend, the Simulator **transparently substitutes a lightweight stand-in** for a few bricks/generators. The config you author is untouched — only the Simulator's runtime behavior differs. **A fallback render proves wiring and layout, not the real feature.**
|
|
88
|
-
|
|
89
|
-
| Brick / Generator | In the Simulator | Does NOT prove |
|
|
90
|
-
|-------------------|------------------|----------------|
|
|
91
|
-
| Camera (`BRICK_CAMERA`) | A 3D mock canvas, no camera permission prompt. `takePicture` snapshots the canvas; recording produces a placeholder clip | Real camera feed, focus, recording, permission flow |
|
|
92
|
-
| Maps (`BRICK_MAPS`) | A real interactive map on free OpenStreetMap-based tiles — no Google Maps API key needed. Markers, path polyline, the six themes / map types (approximated with free tile sets + CSS tints), and the zoom / pan / navigate / focus / reset / fit actions all work | Google / Apple Maps rendering, exact `customMapStyle` / theme styling (approximated), traffic / buildings / indoors layers, real device geolocation |
|
|
93
|
-
| Thermal Printer (`GENERATOR_THERMAL_PRINTER`) | A simulated printer — `init` / `checkStatus` / `scan` fake per-driver status and discovered devices (ESC/POS, Star, TSC, Castles); `print` renders an approximate on-screen receipt. A bottom-left bubble shows live status with a fault toggle to exercise error wiring. Print results can be exported as PNG via `bricks-cli` (see below) | Real device connection, actual paper output, exact native driver status codes |
|
|
94
|
-
| LLM (`GENERATOR_LLM`) | Swapped to a tiny local stand-in model | Output quality / latency of your real model |
|
|
95
|
-
| Reranker — GGML (`GENERATOR_RERANKER`) | Swapped to a small local multilingual reranker model | Ranking quality / latency of your real model |
|
|
96
|
-
| Speech-to-Text — GGML (`GENERATOR_SPEECH_INFERENCE`) | Swapped to a tiny local model | Accuracy / latency of your real model |
|
|
97
|
-
| Speech-to-Text — ONNX (`GENERATOR_ONNX_STT`) | Swapped to a tiny whisper model | Accuracy / latency of your real model |
|
|
98
|
-
| Text-to-Speech — ONNX (`GENERATOR_TTS`) | Swapped to a tiny VITS model (no vocoder or speaker embedding) | Voice / quality / latency of your real model |
|
|
99
|
-
| Vector Store (`GENERATOR_VECTOR_STORE`) | Runs with a tiny local embedding model — an OpenAI-source config works **without a key** | Real embeddings / dimensions / recall (and no persistence — see above) |
|
|
100
|
-
| Buttress (all generators) | **Disabled** — there is no remote inference backend in the Simulator | The Buttress offload path — see [Buttress](buttress.md) |
|
|
101
|
-
| MLX LLM (`GENERATOR_MLX_LLM`) | Runs as authored, except Buttress is disabled | The MLX / Buttress path |
|
|
102
|
-
|
|
103
|
-
These swaps make the AI generators runnable in the Simulator for wiring checks — validate real models, quality, and latency on a device (Path 2).
|
|
104
|
-
|
|
105
|
-
### Inspecting simulated thermal printer print results
|
|
106
|
-
|
|
107
|
-
With the Simulator running (CDP at `localhost:19852`, see [Verification Toolchain](verification-toolchain.md)), `bricks-cli` can read the simulated printers and export a print result as a PNG image — no need to open the bubble popover or screenshot the whole window:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
# Printers + print history (newest first; shows the --index value per result)
|
|
111
|
-
bricks devtools simulator thermal-printer list -p 19852
|
|
112
|
-
bricks devtools simulator thermal-printer list -p 19852 -j --commands # full print payloads as JSON
|
|
113
|
-
|
|
114
|
-
# Render one print result to PNG (defaults: the only printer, --index 0 = latest)
|
|
115
|
-
bricks devtools simulator thermal-printer print-result -p 19852 -o receipt.png
|
|
116
|
-
bricks devtools simulator thermal-printer print-result -p 19852 --index 1 --scale 2 -o older.png
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
The PNG is the same approximate receipt the on-screen preview shows (rendered from the print payload). It proves the payload wiring — content, ordering, alignment, barcode/QR/image presence — not pixel-exact native raster output. Print history is in-memory (up to 10 per printer) and clears on preview reload.
|
|
120
|
-
|
|
121
|
-
### Running the real implementation instead
|
|
122
|
-
|
|
123
|
-
Each substituted brick/generator can be switched back to its real implementation per item: open the **gear (Simulator settings)** in the editor's preview toolbar, uncheck the item, and **Apply**. Apply persists the choice and reloads the preview so it takes effect (a plain refresh won't). Use this to, e.g., point a Vector Store at a real API key in the preview, or render the real Google/Apple Maps brick (which needs a Maps API key on web). The browser limits above still apply, and **Buttress stays disabled regardless** — there's no backend for it here.
|
|
124
|
-
|
|
125
|
-
The Thermal Printer is the exception: it has no real web implementation to switch to (the native drivers can't run in a browser), so it is **always simulated** and is not in the gear list.
|
|
126
|
-
|
|
127
|
-
## Enough vs. escalate
|
|
128
|
-
|
|
129
|
-
- **Simulator is enough for:** layout, navigation, Standby Transitions, Data wiring, Automation / state-machine happy paths, and confirming a generator fires and handles its events.
|
|
130
|
-
- **Escalate to a real device for:** anything in the "can't reproduce" tables, real camera / peripherals / payment / identity, real model quality & latency, multi-device Local Sync, on-device persistence, the Buttress offload path, and engine-specific behavior.
|
|
131
|
-
|
|
132
|
-
The full Path 1/2/3 decision rule lives in [Verification Toolchain](verification-toolchain.md).
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# MCP Source-Editing Tools
|
|
2
|
-
|
|
3
|
-
The project-local `bricks-ctor` MCP server exposes tools that edit `subspaces/**` via
|
|
4
|
-
surgical AST edits, keeping files in the standard generated style. Prefer them over
|
|
5
|
-
hand-editing entry files; they validate references, manage imports, compile-verify, and
|
|
6
|
-
record every operation in `.bricks/edits.jsonl`.
|
|
7
|
-
|
|
8
|
-
## Entry tools (bricks.ts / generators.ts / canvases.ts / data.ts / animations.ts)
|
|
9
|
-
|
|
10
|
-
| Tool | Purpose |
|
|
11
|
-
|------|---------|
|
|
12
|
-
| `new_entry` | Create a standard entry skeleton (`file`, `type`, `templateKey`, `alias`, optional initial `set`/`events`) |
|
|
13
|
-
| `edit_entry` | Set/unset dotted paths on an entry: `title`, `property.url`, `outlets.response`, `value`, `switches[0].property.text`, … |
|
|
14
|
-
| `edit_events` | Add/remove/replace/move/clear EventAction items in `events.<eventKey>` |
|
|
15
|
-
| `edit_canvas_items` | Add/replace/remove/move brick items on a Canvas `items` array (frames need numeric x/y/width/height) |
|
|
16
|
-
| `edit_switches` | Add/replace/remove/move switches (id, title, conds, override, disabled, break) |
|
|
17
|
-
| `remove_entry` | Delete an entry; cascades same-subspace references by default, `strict: true` refuses and lists sites |
|
|
18
|
-
|
|
19
|
-
Addressing: `{ file, entry }` (export const name) is primary; `id` works as a global
|
|
20
|
-
fallback (omit `file`). `edit_entry`/`edit_events` accept a `switch` parameter (switch id
|
|
21
|
-
or index) to edit the facets inside one switch — `edit_switches` owns only the array and
|
|
22
|
-
the conds/override shell.
|
|
23
|
-
|
|
24
|
-
### Event actions
|
|
25
|
-
|
|
26
|
-
```jsonc
|
|
27
|
-
{
|
|
28
|
-
"handler": "system", // or { "ref": "brickOrGeneratorRef" } or { "subspace": "SUBSPACE_id" }
|
|
29
|
-
"name": "CHANGE_CANVAS",
|
|
30
|
-
"params": { "canvasId": { "ref": "mainCanvas" } }, // template params, OR:
|
|
31
|
-
"dataParams": { "someData": 5 }, // PROPERTY_BANK-style params
|
|
32
|
-
"waitAsync": false
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
System actions derive their `as SystemAction...` cast automatically; entity-action casts
|
|
37
|
-
are added only when passed via `cast`. The compiled source form
|
|
38
|
-
`{ handler, action: { name, params: [...], dataParams: [...] }, waitAsync }` is also
|
|
39
|
-
accepted, and `{ "expr": "<raw EventAction>" }` is the escape hatch for shapes the
|
|
40
|
-
structured form cannot express. Handler refs must resolve to a brick or generator.
|
|
41
|
-
`PROPERTY_BANK_EXPRESSION` expressions are validated against the runtime fold rules at
|
|
42
|
-
edit time: only expression statements, simple `const`/`let` declarations, and a final
|
|
43
|
-
return inside a zero-arg IIFE evaluate — no `if`/`for`/`while` (use ternaries, or a
|
|
44
|
-
DataCalculationScript for branching logic).
|
|
45
|
-
|
|
46
|
-
## Data-calc tools (DataCalculationScript only)
|
|
47
|
-
|
|
48
|
-
| Tool | Purpose |
|
|
49
|
-
|------|---------|
|
|
50
|
-
| `new_data_calc` | Create `data-calc/data-calculation-{slug}.ts` + `.sandbox.js`, regenerate `data-calc/index.ts`, wire a minimal subspace root |
|
|
51
|
-
| `edit_data_calc` | Set/unset scalar fields, `output`/`error` refs, replace whole `inputs`/`outputs`, or rewrite the sandbox `code` |
|
|
52
|
-
| `edit_data_calc_io` | Add/remove/replace/clear single `inputs`/`outputs` items (input keys unique; output keys may repeat for fan-out) |
|
|
53
|
-
| `remove_data_calc` | Delete the calc `.ts` + its sandbox file and regenerate the index |
|
|
54
|
-
|
|
55
|
-
Addressing: `{ file }` or `{ subspace, calc }` where `calc` is alias, id, or filename
|
|
56
|
-
slug (subspace defaults to `subspace-0`). Code is canonicalized to the sandbox file form
|
|
57
|
-
(`export function main() { ... }` — wrapped automatically, `async` added when the body
|
|
58
|
-
uses top-level `await`). `DataCalculationMap` (visual node graph) is out of scope and
|
|
59
|
-
returns `fallback_recommended`.
|
|
60
|
-
|
|
61
|
-
## Value grammar (everywhere a value appears)
|
|
62
|
-
|
|
63
|
-
| You pass | Emits |
|
|
64
|
-
|----------|-------|
|
|
65
|
-
| JSON scalar/array/object | literal |
|
|
66
|
-
| `{ "link": "dataRefOrAlias" }` | `linkData(() => data.dX)` (property data-links) |
|
|
67
|
-
| `{ "ref": "idOrAliasOrVarName", "subspace"?: 1 }` | `() => namespace.varName` getter |
|
|
68
|
-
| `{ "expr": "raw TypeScript" }` | spliced verbatim |
|
|
69
|
-
|
|
70
|
-
References resolve by var name, id, or alias within the target subspace and fail loudly
|
|
71
|
-
when missing or ambiguous — this doubles as reference validation.
|
|
72
|
-
|
|
73
|
-
## Verification and audit
|
|
74
|
-
|
|
75
|
-
- Every call compile-verifies by default and returns `verify.configChange` — the minimal
|
|
76
|
-
compiled-config delta (path-keyed set/unset ops). Skip with per-call `verify: false`
|
|
77
|
-
or `BRICKS_CTOR_MCP_EDIT_VERIFY=0` when batching, then finish with the `compile` tool.
|
|
78
|
-
- All operations append to `.bricks/edits.jsonl` (gitignored) with inputs, outcomes, and
|
|
79
|
-
touched sites.
|
|
80
|
-
- Non-standard files or entries (hand-written shapes the AST editor cannot safely
|
|
81
|
-
rewrite) return `fallback_recommended` — use plain file edits for those cases only.
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# Standby Transition
|
|
2
|
-
|
|
3
|
-
Easy-to-configure animation for Bricks based on Canvas render/change. Provides smooth enter animations when bricks appear and position transitions when canvas changes.
|
|
4
|
-
|
|
5
|
-
## How It Works
|
|
6
|
-
|
|
7
|
-
Two transition cases:
|
|
8
|
-
1. **First Render**: Run position transition based on `standbyMode` setting
|
|
9
|
-
2. **Canvas Change**: Existing bricks animate to new positions instead of re-rendering
|
|
10
|
-
|
|
11
|
-
## Configuration
|
|
12
|
-
|
|
13
|
-
Standby transition is configured in the **canvas item frame**, not the brick itself.
|
|
14
|
-
|
|
15
|
-
### Standby Mode
|
|
16
|
-
|
|
17
|
-
| Mode | Description |
|
|
18
|
-
|------|-------------|
|
|
19
|
-
| `top` | Slide in from top |
|
|
20
|
-
| `bottom` | Slide in from bottom |
|
|
21
|
-
| `left` | Slide in from left |
|
|
22
|
-
| `right` | Slide in from right |
|
|
23
|
-
| `custom` | Use custom `standbyFrame` values |
|
|
24
|
-
|
|
25
|
-
### Frame Options
|
|
26
|
-
|
|
27
|
-
| Option | Description |
|
|
28
|
-
|--------|-------------|
|
|
29
|
-
| `standbyMode` | Direction or `'custom'` |
|
|
30
|
-
| `standbyFrame` | Custom start frame `{ x?, y?, width?, height? }` |
|
|
31
|
-
| `standbyOpacity` | Start opacity (0.0 - 1.0) |
|
|
32
|
-
| `standbyDelay` | Delay before transition starts (ms) |
|
|
33
|
-
| `standbyDelayRandom` | Random delay variance (ms) |
|
|
34
|
-
| `standbyEasing` | Per-property easing config |
|
|
35
|
-
|
|
36
|
-
### Easing Configuration
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
standbyEasing: {
|
|
40
|
-
default?: { method: Easing, duration: number },
|
|
41
|
-
x?: { method: Easing, duration: number },
|
|
42
|
-
y?: { method: Easing, duration: number },
|
|
43
|
-
width?: { method: Easing, duration: number },
|
|
44
|
-
height?: { method: Easing, duration: number },
|
|
45
|
-
opacity?: { method: Easing, duration: number },
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## TypeScript Example
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
import { makeId } from 'bricks-ctor'
|
|
53
|
-
|
|
54
|
-
const canvas: Canvas = {
|
|
55
|
-
__typename: 'Canvas',
|
|
56
|
-
id: makeId('canvas'),
|
|
57
|
-
title: 'Home',
|
|
58
|
-
description: '',
|
|
59
|
-
property: {
|
|
60
|
-
backgroundColor: '#ffffff',
|
|
61
|
-
},
|
|
62
|
-
events: {},
|
|
63
|
-
switches: [],
|
|
64
|
-
items: [
|
|
65
|
-
{
|
|
66
|
-
item: () => heroCard,
|
|
67
|
-
frame: {
|
|
68
|
-
x: 100,
|
|
69
|
-
y: 50,
|
|
70
|
-
width: 400,
|
|
71
|
-
height: 300,
|
|
72
|
-
// Standby transition config
|
|
73
|
-
standbyMode: 'bottom',
|
|
74
|
-
standbyOpacity: 0,
|
|
75
|
-
standbyDelay: 100,
|
|
76
|
-
standbyEasing: {
|
|
77
|
-
default: { method: 'easeOutCubic', duration: 400 },
|
|
78
|
-
opacity: { method: 'easeOutQuad', duration: 300 },
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## Canvas Change Transition
|
|
87
|
-
|
|
88
|
-
When navigating between canvases, bricks with the same ID smoothly transition:
|
|
89
|
-
- Position interpolates from old to new location
|
|
90
|
-
- Size interpolates if dimensions change
|
|
91
|
-
- Opacity interpolates if visibility changes
|
|
92
|
-
|
|
93
|
-
This creates a "shared element transition" effect.
|
|
94
|
-
|
|
95
|
-
## Related Events
|
|
96
|
-
|
|
97
|
-
- `standby`: Triggered when brick completes standby transition
|
|
98
|
-
|
|
99
|
-
```typescript
|
|
100
|
-
// In brick definition
|
|
101
|
-
events: {
|
|
102
|
-
standby: [
|
|
103
|
-
{
|
|
104
|
-
handler: 'system',
|
|
105
|
-
action: {
|
|
106
|
-
__actionName: 'DYNAMIC_ANIMATION',
|
|
107
|
-
parent: 'System',
|
|
108
|
-
params: [
|
|
109
|
-
{ input: 'brickId', value: () => heroCard },
|
|
110
|
-
{ input: 'animationId', value: () => pulseAnimation },
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## Best Practices
|
|
119
|
-
|
|
120
|
-
1. **Stagger delays**: Use incremental delays for list items (e.g., 0, 50, 100ms)
|
|
121
|
-
2. **Keep it short**: 200-400ms transitions feel responsive
|
|
122
|
-
3. **Match content**: Use directional transitions that match scroll direction
|
|
123
|
-
4. **Opacity for polish**: Combine position transition with opacity fade
|
|
124
|
-
5. **Same-ID trick**: Reuse brick IDs across canvases for smooth transitions
|