feat: alive UI wave, galaxy presence, spread and fleet enhancements
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Dashboard ambient layer, comrade presence, Mission Deck and War Room, Emberwake supply chain, spread/docs publishing, fleet policy and modules API, CI docker mining, and refreshed USB pack.
This commit is contained in:
92
server/web/src/help/forgeMissionWizard.ts
Normal file
92
server/web/src/help/forgeMissionWizard.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import type { OperationModeId } from './forgeOperationModes';
|
||||
import type { SpreadProfileId } from './spreadProfiles';
|
||||
|
||||
export const MISSION_WIZARD_STEPS = ['mode', 'profile', 'launch'] as const;
|
||||
export type MissionWizardStep = (typeof MISSION_WIZARD_STEPS)[number];
|
||||
|
||||
export const MISSION_WIZARD_STEP_LABELS: Record<MissionWizardStep, string> = {
|
||||
mode: 'Mode',
|
||||
profile: 'Profile',
|
||||
launch: 'Launch',
|
||||
};
|
||||
|
||||
export type MissionOperationChip = 'ghost' | 'loud' | 'spread';
|
||||
|
||||
export interface MissionOperationChipDef {
|
||||
id: MissionOperationChip;
|
||||
label: string;
|
||||
color: string;
|
||||
modeId: OperationModeId;
|
||||
blurb: string;
|
||||
}
|
||||
|
||||
export const MISSION_OPERATION_CHIPS: MissionOperationChipDef[] = [
|
||||
{
|
||||
id: 'ghost',
|
||||
label: 'Ghost',
|
||||
color: '#6b8cff',
|
||||
modeId: 'ghost_walk',
|
||||
blurb: 'Stealth on, hidden display, garble — minimal LAN footprint',
|
||||
},
|
||||
{
|
||||
id: 'loud',
|
||||
label: 'Loud',
|
||||
color: '#ff5c5c',
|
||||
modeId: 'open_flame',
|
||||
blurb: 'Visible console, logging on — lab testing and debugging',
|
||||
},
|
||||
{
|
||||
id: 'spread',
|
||||
label: 'Spread',
|
||||
color: '#ff8c3a',
|
||||
modeId: 'wildfire',
|
||||
blurb: 'Universal spread kit + LAN/USB autospread — seed the fleet',
|
||||
},
|
||||
];
|
||||
|
||||
export function operationModeForChip(chip: MissionOperationChip): OperationModeId {
|
||||
return MISSION_OPERATION_CHIPS.find((c) => c.id === chip)?.modeId ?? 'ghost_walk';
|
||||
}
|
||||
|
||||
export function missionChipForMode(mode: OperationModeId): MissionOperationChip {
|
||||
if (mode === 'open_flame') return 'loud';
|
||||
if (mode === 'wildfire' || mode === 'crucible_storm') return 'spread';
|
||||
return 'ghost';
|
||||
}
|
||||
|
||||
export function wizardStepIndex(step: MissionWizardStep): number {
|
||||
return MISSION_WIZARD_STEPS.indexOf(step);
|
||||
}
|
||||
|
||||
export function nextWizardStep(step: MissionWizardStep): MissionWizardStep | null {
|
||||
const idx = wizardStepIndex(step);
|
||||
if (idx < 0 || idx >= MISSION_WIZARD_STEPS.length - 1) return null;
|
||||
return MISSION_WIZARD_STEPS[idx + 1];
|
||||
}
|
||||
|
||||
export function prevWizardStep(step: MissionWizardStep): MissionWizardStep | null {
|
||||
const idx = wizardStepIndex(step);
|
||||
if (idx <= 0) return null;
|
||||
return MISSION_WIZARD_STEPS[idx - 1];
|
||||
}
|
||||
|
||||
export function canAdvanceWizardStep(
|
||||
step: MissionWizardStep,
|
||||
chip: MissionOperationChip,
|
||||
_spreadProfile: SpreadProfileId | '',
|
||||
): boolean {
|
||||
if (step === 'mode') return !!chip;
|
||||
if (step === 'profile') return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
export function wizardPillStatus(
|
||||
pill: MissionWizardStep,
|
||||
current: MissionWizardStep,
|
||||
): 'pending' | 'active' | 'done' {
|
||||
const pillIdx = wizardStepIndex(pill);
|
||||
const curIdx = wizardStepIndex(current);
|
||||
if (pillIdx < curIdx) return 'done';
|
||||
if (pillIdx === curIdx) return 'active';
|
||||
return 'pending';
|
||||
}
|
||||
Reference in New Issue
Block a user