@shun-js/aibaiban-server 1.3.4 → 1.3.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shun-js/aibaiban-server",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "aibaiban.com server",
5
5
  "keywords": [
6
6
  "ai aibaiban"
@@ -45,5 +45,5 @@
45
45
  "access": "public",
46
46
  "registry": "https://registry.npmjs.org/"
47
47
  },
48
- "gitHead": "686c4523b1eeddcb67dd4150d7b04318d25210e6"
48
+ "gitHead": "e173153fd979b0357a67ac4443691238100e4fe9"
49
49
  }
@@ -369,6 +369,12 @@ exports.drawAgent = async (req, res) => {
369
369
  req.logger.error(methodName, 'image generation failed', JSON.stringify(imageResult));
370
370
  res.streaming(`data: ${JSON.stringify({ type: 'message', content: '图片生成失败,请稍后重试。' })}\n\n`);
371
371
  }
372
+ } else if (decision.action === 'sketch') {
373
+ // 5. Sketch - 通知前端执行线稿提取(处理在前端完成)
374
+ const duration = Date.now() - startTime;
375
+ req.logger.info(methodName, 'step: sketch', `${duration}ms`);
376
+ chatFeishuMsg(req, 'sketch');
377
+ res.streaming(`data: ${JSON.stringify({ type: 'sketch', duration })}\n\n`);
372
378
  } else {
373
379
  // 未知 action fallback
374
380
  res.streaming(
@@ -13,6 +13,7 @@ module.exports = {
13
13
  1. 支持 4 种图表:flowchart(流程图)、sequence(时序图)、classDiagram(类图)、erDiagram(ER图)。
14
14
  2. 支持直接在白板上绘制形状、文字、箭头等基础图形。
15
15
  3. 支持生成图片(人物、动物、风景、物品等具象内容)。
16
+ 4. 支持将白板上选中的图片转换为线稿图(提取轮廓线条)。
16
17
 
17
18
  ## 决策规则
18
19
  收到用户消息后判断,只回复 JSON:
@@ -29,7 +30,10 @@ module.exports = {
29
30
  4. 生成图片(用户要画人物、动物、风景、物品、logo、海报等具象内容):
30
31
  {"action":"image","prompt":"English prompt for image generation, describe the content, style, composition in detail"}
31
32
 
32
- 5. 与画图完全无关:
33
+ 5. 图片转线稿(用户要求将白板上的图片转换为线稿/素描/轮廓/手绘线条):
34
+ {"action":"sketch"}
35
+
36
+ 6. 与画图完全无关:
33
37
  {"action":"irrelevant"}
34
38
 
35
39
  ## 判断标准
@@ -42,6 +46,7 @@ module.exports = {
42
46
  - 用户说"清空白板" → canvas
43
47
  - 用户要画人物/动物/风景/物品/头像等具象内容 → image
44
48
  - "画一个鸣人"、"画一只猫"、"画日落"、"设计一个logo" → image
49
+ - 用户说"转线稿"、"提取线稿"、"转素描"、"提取轮廓"、"转手绘" → sketch
45
50
  - 用户闲聊但话题相关 → reply 自然回应并引导回画图
46
51
  - 用户闲聊话题无关 → irrelevant
47
52
 
package/views/index.html CHANGED
@@ -105,7 +105,7 @@
105
105
  <script
106
106
  type="module"
107
107
  crossorigin
108
- src="https://static-small.vincentqiao.com/aibaiban/static/index-CaHQbX_H.js"
108
+ src="https://static-small.vincentqiao.com/aibaiban/static/index-L5my37ht.js"
109
109
  ></script>
110
110
  <link
111
111
  rel="modulepreload"
@@ -130,7 +130,7 @@
130
130
  <link
131
131
  rel="modulepreload"
132
132
  crossorigin
133
- href="https://static-small.vincentqiao.com/aibaiban/static/chunks/excalidraw-uW8o6EnV.js"
133
+ href="https://static-small.vincentqiao.com/aibaiban/static/chunks/excalidraw-BN93vlts.js"
134
134
  />
135
135
  <link
136
136
  rel="stylesheet"