@shun-js/aibaiban-server 1.0.5 → 1.0.7

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.
Binary file
Binary file
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "AI白板 - 智能协作白板工具",
3
+ "short_name": "AI白板",
4
+ "description": "AI白板是一款智能协作白板工具,结合Excalidraw强大的绘图能力和AI助手的智能辅助",
5
+ "start_url": "/",
6
+ "display": "standalone",
7
+ "background_color": "#ffffff",
8
+ "theme_color": "#1677ff",
9
+ "orientation": "any",
10
+ "icons": [
11
+ {
12
+ "src": "/icon-192.png",
13
+ "sizes": "192x192",
14
+ "type": "image/png",
15
+ "purpose": "any maskable"
16
+ },
17
+ {
18
+ "src": "/icon-512.png",
19
+ "sizes": "512x512",
20
+ "type": "image/png",
21
+ "purpose": "any maskable"
22
+ }
23
+ ],
24
+ "categories": ["productivity", "utilities"]
25
+ }
package/assets/sw.js ADDED
@@ -0,0 +1,3 @@
1
+ // Service Worker - 仅用于满足 PWA 安装条件
2
+ self.addEventListener('install', () => self.skipWaiting());
3
+ self.addEventListener('activate', (e) => e.waitUntil(self.clients.claim()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shun-js/aibaiban-server",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "aibaiban.com server",
5
5
  "keywords": [
6
6
  "ai aibaiban"
@@ -44,5 +44,5 @@
44
44
  "access": "public",
45
45
  "registry": "https://registry.npmjs.org/"
46
46
  },
47
- "gitHead": "5eb0853768a4ff327c1ddda1eaa414b8645144b1"
47
+ "gitHead": "ba5c8b1bf76a18e50b2da8433124bb6fc40b211f"
48
48
  }
@@ -15,4 +15,18 @@ module.exports = (app) => {
15
15
  app.get('/4cb288d7aef5469c92616c0f5b5aeb89.txt', (req, res) => {
16
16
  service.bingIndexNow(req, res);
17
17
  });
18
+
19
+ // pwa
20
+ app.get('/manifest.json', (req, res) => {
21
+ service.manifestJson(req, res);
22
+ });
23
+ app.get('/sw.js', (req, res) => {
24
+ service.swJs(req, res);
25
+ });
26
+ app.get('/icon-192.png', (req, res) => {
27
+ service.icon192Png(req, res);
28
+ });
29
+ app.get('/icon-512.png', (req, res) => {
30
+ service.icon512Png(req, res);
31
+ });
18
32
  };
@@ -36,3 +36,47 @@ exports.bingIndexNow = async (req, res) => {
36
36
  const txt = await readFile(txtPath);
37
37
  res.send(txt);
38
38
  };
39
+
40
+ /**
41
+ * manifestJson
42
+ * @param {*} req
43
+ * @param {*} res
44
+ */
45
+ exports.manifestJson = async (req, res) => {
46
+ const txtPath = path.resolve(__dirname, '../../assets/manifest.json');
47
+ const txt = await readFile(txtPath);
48
+ res.send(txt);
49
+ };
50
+
51
+ /**
52
+ * swJs
53
+ * @param {*} req
54
+ * @param {*} res
55
+ */
56
+ exports.swJs = async (req, res) => {
57
+ const txtPath = path.resolve(__dirname, '../../assets/sw.js');
58
+ const txt = await readFile(txtPath);
59
+ res.send(txt);
60
+ };
61
+
62
+ /**
63
+ * icon192Png
64
+ * @param {*} req
65
+ * @param {*} res
66
+ */
67
+ exports.icon192Png = async (req, res) => {
68
+ const txtPath = path.resolve(__dirname, '../../assets/icon-192.png');
69
+ const txt = await readFile(txtPath);
70
+ res.send(txt);
71
+ };
72
+
73
+ /**
74
+ * icon512Png
75
+ * @param {*} req
76
+ * @param {*} res
77
+ */
78
+ exports.icon512Png = async (req, res) => {
79
+ const txtPath = path.resolve(__dirname, '../../assets/icon-512.png');
80
+ const txt = await readFile(txtPath);
81
+ res.send(txt);
82
+ };
@@ -60,17 +60,29 @@ module.exports = {
60
60
  细化描述: {elaboration}
61
61
 
62
62
  ⚠️ 重要语法限制:
63
- 1. 禁止使用以下 Mermaid 保留字作为节点名称: start, end, stop, pause, resume, done, state, choice, fork, join
64
- 2. 如果流程有"开始"或"结束",使用 node_start((开始))、node_end((结束)) 这样的自定义ID
65
- 3. 节点文本和连接线文本中禁止使用括号()[]{},这些是 Mermaid 的形状语法符号,会导致解析错误
66
- 4. 连接线标签示例: -->|是| 、-->|否| 、-->|提交|,不要写 -->|否(注册)| 或 -->|是(通过)|
67
- 5. 如需补充说明,用斜杠/顿号/破折号代替括号,如"否-注册"、"否/注册"
68
- 6. erDiagram 属性格式严格为: type name PK/FK "注释",每个属性只能有这4个部分
69
- - 正确: string username PK "用户名"
70
- - 正确: int age "年龄"
71
- - 错误: VARCHAR(50) UNIQUE NOT NULL username "用户名"(不支持SQL语法)
72
- - 错误: DATETIME DEFAULT CURRENT_TIMESTAMP created_at(不支持DEFAULT等修饰符)
73
- - type只用简单类型: string, int, text, datetime, boolean, float
63
+
64
+ 【通用规则】
65
+ 1. 所有节点必须使用英文ID,中文文本放在形状符号内,如: node1[中文文本]、node2{判断条件}
66
+ 2. 禁止直接用中文作为节点名,如: 访问网站 --> 判断(错误!)
67
+ 3. 节点文本和连接线标签中禁止使用 ? ? () [] {} 等特殊符号
68
+ 4. 连接线标签示例: -->|是|、-->|否|,不要写 -->|否(注册)|
69
+ 5. 禁止使用 Mermaid 保留字作为节点ID: start, end, stop, state, choice, fork, join
70
+
71
+ 【flowchart 示例】
72
+ flowchart TD
73
+ node_start((开始))
74
+ node_visit[访问网站]
75
+ node_check{是否已注册}
76
+ node_start --> node_visit
77
+ node_visit --> node_check
78
+ node_check -->|是| node_login[登录]
79
+ node_check -->|否| node_register[注册]
80
+
81
+ 【erDiagram 属性格式】
82
+ - 格式: type name PK/FK "注释",每个属性最多4个部分
83
+ - 正确: string username PK "用户名"
84
+ - 错误: VARCHAR(50) UNIQUE NOT NULL username(不支持SQL语法)
85
+ - type只用: string, int, text, datetime, boolean, float
74
86
 
75
87
  要求:
76
88
  1. 生成合法的 Mermaid 语法
package/views/index.html CHANGED
@@ -55,7 +55,7 @@
55
55
  <link rel="apple-touch-icon" href="https://static-small.vincentqiao.com/aibaiban/static/apple-touch-icon.png" />
56
56
 
57
57
  <!-- Manifest -->
58
- <link rel="manifest" href="https://static-small.vincentqiao.com/aibaiban/static/manifest.json" />
58
+ <link rel="manifest" href="https://aibaiban.com/manifest.json" />
59
59
 
60
60
  <!-- Structured Data (JSON-LD) for SEO -->
61
61
  <script type="application/ld+json">
@@ -144,5 +144,10 @@
144
144
  </head>
145
145
  <body>
146
146
  <div id="root"></div>
147
+ <script>
148
+ if ('serviceWorker' in navigator) {
149
+ navigator.serviceWorker.register('/sw.js');
150
+ }
151
+ </script>
147
152
  </body>
148
153
  </html>