mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 20:05:46 -06:00
ae55a4090c
* refactor(canvas): retire legacy host and commands * refactor(apple): narrow shared Canvas contracts * refactor(macos): keep Canvas as widget presenter * refactor(ios): remove Canvas client * refactor(android): remove Canvas client * refactor(linux): remove Canvas client * fix(ci): isolate native locale artifacts * fix(linux): regenerate companion lockfile * fix(canvas): refresh native tool display metadata * test(canvas): align coverage with presenter surface * test(canvas): remove obsolete asset root seam * test(canvas): stabilize retirement CI coverage * refactor(swift): remove orphaned resource wrapper * test(ios): remove retired canvas layout assertion * fix(macos): reserve retired canvas command namespace * refactor(macos): isolate canvas command policy * fix(canvas): select only eligible macOS panels * fix(canvas): keep panel selection plugin-owned
57 lines
1.8 KiB
TypeScript
57 lines
1.8 KiB
TypeScript
/**
|
|
* Bonjour gateway-discovery plugin entry. It advertises the local gateway over
|
|
* mDNS and lazily loads the ciao-based advertiser.
|
|
*/
|
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
|
|
function formatBonjourInstanceName(displayName: string) {
|
|
const trimmed = displayName.trim();
|
|
if (!trimmed) {
|
|
return "OpenClaw";
|
|
}
|
|
if (/openclaw/i.test(trimmed)) {
|
|
return trimmed;
|
|
}
|
|
return `${trimmed} (OpenClaw)`;
|
|
}
|
|
|
|
/** Plugin entry for Bonjour/mDNS gateway discovery. */
|
|
export default definePluginEntry({
|
|
id: "bonjour",
|
|
name: "Bonjour Gateway Discovery",
|
|
description: "Advertise the local OpenClaw gateway over Bonjour/mDNS.",
|
|
register(api) {
|
|
api.registerGatewayDiscoveryService({
|
|
id: "bonjour",
|
|
advertise: async (ctx) => {
|
|
const [
|
|
{ startGatewayBonjourAdvertiser },
|
|
{ registerUncaughtExceptionHandler, registerUnhandledRejectionHandler },
|
|
] = await Promise.all([
|
|
import("./src/advertiser.js"),
|
|
import("openclaw/plugin-sdk/runtime"),
|
|
]);
|
|
const advertiser = await startGatewayBonjourAdvertiser(
|
|
{
|
|
instanceName: formatBonjourInstanceName(ctx.machineDisplayName),
|
|
gatewayPort: ctx.gatewayPort,
|
|
gatewayTlsEnabled: ctx.gatewayTlsEnabled,
|
|
gatewayTlsFingerprintSha256: ctx.gatewayTlsFingerprintSha256,
|
|
gatewayDirectReachable: ctx.gatewayDirectReachable,
|
|
sshPort: ctx.sshPort,
|
|
tailnetDns: ctx.tailnetDns,
|
|
cliPath: ctx.cliPath,
|
|
minimal: ctx.minimal,
|
|
},
|
|
{
|
|
logger: api.logger,
|
|
registerUncaughtExceptionHandler,
|
|
registerUnhandledRejectionHandler,
|
|
},
|
|
);
|
|
return { stop: advertiser.stop };
|
|
},
|
|
});
|
|
},
|
|
});
|