summaryrefslogtreecommitdiffhomepage
path: root/packages/console/app/src/context/auth.withActor.ts
blob: 2cb970269922302a02840b0849e86f9bf9a783c7 (plain)
1
2
3
4
5
6
7
import { Actor } from "@opencode/console-core/actor.js"
import { getActor } from "./auth"

export async function withActor<T>(fn: () => T, workspace?: string) {
  const actor = await getActor(workspace)
  return Actor.provide(actor.type, actor.properties, fn)
}