mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-16 14:57:15 +00:00
15 lines
524 B
TypeScript
15 lines
524 B
TypeScript
/** Unavailability takes priority over the deployment's scope restriction. */
|
|
export function getBoxScopeContext(
|
|
boxAvailable: boolean,
|
|
forcedTemplate?: string,
|
|
) {
|
|
forcedTemplate = forcedTemplate?.trim();
|
|
return {
|
|
box_available: boxAvailable,
|
|
box_scope_editable: boxAvailable && !forcedTemplate,
|
|
// Only expose forced-scope reasons when the sandbox is available.
|
|
box_scope_forced: boxAvailable && !!forcedTemplate,
|
|
box_scope_forced_global: boxAvailable && forcedTemplate === '{global}',
|
|
};
|
|
}
|