botrun-horse 2.28.2 → 2.28.3
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/bin/commands/prompt.mjs
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
// 不認識的子指令 → 當關鍵字做全文模糊搜尋
|
|
4
4
|
import { timer, jsonOut, emitError, logProgress } from '../../lib/core/cli-utils.mjs';
|
|
5
5
|
|
|
6
|
+
/** 去掉 body 開頭的 # 標題行(CLI 標頭已顯示,避免重複) */
|
|
7
|
+
function stripTitle(body) {
|
|
8
|
+
return body.replace(/^#\s+.+\n+/, '');
|
|
9
|
+
}
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* prompt 指令主路由
|
|
8
13
|
*
|
|
@@ -66,7 +71,7 @@ async function cmdPromptList(flags) {
|
|
|
66
71
|
const p = filtered[i];
|
|
67
72
|
if (i > 0) process.stdout.write('\n---\n\n');
|
|
68
73
|
process.stdout.write(`[${p.meta.series || ''}/${p.slug}] ${p.meta.title || p.slug}\n\n`);
|
|
69
|
-
process.stdout.write(p.body + '\n');
|
|
74
|
+
process.stdout.write(stripTitle(p.body) + '\n');
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
77
|
|
|
@@ -125,7 +130,7 @@ async function cmdPromptShow(positionals, flags) {
|
|
|
125
130
|
};
|
|
126
131
|
process.stdout.write(jsonOut('prompt show', data, elapsed()));
|
|
127
132
|
} else {
|
|
128
|
-
process.stdout.write(prompt.body + '\n');
|
|
133
|
+
process.stdout.write(stripTitle(prompt.body) + '\n');
|
|
129
134
|
}
|
|
130
135
|
}
|
|
131
136
|
|
|
@@ -170,6 +175,6 @@ async function cmdPromptSearch(positionals, flags) {
|
|
|
170
175
|
const r = results[i];
|
|
171
176
|
if (i > 0) process.stdout.write('\n---\n\n');
|
|
172
177
|
process.stdout.write(`[${r.prompt.meta.series || ''}/${r.prompt.slug}] ${r.prompt.meta.title}\n\n`);
|
|
173
|
-
process.stdout.write(r.prompt.body + '\n');
|
|
178
|
+
process.stdout.write(stripTitle(r.prompt.body) + '\n');
|
|
174
179
|
}
|
|
175
180
|
}
|
|
@@ -7,9 +7,9 @@ aliases: [coding, 扣頂, 寫程式, 開發]
|
|
|
7
7
|
|
|
8
8
|
# 零框架扣頂 coding
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
🔄 換位思考:先掃描資料與提問,推理需求背後動機,具體列出 5 個潛在動機
|
|
11
|
+
📡 新文件:根據提問與需求上網查詢最新 SDK API 文件,因為隨時都在變化
|
|
12
|
+
🥊 三方案:提出 3 替代方案多維度打分,以使用者為中心選最適合方案
|
|
13
|
+
🏗️ 六軟工:採用 BDD TDD SOLID DRY KISS DDD 實作
|
|
14
|
+
✅ 待辦:在 ./todo/ 設計 DAG todo list,盡力平行子代理實作,追蹤測試完整
|
|
15
|
+
🌐 HTTPS 代理:系統有機率在沙盒 HTTPS proxy 環境變數之下執行,必須相容
|
|
@@ -7,6 +7,6 @@ aliases: [search, 搜尋, 查詢, 找資料]
|
|
|
7
7
|
|
|
8
8
|
# 零框架搜尋
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
🔍 搜尋接地:啟用 Google Search grounding,確保回應以真實搜尋結果為依據
|
|
11
|
+
🔗 引證 URL:回應必須包含引證來源的 URL,讓使用者可驗證
|
|
12
|
+
🚫 零幻覺:不捏造不存在的資料,所有事實陳述須有搜尋結果佐證
|