mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 13:52:20 +00:00
Drop the unreachable text-only-model reason from the OCR capability enum and its DTO type. Replace the literal NUL delimiter in the Fitbit dedup map keys with a named constant so text tooling stops treating the file as binary (behaviour unchanged). Correct the Coach tool-executor docblock, which overstated cross-tool snapshot-cache sharing.
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
/**
|
|
* v1.18.9 — GET /api/labs/ocr/capability
|
|
*
|
|
* Cheap probe (no provider call) the Labs UI uses to decide whether to show
|
|
* the "Scan a report" affordance. Returns `{ available, reason, pdfSupported }`
|
|
* for the calling user's configured AI provider. The surface stays dark for
|
|
* users with no provider configured and no local-OCR opt-in.
|
|
*/
|
|
import { apiHandler, requireAuth } from "@/lib/api-handler";
|
|
import { apiSuccess } from "@/lib/api-response";
|
|
import { resolveOcrCapability } from "@/lib/labs/ocr-capability";
|
|
import { annotate } from "@/lib/logging/context";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export const GET = apiHandler(async () => {
|
|
const { user } = await requireAuth();
|
|
|
|
const capability = await resolveOcrCapability(user.id);
|
|
|
|
annotate({
|
|
action: { name: "labs.ocr.capability" },
|
|
meta: {
|
|
available: capability.available,
|
|
mode: capability.mode,
|
|
reason: capability.reason,
|
|
pdfSupported: capability.pdfSupported,
|
|
},
|
|
});
|
|
|
|
return apiSuccess(capability);
|
|
});
|