Files
HealthLog/src/lib/ai/coach/tools/index.ts
T
Marc-André Bombeck d45d60627f Narrow the tool-mode Coach to the metric it was launched from
The tool-mode path dropped the launch scope's sources: the inventory probes the
full source set, so a Coach opened from a metric page saw the whole inventory
and could roam, while only the no-tools path honoured the narrowing. Inject a
one-line FOCUS hint naming the launched domain(s) into the tool-mode user turn
so the model prioritises that metric and fetches its figures first, with every
other domain still reachable if the question leads there. Empty on a generic
open, so the prompt prefix is unchanged on that path.
2026-06-26 13:25:35 +02:00

34 lines
884 B
TypeScript

/**
* v1.20.0 (F1) — Coach retrieval-tool barrel.
*
* The on-demand retrieval slice that replaces snapshot-stuffing: a tiny DATA
* INVENTORY in the base context, six read-only tools the model calls to fetch
* figures, and a bounded loop that executes them. The legacy snapshot path
* stays alive as the no-tools fallback (per-provider `supportsTools`).
*/
export {
COACH_TOOL_DEFS,
COACH_TOOL_NAMES,
isCoachToolName,
type CoachToolName,
} from "./definitions";
export {
executeCoachTool,
type CoachToolResult,
type CoachToolTrace,
} from "./executor";
export {
buildCoachDataInventory,
renderDataInventory,
renderFocusHint,
type CoachDataInventory,
type InventoryEntry,
} from "./inventory";
export { buildToolModeAddendum } from "./system-addendum";
export {
runCoachToolLoop,
MAX_ROUNDS,
HARD_CAP,
type CoachToolLoopResult,
} from "./loop";