Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QingJ01/Agent-Zhihu
/ functions
Functions
324 in github.com/QingJ01/Agent-Zhihu
⨍
Functions
324
◇
Types & classes
103
↓ 55 callers
Function
connectDB
()
src/lib/mongodb.ts:35
↓ 19 callers
Function
generateId
(prefix: string)
src/lib/id.ts:3
↓ 18 callers
Function
sendEvent
(event: string, data: unknown)
src/app/api/debate/route.ts:309
↓ 17 callers
Function
checkRateLimit
(key: string, limit: number, windowMs: number)
src/lib/api-security.ts:45
↓ 17 callers
Function
rateLimitResponse
(retryAfter: number)
src/lib/api-security.ts:72
↓ 16 callers
Function
getClientIp
(request: NextRequest)
src/lib/api-security.ts:36
↓ 14 callers
Function
sendEvent
(event: string, data: unknown)
src/app/api/roundtable/route.ts:212
↓ 12 callers
Function
sendEvent
(event: string, data: unknown)
src/app/api/debate/reply/route.ts:251
↓ 8 callers
Function
openLoginModal
()
src/lib/loginModal.ts:1
↓ 7 callers
Function
validateJsonBodySize
(request: NextRequest, maxBytes: number)
src/lib/api-security.ts:84
↓ 6 callers
Function
requireEnv
(name: string)
src/lib/oauth.ts:14
↓ 6 callers
Function
sendEvent
(event: string, data: unknown)
src/app/api/questions/route.ts:817
↓ 6 callers
Function
sendEvent
(event: string, data: unknown)
src/app/api/roundtable/interject/route.ts:71
↓ 5 callers
Function
shareOrCopy
(title: string, url: string)
src/lib/share.ts:7
↓ 5 callers
Function
verifyAgentKey
( request: NextRequest, )
src/lib/agent-auth.ts:37
↓ 4 callers
Function
buildPersonaSnippet
(persona: UserPersona | null | undefined)
src/lib/persona.ts:53
↓ 4 callers
Function
fetchUserPersona
(userId: string)
src/lib/persona.ts:88
↓ 4 callers
Function
generateResponseStream
( systemPrompt: string, conversationHistory: { role: 'user' | 'assistant'; content: string }[] )
src/app/api/debate/route.ts:125
↓ 4 callers
Function
getCollection
()
src/lib/agent-auth.ts:32
↓ 4 callers
Function
getHeat
(item: FeedItem)
src/app/HomePageClient.tsx:207
↓ 4 callers
Function
pickOne
(arr: T[])
src/app/api/agent/participate/route.ts:131
↓ 4 callers
Function
pickStrategy
(arr: T[])
src/app/api/debate/route.ts:43
↓ 4 callers
Function
removeTag
(field: PersonaTagField, index: number)
src/components/profile/PersonaImportModal.tsx:91
↓ 4 callers
Function
trimArr
(arr: unknown, max: number)
src/lib/persona.ts:20
↓ 4 callers
Function
useVote
( targetId: string, targetType: 'question' | 'message' | 'debate', currentUserId: string | undefined,
src/lib/useVote.ts:14
↓ 3 callers
Function
authorizeWithPayload
( req: unknown, provider: AuthProvider, cookieName: string, options?: { requireAccessToken?: boolean }
src/app/api/auth/[...nextauth]/route.ts:79
↓ 3 callers
Function
buildOpponentPrompt
(opponent: OpponentProfile, topic: string)
src/app/api/debate/route.ts:86
↓ 3 callers
Function
computeETag
(input: string)
src/app/api/questions/route.ts:28
↓ 3 callers
Function
formatGame
(game: any, userId?: string)
src/app/api/turing/[questionId]/route.ts:118
↓ 3 callers
Function
getNodeSize
(weight: number)
src/components/OpinionGraphView.tsx:200
↓ 3 callers
Function
getUserId
()
src/app/api/profile/agent-keys/route.ts:7
↓ 3 callers
Function
loadAgentKeys
()
src/app/profile/page.tsx:92
↓ 3 callers
Function
loadAgentKeys
()
src/app/profile/ProfilePageClient.tsx:78
↓ 3 callers
Function
loadHistory
(id: string)
src/components/RoundtableArena.tsx:277
↓ 3 callers
Function
normalizePersona
(raw: Partial<UserPersona>)
src/lib/persona.ts:19
↓ 3 callers
Function
parseIfNoneMatch
(header: string | null)
src/app/api/questions/route.ts:33
↓ 3 callers
Function
pickOne
(arr: T[])
src/app/api/questions/route.ts:342
↓ 3 callers
Function
pickRandom
(items: T[])
src/app/api/questions/route.ts:92
↓ 3 callers
Function
resolveAuthOrigin
(request: NextRequest)
src/lib/auth-origin.ts:12
↓ 3 callers
Function
selectOpponent
(topic: string, opponentId?: string)
src/lib/opponents.ts:56
↓ 3 callers
Function
toast
(message: string, type: ToastType = 'info')
src/components/Toast.tsx:16
↓ 3 callers
Function
trimStr
(val: unknown, fallback: string)
src/lib/persona.ts:28
↓ 3 callers
Function
validatePersona
(data: unknown)
src/lib/persona.ts:7
↓ 2 callers
Function
applyVoteAtomic
(model: VoteModel, query: Record<string, unknown>, voterId: string, voteType: VoteType)
src/app/api/agent/questions/[id]/vote/route.ts:22
↓ 2 callers
Function
buildContext
(messages: DiscussionMessage[], focusMessage: DiscussionMessage)
src/app/api/questions/route.ts:289
↓ 2 callers
Function
buildFallbackDraft
(payload: DraftPayload, replyTarget: DiscussionMessage | null)
src/app/api/questions/draft/route.ts:33
↓ 2 callers
Function
ensureAllowed
()
src/app/api/test-db/route.ts:13
↓ 2 callers
Function
generateAgentQuestion
(actor: UserAuthor, personaSnippet?: string)
src/app/api/agent/participate/route.ts:135
↓ 2 callers
Function
generateSynthesis
( topic: string, messages: DebateMessage[], userName: string, opponentName: string, opponentTitle: s
src/app/api/debate/reply/route.ts:82
↓ 2 callers
Function
getRandomExperts
(count: number = 3, exclude: string[] = [])
src/lib/experts.ts:251
↓ 2 callers
Function
handleActivityVote
(item: ActivityItem, voteType: 'up' | 'down')
src/app/profile/page.tsx:298
↓ 2 callers
Function
handleGuess
(messageId: string, guess: 'human' | 'ai')
src/components/TuringGame.tsx:119
↓ 2 callers
Function
hashKey
(raw: string)
src/lib/agent-auth.ts:8
↓ 2 callers
Function
insertAtCursor
(text: string)
src/components/CommentInput.tsx:100
↓ 2 callers
Function
isMigrationAllowed
(userId: string | undefined)
src/app/api/migrate/route.ts:36
↓ 2 callers
Function
isProduction
()
src/app/api/test-db/route.ts:9
↓ 2 callers
Function
isValidAvatarUrl
(value: string)
src/app/api/profile/me/route.ts:7
↓ 2 callers
Function
loadIdentities
()
src/app/profile/page.tsx:138
↓ 2 callers
Function
loadIdentities
()
src/app/profile/ProfilePageClient.tsx:131
↓ 2 callers
Function
normalizeOrigin
(value: string | undefined | null)
src/lib/auth-origin.ts:3
↓ 2 callers
Function
normalizeTitle
(title: string)
src/app/api/questions/route.ts:96
↓ 2 callers
Function
order
(s: string | null)
src/app/turing/page.tsx:45
↓ 2 callers
Function
parsePositiveInt
(value: string | null, fallback: number)
src/app/api/agent/questions/route.ts:10
↓ 2 callers
Function
parseSynthesis
(content: string)
src/app/api/debate/reply/route.ts:143
↓ 2 callers
Function
pickSlot
(arr: T[])
src/app/api/questions/draft/route.ts:109
↓ 2 callers
Function
pickStrategy
(arr: T[])
src/app/api/debate/reply/route.ts:29
↓ 2 callers
Function
postProcess
(result: GenerateResult)
src/app/api/questions/generate/route.ts:349
↓ 2 callers
Function
randomPick
(arr: T[])
src/app/api/questions/generate/route.ts:286
↓ 2 callers
Function
resetModal
()
src/components/profile/PersonaImportModal.tsx:26
↓ 2 callers
Function
resolveAuthorName
(message: DiscussionMessage)
src/app/api/questions/draft/route.ts:26
↓ 2 callers
Function
resolveRedirectUri
(redirectUri?: string)
src/lib/secondme.ts:13
↓ 2 callers
Function
runReplySafe
()
src/components/AgentAutoRunner.tsx:217
↓ 2 callers
Function
runSystemSafe
()
src/components/AgentAutoRunner.tsx:177
↓ 2 callers
Function
safeCount
(value: unknown)
src/app/api/likes/route.ts:12
↓ 2 callers
Function
selectExperts
(tags: string[], count: number = 3)
src/lib/experts.ts:221
↓ 2 callers
Function
streamResponse
(systemPrompt: string)
src/app/api/roundtable/route.ts:146
↓ 2 callers
Function
submitSearch
()
src/components/AppHeader.tsx:73
↓ 2 callers
Function
toTimestamp
(value: unknown)
src/app/api/logs/route.ts:26
↓ 2 callers
Function
triggerExpertDiscussion
(question: Question, existingMessages: DiscussionMessage[])
src/components/AgentAutoRunner.tsx:60
↓ 2 callers
Function
tryParse
(raw: string)
src/app/api/questions/generate/route.ts:401
↓ 2 callers
Function
useFavorite
( targetId: string, targetType: 'question' | 'message', currentUserId: string | undefined, onFavoriteC
src/lib/useFavorite.ts:7
↓ 1 callers
Function
applyVoteAtomic
(targetType: 'question' | 'message' | 'debate', targetId: string, userId: string, voteType: VoteType)
src/app/api/likes/route.ts:17
↓ 1 callers
Function
attemptSignIn
()
src/app/auth/callback/secondme/page.tsx:10
↓ 1 callers
Function
buildDiscussionPrompt
( expert: IRoundtableExpert, topic: string, messages: IRoundtableMessage[], replyToMsg?: IRoundtableMe
src/app/api/roundtable/route.ts:38
↓ 1 callers
Function
buildGitHubAuthUrl
(state: string, redirectUri: string)
src/lib/oauth.ts:22
↓ 1 callers
Function
buildGoogleAuthUrl
(state: string, redirectUri: string)
src/lib/oauth.ts:100
↓ 1 callers
Function
buildGraphPrompt
(title: string, description: string, messages: { index: number; authorName: string; authorType: string; conten
src/app/api/questions/[id]/graph/route.ts:16
↓ 1 callers
Function
buildOpeningPrompt
(expert: IRoundtableExpert, topic: string, description: string, otherExperts: IRoundtableExpert[])
src/app/api/roundtable/route.ts:19
↓ 1 callers
Function
buildOpponentPrompt
(opponent: OpponentProfile)
src/app/api/debate/reply/route.ts:33
↓ 1 callers
Function
buildQuestionFromInput
(content: string, author: { id: string; name: string; avatar?: string | null })
src/app/HomePageClient.tsx:32
↓ 1 callers
Function
buildSummaryPrompt
(topic: string, experts: IRoundtableExpert[], messages: IRoundtableMessage[])
src/app/api/roundtable/route.ts:66
↓ 1 callers
Function
buildUserAgentPrompt
(profile: SecondMeProfile, topic: string, personaSnippet?: string)
src/app/api/debate/route.ts:47
↓ 1 callers
Function
buildUserPrompt
(keyword: string)
src/app/api/questions/generate/route.ts:305
↓ 1 callers
Function
checkEligibility
(questionId: string)
src/app/api/turing/[questionId]/route.ts:17
↓ 1 callers
Function
cleanJSON
(raw: string)
src/app/api/questions/generate/route.ts:295
↓ 1 callers
Function
consumeDiscussionStream
(response: Response)
src/components/AgentAutoRunner.tsx:13
↓ 1 callers
Function
createKeyForUser
( userId: string, name: string, )
src/lib/agent-auth.ts:64
↓ 1 callers
Function
createTuringGame
(questionId: string)
src/app/api/turing/[questionId]/route.ts:23
↓ 1 callers
Function
decideAction
( actor: UserAuthor, questions: Question[], trigger: 'manual' | 'auto' )
src/app/api/agent/participate/route.ts:299
↓ 1 callers
Function
decideNextSpeaker
( experts: IRoundtableExpert[], messages: IRoundtableMessage[], currentRound: number, hostDirectTo?: s
src/app/api/roundtable/route.ts:102
next →
1–100 of 324, ranked by callers