feat(k1): complete primary acquisition lifecycle

This commit is contained in:
DCCONSTRUCTIONS
2026-07-17 23:03:59 +03:00
parent 9d51080d2e
commit aa3680948f
66 changed files with 6093 additions and 544 deletions
@@ -29,6 +29,17 @@ export function isTerminalAcquisitionState(
return state ? TERMINAL_ACQUISITION_STATES.has(state) : false;
}
export function shouldRenderSpatialControls(
state: XgridsK1State | null | undefined,
): boolean {
const acquisition = state?.acquisition;
if (!acquisition || state?.source_mode === "replay") return false;
return (
!isTerminalAcquisitionState(acquisition.state) ||
acquisition.cleanup_pending === true
);
}
export function recoverableAcquisition(
state: XgridsK1State | null | undefined,
): XgridsAcquisition | null {
@@ -44,6 +55,21 @@ export function isSourceRuntimeBusy(state: XgridsK1State | null | undefined): bo
return state?.source_mode === "live" || state?.source_mode === "replay";
}
export function isVendorWriteCapable(
state: XgridsK1State | null | undefined,
): boolean {
return (
state?.compatibility?.vendor_writes_enabled === true &&
state.compatibility.permitted_mode === "active-control"
);
}
export function isSoftwareCommandedAcquisition(
state: XgridsK1State | null | undefined,
): boolean {
return isVendorWriteCapable(state) && state?.acquisition?.control_mode === "plugin-commanded";
}
export function confirmedRuntimeSourceMode(
state: XgridsK1State | null | undefined,
): RuntimeSourceMode {