sync: collector/ 同步自 inkstone/arcrun-rag@7c21a3a(桌面小幫手 0.18.42)

This commit is contained in:
2026-08-27 21:30:21 +08:00
parent 6e80296362
commit 3d1cb83110
18 changed files with 737 additions and 61 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ func tooBigForWorkersAI(srcText, relPath string) string {
// ExtractWithWorkersAI 讀原稿 → 送自己雲端的 /portal/daemon/extract 萃卡 → 卡片落地。
// cypherURL/apiKey 用的是 daemon 既有的連線憑證(送卡片上雲時同一把,見 direct.go)。
// 回傳產出的卡片相對路徑(單檔一卡),與 ExtractWithGemma 契約一致。
func ExtractWithWorkersAI(cypherURL, apiKey, absRoot, relPath string) ([]string, error) {
func ExtractWithWorkersAI(cypherURL, apiKey, absRoot, relPath string, origin SourceOrigin) ([]string, error) {
if strings.TrimSpace(cypherURL) == "" {
return nil, fmt.Errorf("workers-ai 萃取路需要 cypher_urlconfig")
}
@@ -183,7 +183,7 @@ func ExtractWithWorkersAI(cypherURL, apiKey, absRoot, relPath string) ([]string,
if perr != nil {
return nil, perr
}
cards, berr := BuildWikiDoc(absRoot, relPath, srcText, ex, time.Now())
cards, berr := BuildWikiDoc(absRoot, relPath, srcText, ex, origin, time.Now())
if berr != nil {
return nil, berr
}