MCPcopy Create free account
hub / github.com/apache/maka / thread

Function thread

apps/desktop/src/preload/preload.ts:2077–2103  ·  view source on GitHub ↗
(request: SearchRequest)

Source from the content-addressed store, hash-verified

2075 // Search each ready Host independently; a remote profile sends the query
2076 // over that Host's authenticated connection, never through telemetry.
2077 async thread(request: SearchRequest): Promise<SearchResult[] | { ok: false; reason: SearchErrorReason; message: string }> {
2078 const scopes = await runtimeHostScopeList();
2079 return collectThreadSearchResponses(
2080 scopes.map(async (scope) => {
2081 const result = await ipcRenderer.invoke('search:thread', scope, request) as
2082 | SearchResult[]
2083 | { ok: false; reason: SearchErrorReason; message: string };
2084 return Array.isArray(result)
2085 ? result.map((entry) =>
2086 entry.target?.kind === 'thread'
2087 ? {
2088 ...entry,
2089 target: {
2090 ...entry.target,
2091 sessionId: desktopSessionKey({
2092 hostId: scope.hostId,
2093 sessionId: entry.target.sessionId,
2094 }),
2095 },
2096 }
2097 : entry,
2098 )
2099 : result;
2100 }),
2101 request.limit,
2102 );
2103 },
2104 },
2105 // PR-OAUTH-SUBSCRIPTION-0: Claude subscription OAuth bridge.
2106 // NEVER returns raw OAuth credentials; renderer only sees account

Callers

nothing calls this directly

Calls 4

runtimeHostScopeListFunction · 0.85
desktopSessionKeyFunction · 0.85
invokeMethod · 0.80

Tested by

no test coverage detected