refactor: 项目更名 WeKnora → Academy
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
- 全量替换代码/配置/文档中的项目名(保留上游 GitHub 链接、weixin 文档域名、Docker Hub 镜像名) - 重命名 32 个含项目名的文件/目录;Go module 路径改为 academy(含 client/cli 子模块) - docreader proto 描述符采用等长替换,保持序列化字节布局有效 - Dockerfile.app 构建网络修复: browserskill 离线产物通道、PyPI/apt 国内镜像 - 运行验证: go build ✓ docker compose up ✓ 健康检查 ✓
This commit is contained in:
1 parent
9097ee699d
commit
9058149576
3136 files changed
+18018
-18004
No files matched your search
@@ -11,7 +11,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"academy/internal/datasource"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -13,9 +13,9 @@ import (
|
||||
"time"
|
||||
|
||||
htmltomd "github.com/JohannesKaufmann/html-to-markdown/v2"
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
type roundTripper func(*http.Request) (*http.Response, error)
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
func TestPATAuthentication(t *testing.T) {
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
func TestSafeFilenameKeepsUTF8ValidAtLimit(t *testing.T) {
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -94,7 +94,7 @@ type node struct {
|
||||
}
|
||||
|
||||
// binaryDocumentTypes maps the extension of an uploaded DingTalk file to the
|
||||
// MIME type WeKnora stores it under. Only formats WeKnora can parse are listed;
|
||||
// MIME type Academy stores it under. Only formats Academy can parse are listed;
|
||||
// native ALIDOC files have their own online read APIs and are absent on
|
||||
// purpose, as are media files that would be pointless to index as text.
|
||||
var binaryDocumentTypes = map[string]string{
|
||||
@@ -128,7 +128,7 @@ func (n node) binaryContentType() (string, bool) {
|
||||
}
|
||||
|
||||
// isBinaryDocument reports whether the node is an uploaded file this connector
|
||||
// can download and hand to WeKnora's own parsers.
|
||||
// can download and hand to Academy's own parsers.
|
||||
func (n node) isBinaryDocument() bool {
|
||||
_, ok := n.binaryContentType()
|
||||
return ok
|
||||
|
||||
@@ -12,10 +12,10 @@ import (
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/common"
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/common"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -24,7 +24,7 @@ const (
|
||||
)
|
||||
|
||||
// mediaExtensions are the file types this connector deliberately never
|
||||
// downloads: media carries no text WeKnora could index.
|
||||
// downloads: media carries no text Academy could index.
|
||||
var mediaExtensions = map[string]struct{}{
|
||||
"mp4": {}, "mov": {}, "avi": {}, "mkv": {}, "flv": {}, "wmv": {}, "m4v": {}, "webm": {},
|
||||
"mp3": {}, "wav": {}, "m4a": {}, "aac": {}, "flac": {},
|
||||
@@ -1370,7 +1370,7 @@ func warnUnknownBlockTypes(ctx context.Context, document node, rendered renderRe
|
||||
|
||||
// readDocument turns one supported wiki node into a FetchedItem. Native adoc
|
||||
// documents are rendered from their blocks, and uploaded files are transferred
|
||||
// byte-for-byte so WeKnora's own parsers can read them. folders is the source
|
||||
// byte-for-byte so Academy's own parsers can read them. folders is the source
|
||||
// folder hierarchy to encode in the item's FileName, or nil to keep the
|
||||
// historical flat name.
|
||||
func readDocument(
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
type fakeAPI struct {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// The unknown-type collection is a value on its own so the reporting path is
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// --- settings ---
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// The fixture below reproduces the shape of the tenant that reported the
|
||||
|
||||
@@ -3,7 +3,7 @@ package dingtalk
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// settingBool interprets a data source settings value as a boolean, returning
|
||||
@@ -35,7 +35,7 @@ func settingBool(v interface{}, def bool) bool {
|
||||
// nobody asked for.
|
||||
type documentSettings struct {
|
||||
// IncludeUploadedFiles admits uploaded Office/PDF files (FILE/DOCUMENT
|
||||
// nodes) that are downloaded from 钉盘 and parsed by WeKnora itself.
|
||||
// nodes) that are downloaded from 钉盘 and parsed by Academy itself.
|
||||
IncludeUploadedFiles bool
|
||||
// PreserveFolderStructure encodes each document's DingTalk folder hierarchy
|
||||
// into its FileName, so the document lands in the knowledge base folder
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
func twoFolderFixture(t *testing.T) (*Connector, *fakeAPI, *types.DataSourceConfig, string, string) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"academy/internal/datasource"
|
||||
)
|
||||
|
||||
// A data source that names resources syncs those resources, so Validate has to
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// Feishu docx block_type integer enum (subset this connector handles).
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
func TestListDocumentBlocks_Paginates(t *testing.T) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// P3 embedded-object pipeline tests: board blocks (block_type 43) exported via
|
||||
@@ -92,7 +92,7 @@ func TestFetchDocxWithBlocks_BoardExportSuccess(t *testing.T) {
|
||||
if !strings.Contains(string(main.Content), " {
|
||||
t.Errorf("board not inlined as base64 data URI:\n%s", main.Content)
|
||||
}
|
||||
if strings.Contains(string(main.Content), "weknora-img://") {
|
||||
if strings.Contains(string(main.Content), "academy-img://") {
|
||||
t.Errorf("internal marker leaked into stored markdown:\n%s", main.Content)
|
||||
}
|
||||
if main.Metadata["image_map"] != "" {
|
||||
@@ -120,7 +120,7 @@ func TestFetchDocxWithBlocks_BoardExportForbiddenDegrades(t *testing.T) {
|
||||
if !strings.Contains(string(main.Content), "![图片]()") {
|
||||
t.Errorf("markdown missing board degrade note:\n%s", main.Content)
|
||||
}
|
||||
if strings.Contains(string(main.Content), "weknora-img") {
|
||||
if strings.Contains(string(main.Content), "academy-img") {
|
||||
t.Errorf("unresolved board marker left in markdown:\n%s", main.Content)
|
||||
}
|
||||
if main.Metadata["image_map"] != "" {
|
||||
@@ -438,7 +438,7 @@ func TestFetchDocxWithBlocks_MentionDocTitleBackfill(t *testing.T) {
|
||||
// A header can advertise dimensions far beyond the compressed download size.
|
||||
// The sentinel codec proves that the full pixel decoder is never invoked.
|
||||
func TestTrimBoardImageRejectsOversizeBeforeDecode(t *testing.T) {
|
||||
const magic = "weknora-oversized-board-test"
|
||||
const magic = "academy-oversized-board-test"
|
||||
image.RegisterFormat("png", magic,
|
||||
func(io.Reader) (image.Image, error) {
|
||||
panic("oversized board reached pixel decoder")
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// Client wraps the Feishu Open Platform API for document/wiki operations.
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// engine.go holds the single generic streaming sync engine shared by the wiki
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
secutils "academy/internal/utils"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
|
||||
@@ -27,7 +27,7 @@ type pendingAttachment struct {
|
||||
}
|
||||
|
||||
// pendingDocName is one 云文档 mention link awaiting a title backfill: the
|
||||
// renderer emits "[weknora-docname://<token>](<url>)" placeholders (it has no
|
||||
// renderer emits "[academy-docname://<token>](<url>)" placeholders (it has no
|
||||
// access to document titles) and FetchDocxWithBlocks resolves the titles via
|
||||
// the drive metadata batch API, patching the link text in place.
|
||||
type pendingDocName struct {
|
||||
@@ -83,11 +83,11 @@ func (r *mdRenderer) nextImageNo(kind, token string) int {
|
||||
}
|
||||
|
||||
// imageMarker renders the synthetic placeholder for image/board N. The nonce
|
||||
// keeps user-typed look-alike text (a literal  in a
|
||||
// keeps user-typed look-alike text (a literal  in a
|
||||
// text run) from ever matching the connector's patch needle — only this
|
||||
// renderer and the patcher share the derivation (imageMarkerNonce).
|
||||
func (r *mdRenderer) imageMarker(n int) string {
|
||||
return fmt.Sprintf("", n, r.markerNonce)
|
||||
return fmt.Sprintf("", n, r.markerNonce)
|
||||
}
|
||||
|
||||
// imageMarkerNonce derives the per-document marker nonce from the doc URL.
|
||||
@@ -99,7 +99,7 @@ func imageMarkerNonce(seed string) string {
|
||||
|
||||
// blocksToMarkdown renders a flat docx block array to Markdown, inlining
|
||||
// embedded spreadsheet/bitable tables, collecting downloadable
|
||||
// attachments, and numbering image/board blocks as weknora-img://N markers.
|
||||
// attachments, and numbering image/board blocks as academy-img://N markers.
|
||||
// docURL is the parent document's web URL used in non-whitelisted attachment
|
||||
// placeholders (empty → placeholder without link). client may be nil when the
|
||||
// block set has no downdrill blocks. userName resolves mention_user OpenIDs to
|
||||
@@ -271,7 +271,7 @@ func (r *mdRenderer) renderBlock(b DocxBlock) string {
|
||||
// this exact line after the download attempt (name on success /
|
||||
// tiny, degrade note over cap), so an identical earlier bullet
|
||||
// can never be replaced by mistake.
|
||||
return "- weknora-att://" + b.File.Token
|
||||
return "- academy-att://" + b.File.Token
|
||||
}
|
||||
// Not ingestible (wrong type / video): keep a visible reference with
|
||||
// the source link when available.
|
||||
@@ -543,7 +543,7 @@ func (r *mdRenderer) richText(bt *BlockText) string {
|
||||
r.docNameSeen[ref.Token] = true
|
||||
r.docNames = append(r.docNames, ref)
|
||||
}
|
||||
sb.WriteString("[weknora-docname://" + ref.Token + "](" + escapeURL(u) + ")")
|
||||
sb.WriteString("[academy-docname://" + ref.Token + "](" + escapeURL(u) + ")")
|
||||
} else {
|
||||
sb.WriteString("[" + u + "](" + escapeURL(u) + ")")
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ func TestContainerPreservesNestedListContent(t *testing.T) {
|
||||
}
|
||||
md, atts, imgs, _, err := blocksToMarkdown(context.Background(), nil, blocks, "", nil)
|
||||
require.NoError(t, err)
|
||||
for _, text := range []string{"parent", "nested content", "weknora-att://pdf", "weknora-img://"} {
|
||||
for _, text := range []string{"parent", "nested content", "academy-att://pdf", "academy-img://"} {
|
||||
require.Equal(t, 1, strings.Count(string(md), text), "content must appear exactly once: %s", md)
|
||||
}
|
||||
require.Len(t, atts, 1)
|
||||
@@ -102,7 +102,7 @@ func TestBoardInNativeTableIsDownloaded(t *testing.T) {
|
||||
md := string(items[0].Content)
|
||||
require.Equal(t, 1, strings.Count(md, "data:image/png;base64,"))
|
||||
require.Equal(t, 1, strings.Count(md, "board caption"))
|
||||
require.NotContains(t, md, "weknora-img://")
|
||||
require.NotContains(t, md, "academy-img://")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func TestBlocksToMarkdown_EmbeddedSheetAndFile(t *testing.T) {
|
||||
if !strings.Contains(string(md), "| 名称 | 数量 |") || !strings.Contains(string(md), "| 苹果 | 3 |") {
|
||||
t.Errorf("sheet not inlined:\n%s", md)
|
||||
}
|
||||
if !strings.Contains(string(md), fmt.Sprintf("", imageMarkerNonce(""))) {
|
||||
if !strings.Contains(string(md), fmt.Sprintf("", imageMarkerNonce(""))) {
|
||||
t.Errorf("numbered image marker missing:\n%s", md)
|
||||
}
|
||||
if len(imgs) != 1 || imgs[0].N != 1 || imgs[0].Kind != "image" || imgs[0].Token != "img_t" {
|
||||
@@ -63,7 +63,7 @@ func TestBlocksToMarkdown_EmbeddedSheetAndFile(t *testing.T) {
|
||||
if len(atts) != 1 || atts[0].FileToken != "file_t" || atts[0].Name != "报表.pdf" {
|
||||
t.Errorf("attachments = %+v", atts)
|
||||
}
|
||||
if !strings.Contains(string(md), "- weknora-att://file_t") {
|
||||
if !strings.Contains(string(md), "- academy-att://file_t") {
|
||||
t.Errorf("attachment marker line missing:\n%s", md)
|
||||
}
|
||||
}
|
||||
@@ -496,9 +496,9 @@ func TestBlocksToMarkdown_UnsupportedBlocksPlaceholdersNoTokenLeak(t *testing.T)
|
||||
t.Errorf("empty view must not emit a placeholder:\n%s", s)
|
||||
}
|
||||
// Board (43) now rides the image pipeline: a token-bearing board renders a
|
||||
// numbered weknora-img:// marker and records a pendingImage for the
|
||||
// numbered academy-img:// marker and records a pendingImage for the
|
||||
// connector's whiteboard download.
|
||||
if !strings.Contains(s, fmt.Sprintf("", imageMarkerNonce(""))) {
|
||||
if !strings.Contains(s, fmt.Sprintf("", imageMarkerNonce(""))) {
|
||||
t.Errorf("board marker missing:\n%s", s)
|
||||
}
|
||||
if len(imgs) != 1 || imgs[0].Kind != "board" || imgs[0].Token != "brdSECRET" {
|
||||
@@ -536,10 +536,10 @@ func TestBlocksToMarkdown_ViewContainerRendersChildren(t *testing.T) {
|
||||
}
|
||||
// Raw render emits unique per-token marker lines; FetchDocxWithBlocks
|
||||
// patches them to the display names after the download attempt.
|
||||
if n := strings.Count(s, "- weknora-att://ftok1"); n != 1 {
|
||||
if n := strings.Count(s, "- academy-att://ftok1"); n != 1 {
|
||||
t.Errorf("file child rendered %d times, want exactly 1:\n%s", n, s)
|
||||
}
|
||||
if !strings.Contains(s, "- weknora-att://ftok1\n- weknora-att://ftok2") {
|
||||
if !strings.Contains(s, "- academy-att://ftok1\n- academy-att://ftok2") {
|
||||
t.Errorf("view children not rendered as one list:\n%s", s)
|
||||
}
|
||||
if len(atts) != 2 {
|
||||
@@ -778,9 +778,9 @@ func TestBlocksToMarkdown_ImageNumberingStableOrder(t *testing.T) {
|
||||
s := string(md)
|
||||
nonce := imageMarkerNonce("")
|
||||
for _, want := range []string{
|
||||
fmt.Sprintf("", nonce),
|
||||
fmt.Sprintf("", nonce),
|
||||
fmt.Sprintf("", nonce),
|
||||
fmt.Sprintf("", nonce),
|
||||
fmt.Sprintf("", nonce),
|
||||
fmt.Sprintf("", nonce),
|
||||
} {
|
||||
if !strings.Contains(s, want) {
|
||||
t.Errorf("marker %q missing:\n%s", want, s)
|
||||
@@ -1057,7 +1057,7 @@ func TestBlocksToMarkdown_MentionDocTitlePlaceholder(t *testing.T) {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
url := "https://my.feishu.cn/docx/MHU6d4eixo1UdCxNzGbcspVSnfg"
|
||||
if !strings.Contains(string(md), "[weknora-docname://MHU6d4eixo1UdCxNzGbcspVSnfg]("+escapeURL(url)+")") {
|
||||
if !strings.Contains(string(md), "[academy-docname://MHU6d4eixo1UdCxNzGbcspVSnfg]("+escapeURL(url)+")") {
|
||||
t.Errorf("title placeholder missing, got:\n%s", md)
|
||||
}
|
||||
if len(docs) != 1 || docs[0].Token != "MHU6d4eixo1UdCxNzGbcspVSnfg" || docs[0].DocType != "docx" {
|
||||
|
||||
@@ -38,8 +38,8 @@ func TestTableViewKeepsFileAndBoard(t *testing.T) {
|
||||
if len(atts) != 1 || len(imgs) != 1 {
|
||||
t.Fatalf("table view media lost: attachments=%d images=%d markdown=%q", len(atts), len(imgs), md)
|
||||
}
|
||||
if strings.Count(string(md), "weknora-att://pdf") != 1 ||
|
||||
strings.Count(string(md), "weknora-img://") != 1 {
|
||||
if strings.Count(string(md), "academy-att://pdf") != 1 ||
|
||||
strings.Count(string(md), "academy-img://") != 1 {
|
||||
t.Fatalf("media must render exactly once: %s", md)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package core
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package core
|
||||
|
||||
import "github.com/Tencent/WeKnora/internal/types"
|
||||
import "academy/internal/types"
|
||||
|
||||
// Open Platform API origins. Feishu and Lark are the same product deployed on
|
||||
// two isolated clouds; the wiki/docx/drive APIs this connector uses are
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
func TestRegions_AreDistinct(t *testing.T) {
|
||||
|
||||
@@ -18,9 +18,9 @@ import (
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
const FeishuWikiNodeResourceSeparator = ":"
|
||||
@@ -168,7 +168,7 @@ const MinAttachmentBytes = 2 * 1024
|
||||
const maxInlineImageBytes = 10 * 1024 * 1024
|
||||
|
||||
// SupportedImageExt sniffs image bytes and returns the filename extension and
|
||||
// content type WeKnora accepts for a standalone image knowledge item (png/jpg/
|
||||
// content type Academy accepts for a standalone image knowledge item (png/jpg/
|
||||
// gif — the image set isValidFileType admits). ok is false for non-image or
|
||||
// unsupported formats (e.g. webp/bmp), which the caller skips rather than
|
||||
// mislabel — a wrong extension would fail parsing. The detected content type is
|
||||
@@ -382,7 +382,7 @@ func userNameResolver(ctx context.Context, client *Client) func(string) string {
|
||||
// DocxFetchInput is the unified description of one docx document from either
|
||||
// source (wiki node or Drive file) that FetchDocxWithBlocks needs.
|
||||
type DocxFetchInput struct {
|
||||
// WeKnora external_id: wiki=node.NodeToken, drive=file.Token
|
||||
// Academy external_id: wiki=node.NodeToken, drive=file.Token
|
||||
DocToken string
|
||||
// Feishu docx document token
|
||||
ObjToken string
|
||||
@@ -410,7 +410,7 @@ func FetchDocxWithBlocks(ctx context.Context, client *Client, in DocxFetchInput)
|
||||
// The parse mode comes from the data source's Settings["parse_mode"],
|
||||
// resolved by ParseFeishuConfig and threaded in via DocxFetchInput.ParseMode.
|
||||
// The blocks path (default) inlines images/boards into the parent
|
||||
// Markdown as base64 data URIs (via weknora-img://N markers) and fans
|
||||
// Markdown as base64 data URIs (via academy-img://N markers) and fans
|
||||
// attachments out into sub-items wired to the parent via attachment_ids
|
||||
// metadata. The export path yields a .docx that docreader
|
||||
// parses inline, so images are bound to the parent document via
|
||||
@@ -494,7 +494,7 @@ func FetchDocxWithBlocks(ctx context.Context, client *Client, in DocxFetchInput)
|
||||
// ![图片]() placeholder or a degrade note on failure. Markers are unique
|
||||
// per N, and N is assigned once per image/board block.
|
||||
patchMarker := func(n int, replacement string) {
|
||||
needle := fmt.Sprintf("", n, imageMarkerNonce(in.URL))
|
||||
needle := fmt.Sprintf("", n, imageMarkerNonce(in.URL))
|
||||
md = strings.Replace(md, needle, replacement, 1)
|
||||
}
|
||||
|
||||
@@ -502,13 +502,13 @@ func FetchDocxWithBlocks(ctx context.Context, client *Client, in DocxFetchInput)
|
||||
for _, a := range atts {
|
||||
childID := types.SubtreeChildID(in.DocToken, "file", a.FileToken)
|
||||
keep = append(keep, childID) // present in the doc → never sweep as stale
|
||||
// The renderer emitted the unique line "- weknora-att://<token>" for
|
||||
// The renderer emitted the unique line "- academy-att://<token>" for
|
||||
// this attachment; patch that exact line so an identical earlier
|
||||
// bullet can never be replaced by mistake. Anchoring on the token's
|
||||
// end (newline or end of markdown) keeps a token that is a strict
|
||||
// prefix of another attachment's token from matching inside it.
|
||||
patchAtt := func(line string) {
|
||||
needle := "- weknora-att://" + a.FileToken
|
||||
needle := "- academy-att://" + a.FileToken
|
||||
if anchored := needle + "\n"; strings.Contains(md, anchored) {
|
||||
md = strings.Replace(md, anchored, line+"\n", 1)
|
||||
return
|
||||
@@ -589,14 +589,14 @@ func FetchDocxWithBlocks(ctx context.Context, client *Client, in DocxFetchInput)
|
||||
}
|
||||
|
||||
// ── 云文档 mention links: backfill document titles ──
|
||||
// The renderer emits "[weknora-docname://<token>](<url>)" placeholders; the
|
||||
// The renderer emits "[academy-docname://<token>](<url>)" placeholders; the
|
||||
// drive metadata batch API resolves every title in one call. Refs that
|
||||
// cannot be resolved (no permission, deleted, unsupported type) keep the
|
||||
// URL as the link text — exactly the form rendered before this backfill.
|
||||
if len(docNames) > 0 {
|
||||
titles := client.DocTitles(ctx, docNames)
|
||||
for _, dn := range docNames {
|
||||
needle := "[weknora-docname://" + dn.Token + "](" + escapeURL(dn.URL) + ")"
|
||||
needle := "[academy-docname://" + dn.Token + "](" + escapeURL(dn.URL) + ")"
|
||||
repl := "[" + dn.URL + "](" + escapeURL(dn.URL) + ")"
|
||||
if title := titles[dn.Token]; title != "" {
|
||||
clean := strings.NewReplacer("[", "[", "]", "]", "\n", " ", "\r", "").Replace(title)
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Package feishu implements the Feishu (飞书/Lark) data source connector for WeKnora.
|
||||
// Package feishu implements the Feishu (飞书/Lark) data source connector for Academy.
|
||||
//
|
||||
// It syncs documents from Feishu Wiki spaces and cloud documents into WeKnora knowledge bases.
|
||||
// It syncs documents from Feishu Wiki spaces and cloud documents into Academy knowledge bases.
|
||||
//
|
||||
// Feishu API docs:
|
||||
// - Wiki spaces: https://open.feishu.cn/document/server-docs/docs/wiki-v2/space/list
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// ListWikiNodesWithShortcuts supplements the existing traversal with descendants
|
||||
|
||||
@@ -8,10 +8,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// DriveConnector implements the datasource.Connector (and StreamingConnector)
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
)
|
||||
|
||||
// TestDriveCursorRoundTrip verifies driveOps.EncodeCursor/DecodeCursorTimes
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// makeDriveConfig builds a DataSourceConfig for the Drive connector, mirroring
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
secutils "academy/internal/utils"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
)
|
||||
|
||||
// TestClientDriveListFilesPagination is the Drive (云盘) counterpart of the wiki
|
||||
|
||||
@@ -3,9 +3,9 @@ package drive
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// This file implements the P1 directory mapping for the Drive connector:
|
||||
|
||||
@@ -10,10 +10,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// Connector implements the datasource.Connector interface for Feishu and, with
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// statefulFeishu is a fake Feishu server whose per-node export outcome can be
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -25,9 +25,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
// collectHandler records everything a real FetchStream emits so the test can
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// env vars) so it never runs in the normal suite or CI.
|
||||
//
|
||||
// It WRITES to your Feishu tenant: it creates a handful of docx documents under
|
||||
// the given wiki space, each titled "WeKnora sync test doc N" so you can find
|
||||
// the given wiki space, each titled "Academy sync test doc N" so you can find
|
||||
// and delete them afterwards. Requires app write scopes:
|
||||
// - wiki:wiki (create wiki nodes)
|
||||
// - docx:document (write docx content)
|
||||
@@ -26,8 +26,8 @@ import (
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
// wikiNodeCreateResp is the subset of POST /wiki/v2/spaces/:id/nodes we need.
|
||||
@@ -68,7 +68,7 @@ func TestRealAPI_CreateSpace(t *testing.T) {
|
||||
}
|
||||
err := client.DoRequest(context.Background(), "POST", "/open-apis/wiki/v2/spaces",
|
||||
map[string]interface{}{
|
||||
"name": "WeKnora Resilience Test KB",
|
||||
"name": "Academy Resilience Test KB",
|
||||
"description": "Auto-created for connector resilience testing (#2136). Safe to delete.",
|
||||
}, &resp)
|
||||
if err != nil {
|
||||
@@ -101,7 +101,7 @@ func TestRealAPI_SeedDocs(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
for i := 1; i <= count; i++ {
|
||||
title := fmt.Sprintf("WeKnora sync test doc %d", i)
|
||||
title := fmt.Sprintf("Academy sync test doc %d", i)
|
||||
|
||||
// 1) Create a docx wiki node.
|
||||
var created wikiNodeCreateResp
|
||||
@@ -134,7 +134,7 @@ func TestRealAPI_SeedDocs(t *testing.T) {
|
||||
"text": map[string]interface{}{
|
||||
"elements": []map[string]interface{}{{
|
||||
"text_run": map[string]interface{}{
|
||||
"content": fmt.Sprintf("This is WeKnora sync test document number %d. It exists to validate connector resilience (issue #2136).", i),
|
||||
"content": fmt.Sprintf("This is Academy sync test document number %d. It exists to validate connector resilience (issue #2136).", i),
|
||||
},
|
||||
}},
|
||||
},
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// fakeFeishuFailingExport serves the auth/spaces/nodes endpoints normally but
|
||||
|
||||
@@ -15,10 +15,10 @@ import (
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
secutils "academy/internal/utils"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
@@ -1678,7 +1678,7 @@ func TestFetchDocxWithBlocks_EmbeddedImage(t *testing.T) {
|
||||
if !strings.Contains(string(main.Content), wantURI) {
|
||||
t.Errorf("image not inlined as base64 data URI:\n%s", main.Content[:min(len(main.Content), 400)])
|
||||
}
|
||||
if strings.Contains(string(main.Content), "weknora-img://") {
|
||||
if strings.Contains(string(main.Content), "academy-img://") {
|
||||
t.Errorf("internal marker leaked into stored markdown:\n%s", main.Content[:400])
|
||||
}
|
||||
if main.Metadata["image_map"] != "" {
|
||||
@@ -1740,7 +1740,7 @@ func TestFetchDocxWithBlocks_ImageDownloadFailure(t *testing.T) {
|
||||
if !strings.Contains(string(main.Content), "![图片]()") {
|
||||
t.Errorf("broken image must degrade to a placeholder:\n%s", main.Content)
|
||||
}
|
||||
if strings.Contains(string(main.Content), "weknora-img://") {
|
||||
if strings.Contains(string(main.Content), "academy-img://") {
|
||||
t.Errorf("internal marker leaked into stored markdown:\n%s", main.Content)
|
||||
}
|
||||
}
|
||||
@@ -1868,7 +1868,7 @@ func TestFeishuCursorRoundTrip(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestSupportedImageExt covers every arm of the sniff table: the png/jpg/gif
|
||||
// formats WeKnora accepts (aligned with isValidFileType's image set), and the
|
||||
// formats Academy accepts (aligned with isValidFileType's image set), and the
|
||||
// unsupported case which must return ok=false while still surfacing the detected
|
||||
// content type so the caller can log it without re-sniffing.
|
||||
func TestSupportedImageExt(t *testing.T) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package wiki
|
||||
|
||||
import "github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
import "academy/internal/datasource/connector/feishu/core"
|
||||
|
||||
func txt(s string) *core.BlockText {
|
||||
return &core.BlockText{Elements: []core.TextElement{{TextRun: &core.TextRun{Content: s}}}}
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// A Lark connector must surface wiki links on the Lark host. Before Lark became
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
)
|
||||
|
||||
func TestParseModeChangeRefetchesExistingDocument(t *testing.T) {
|
||||
|
||||
@@ -3,8 +3,8 @@ package wiki
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// This file implements the P1 directory mapping: FetchedItem.FileName becomes
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource/connector/feishu/core"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource/connector/feishu/core"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/types"
|
||||
secutils "academy/internal/utils"
|
||||
)
|
||||
|
||||
func allowLocalGitLabServer(t *testing.T) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
var _ datasource.StreamingConnector = (*Connector)(nil)
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
type projectSelection struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package gitlab
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
func TestParseConfigCollapsesDirectories(t *testing.T) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Package ima implements the WeKnora data source connector for Tencent IMA
|
||||
// Package ima implements the Academy data source connector for Tencent IMA
|
||||
// (ima.qq.com), syncing documents and files out of IMA knowledge bases via the
|
||||
// /openapi/wiki/v1 OpenAPI.
|
||||
package ima
|
||||
@@ -15,15 +15,15 @@ import (
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultTimeout = 60 * time.Second
|
||||
defaultPageSize = 50
|
||||
userAgent = "WeKnora-IMA-Connector/1.0"
|
||||
userAgent = "Academy-IMA-Connector/1.0"
|
||||
|
||||
// IMA hard limit: get_knowledge_list max limit=50; search_knowledge_base max=20.
|
||||
searchPageSize = 20
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// Compile-time proof that *Connector satisfies the datasource.Connector interface.
|
||||
@@ -534,9 +534,9 @@ func fetchOneMedia(
|
||||
ext := extensionForMediaType(info.MediaType)
|
||||
|
||||
// A media type with no fixed extension (web page, WeChat article, ...) is
|
||||
// normally handed to the ingest layer as a bare URL so WeKnora fetches it
|
||||
// normally handed to the ingest layer as a bare URL so Academy fetches it
|
||||
// itself. That only works for publicly reachable links: when IMA attaches
|
||||
// auth headers the URL points at IMA-hosted storage and WeKnora's own
|
||||
// auth headers the URL points at IMA-hosted storage and Academy's own
|
||||
// fetch — which cannot carry those headers — would be rejected. In that
|
||||
// case download here, where the headers are available, and infer the
|
||||
// extension from the response instead.
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
func TestConnector_Type(t *testing.T) {
|
||||
@@ -365,7 +365,7 @@ func TestFetchAll_AISessionIsStillSkipped(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestFetchAll_AuthenticatedURLIsDownloaded covers media types with no fixed
|
||||
// extension. When IMA attaches auth headers the URL is IMA-hosted and WeKnora's
|
||||
// extension. When IMA attaches auth headers the URL is IMA-hosted and Academy's
|
||||
// own fetch could not authenticate, so the connector must download it here and
|
||||
// forward the headers.
|
||||
func TestFetchAll_AuthenticatedURLIsDownloaded(t *testing.T) {
|
||||
@@ -397,7 +397,7 @@ func TestFetchAll_AuthenticatedURLIsDownloaded(t *testing.T) {
|
||||
|
||||
// TestFetchAll_PublicURLStaysURLOnly is the counterpart: without auth headers
|
||||
// the link is publicly reachable, so it is handed to the ingest layer as a URL
|
||||
// and WeKnora renders the live page instead of a snapshot.
|
||||
// and Academy renders the live page instead of a snapshot.
|
||||
func TestFetchAll_PublicURLStaysURLOnly(t *testing.T) {
|
||||
f := newFakeIMA(t)
|
||||
f.setKB("kb1", []fakeFile{{MediaID: "m-web", Title: "Article", MediaType: mediaTypeWeb, Body: "ignored"}})
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/types"
|
||||
secutils "academy/internal/utils"
|
||||
)
|
||||
|
||||
// TestMain whitelists loopback for SSRF so the httptest servers (127.0.0.1)
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// paginationHopCap mirrors maxPaginationHops in connector.go. It is spelled as
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// DefaultBaseURL is the IMA OpenAPI base URL. The Path prefix is baked into
|
||||
@@ -267,7 +267,7 @@ type imaCursor struct {
|
||||
// Rationale:
|
||||
//
|
||||
// - kb_id keeps identities isolated across knowledge bases (same file
|
||||
// copied into two KBs is two distinct docs from WeKnora's perspective).
|
||||
// copied into two KBs is two distinct docs from Academy's perspective).
|
||||
// - parent_folder_id + title anchor the doc to its folder location and
|
||||
// display name — the tuple IMA's own check_repeated_names uses to gate
|
||||
// uploads (see api.md), so IMA's own uniqueness constraint enforces
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
func TestLogicalKey_IsStableAndScoped(t *testing.T) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
const attachmentPageEditTime = "2026-10-03T10:00:00Z"
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
const retryPageTime = "2026-09-24T10:00:00Z"
|
||||
|
||||
@@ -14,9 +14,9 @@ import (
|
||||
|
||||
"golang.org/x/time/rate"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
// notionClient wraps the Notion API with rate limiting and retry logic.
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
secutils "academy/internal/utils"
|
||||
)
|
||||
|
||||
func mustTestClient(t *testing.T, token, baseURL string) *notionClient {
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
secutils "github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/types"
|
||||
secutils "academy/internal/utils"
|
||||
)
|
||||
|
||||
func allowNotionTestServer(t *testing.T) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"academy/internal/datasource"
|
||||
)
|
||||
|
||||
func TestFetchIncrementalSearchFailure(t *testing.T) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/time/rate"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// paginationHopCap mirrors maxPaginationHops in client.go. It is spelled as a
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/logger"
|
||||
)
|
||||
|
||||
// childrenPageFunc decides, for the page covering [offset, end), whether the
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Package notion implements the Notion data source connector for WeKnora.
|
||||
// Package notion implements the Notion data source connector for Academy.
|
||||
//
|
||||
// It syncs pages, databases, and attachments from Notion workspaces into WeKnora knowledge bases.
|
||||
// It syncs pages, databases, and attachments from Notion workspaces into Academy knowledge bases.
|
||||
//
|
||||
// Notion API docs:
|
||||
// - Authentication: https://developers.notion.com/docs/authorization
|
||||
@@ -15,8 +15,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
// NotionAPIVersion is the Notion API version used by this connector.
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
func TestParseNotionConfig(t *testing.T) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
readability "codeberg.org/readeck/go-readability/v2"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -24,7 +24,7 @@ const (
|
||||
maxArticleSize = 5 * 1024 * 1024 // 5 MB
|
||||
|
||||
// defaultUserAgent is sent on every request; some feeds reject empty UAs.
|
||||
defaultUserAgent = "Mozilla/5.0 (compatible; WeKnora-RSS/1.0; +https://weknora.weixin.qq.com)"
|
||||
defaultUserAgent = "Mozilla/5.0 (compatible; Academy-RSS/1.0; +https://weknora.weixin.qq.com)"
|
||||
)
|
||||
|
||||
// client performs SSRF-safe HTTP fetches with optional custom headers.
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"time"
|
||||
|
||||
htmltomd "github.com/JohannesKaufmann/html-to-markdown/v2"
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
"github.com/mmcdole/gofeed"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
"academy/internal/utils"
|
||||
"github.com/mmcdole/gofeed"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
type identityFeed struct {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Package rss implements the RSS/Atom data source connector for WeKnora.
|
||||
// Package rss implements the RSS/Atom data source connector for Academy.
|
||||
//
|
||||
// It syncs articles from one or more RSS/Atom/JSON feeds into a WeKnora
|
||||
// It syncs articles from one or more RSS/Atom/JSON feeds into a Academy
|
||||
// knowledge base. Each configured feed URL is treated as a selectable
|
||||
// resource; each feed item becomes a knowledge entry whose body is the
|
||||
// article's full text rendered as Markdown.
|
||||
@@ -18,7 +18,7 @@
|
||||
// Deletions are NOT synced — feeds routinely drop old items.
|
||||
//
|
||||
// All outbound requests go through the SSRF-safe HTTP client so a malicious
|
||||
// feed cannot redirect WeKnora to internal services.
|
||||
// feed cannot redirect Academy to internal services.
|
||||
package rss
|
||||
|
||||
import (
|
||||
@@ -30,8 +30,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
"github.com/mmcdole/gofeed"
|
||||
)
|
||||
|
||||
|
||||
@@ -13,12 +13,12 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
userAgent = "WeKnora-Seafile-Connector/1.0"
|
||||
userAgent = "Academy-Seafile-Connector/1.0"
|
||||
apiTimeout = 30 * time.Second
|
||||
downloadTimeout = 120 * time.Second
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
// noWait replaces the package sleep with a recorder so tests never wait.
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"academy/internal/datasource"
|
||||
)
|
||||
|
||||
func TestConnectorResources(t *testing.T) {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"maps"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
const cursorSchemaVersion = 1
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/types"
|
||||
)
|
||||
|
||||
func TestCursorRoundTrip(t *testing.T) {
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
// TestMain whitelists loopback for SSRF so the httptest servers are reachable.
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"academy/internal/datasource"
|
||||
)
|
||||
|
||||
// knowledgeFileName maps a library file to the knowledge base folder
|
||||
|
||||
@@ -11,10 +11,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"github.com/Tencent/WeKnora/internal/types"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/datasource"
|
||||
"academy/internal/logger"
|
||||
"academy/internal/types"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
// checkpointEvery bounds how many cursor mutations may be lost on a crash.
|
||||
|
||||
Loaded 100 of 3136 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user