Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

1.4 KB
Raw Blame
/**
 * What this caller is entitled to in a persistent sandbox workspace, or `null`
 * for no persistent workspace at all β€” the sandbox stays ephemeral, which is
 * the default and the only behaviour the open-source build has.
 *
 * A deployment that offers persistent workspaces overrides this module to
 * answer from whatever it uses to decide entitlements.
 *
 * Only the entitlement lives behind this slot. The directory NAME comes from
 * the caller's identity via `deriveSandboxStorageKey`; it is not a deployment
 * decision and must stay identical on both sides of the claim.
 */
export interface SandboxStorageEntitlement {
  /**
   * Whether writes past {@link quotaBytes} are allowed and billed, rather than
   * refused. Whatever decides that β€” a plan, a consent, a payment method, a
   * spending cap β€” is the deployment's business; the execution plane is told
   * the answer, never the inputs.
   *
   * Omitted means no, which is the answer that cannot charge anyone by
   * mistake.
   */
  overageAllowed?: boolean;
  /** How much storage the caller may keep, in bytes. */
  quotaBytes: number;
}

export const resolveSandboxStorageEntitlement = async (_params: {
  userId: string;
  /** Organization workspace the run is scoped to; it is judged, not the acting member. */
  workspaceId?: string | null;
}): Promise<SandboxStorageEntitlement | null> => null;