From 6104f6c51457f60a702e369625e4cf910ca4e59c Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 15 Jul 2026 22:18:59 +0100 Subject: [PATCH] Load typed transport from packaged CultLib --- tools/bifrost-crossing-documents.mjs | 3 ++- tools/cultmesh-bridge-commands.mjs | 3 ++- tools/provider-advertisement.mjs | 13 +++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/bifrost-crossing-documents.mjs b/tools/bifrost-crossing-documents.mjs index ac363f9..c6ec6e3 100644 --- a/tools/bifrost-crossing-documents.mjs +++ b/tools/bifrost-crossing-documents.mjs @@ -6,6 +6,7 @@ import { dirname, resolve } from "node:path"; const repoRoot = resolve(import.meta.dirname, ".."); const projectsRoot = resolve(repoRoot, ".."); +const cultLibRoot = resolve(process.env.VOIDBOT_CULTLIB_ROOT || resolve(projectsRoot, "CultLib")); export const crossingReceiptDocumentType = "bifrost.crossing_receipt"; export const crossingReceiptSchemaId = "bifrost.crossing_receipt.v1"; @@ -267,7 +268,7 @@ function loadCultCacheRuntime() { return cachedRuntime; } const packagePath = resolveFirstExisting("CultCache TypeScript runtime", [ - resolve(projectsRoot, "CultLib", "packages", "cultcache-ts", "package.json"), + resolve(cultLibRoot, "packages", "cultcache-ts", "package.json"), resolve(projectsRoot, "CultCacheTS", "package.json"), resolve(projectsRoot, "CultCacheTS", "node_modules", "cultcache-ts", "package.json"), ]); diff --git a/tools/cultmesh-bridge-commands.mjs b/tools/cultmesh-bridge-commands.mjs index 007c3de..6dbb57c 100644 --- a/tools/cultmesh-bridge-commands.mjs +++ b/tools/cultmesh-bridge-commands.mjs @@ -16,6 +16,7 @@ import { const repoRoot = resolve(import.meta.dirname, ".."); const projectsRoot = resolve(repoRoot, ".."); +const cultLibRoot = resolve(process.env.VOIDBOT_CULTLIB_ROOT || resolve(projectsRoot, "CultLib")); const defaultStorePath = resolve(repoRoot, ".bifrost", "provider-store.cc"); async function main() { @@ -292,7 +293,7 @@ function genericDocument(defineDocumentType, type, schemaId, name) { function loadCultMeshRuntime() { const candidates = [ - resolve(projectsRoot, "CultLib", "packages", "cultmesh-ts", "package.json"), + resolve(cultLibRoot, "packages", "cultmesh-ts", "package.json"), resolve(projectsRoot, "CultMeshTS", "package.json"), ]; diff --git a/tools/provider-advertisement.mjs b/tools/provider-advertisement.mjs index 41e46ea..35d5016 100644 --- a/tools/provider-advertisement.mjs +++ b/tools/provider-advertisement.mjs @@ -24,6 +24,7 @@ import { const scriptDir = dirname(fileURLToPath(import.meta.url)); const repoRoot = resolve(scriptDir, ".."); const projectsRoot = resolve(repoRoot, ".."); +const cultLibRoot = resolve(process.env.VOIDBOT_CULTLIB_ROOT || resolve(projectsRoot, "CultLib")); const defaultStorePath = resolve(repoRoot, ".bifrost", "provider-store.cc"); const defaultOdinCultMeshUri = "cultmesh://odin/rendezvous/provider-catalog"; @@ -43,7 +44,7 @@ const { defineCultNetDocumentBinding } = cultNetRuntime; function loadCultCacheRuntime() { const candidates = [ - resolve(projectsRoot, "CultLib", "packages", "cultcache-ts", "dist", "index.js"), + resolve(cultLibRoot, "packages", "cultcache-ts", "dist", "index.js"), resolve(projectsRoot, "CultCacheTS", "dist", "index.js"), ]; @@ -63,7 +64,7 @@ function loadCultCacheRuntime() { function resolveCultCachePackagePath() { const candidates = [ - resolve(projectsRoot, "CultLib", "packages", "cultcache-ts", "package.json"), + resolve(cultLibRoot, "packages", "cultcache-ts", "package.json"), resolve(projectsRoot, "CultCacheTS", "package.json"), resolve(projectsRoot, "CultCacheTS", "node_modules", "cultcache-ts", "package.json"), ]; @@ -79,7 +80,7 @@ function resolveCultCachePackagePath() { function loadCultMeshRuntime() { const candidates = [ - resolve(projectsRoot, "CultLib", "packages", "cultmesh-ts", "dist", "index.js"), + resolve(cultLibRoot, "packages", "cultmesh-ts", "dist", "index.js"), resolve(projectsRoot, "CultMeshTS", "dist", "index.js"), ]; @@ -99,7 +100,7 @@ function loadCultMeshRuntime() { function resolveCultMeshPackagePath() { const candidates = [ - resolve(projectsRoot, "CultLib", "packages", "cultmesh-ts", "package.json"), + resolve(cultLibRoot, "packages", "cultmesh-ts", "package.json"), resolve(projectsRoot, "CultMeshTS", "package.json"), resolve(projectsRoot, "CultMeshTS", "node_modules", "cultmesh-ts", "package.json"), ]; @@ -115,7 +116,7 @@ function resolveCultMeshPackagePath() { function loadCultNetRuntime() { const candidates = [ - resolve(projectsRoot, "CultLib", "packages", "cultnet-ts", "dist", "index.js"), + resolve(cultLibRoot, "packages", "cultnet-ts", "dist", "index.js"), resolve(projectsRoot, "CultNetTS", "dist", "index.js"), ]; @@ -135,7 +136,7 @@ function loadCultNetRuntime() { function resolveCultNetPackagePath() { const candidates = [ - resolve(projectsRoot, "CultLib", "packages", "cultnet-ts", "package.json"), + resolve(cultLibRoot, "packages", "cultnet-ts", "package.json"), resolve(projectsRoot, "CultNetTS", "package.json"), resolve(projectsRoot, "CultNetTS", "node_modules", "cultnet-ts", "package.json"), ];