mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 02:31:22 +00:00
Discovery: wide-area bridge DNS-SD
# Conflicts: # apps/ios/Sources/Bridge/BridgeDiscoveryModel.swift # src/cli/dns-cli.ts
This commit is contained in:
@@ -5,6 +5,8 @@ export type SystemPresence = {
|
||||
ip?: string;
|
||||
version?: string;
|
||||
platform?: string;
|
||||
deviceFamily?: string;
|
||||
modelIdentifier?: string;
|
||||
lastInputSeconds?: number;
|
||||
mode?: string;
|
||||
reason?: string;
|
||||
@@ -54,12 +56,20 @@ function initSelfPresence() {
|
||||
if (p === "win32") return `windows ${rel}`;
|
||||
return `${p} ${rel}`;
|
||||
})();
|
||||
const deviceFamily = (() => {
|
||||
const p = os.platform();
|
||||
if (p === "darwin") return "Mac";
|
||||
if (p === "win32") return "Windows";
|
||||
if (p === "linux") return "Linux";
|
||||
return p;
|
||||
})();
|
||||
const text = `Gateway: ${host}${ip ? ` (${ip})` : ""} · app ${version} · mode gateway · reason self`;
|
||||
const selfEntry: SystemPresence = {
|
||||
host,
|
||||
ip,
|
||||
version,
|
||||
platform,
|
||||
deviceFamily,
|
||||
mode: "gateway",
|
||||
reason: "self",
|
||||
text,
|
||||
@@ -123,6 +133,8 @@ type SystemPresencePayload = {
|
||||
ip?: string;
|
||||
version?: string;
|
||||
platform?: string;
|
||||
deviceFamily?: string;
|
||||
modelIdentifier?: string;
|
||||
lastInputSeconds?: number;
|
||||
mode?: string;
|
||||
reason?: string;
|
||||
@@ -147,6 +159,8 @@ export function updateSystemPresence(payload: SystemPresencePayload) {
|
||||
ip: payload.ip ?? parsed.ip ?? existing.ip,
|
||||
version: payload.version ?? parsed.version ?? existing.version,
|
||||
platform: payload.platform ?? existing.platform,
|
||||
deviceFamily: payload.deviceFamily ?? existing.deviceFamily,
|
||||
modelIdentifier: payload.modelIdentifier ?? existing.modelIdentifier,
|
||||
mode: payload.mode ?? parsed.mode ?? existing.mode,
|
||||
lastInputSeconds:
|
||||
payload.lastInputSeconds ??
|
||||
|
||||
Reference in New Issue
Block a user