docs(ai-code-review): 補齊各模組 JSDoc、指令檔逐行註解並重建 README
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
303104bb20
commit
1378f03595
@@ -12,10 +12,29 @@ export const PR_BASE_BRANCH = process.env.PR_BASE_BRANCH || '';
|
||||
export const FINDINGS_PATH = '.gitea/ai-review/findings.json';
|
||||
export const EXCLUSIONS_PATH = '.gitea/ai-review/exclusions.json';
|
||||
|
||||
/**
|
||||
* 建立一個停用 TLS 憑證驗證(`rejectUnauthorized: false`)的 HTTPS Agent,
|
||||
* 供連接使用自簽或無效憑證的 OpenCode 服務時使用。
|
||||
*
|
||||
* @remarks 每次呼叫都會回傳全新的 Agent 實例(不快取),建議呼叫端重用以共用連線池。
|
||||
* 停用憑證驗證有中間人攻擊風險,僅限受信任的內部環境使用。
|
||||
* @returns {import('https').Agent} 已關閉憑證驗證的 HTTPS Agent 實例。
|
||||
*/
|
||||
export function getOpenCodeHttpsAgent() {
|
||||
return new https.Agent({ rejectUnauthorized: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* 依環境變數解析並回傳 LLM 提供者設定。
|
||||
*
|
||||
* 當設定了 `OPENCODE_BASE_URL` 時回傳 OpenCode 提供者設定
|
||||
* (model 取自 `OPENCODE_MODEL`,預設為 `gemini-2.5-flash`);
|
||||
* 否則回傳各欄位皆為空/null 的「無提供者」設定,由呼叫端據此判斷是否略過 LLM 流程。
|
||||
*
|
||||
* @remarks 每次呼叫都會即時讀取 `process.env`。`apiKeys` 在 OpenCode 模式下為固定佔位值 `['opencode']`,並非真實金鑰。
|
||||
* @returns {{ provider: ('opencode'|null), apiKeys: string[], baseURL: (string|null), model: (string|null) }}
|
||||
* LLM 設定物件;`provider` 為 `null` 表示沒有可用的提供者。
|
||||
*/
|
||||
export function getLLMConfig() {
|
||||
if (process.env.OPENCODE_BASE_URL) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user