chatbot-analyze-qweasd 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/apiflow5.mjs +29 -11
  2. package/package.json +1 -1
package/apiflow5.mjs CHANGED
@@ -628,17 +628,34 @@ focus_hint: ${focus?.focus || ""}
628
628
  ${headerFromContext}
629
629
 
630
630
  【任務】
631
- 1) 產生「概要流程圖」,只涵蓋 A function 的主要步驟與檢核點。
632
- 2) nodes/edges 以步驟順序描述呼叫與 if 判斷,避免過細節。
633
- 3) 對重要檢核/外部呼叫節點填寫 focus(供後續細化用)。
634
- 4) call 節點需提供簡短功能描述(1-2 句),可根據命名/註解推測。
635
- 5) 外部呼叫(HTTP/DB/第三方)只需顯示呼叫名稱或 endpoint,不需展開。
636
- 6) if 節點需提供條件,並用 edges 標記 true/false。
637
- 7) 若為專案內部方法,盡量提供檔案路徑與行號(相對於專案根目錄)。
638
- 8) nodes 請包含 start 與 end 節點,並把流程串起來。
639
- 9) 遇到 return 就結束流程,不要列出 return 之後的語句或步驟。
640
- 10) 不要把「解析錯誤/JSON parse」這類內部處理訊息當成流程步驟。
641
- 11) DB 查詢(例如 findByTeamAndChannelIdAndUserId)只需顯示方法名,不要附加說明。
631
+ 1) 產生「概要流程圖」,涵蓋 A function 的所有主要步驟與檢核點。
632
+ 2) nodes/edges 以步驟順序描述呼叫與 if 判斷。
633
+ 3) **重要:對於 if/else if 分支,每個分支都必須單獨列出為獨立的 if 節點,不要合併成一個通用節點。**
634
+ 4) **重要:對於有多個 else if 的結構(例如處理不同訊息類型),每個 else if 都要展開為獨立的條件節點。**
635
+ 5) 對重要檢核/外部呼叫節點填寫 focus(供後續細化用)。
636
+ 6) **重要:對於每個 else if 分支的內部處理邏輯,也要填寫 focus 欄位,使用分支的關鍵特徵作為 focus 值。**
637
+ 7) call 節點需提供簡短功能描述(1-2 句),可根據命名/註解推測。
638
+ 8) 外部呼叫(HTTP/DB/第三方)只需顯示呼叫名稱或 endpoint,不需展開。
639
+ 9) if 節點需提供條件,並用 edges 標記 true/false。
640
+ 10) 若為專案內部方法,盡量提供檔案路徑與行號(相對於專案根目錄)。
641
+ 11) nodes 請包含 start 與 end 節點,並把流程串起來。
642
+ 12) 遇到 return 就結束流程,不要列出 return 之後的語句或步驟。
643
+ 13) 不要把「解析錯誤/JSON parse」這類內部處理訊息當成流程步驟。
644
+ 14) DB 查詢(例如 findByTeamAndChannelIdAndUserId)只需顯示方法名,不要附加說明。
645
+
646
+ 【if/else if 分支處理範例】
647
+ 如果程式碼是:
648
+ \`\`\`
649
+ if (type == A) { ... }
650
+ else if (type == B) { ... }
651
+ else if (type == C) { ... }
652
+ \`\`\`
653
+ 應該產生:
654
+ - if 節點 "type == A?",true 分支處理 A,false 分支連到下一個 if
655
+ - if 節點 "type == B?",true 分支處理 B,false 分支連到下一個 if
656
+ - if 節點 "type == C?",true 分支處理 C,false 分支繼續
657
+
658
+ **不要**產生一個通用的 "Handle other types" 節點!
642
659
 
643
660
  【節點欄位說明】
644
661
  - call 節點需帶 call 欄位:
@@ -648,6 +665,7 @@ ${headerFromContext}
648
665
  - label: 用於圖上顯示,請簡短
649
666
  - summary: call 節點的功能描述(1-2 句,純文字)
650
667
  - focus: 需要細化的節點用簡短關鍵字描述;不需要細化則填 null
668
+ - **重要:對於處理不同類型/分支的邏輯,focus 應填入該類型的關鍵字(例如 "button-template", "carousel", "quick-reply")**
651
669
 
652
670
  【輸出資料結構】
653
671
  - nodes: 流程節點列表,id 請用簡單編號(如 n1, n2, n3)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatbot-analyze-qweasd",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {