fix: center function calling context

This commit is contained in:
Shivering Ocelot committed 2026-09-08 10:34:34 -05:00
1 parent dd9412ef4f
commit e9956bd34f
1 file changed
+8 -7
+8 -7
View File
@@ -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();