feat(m01-lb): lbCalcNow — 기다림 없이 바로 셈(기대값 시험표용)

- 같은 /api/m01/lb/calc 길 · 최신만 안 씀(lbCalcLater 와 안 걸림)
- 서버에 못 닿으면 null · 멈춤은 답 그대로 · 둘 다 onPlain 에 쉬운 말

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmELpdXFDRZHhfbGuRhSmL
This commit is contained in:
2026-10-01 11:52:22 +09:00
co-authored by Claude Opus 5.5
parent b5e0b215f9
commit d6ae40b117
+18
View File
@@ -84,6 +84,24 @@ export function lbCalcLater(
}, CALC_WAIT_MS);
}
/** 기다림 없이 바로 셈(기대값 시험표처럼 여러 줄을 차례로) — `lbCalcLater` 의 최신만과 안 걸림.
* 서버에 못 닿으면 null · 멈춤(ok false)은 답 그대로 · 둘 다 `onPlain` 에 쉬운 말 */
export async function lbCalcNow(
row: LogicRow,
inputs: Record<string, unknown>,
tables: LbTables,
onPlain?: (plain: string) => void,
): Promise<CalcAnswer | null> {
try {
const ans = await send<CalcAnswer>("/calc", { row, inputs: inputsFor(row, inputs), tables });
if (!ans.ok) onPlain?.(plainStop(ans.reason));
return ans;
} catch (e: unknown) {
onPlain?.(plainError(e));
return null;
}
}
/** 사용처 — 그 표를 쓰는 로직(표 「용도」 + 로직 글 대조) */
export async function tableUsers(key: string): Promise<LbTableUser[]> {
const got = await send<{ users: LbTableUser[] }>(