Scope plugin config bridge reads to invocation company

This commit is contained in:
Paperclip Bot 2026-06-05 08:13:45 +00:00
parent 1580e3b755
commit 8969a713a1
2 changed files with 52 additions and 2 deletions

View file

@ -627,8 +627,16 @@ export function createHostClientHandlers(
return {
// Config
"config.get": gated("config.get", async (params) => {
return services.config.get(params);
"config.get": gated("config.get", async (params, context) => {
const scopedCompanyId = readNonEmptyString(context?.invocationScope?.companyId);
const explicitCompanyId = Object.prototype.hasOwnProperty.call(params ?? {}, "companyId")
? params.companyId ?? null
: undefined;
return services.config.get(
explicitCompanyId === undefined
? (scopedCompanyId ? { companyId: scopedCompanyId } : {})
: { companyId: explicitCompanyId },
);
}),
"localFolders.declarations": gated("localFolders.declarations", async (params) => {