MCPcopy Create free account

hub / github.com/Tencent/WeKnora / functions

Functions12,364 in github.com/Tencent/WeKnora

↓ 32 callersFunctionSave
Save writes the config atomically with mode 0600 via internal/xdg.WriteAtomicYAML.
cli/internal/config/config.go:76
↓ 31 callersFunctionInjectTracing
InjectTracing stamps the current trace/span ids (and a best-effort user/session label) from ctx onto the given payload, provided the payload embeds ty
internal/tracing/langfuse/asynq.go:24
↓ 31 callersFunctionclose
()
frontend/public/weknora-widget.js:345
↓ 31 callersFunctionvisualReport
═══════════════════════════════════════════════════════════════════════════ Helper: visual test reporter ═════════════════════════════════════════════
internal/infrastructure/docparser/json_converter_test.go:17
↓ 30 callersMethodFinish
Finish updates a span with its final output, extra metadata and any error. A non-nil err marks the span as ERROR level in Langfuse.
internal/tracing/langfuse/tracer.go:205
↓ 30 callersMethodGetString
(ctx context.Context, key string, envName string, def string)
internal/types/interfaces/system_setting.go:55
↓ 30 callersFunctionTenantRoleFromContext
TenantRoleFromContext extracts the caller's TenantRole in the currently active tenant. Returns TenantRoleViewer when the key is absent so that callers
internal/types/context_helpers.go:88
↓ 30 callersFunctionjsonToMarkdown
jsonToMarkdown converts raw JSON bytes into markdown text Key properties: - Every output chunk is a **valid JSON object** (not a fragment). - Nested
internal/infrastructure/docparser/json_converter.go:29
↓ 30 callersMethodparse
Parse document and return markdown + image references. No chunking, no OCR, no VLM caption — those are done in Go.
docreader/parser/base_parser.py:45
↓ 29 callersMethodEnsureDefaults
EnsureDefaults sets default values for the agent
internal/types/custom_agent.go:278
↓ 29 callersFunctionLoad
Load reads the config file. If it does not exist, returns a zero-value Config with no error (commands like `version` and `--help` must not fail just b
cli/internal/config/config.go:56
↓ 29 callersFunctionnewTestServer
newTestServer wires svc to an in-process MCP server and returns a connected client session ready to CallTool against it.
cli/internal/mcp/tools_test.go:140
↓ 29 callersFunctionpreviewText
(s string, maxRunes int)
internal/application/service/wiki_ingest.go:700
↓ 28 callersFunctionEncryptAESGCM
EncryptAESGCM encrypts plaintext with AES-256-GCM. Returns the original string if empty, already encrypted, or key is nil.
internal/utils/crypto.go:29
↓ 28 callersFunctionGetString
GetString safely extracts a string value from a credentials map.
internal/im/credentials.go:21
↓ 28 callersMethodIsValid
IsValid reports whether r is one of the four defined tenant roles.
internal/types/tenant_member.go:46
↓ 28 callersMethodResult
Result returns the accumulated answer-event content.
cli/internal/sse/accumulator.go:87
↓ 28 callersMethod_request
Make a request to the WeKnora API Args: method: HTTP method (GET, POST, PUT, DELETE) endpoint: API endpoint path
mcp-server/weknora_mcp_server.py:67
↓ 28 callersFunctioncfgCrossTenant
access_test.go covers the four exported helpers in access.go: IsCrossTenantSuperuser, IsTenantAccessible, RequireCrossTenantAccess, RequirePathTenantM
internal/middleware/access_test.go:27
↓ 27 callersMethodChat
Chat 进行非流式聊天
internal/models/chat/chat.go:89
↓ 27 callersMethodFeed
Feed processes a new argument delta and returns any new content to emit. Returns empty string if no new content is available yet.
internal/models/chat/json_field_extractor.go:32
↓ 27 callersFunctionNewForbiddenError
NewForbiddenError creates a forbidden error
internal/errors/errors.go:87
↓ 27 callersFunctionNewUnauthorizedError
NewUnauthorizedError creates an unauthorized error
internal/errors/errors.go:78
↓ 27 callersMethodOn
On registers an event handler for a specific event type Multiple handlers can be registered for the same event type
internal/event/event.go:111
↓ 27 callersMethodUpsert
(ctx context.Context, row *types.KnowledgeProcessingSpan)
internal/application/repository/knowledge_span_repo.go:23
↓ 27 callersFunctioncreateTestPNG
createTestPNG generates a minimal PNG image with the given dimensions.
internal/infrastructure/docparser/image_resolver_test.go:24
↓ 26 callersFunctionAddDryRunFlag
AddDryRunFlag registers --dry-run on a cobra command, binding to a bool pointer. A bool is sufficient because the CLI is single-tenant and self-hosted
cli/internal/cmdutil/dryrun.go:40
↓ 26 callersMethodGetDimensions
GetDimensions returns the vector dimensions
internal/models/embedding/embedder.go:27
↓ 26 callersMethodGetEmbeddingModel
GetEmbeddingModel gets an embedding model
internal/types/interfaces/model.go:36
↓ 26 callersFunctionNewImageResolver
NewImageResolver creates a resolver.
internal/infrastructure/docparser/image_resolver.go:70
↓ 26 callersMethodparse_into_text
(self, content: bytes)
docreader/parser/pdf_parser.py:1382
↓ 25 callersMethodDebug
(ctx context.Context, args ...interface{})
internal/im/feishu/longconn.go:62
↓ 25 callersFunctionHandleDryRun
HandleDryRun bundles the dry-run preamble for mutation command RunE: FormatOptions resolution + envelope emit. Returns (handled, err) — when handled i
cli/internal/cmdutil/dryrun.go:103
↓ 25 callersMethodOn
On registers an event handler for a specific event type
internal/types/event_bus.go:26
↓ 25 callersFunctionRegister
Register 添加一个提供者到全局注册表
internal/models/provider/provider.go:159
↓ 25 callersMethodSet
(c, key, value string)
cli/internal/secrets/secrets.go:124
↓ 25 callersMethodType
Type returns the sandbox type
internal/sandbox/sandbox.go:53
↓ 24 callersFunctionGetManager
GetManager returns the installed singleton, or nil if Init has not been called. Callers must tolerate a nil return.
internal/tracing/langfuse/manager.go:69
↓ 24 callersMethodOffset
Offset gets the offset for database query
internal/types/search.go:207
↓ 24 callersMethodRaw
(ctx context.Context, method, path string, body any)
cli/cmd/api/api.go:45
↓ 24 callersFunctioncontainsAny
(s string, substrs ...string)
internal/models/provider/provider.go:274
↓ 24 callersFunctionmakeConfig
(cfg *Config, resourceIDs []string)
internal/datasource/connector/feishu/connector_test.go:273
↓ 24 callersFunctionmemberTestRouter
memberTestRouter wires the handler with the same errorCapture middleware production uses, so c.Error() shows up as a real HTTP status in the recorder.
internal/handler/tenant_member_test.go:138
↓ 24 callersFunctionnewFakeYuque
()
internal/datasource/connector/yuque/client_test.go:29
↓ 24 callersFunctionnewTestMemberHandler
newTestMemberHandler builds a TenantMemberHandler with no extra dependencies. The cross-tenant URL check moved to middleware.RequirePathTenantMatch in
internal/handler/tenant_member_test.go:128
↓ 24 callersFunctionrunList
(ctx context.Context, opts *ListOptions, fopts *cmdutil.FormatOptions, svc ListService, kbID string)
cli/cmd/doc/list.go:122
↓ 23 callersMethodError
()
internal/datasource/connector/feishu/client.go:41
↓ 23 callersMethodGetTenantMember
(ctx context.Context, orgID string, tenantID uint64)
internal/types/interfaces/organization.go:32
↓ 23 callersFunctionSanitizeForLog
SanitizeForLog 清理日志输入,防止日志注入攻击 日志注入攻击是指攻击者通过在输入中插入换行符和其他控制字符, 伪造日志条目,可能导致日志分析工具误判或隐藏恶意活动
internal/utils/security.go:536
↓ 23 callersFunctiongetString
Helper function for type assertion with default value
internal/handler/session/helpers.go:328
↓ 23 callersMethodtracker
tracker returns a usable SpanTracker — falls back to a no-op when the service was constructed without one (test harness, lite mode w/o repo). All pipe
internal/application/service/knowledge.go:141
↓ 22 callersFunctionIsAppError
IsAppError checks if the error is an AppError type
internal/errors/errors.go:252
↓ 22 callersFunctionNewVectorStoreService
NewVectorStoreService creates a new vector store service. kbRepo and db are required by the delete guard, which counts bound KBs inside a transaction
internal/application/service/vectorstore.go:34
↓ 22 callersMethodObserve
Observe parses line and updates the hierarchy if line is a Markdown heading. Returns the (level, headingText) when a heading was recognized, or (0, ""
internal/infrastructure/chunker/heading_hierarchy.go:34
↓ 22 callersFunctionSetForTestWithTTY
SetForTestWithTTY is like SetForTest but reports IsStdoutTTY/IsStderrTTY = true so tests can exercise interactive code paths (confirm prompts, color,
cli/internal/iostreams/iostreams.go:73
↓ 22 callersFunctionlinkifyContent
linkifyContent injects [[slug|matchText]] cross-links into content for each ref, skipping occurrences that fall inside code or existing links and requ
internal/application/service/wiki_linkify.go:35
↓ 22 callersFunctionmakePendingOp
(taskType, scope, scopeID, op, dedup string, payload []byte)
internal/application/repository/task_queue_test.go:61
↓ 22 callersMethodtracker
tracker returns a non-nil span tracker so callers don't have to nil-check on every Begin/End. Matches the noopSpanTracker pattern used elsewhere (see
internal/application/service/wiki_ingest.go:252
↓ 21 callersMethodGetChatModel
GetChatModel gets a chat model
internal/types/interfaces/model.go:42
↓ 21 callersMethodList
List lists all models
internal/types/interfaces/model.go:56
↓ 21 callersFunctionNewConnector
NewConnector creates a new Feishu connector.
internal/datasource/connector/feishu/connector.go:21
↓ 21 callersMethodRemove
(ctx context.Context, tenantID uint64, agentID string, sourceTenantID uint64)
internal/types/interfaces/organization.go:219
↓ 21 callersMethodStop
Stop gracefully shuts down the service, stopping all channels and background goroutines.
internal/im/service.go:756
↓ 21 callersFunctionbuildBoundComposite
(t *testing.T, svc interfaces.RetrieveEngineService)
internal/application/service/knowledgebase_search_fanout_test.go:443
↓ 21 callersFunctioncfgRBAC
(enabled bool)
internal/middleware/rbac_test.go:42
↓ 20 callersFunctionCloneContext
CloneContext 复制上下文中的关键信息到新上下文
internal/logger/logger.go:492
↓ 20 callersFunctionGetAESKey
GetAESKey reads the 32-byte AES key from SYSTEM_AES_KEY env. Returns nil if not set or not exactly 32 bytes.
internal/utils/crypto.go:19
↓ 20 callersMethodGetAgentByID
GetAgentByID retrieves agent information by ID (uses tenant from context) Parameters: - ctx: Context information - id: Unique identifier of the agent
internal/types/interfaces/custom_agent.go:29
↓ 20 callersMethodGetKnowledgeByIDOnly
(ctx context.Context, id string)
internal/middleware/kb_access.go:95
↓ 20 callersFunctionNewKVHybridRetrieveEngine
NewKVHybridRetrieveEngine creates a new instance of the hybrid retrieval engine KV stands for KeywordsVector
internal/application/service/retriever/keywords_vector_hybrid_indexer.go:49
↓ 20 callersFunctionResolveProcessConfig
ResolveProcessConfig merges KB defaults with per-upload overrides for the parse pipeline.
internal/application/service/knowledge_process_config.go:13
↓ 20 callersFunctionTenantInfoFromContext
TenantInfoFromContext extracts the *Tenant from ctx.
internal/types/context_helpers.go:40
↓ 20 callersFunctionbptr
bptr returns a pointer to a bool literal. MCP ToolAnnotations uses pointer types for DestructiveHint and OpenWorldHint so that "explicit false" can be
cli/internal/mcp/tools.go:695
↓ 20 callersFunctionmakeChunk
(kbID, knowledgeID string, chunkType string)
internal/application/repository/chunk_sqlite_test.go:24
↓ 20 callersMethodvalidateWikiKB
validateWikiKB validates that the KB exists and is a wiki type
internal/handler/wiki_page.go:44
↓ 20 callersFunctionvectorParams
(query string)
internal/application/service/knowledgebase_search_fanout_test.go:455
↓ 19 callersMethodAppend
Append consumes one StreamResponse event. Safe to call multiple times; idempotent post-Done so callers do not need to special-case late events.
cli/internal/sse/accumulator.go:39
↓ 19 callersMethodEngineType
EngineType gets the retrieve engine type
internal/types/interfaces/retriever.go:13
↓ 19 callersMethodEnqueue
Enqueue inserts a single op. The caller fills in TenantID, TaskType, Scope, ScopeID, Op, DedupKey, Payload; ID, FailCount, EnqueuedAt are server-side
internal/types/interfaces/task_queue.go:25
↓ 19 callersMethodFAQMetadata
FAQMetadata 解析 Chunk 中的 FAQ 元数据 返回原始数据(仅做基础清理)
internal/types/faq.go:140
↓ 19 callersFunctionNewConnector
NewConnector creates a new Yuque connector.
internal/datasource/connector/yuque/connector.go:25
↓ 19 callersFunctionNewEventBus
NewEventBus creates a new EventBus instance
internal/event/event.go:94
↓ 19 callersMethodOwnedKBOrAdmin
Ownership-or-role guards. Required role here is the privilege level that bypasses the ownership check; Contributors ALWAYS pass when they own the reso
internal/router/rbac.go:212
↓ 19 callersMethodReset
Reset removes the DB override for `key` so the resolver falls back to ENV / built-in default. Idempotent: deleting a key that was never persisted retu
internal/types/interfaces/system_setting.go:85
↓ 19 callersFunctionSafeObjectKey
SafeObjectKey 校验对象存储的 key(如 COS/MinIO objectName),禁止包含 ".." 等路径遍历
internal/utils/security.go:146
↓ 19 callersMethodStatus
Status reports whether the current user has authorized this service. Status godoc @Summary 查询 MCP OAuth 授权状态 @Description 返回当前用户对指定 MCP 服务是否已完成
internal/handler/mcp_oauth.go:158
↓ 19 callersFunctionValidateIndexConfig
ValidateIndexConfig checks IndexConfig fields for safe values. Call this from the service layer before persisting a VectorStore.
internal/types/vectorstore.go:475
↓ 19 callersFunctionallBlocksValidJSON
blockIsValidJSON checks that each code block inside the result is valid JSON.
internal/infrastructure/docparser/json_converter_test.go:113
↓ 19 callersFunctioncallTool
callTool invokes name with args and returns the parsed structured output.
cli/internal/mcp/tools_test.go:168
↓ 19 callersFunctioncreateSessionForTest
(t *testing.T, db *gorm.DB, tenantID uint64, userID string)
internal/application/repository/session_test.go:25
↓ 19 callersFunctionlog
(...args: unknown[])
frontend/src/composables/useChatStreamHandler.ts:58
↓ 19 callersFunctionregister
(data: RegisterRequest)
frontend/src/api/auth/index.ts:280
↓ 18 callersFunctionBuildEnvVectorStores
--------------------------------------------------------------------------- BuildEnvVectorStores — virtual stores from RETRIEVE_DRIVER env var -------
internal/types/vectorstore.go:803
↓ 18 callersMethodEnabled
Enabled reports whether the manager would actually emit events.
internal/tracing/langfuse/manager.go:76
↓ 18 callersMethodEntryCount
EntryCount returns the number of active cron entries (for testing/monitoring).
internal/datasource/scheduler.go:206
↓ 18 callersMethodError
()
internal/sandbox/validator.go:27
↓ 18 callersMethodGetModelByID
GetModelByID gets a model by ID
internal/types/interfaces/model.go:19
↓ 18 callersMethodGetPageBySlug
GetPageBySlug retrieves a wiki page by its slug within a knowledge base.
internal/types/interfaces/wiki_page.go:40
↓ 18 callersMethodHasPermission
HasPermission reports whether r is at least as privileged as required. Used by RequireRole-style middleware to gate endpoints.
internal/types/tenant_member.go:59
↓ 18 callersFunctionPipelineInfo
PipelineInfo logs pipeline info level entries.
internal/common/tools.go:188
← previousnext →101–200 of 12,364, ranked by callers