@forwardimpact/libbridge 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forwardimpact/libbridge",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Threaded-channel bridge primitives — relay messages between human channels (GitHub Discussions, Microsoft Teams) and the Kata agent team.",
5
5
  "keywords": [
6
6
  "bridge",
package/src/index.js CHANGED
@@ -34,6 +34,7 @@ export { Dispatcher } from "./dispatcher.js";
34
34
  export {
35
35
  DefaultTenantResolver,
36
36
  RegistryTenantResolver,
37
+ assertMultiTenantDeps,
37
38
  } from "./tenant-resolver.js";
38
39
  export { TokenResolver } from "./token-resolver.js";
39
40
  export { GhServerTokenResolver } from "./ghserver-token-resolver.js";
@@ -100,3 +100,18 @@ export class RegistryTenantResolver {
100
100
  return this.#client.ResolveByTenantId({ tenant_id });
101
101
  }
102
102
  }
103
+
104
+ /**
105
+ * Fail fast when a bridge is in multi-tenant mode but the tenancy client that
106
+ * mode requires was not injected. The bridge's `tenancy_mode` config is the
107
+ * single source of truth; a multi config missing its collaborators is a wiring
108
+ * error, not single-tenant mode.
109
+ *
110
+ * @param {boolean} multiTenant
111
+ * @param {object} [tenancyClient]
112
+ * @returns {void}
113
+ */
114
+ export function assertMultiTenantDeps(multiTenant, tenancyClient) {
115
+ if (multiTenant && !tenancyClient)
116
+ throw new Error("tenancyClient is required in multi-tenant mode");
117
+ }