auth.withActor.ts 265 B

1234567
  1. import { Actor } from "@opencode-ai/console-core/actor.js"
  2. import { getActor } from "./auth"
  3. export async function withActor<T>(fn: () => T, workspace?: string) {
  4. const actor = await getActor(workspace)
  5. return Actor.provide(actor.type, actor.properties, fn)
  6. }