feat(desktop): embed BoosAPI Desktop client as a subproject

Vendor the rebranded BoosAPI Desktop client (Tauri + Vue) into metapi as
a monorepo subdirectory under desktop/. Source only — node_modules,
dist, Cargo target and the upstream .git history are excluded.

desktop/ keeps its own independent Cargo workspace (desktop/src-tauri
with crates/*); it is not part of the backend boosapi crate, so a
`cargo check` at the metapi root still compiles only the backend. Build
the desktop app from desktop/src-tauri per desktop/README.md.

Note: app icons are still placeholder assets pending the final BoosAPI
logo. The updater signing keys live outside the repo and are not
included.
This commit is contained in:
boos
2026-06-22 11:32:57 +08:00
parent d9c78ecc73
commit e0a5f57793
2305 changed files with 449355 additions and 0 deletions
@@ -0,0 +1,3 @@
::: warning
This is a warning admonition with **markdown** inside.
:::
+4
View File
@@ -0,0 +1,4 @@
- [x] Completed task
- [ ] Incomplete task
Regular list item
+11
View File
@@ -0,0 +1,11 @@
```diff
--- a/file.txt
+++ b/file.txt
@@
- old line
+ new line
```
```js
console.log('hello world')
```
@@ -0,0 +1,3 @@
A line with an escaped bracket: \[not a link\]
And a literal backslash \\ and more text.
@@ -0,0 +1,10 @@
```diff js
@@
- old
+ new
```
```python
# regular code block
print('ok')
```
@@ -0,0 +1,3 @@
This is a sentence with a footnote[^1].
[^1]: This is the footnote text.
+7
View File
@@ -0,0 +1,7 @@
# Heading 1
A short paragraph under heading 1.
## Heading 2
Another paragraph with **strong** and *emphasis*.
@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>卷绕设备异常分析处理</title>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
<style>
table {
border-collapse: collapse;
width: 100%;
margin: 20px auto;
border: 1px solid #ddd;
font-family: Arial, sans-serif;
}
th, td {
border: 1px solid #ddd;
padding: 8px 12px;
text-align: left;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
.chart-container {
width: 800px;
height: 400px;
margin: 30px auto;
border: 1px solid #ddd;
padding: 10px;
background-color: #fff;
}
h2 {
text-align: center;
color: #333;
}
</style>
</head>
<body>
<h2>卷绕设备异常分析处理汇总</h2>
<table>
<tr>
<th>异常类型</th>
<th>问题描述</th>
<th>排查解决步骤/原因</th>
</tr>
<tr>
<td>1</td>
<td>电芯X-ray包覆不良与那些因素有关</td>
<td>1. 纠偏感应器有脏污,纠偏感应器有无信号。<br>2. 纠偏过辊卡死或窜动。<br>3. 纠偏靠辊和最终靠辊平行度不平行,三角架内过辊的精度异常。<br>4. 正负极入料吹气异常。<br>5. 卷针插针时插隔膜,卷针前后有窜动。<br>6. 卷针内夹针夹不紧隔膜。<br>7. 卷针左右晃动,卷针和插针丝杆磨损严重。<br>8. 极片来料波浪太大,卷绕时极片抖动。</td>
</tr>
<tr>
<td>2</td>
<td>电芯X-ray包覆不良排查解决</td>
<td>1. 确认正负极极片物料是否有异常。<br>2. 确认极片和隔膜张力是否正常<br>3. 确认纠偏压辊水平,纠偏压辊压力及纠偏压辊行程。<br>4. 确认纠偏方向,光电设置是否正确。<br>5. 确认卷绕收尾靠辊压力及收尾位置是否合适。<br>6. 确认插片角度是否有偏差,纠偏料线是否同一基准。<br>7. 确认卷针与锁膜头同心度,卷针铁氟龙有无破损。<br>8. 确认正负极切断吹气及入料吹气是否合适。</td>
</tr>
<tr>
<td>3</td>
<td>卷针运转时不稳定晃动,手动左右旋转有间隙</td>
<td>1. 卷针螺丝是否松动。<br>2. 卷针前锁膜头是否与卷针匹配,顺畅,检查同心度。<br>3. 卷针是否与卷针座同心,卷针座安装固定螺丝是否紧固。<br>4. 检查卷针尾座与花键轴连接是否松动。</td>
</tr>
<tr>
<td>4</td>
<td>间距不良排查解决</td>
<td>1. 电芯分针查看间距。<br>2. 确认电芯极片头部是否顶到电芯内圈边缘。<br>3. 对比间距不良电芯和正常电芯切位。<br>4. 确认电芯下料有无拔针现象。<br>5. 确认入料压辊配合及压力。<br>6. 确认极耳检测传感器安装位置及设置是否正确。<br>7. 确认投入夹片是否能加紧极片。<br>8. 确认极片裁切时是否极片不平整或有拉伸。<br>9. 确认卷针夹针间隙及内夹针。<br>10. 确认卷针下料夹紧压力<br>11. 确认卷绕减速点设置和卷绕速度是否合理。<br>12. 确认插片电机,切刀电机联轴器是否紧固。</td>
</tr>
<tr>
<td>5</td>
<td>电芯隔膜锥形调试解决</td>
<td>1. 确认隔膜纠偏有无异常波动。<br>2. 隔膜过辊精度有无明显歪斜,入料靠辊是否水平。<br>3. 确认隔膜来料是否不良波浪边。<br>4. 检查A、B、C三根卷针前位位置是否统一位置,卷针前位磁铁块位置是否统一。<br>5. 确认卷针与推卷针电机前位位置间隙。<br>6. 确认转塔翻位到贴胶位时磁铁块有无吸住卷针。<br>7. 确认卷绕位电芯卷绕时隔膜抖动是否过大,隔膜张力设置是否合理。<br>8. 检查隔膜过辊有无卡点造成隔膜卷绕时阻力过大。</td>
</tr>
<tr>
<td>6</td>
<td>极片入料打折</td>
<td>1. 入料吹气不良,入料角度与吹气角度不匹配<br>2. 入料吹气大小及时间设置是否匹配。<br>3. 入料前极片弯曲打折。<br>4. 正负极入料时极片切刀吸尘真空过大。<br>5. 极片入料卡在切刀口。<br>6. 检查入料部件极片入料时有无异物干涉。</td>
</tr>
<tr>
<td>7</td>
<td>收尾贴胶打皱</td>
<td>1. 检查胶带切刀是否异常。<br>2. 检查吸胶辊表面有无异物,吸胶角度是否正确。<br>3. 确认吸胶辊预留吸孔是否合理,封孔胶带是否有破损。<br>4. 确认贴胶辊与卷针水平,贴胶圈数是否合理。<br>5. 确认贴胶辊电机扭矩设置是否合理。</td>
</tr>
<tr>
<td>8</td>
<td>下料拔针不良</td>
<td>1. 检查下料夹爪与卷针角度。<br>2. 卷针表面是否有脏污。<br>3. 下料时速度过快,下料夹爪有无晃动。<br>4. 下料时卷针卷针有无解锁。<br>5. 卷针下料夹紧电芯压力。<br>6. 检查卷针内夹针缝隙大小,及内针弹性有无异常。</td>
</tr>
</table>
<div class="chart-container">
<div id="exceptionChart"></div>
</div>
<script>
// 初始化ECharts图表
var chartDom = document.getElementById('exceptionChart');
var myChart = echarts.init(chartDom);
// 异常类型分布数据(按类型统计条目数量)
var option = {
title: { text: '异常类型分布统计' },
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
xAxis: { type: 'category', data: ['1', '2', '3', '4', '5', '6', '7', '8'], name: '异常类型' },
yAxis: { type: 'value', name: '问题数量' },
series: [{
name: '异常数量',
type: 'bar',
data: [8, 8, 4, 12, 8, 6, 5, 6]
}]
};
option && myChart.setOption(option);
</script>
</body>
</html>
@@ -0,0 +1,3 @@
Here is an image: ![alt text](https://example.com/image.png)
And a link: [example](https://example.com)
@@ -0,0 +1,11 @@
```infographic
infographic list-row-simple-horizontal-arrow
data
items
- label 步骤 1
desc 开始
- label 步骤 2
desc 进行中
- label 步骤 3
desc 完成
```
+7
View File
@@ -0,0 +1,7 @@
Inline math (\alpha + \beta) and another form (x_i).
$$
E = mc^2
$$
A line with parentheses that should not break: (not-math)
+5
View File
@@ -0,0 +1,5 @@
```mermaid
graph TD
A-->B
B-->C
```
@@ -0,0 +1,9 @@
1. Item one
- nested bullet with **bold**
1. nested ordered inside bullet
- another nested
2. Item two
- Top bullet
1. nested ordered inside top bullet
- triple nested bullet
@@ -0,0 +1,62 @@
import type { NodeComponentProps } from 'markstream-react'
import MarkdownRender, { MarkdownCodeBlockNode, setCustomComponents } from 'markstream-react'
import 'markstream-react/index.css'
function rewriteDocsUrl(url: string) {
if (url.startsWith('/docs/'))
return `https://markstream.example.com${url}`
return url
}
function CustomHeading({ node, ctx, renderNode, indexKey }: NodeComponentProps<any>) {
const Tag = `h${node.level || 1}` as keyof JSX.IntrinsicElements
return (
<Tag className="docs-title">
{node.children?.map((child: any, i: number) =>
renderNode && ctx
? renderNode(child, `${String(indexKey)}-heading-${i}`, ctx)
: null,
)}
</Tag>
)
}
function CustomLink({ node, ctx, renderNode, indexKey }: NodeComponentProps<any>) {
const href = rewriteDocsUrl(node.href)
return (
<a href={href} target="_blank" rel="noreferrer">
{node.children?.map((child: any, i: number) =>
renderNode && ctx
? renderNode(child, `${String(indexKey)}-link-${i}`, ctx)
: null,
)}
</a>
)
}
setCustomComponents('migration-demo', {
heading: CustomHeading,
link: CustomLink,
code_block: ({ node, isDark, ctx }: any) => (
<MarkdownCodeBlockNode
node={node}
isDark={isDark}
stream={ctx?.codeBlockStream}
{...(ctx?.codeBlockProps || {})}
/>
),
})
export function AdvancedArticle({ markdown }: { markdown: string }) {
return (
<MarkdownRender
customId="migration-demo"
content={markdown}
/>
)
}
// If the previous component depended on `allowedElements`, filter the parsed
// node tree before render. There is no direct allowlist prop on markstream-react.
@@ -0,0 +1,6 @@
import MarkdownRender from 'markstream-react'
import 'markstream-react/index.css'
export function BasicArticle({ markdown }: { markdown: string }) {
return <MarkdownRender content={markdown} />
}
@@ -0,0 +1,71 @@
import Markdown from 'react-markdown'
import rehypeRaw from 'rehype-raw'
import remarkGfm from 'remark-gfm'
function rewriteDocsUrl(url: string) {
if (url.startsWith('/docs/'))
return `https://markstream.example.com${url}`
return url
}
export function AdvancedArticle({ markdown }: { markdown: string }) {
return (
<Markdown
remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeRaw]}
allowedElements={[
'h1',
'h2',
'p',
'a',
'code',
'pre',
'ul',
'ol',
'li',
'strong',
'em',
'table',
'thead',
'tbody',
'tr',
'th',
'td',
]}
urlTransform={rewriteDocsUrl}
components={{
h1({ children }) {
return <h1 className="docs-title">{children}</h1>
},
a({ href, children }) {
return (
<a href={href} target="_blank" rel="noreferrer">
{children}
</a>
)
},
code({ className, children, ...rest }) {
const isBlock = /language-/.test(className || '')
if (isBlock) {
return (
<pre className="docs-code">
<code className={className} {...rest}>
{children}
</code>
</pre>
)
}
return (
<code className="inline-code" {...rest}>
{children}
</code>
)
},
}}
>
{markdown}
</Markdown>
)
}
@@ -0,0 +1,5 @@
import Markdown from 'react-markdown'
export function BasicArticle({ markdown }: { markdown: string }) {
return <Markdown>{markdown}</Markdown>
}
@@ -0,0 +1,53 @@
# Demo Skill Output
This folder is an isolated demo for the `react-markdown-to-markstream-react` skill.
The main repository is not a real `react-markdown` consumer, so this fixture exists to show what a meaningful audit and migration result would look like.
## Audit Summary
- Found 2 `react-markdown` call sites in this demo fixture.
- Classified 1 call site as direct migration and 1 as advanced/plugin-heavy migration.
- Safe direct migrations were applied in `after-basic.tsx` and `after-advanced.tsx`.
- Manual review is still required for HTML policy and element allowlisting.
## Call Sites
| File | Classification | Why |
|---|---|---|
| `before-basic.tsx` | direct | Plain `<Markdown>{markdown}</Markdown>` usage |
| `before-advanced.tsx` | renderer-custom + plugin-heavy + security-heavy | Uses `components`, `remark-gfm`, `rehype-raw`, `allowedElements`, and `urlTransform` |
## Direct Mappings Applied
| `react-markdown` usage | `markstream-react` migration |
|---|---|
| `children` | `content` |
| `components.h1` | `setCustomComponents('migration-demo', { heading })` with `node.level` |
| `components.a` | custom `link` renderer |
| `components.code` | custom `code_block` renderer with `MarkdownCodeBlockNode` |
| `urlTransform` | link rewrite logic moved into the custom `link` renderer |
## Manual Review Items
### `rehypeRaw`
`markstream-react` does not expose a public `rehype` stage.
If the old app relied on `rehypeRaw` for standard HTML rendering, verify the new HTML behavior.
If it relied on trusted custom tags, prefer `customHtmlTags` plus `setCustomComponents`.
### `allowedElements`
There is no direct `allowedElements` prop in `markstream-react`.
If exact allowlisting still matters, filter the parsed node tree before rendering.
### Security parity
The new renderer sanitizes blocked tags, dangerous event-handler attributes, and unsafe URLs in built-in HTML renderers, but it is still not a byte-for-byte replacement for a repo-specific `rehype` sanitization stack.
## Suggested User-Facing Skill Result
1. Replace `react-markdown` with `markstream-react` for direct call sites first.
2. Convert HTML-tag-based `components` overrides into node-type-based `setCustomComponents`.
3. Remove `remark-gfm` only after checking rendered tables, task lists, and other edge cases.
4. Revisit any `rehype`-based HTML and security logic before claiming migration completeness.
5. Adopt `nodes` + `parseMarkdownToStructure` later only if the app actually needs streaming updates.
+6
View File
@@ -0,0 +1,6 @@
| A | B |
| - | - |
| 1 | 2 |
| 3 | 4 |
A paragraph after the table.
@@ -0,0 +1,6 @@
```js
const a = 1
```
``
Some text after an extra backtick line.
@@ -0,0 +1,5 @@
```js
console.log('unclosed fence')
# Following heading that might be part of the fence
```
@@ -0,0 +1,5 @@
This line has an opening bracket [ without a closing.
Another line with a link-like [text](http://example.com
And a normal line.