mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 04:33:44 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -17,8 +17,8 @@ describe("bonjour-discovery", () => {
|
||||
if (domain === "local.") {
|
||||
return {
|
||||
stdout: [
|
||||
"Add 2 3 local. _clawdbot-gw._tcp. Peter\\226\\128\\153s Mac Studio Gateway",
|
||||
"Add 2 3 local. _clawdbot-gw._tcp. Laptop Gateway",
|
||||
"Add 2 3 local. _moltbot-gw._tcp. Peter\\226\\128\\153s Mac Studio Gateway",
|
||||
"Add 2 3 local. _moltbot-gw._tcp. Laptop Gateway",
|
||||
"",
|
||||
].join("\n"),
|
||||
stderr: "",
|
||||
@@ -30,7 +30,7 @@ describe("bonjour-discovery", () => {
|
||||
if (domain === WIDE_AREA_DISCOVERY_DOMAIN) {
|
||||
return {
|
||||
stdout: [
|
||||
`Add 2 3 ${WIDE_AREA_DISCOVERY_DOMAIN} _clawdbot-gw._tcp. Tailnet Gateway`,
|
||||
`Add 2 3 ${WIDE_AREA_DISCOVERY_DOMAIN} _moltbot-gw._tcp. Tailnet Gateway`,
|
||||
"",
|
||||
].join("\n"),
|
||||
stderr: "",
|
||||
@@ -65,7 +65,7 @@ describe("bonjour-discovery", () => {
|
||||
|
||||
return {
|
||||
stdout: [
|
||||
`${instance}._clawdbot-gw._tcp. can be reached at ${host}:18789`,
|
||||
`${instance}._moltbot-gw._tcp. can be reached at ${host}:18789`,
|
||||
txtParts.join(" "),
|
||||
"",
|
||||
].join("\n"),
|
||||
@@ -112,7 +112,7 @@ describe("bonjour-discovery", () => {
|
||||
const domain = argv[3] ?? "";
|
||||
if (argv[0] === "dns-sd" && argv[1] === "-B" && domain === "local.") {
|
||||
return {
|
||||
stdout: ["Add 2 3 local. _clawdbot-gw._tcp. Studio Gateway", ""].join("\n"),
|
||||
stdout: ["Add 2 3 local. _moltbot-gw._tcp. Studio Gateway", ""].join("\n"),
|
||||
stderr: "",
|
||||
code: 0,
|
||||
signal: null,
|
||||
@@ -123,7 +123,7 @@ describe("bonjour-discovery", () => {
|
||||
if (argv[0] === "dns-sd" && argv[1] === "-L") {
|
||||
return {
|
||||
stdout: [
|
||||
"Studio Gateway._clawdbot-gw._tcp. can be reached at studio.local:18789",
|
||||
"Studio Gateway._moltbot-gw._tcp. can be reached at studio.local:18789",
|
||||
"txtvers=1 displayName=Peter\\226\\128\\153s\\032Mac\\032Studio lanHost=studio.local gatewayPort=18789 sshPort=22",
|
||||
"",
|
||||
].join("\n"),
|
||||
@@ -164,6 +164,9 @@ describe("bonjour-discovery", () => {
|
||||
|
||||
it("falls back to tailnet DNS probing for wide-area when split DNS is not configured", async () => {
|
||||
const calls: Array<{ argv: string[]; timeoutMs: number }> = [];
|
||||
const zone = WIDE_AREA_DISCOVERY_DOMAIN.replace(/\.$/, "");
|
||||
const serviceBase = `_moltbot-gw._tcp.${zone}`;
|
||||
const studioService = `studio-gateway.${serviceBase}`;
|
||||
|
||||
const run = vi.fn(async (argv: string[], options: { timeoutMs: number }) => {
|
||||
calls.push({ argv, timeoutMs: options.timeoutMs });
|
||||
@@ -200,13 +203,9 @@ describe("bonjour-discovery", () => {
|
||||
const qname = argv[argv.length - 2] ?? "";
|
||||
const qtype = argv[argv.length - 1] ?? "";
|
||||
|
||||
if (
|
||||
server === "100.123.224.76" &&
|
||||
qtype === "PTR" &&
|
||||
qname === "_clawdbot-gw._tcp.clawdbot.internal"
|
||||
) {
|
||||
if (server === "100.123.224.76" && qtype === "PTR" && qname === serviceBase) {
|
||||
return {
|
||||
stdout: `studio-gateway._clawdbot-gw._tcp.clawdbot.internal.\n`,
|
||||
stdout: `${studioService}.\n`,
|
||||
stderr: "",
|
||||
code: 0,
|
||||
signal: null,
|
||||
@@ -214,13 +213,9 @@ describe("bonjour-discovery", () => {
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
server === "100.123.224.76" &&
|
||||
qtype === "SRV" &&
|
||||
qname === "studio-gateway._clawdbot-gw._tcp.clawdbot.internal"
|
||||
) {
|
||||
if (server === "100.123.224.76" && qtype === "SRV" && qname === studioService) {
|
||||
return {
|
||||
stdout: `0 0 18789 studio.clawdbot.internal.\n`,
|
||||
stdout: `0 0 18789 studio.${zone}.\n`,
|
||||
stderr: "",
|
||||
code: 0,
|
||||
signal: null,
|
||||
@@ -228,11 +223,7 @@ describe("bonjour-discovery", () => {
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
server === "100.123.224.76" &&
|
||||
qtype === "TXT" &&
|
||||
qname === "studio-gateway._clawdbot-gw._tcp.clawdbot.internal"
|
||||
) {
|
||||
if (server === "100.123.224.76" && qtype === "TXT" && qname === studioService) {
|
||||
return {
|
||||
stdout: [
|
||||
`"displayName=Studio"`,
|
||||
@@ -240,7 +231,7 @@ describe("bonjour-discovery", () => {
|
||||
`"transport=gateway"`,
|
||||
`"sshPort=22"`,
|
||||
`"tailnetDns=peters-mac-studio-1.sheep-coho.ts.net"`,
|
||||
`"cliPath=/opt/homebrew/bin/clawdbot"`,
|
||||
`"cliPath=/opt/homebrew/bin/moltbot"`,
|
||||
"",
|
||||
].join(" "),
|
||||
stderr: "",
|
||||
@@ -266,12 +257,12 @@ describe("bonjour-discovery", () => {
|
||||
domain: WIDE_AREA_DISCOVERY_DOMAIN,
|
||||
instanceName: "studio-gateway",
|
||||
displayName: "Studio",
|
||||
host: "studio.clawdbot.internal",
|
||||
host: `studio.${zone}`,
|
||||
port: 18789,
|
||||
tailnetDns: "peters-mac-studio-1.sheep-coho.ts.net",
|
||||
gatewayPort: 18789,
|
||||
sshPort: 22,
|
||||
cliPath: "/opt/homebrew/bin/clawdbot",
|
||||
cliPath: "/opt/homebrew/bin/moltbot",
|
||||
}),
|
||||
]);
|
||||
|
||||
@@ -295,12 +286,12 @@ describe("bonjour-discovery", () => {
|
||||
await discoverGatewayBeacons({
|
||||
platform: "darwin",
|
||||
timeoutMs: 1,
|
||||
domains: ["local", "clawdbot.internal"],
|
||||
domains: ["local", "moltbot.internal"],
|
||||
run: run as unknown as typeof runCommandWithTimeout,
|
||||
});
|
||||
|
||||
expect(calls.filter((c) => c[1] === "-B").map((c) => c[3])).toEqual(
|
||||
expect.arrayContaining(["local.", "clawdbot.internal."]),
|
||||
expect.arrayContaining(["local.", "moltbot.internal."]),
|
||||
);
|
||||
|
||||
calls.length = 0;
|
||||
|
||||
Reference in New Issue
Block a user