@fugood/bricks-project 2.23.2 → 2.23.4
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/index.ts +343 -125
- package/package.json +4 -2
- package/skills/bricks-project/rules/automations.md +7 -7
- package/tools/deploy.ts +39 -10
- package/tools/mcp-server.ts +10 -877
- package/tools/mcp-tools/compile.ts +91 -0
- package/tools/mcp-tools/huggingface.ts +653 -0
- package/tools/mcp-tools/icons.ts +60 -0
- package/tools/mcp-tools/lottie.ts +102 -0
- package/tools/mcp-tools/media.ts +110 -0
- package/tools/postinstall.ts +11 -6
- package/tools/pull.ts +25 -9
- package/tsconfig.json +16 -0
- package/types/bricks/Camera.ts +1 -1
- package/types/bricks/Chart.ts +1 -1
- package/types/bricks/GenerativeMedia.ts +1 -1
- package/types/bricks/Icon.ts +1 -1
- package/types/bricks/Image.ts +1 -1
- package/types/bricks/Items.ts +1 -1
- package/types/bricks/Lottie.ts +1 -1
- package/types/bricks/Maps.ts +1 -1
- package/types/bricks/QrCode.ts +1 -1
- package/types/bricks/Rect.ts +1 -1
- package/types/bricks/RichText.ts +1 -1
- package/types/bricks/Rive.ts +1 -1
- package/types/bricks/Slideshow.ts +1 -1
- package/types/bricks/Svg.ts +1 -1
- package/types/bricks/Text.ts +1 -1
- package/types/bricks/TextInput.ts +1 -1
- package/types/bricks/Video.ts +1 -1
- package/types/bricks/VideoStreaming.ts +1 -1
- package/types/bricks/WebRtcStream.ts +1 -1
- package/types/bricks/WebView.ts +1 -1
- package/types/canvas.ts +2 -2
- package/types/common.ts +4 -4
- package/types/generators/AlarmClock.ts +1 -1
- package/types/generators/Assistant.ts +1 -1
- package/types/generators/BleCentral.ts +1 -1
- package/types/generators/BlePeripheral.ts +1 -1
- package/types/generators/CanvasMap.ts +1 -1
- package/types/generators/CastlesPay.ts +1 -1
- package/types/generators/DataBank.ts +1 -1
- package/types/generators/File.ts +1 -1
- package/types/generators/GraphQl.ts +1 -1
- package/types/generators/Http.ts +1 -1
- package/types/generators/HttpServer.ts +1 -1
- package/types/generators/Information.ts +1 -1
- package/types/generators/Intent.ts +1 -1
- package/types/generators/Iterator.ts +1 -1
- package/types/generators/Keyboard.ts +1 -1
- package/types/generators/LlmAnthropicCompat.ts +1 -1
- package/types/generators/LlmAppleBuiltin.ts +1 -1
- package/types/generators/LlmGgml.ts +1 -1
- package/types/generators/LlmOnnx.ts +1 -1
- package/types/generators/LlmOpenAiCompat.ts +1 -1
- package/types/generators/LlmQualcommAiEngine.ts +1 -1
- package/types/generators/Mcp.ts +1 -1
- package/types/generators/McpServer.ts +1 -1
- package/types/generators/MediaFlow.ts +1 -1
- package/types/generators/MqttBroker.ts +1 -1
- package/types/generators/MqttClient.ts +1 -1
- package/types/generators/Question.ts +1 -1
- package/types/generators/RealtimeTranscription.ts +1 -1
- package/types/generators/RerankerGgml.ts +1 -1
- package/types/generators/SerialPort.ts +1 -1
- package/types/generators/SoundPlayer.ts +1 -1
- package/types/generators/SoundRecorder.ts +1 -1
- package/types/generators/SpeechToTextGgml.ts +1 -1
- package/types/generators/SpeechToTextOnnx.ts +1 -1
- package/types/generators/SpeechToTextPlatform.ts +1 -1
- package/types/generators/SqLite.ts +1 -1
- package/types/generators/Step.ts +1 -1
- package/types/generators/SttAppleBuiltin.ts +1 -1
- package/types/generators/Tcp.ts +1 -1
- package/types/generators/TcpServer.ts +1 -1
- package/types/generators/TextToSpeechAppleBuiltin.ts +1 -1
- package/types/generators/TextToSpeechGgml.ts +1 -1
- package/types/generators/TextToSpeechOnnx.ts +1 -1
- package/types/generators/TextToSpeechOpenAiLike.ts +1 -1
- package/types/generators/ThermalPrinter.ts +1 -1
- package/types/generators/Tick.ts +1 -1
- package/types/generators/Udp.ts +1 -1
- package/types/generators/VadGgml.ts +1 -1
- package/types/generators/VadOnnx.ts +1 -1
- package/types/generators/VadTraditional.ts +1 -1
- package/types/generators/VectorStore.ts +1 -1
- package/types/generators/Watchdog.ts +1 -1
- package/types/generators/WebCrawler.ts +1 -1
- package/types/generators/WebRtc.ts +1 -1
- package/types/generators/WebSocket.ts +1 -1
- package/types/system.ts +1 -1
- package/utils/calc.ts +16 -10
- package/utils/id.ts +4 -0
- package/api/index.ts +0 -1
- package/api/instance.ts +0 -213
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugood/bricks-project",
|
|
3
|
-
"version": "2.23.
|
|
3
|
+
"version": "2.23.4",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"scripts": {
|
|
6
|
+
"typecheck": "tsc --noEmit",
|
|
6
7
|
"build": "bun scripts/build.js"
|
|
7
8
|
},
|
|
8
9
|
"dependencies": {
|
|
9
|
-
"@fugood/bricks-cli": "^2.23.
|
|
10
|
+
"@fugood/bricks-cli": "^2.23.4",
|
|
10
11
|
"@huggingface/gguf": "^0.3.2",
|
|
11
12
|
"@iarna/toml": "^3.0.0",
|
|
12
13
|
"@modelcontextprotocol/sdk": "^1.15.0",
|
|
13
14
|
"@toon-format/toon": "^2.1.0",
|
|
15
|
+
"@types/bun": "^1.3.9",
|
|
14
16
|
"@types/escodegen": "^0.0.10",
|
|
15
17
|
"@types/lodash": "^4.17.12",
|
|
16
18
|
"acorn": "^8.13.0",
|
|
@@ -35,14 +35,14 @@ Automations can validate:
|
|
|
35
35
|
```typescript
|
|
36
36
|
const testLoginFlow: AutomationTest = {
|
|
37
37
|
__typename: 'AutomationTest',
|
|
38
|
-
id: 'test
|
|
38
|
+
id: makeId('test'),
|
|
39
39
|
title: 'Test Login Flow',
|
|
40
40
|
timeout: 30000,
|
|
41
41
|
trigger_type: 'launch',
|
|
42
42
|
cases: [
|
|
43
43
|
{
|
|
44
44
|
__typename: 'TestCase',
|
|
45
|
-
id: '
|
|
45
|
+
id: makeId('test_case'),
|
|
46
46
|
name: 'Wait for login canvas',
|
|
47
47
|
run: ['wait_until_canvas_change', () => mainSubspace, () => loginCanvas, 5000],
|
|
48
48
|
exit_on_failed: true,
|
|
@@ -53,7 +53,7 @@ const testLoginFlow: AutomationTest = {
|
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
__typename: 'TestCase',
|
|
56
|
-
id: '
|
|
56
|
+
id: makeId('test_case'),
|
|
57
57
|
name: 'Press username input',
|
|
58
58
|
run: ['brick_press', () => mainSubspace, () => usernameInput],
|
|
59
59
|
exit_on_failed: true,
|
|
@@ -64,7 +64,7 @@ const testLoginFlow: AutomationTest = {
|
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
__typename: 'TestCase',
|
|
67
|
-
id: '
|
|
67
|
+
id: makeId('test_case'),
|
|
68
68
|
name: 'Assert username value',
|
|
69
69
|
run: ['assert_property', () => mainSubspace, () => usernameData, 'testuser'],
|
|
70
70
|
exit_on_failed: true,
|
|
@@ -75,7 +75,7 @@ const testLoginFlow: AutomationTest = {
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
__typename: 'TestCase',
|
|
78
|
-
id: '
|
|
78
|
+
id: makeId('test_case'),
|
|
79
79
|
name: 'Press login button',
|
|
80
80
|
run: ['brick_press', () => mainSubspace, () => loginButton],
|
|
81
81
|
exit_on_failed: true,
|
|
@@ -86,7 +86,7 @@ const testLoginFlow: AutomationTest = {
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
__typename: 'TestCase',
|
|
89
|
-
id: '
|
|
89
|
+
id: makeId('test_case'),
|
|
90
90
|
name: 'Wait for dashboard',
|
|
91
91
|
run: ['wait_until_canvas_change', () => mainSubspace, () => dashboardCanvas, 10000],
|
|
92
92
|
exit_on_failed: true,
|
|
@@ -182,7 +182,7 @@ Visual regression testing with screenshot comparison:
|
|
|
182
182
|
```typescript
|
|
183
183
|
{
|
|
184
184
|
__typename: 'TestCase',
|
|
185
|
-
id: '
|
|
185
|
+
id: makeId('test_case'),
|
|
186
186
|
name: 'Match dashboard screenshot',
|
|
187
187
|
run: ['match_screenshot', 'dashboard-initial-state', 0.01, 3],
|
|
188
188
|
exit_on_failed: true,
|
package/tools/deploy.ts
CHANGED
|
@@ -4,29 +4,40 @@ import { parseArgs } from 'util'
|
|
|
4
4
|
const cwd = process.cwd()
|
|
5
5
|
|
|
6
6
|
const {
|
|
7
|
-
values: {
|
|
7
|
+
values: {
|
|
8
|
+
changelogs: changelogsArg,
|
|
9
|
+
'changelogs-file': changelogsFile,
|
|
10
|
+
'auto-commit': autoCommit,
|
|
11
|
+
yes,
|
|
12
|
+
help,
|
|
13
|
+
},
|
|
8
14
|
} = parseArgs({
|
|
9
15
|
args: Bun.argv.slice(2),
|
|
10
16
|
options: {
|
|
11
17
|
changelogs: { type: 'string' },
|
|
12
18
|
'changelogs-file': { type: 'string' },
|
|
19
|
+
'auto-commit': { type: 'boolean' },
|
|
13
20
|
yes: { type: 'boolean', short: 'y' },
|
|
21
|
+
help: { type: 'boolean', short: 'h' },
|
|
14
22
|
},
|
|
15
23
|
allowPositionals: true,
|
|
16
24
|
})
|
|
17
25
|
|
|
26
|
+
if (help) {
|
|
27
|
+
console.log(`Options:
|
|
28
|
+
--changelogs <text> Changelogs text for the release
|
|
29
|
+
--changelogs-file <path> Read changelogs from a file
|
|
30
|
+
--auto-commit Auto-commit unstaged changes before deploying
|
|
31
|
+
-y, --yes Skip all prompts
|
|
32
|
+
-h, --help Show this help message`)
|
|
33
|
+
process.exit(0) // eslint-disable-line unicorn/no-process-exit
|
|
34
|
+
}
|
|
35
|
+
|
|
18
36
|
// Check git status
|
|
19
|
-
const { exitCode } = await $`cd ${cwd} && git status`.nothrow()
|
|
37
|
+
const { exitCode } = await $`cd ${cwd} && git status`.quiet().nothrow()
|
|
20
38
|
const isGitRepo = exitCode === 0
|
|
21
39
|
|
|
22
|
-
|
|
23
|
-
if (isGitRepo) {
|
|
24
|
-
const unstagedChanges = await $`cd ${cwd} && git diff --name-only --diff-filter=ACMR`.text()
|
|
25
|
-
if (unstagedChanges)
|
|
26
|
-
throw new Error('Unstaged changes found, please commit or stash your changes before deploying')
|
|
27
|
-
|
|
28
|
-
commitId = (await $`cd ${cwd} && git rev-parse HEAD`.text()).trim()
|
|
29
|
-
} else if (!yes) {
|
|
40
|
+
if (!isGitRepo && !yes) {
|
|
30
41
|
const confirmContinue = prompt('No git repository found, continue? (y/n)')
|
|
31
42
|
if (confirmContinue !== 'y') throw new Error('Deployment cancelled')
|
|
32
43
|
}
|
|
@@ -53,6 +64,24 @@ if (changelogsArg) {
|
|
|
53
64
|
changelogs = prompt('Enter changelogs (optional, press Enter to skip):') || ''
|
|
54
65
|
}
|
|
55
66
|
|
|
67
|
+
// Handle unstaged changes
|
|
68
|
+
let commitId = ''
|
|
69
|
+
if (isGitRepo) {
|
|
70
|
+
const unstagedChanges = await $`cd ${cwd} && git diff --name-only --diff-filter=ACMR`.text()
|
|
71
|
+
if (unstagedChanges) {
|
|
72
|
+
if (autoCommit) {
|
|
73
|
+
const commitMsg = `chore: release ${version || 'new version'}`
|
|
74
|
+
const commitBody = changelogs || '[no changelogs]'
|
|
75
|
+
await $`cd ${cwd} && git add -A && git commit -m ${commitMsg} -m ${commitBody}`
|
|
76
|
+
} else {
|
|
77
|
+
throw new Error(
|
|
78
|
+
'Unstaged changes found, please commit or stash your changes before deploying',
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
commitId = (await $`cd ${cwd} && git rev-parse HEAD`.text()).trim()
|
|
83
|
+
}
|
|
84
|
+
|
|
56
85
|
// Ask for confirmation
|
|
57
86
|
if (!yes) {
|
|
58
87
|
const confirm = prompt('Are you sure you want to deploy? (y/n)')
|