INNER CODE UNIT · TypeScript
m
celia-sh/Novella · .pi/extensions/trellis/index.ts:308
const m = model?.match(/^(.*):(off|minimal|low|medium|high|xhigh|max)$/i);
return {
model: m ? m[1] : model,
thinking: (m?.[2] ?? fallbackThinking)?.toLowerCase(),
};
}
function modelLabel(r: RunState) {
const { model, thinking } = splitModelThinking(r.model, r.thinking);
if (!model) return undefined;
return thinking && thinking !== "off" ? `${model}(${thinking})` : model;
}
function applyRunConfig(r: RunState, cfg: PiRunConfig) {
const parsed = splitModelThinking(cfg.model, cfg.thinking);
r.model = parsed.model;
r.thinking = parsed.thinking;
}
function runElapsed(d: ProgressDetails, r: RunState) {
const start = r.startedAt ?? d.startedAt;