From e9956bd34f13552e1ee85e796bca98dcd9fd7e1a Mon Sep 17 00:00:00 2001 From: Shivering Ocelot Date: Tue, 8 Sep 2026 10:34:34 -0500 Subject: [PATCH] fix: center function calling context --- src/main.mjs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main.mjs b/src/main.mjs index d15b6cc..ced212d 100644 --- a/src/main.mjs +++ b/src/main.mjs @@ -208,19 +208,20 @@ function run() { if (!token) console.warn('No token set in .remote/config.json'); HORDE = new Horde({ host: HOST, token }); - CENTER = new Remote({ - horde: HORDE, - name: CENTER_NAME, - functionsDir: path.join(WORK_DIR, '.remote', 'functions'), - }); - REMOTES = new Map([[CENTER_NAME, CENTER]]); - API = { createSpace, cloneSpace, listSpaces: () => [...REMOTES.keys()].filter((n) => n !== CENTER_NAME), }; + CENTER = new Remote({ + horde: HORDE, + name: CENTER_NAME, + functionsDir: path.join(WORK_DIR, '.remote', 'functions'), + ctx: { dir: WORK_DIR, remoteName: CENTER_NAME, spaceName: null, api: API }, + }); + REMOTES = new Map([[CENTER_NAME, CENTER]]); + reconcileSpaces(); new Watcher(spacesDir, () => reconcileSpaces()).start(); HORDE.connect();