Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

composerDispatch.ts

15 lines625 Bytes

1import type { SessionPhase } from "../../types";
2​
3export type ComposerDispatchMode = "auto" | "queue" | "steer" | "restart";
4export type ActiveTurnComposerAction = Exclude<ComposerDispatchMode, "auto">;
5​
6/** One policy seam for the future configurable active-turn default action. */
7export function resolveComposerDispatchMode(input: {
8 readonly phase: SessionPhase;
9 readonly queueModifier: boolean;
10 readonly activeTurnDefault?: ActiveTurnComposerAction;
11}): ComposerDispatchMode {
12 if (input.phase !== "running") return "auto";
13 if (input.queueModifier) return "queue";
14 return input.activeTurnDefault ?? "steer";