mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-07-05 11:57:56 +02:00
v0.9.6: InfoNet hashchain, Wormhole gate encryption, mesh reputation, 16 community contributors
Gate messages now propagate via the Infonet hashchain as encrypted blobs — every node syncs them through normal chain sync while only Gate members with MLS keys can decrypt. Added mesh reputation system, peer push workers, voluntary Wormhole opt-in for node participation, fork recovery, killwormhole scripts, obfuscated terminology, and hardened the self-updater to protect encryption keys and chain state during updates. New features: Shodan search, train tracking, Sentinel Hub imagery, 8 new intelligence layers, CCTV expansion to 11,000+ cameras across 6 countries, Mesh Terminal CLI, prediction markets, desktop-shell scaffold, and comprehensive mesh test suite (215 frontend + backend tests passing). Community contributors: @wa1id, @AlborzNazari, @adust09, @Xpirix, @imqdcr, @csysp, @suranyami, @chr0n1x, @johan-martensson, @singularfailure, @smithbh, @OrfeoTerkuci, @deuza, @tm-const, @Elhard1, @ttulttul
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import type {
|
||||
DesktopControlCommand,
|
||||
DesktopControlPayloadMap,
|
||||
LocalControlInvokeMeta,
|
||||
} from '../../frontend/src/lib/desktopControlContract';
|
||||
import { createNativeControlAuditTrail } from './nativeControlAudit';
|
||||
import { createNativeControlRouter } from './nativeControlRouter';
|
||||
import type {
|
||||
NativeControlAuditEvent,
|
||||
NativeControlExecutor,
|
||||
NativeControlHandlerContext,
|
||||
} from './types';
|
||||
|
||||
async function defaultExecutor<T = unknown>(baseUrl: string, path: string, init: RequestInit = {}): Promise<T> {
|
||||
const res = await fetch(`${baseUrl}${path}`, init);
|
||||
const data = await res.json().catch(() => ({}));
|
||||
if (!res.ok || data?.ok === false) {
|
||||
throw new Error(data?.detail || data?.message || 'native_control_request_failed');
|
||||
}
|
||||
return data as T;
|
||||
}
|
||||
|
||||
export function createRuntimeBridge(ctx: NativeControlHandlerContext) {
|
||||
const auditTrail = ctx.auditTrail || createNativeControlAuditTrail();
|
||||
const auditControlUse = (event: NativeControlAuditEvent) => {
|
||||
auditTrail.record(event);
|
||||
ctx.auditControlUse?.(event);
|
||||
};
|
||||
const exec: NativeControlExecutor = <T = unknown>(path: string, init: RequestInit = {}) => {
|
||||
const headers = new Headers(init.headers);
|
||||
if (ctx.adminKey && !headers.has('X-Admin-Key')) {
|
||||
headers.set('X-Admin-Key', ctx.adminKey);
|
||||
}
|
||||
return defaultExecutor<T>(ctx.backendBaseUrl, path, { ...init, headers });
|
||||
};
|
||||
function invocationContext(meta?: LocalControlInvokeMeta): NativeControlHandlerContext {
|
||||
const baseCtx: NativeControlHandlerContext = {
|
||||
...ctx,
|
||||
auditTrail,
|
||||
auditControlUse,
|
||||
};
|
||||
if (ctx.sessionProfile || !meta?.sessionProfileHint) {
|
||||
return baseCtx;
|
||||
}
|
||||
return {
|
||||
...baseCtx,
|
||||
sessionProfile: meta.sessionProfileHint,
|
||||
};
|
||||
}
|
||||
return {
|
||||
invokeLocalControl<C extends DesktopControlCommand>(
|
||||
command: C,
|
||||
payload: DesktopControlPayloadMap[C],
|
||||
meta?: LocalControlInvokeMeta,
|
||||
) {
|
||||
return createNativeControlRouter(invocationContext(meta), exec).invoke(command, payload, meta);
|
||||
},
|
||||
getNativeControlAuditReport(limit?: number) {
|
||||
return auditTrail.snapshot(limit);
|
||||
},
|
||||
clearNativeControlAuditReport() {
|
||||
auditTrail.clear();
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user