MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / generateIndexForSource

Function generateIndexForSource

src/stores/apiServer.ts:526–537  ·  view source on GitHub ↗
(sourceId: string, sessionId?: string)

Source from the content-addressed store, hash-verified

524 }
525
526 function generateIndexForSource(sourceId: string, sessionId?: string) {
527 const ds = dataSources.value.find((s) => s.id === sourceId)
528 if (!ds) return
529 const targets = sessionId
530 ? ds.sessions.filter((s) => s.id === sessionId && s.targetSessionId)
531 : ds.sessions.filter((s) => s.targetSessionId)
532 const indexService = useSessionIndexService()
533 const threshold = getSessionGapThreshold()
534 for (const sess of targets) {
535 indexService.generateIncremental(sess.targetSessionId, threshold).catch(() => {})
536 }
537 }
538
539 function generateIndexForAllSources() {
540 const indexService = useSessionIndexService()

Callers 2

triggerPullFunction · 0.85
triggerPullAllFunction · 0.85

Calls 3

useSessionIndexServiceFunction · 0.90
getSessionGapThresholdFunction · 0.90
generateIncrementalMethod · 0.65

Tested by

no test coverage detected