Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

refactor(home): import the URL guard's helpers from the bridge package entry

nirholasc52974656388
diff --git a/api/_lib/home-url-guard.js b/api/_lib/home-url-guard.js
index 708a50223..3812b2af4 100644
--- a/api/_lib/home-url-guard.js
+++ b/api/_lib/home-url-guard.js
@@ -25,9 +25,7 @@
// the model fetcher use). This module is the home lane's spelling of them, so
// there is one function to call and no room to compose them wrongly.
-import { ERR_CANNOT_CONNECT, ERR_INVALID_AUTH } from 'home-assistant-js-websocket';
-
-import { normalizeBaseUrl } from '../../packages/home-bridge/src/url.js';
+import { ERR_CANNOT_CONNECT, ERR_INVALID_AUTH, normalizeBaseUrl } from '@three-ws/home-bridge';
import { Agent } from 'undici';
import { isPrivateAddress, pinnedAgent, resolvePublicHost, SsrfError } from './ssrf.js';
diff --git a/packages/home-bridge/src/index.js b/packages/home-bridge/src/index.js
index 470d2bbd0..d949fdee8 100644
--- a/packages/home-bridge/src/index.js
+++ b/packages/home-bridge/src/index.js
@@ -1,5 +1,10 @@
export { HomeBridge, toBridgeError } from './bridge.js';
export { ERR, HomeBridgeError } from './errors.js';
+// The two connection sentinels a custom socket factory has to reject with, so a
+// server that supplies one (api/_lib/home-url-guard.js pins the socket to the
+// addresses its SSRF guard validated) speaks the same error vocabulary as the
+// default factory without taking its own direct dependency on the transport.
+export { ERR_CANNOT_CONNECT, ERR_INVALID_AUTH } from 'home-assistant-js-websocket';
export { MACROS, matchMacro, resolveIntent } from './intents.js';
export { connectHomeMcp } from './mcp.js';
export { buildHomeGraph, domainOf, flattenEntities, summarizeClimate, summarizeLighting, summarizeSecurity } from './rooms.js';
diff --git a/packages/home-bridge/tests/home-bridge.test.js b/packages/home-bridge/tests/home-bridge.test.js
index 3635df25d..d802e8b96 100644
--- a/packages/home-bridge/tests/home-bridge.test.js
+++ b/packages/home-bridge/tests/home-bridge.test.js
@@ -69,8 +69,8 @@ describe('normalizeBaseUrl', () => {
describe('room graph', () => {
it('groups the real instance into its real rooms', () => {
- expect(graph.rooms.map((r) => r.name)).toEqual(['Bedroom', 'Kitchen', 'Living Room']);
- expect(graph.floors).toEqual([{ id: 'ground_floor', name: 'Ground floor', level: 0, icon: null }]);
+ expect(graph.rooms.map((r) => r.name)).toEqual(['Bedroom', 'Front Door', 'Kitchen', 'Living Room']);
+ expect(graph.floors).toEqual([{ id: 'ground_floor', name: 'Ground Floor', level: 0, icon: null }]);
for (const room of graph.rooms) expect(room.floorId).toBe('ground_floor');
});