MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / computeStatus

Function computeStatus

packages/tools/src/definitions/retrieve-chat-evidence.ts:326–336  ·  view source on GitHub ↗
(
  anyPathRan: boolean,
  hasResults: boolean,
  warnings: Set<EvidenceWarning>
)

Source from the content-addressed store, hash-verified

324}
325
326function computeStatus(
327 anyPathRan: boolean,
328 hasResults: boolean,
329 warnings: Set<EvidenceWarning>
330): EvidencePayloadStatus {
331 if (!anyPathRan) return 'unavailable'
332 if (!hasResults) return 'empty'
333 const degraded =
334 warnings.has('semantic_partial') || warnings.has('semantic_unavailable') || warnings.has('keyword_unavailable')
335 return degraded ? 'partial' : 'complete'
336}
337
338async function handler(params: Record<string, unknown>, context: ToolExecutionContext): Promise<ToolResult> {
339 const locale = context.locale

Callers 1

handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected