summaryrefslogtreecommitdiffhomepage
path: root/packages/console/app/src/context/auth.withActor.ts
blob: ff377cda4602688b64772896c03e332cf60272d2 (plain)
1
2
3
4
5
6
7
import { Actor } from "@opencode-ai/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)
}