Files
opencode/packages/cloud/app/src/context/auth.withActor.ts
2025-09-18 01:32:40 -04:00

8 lines
260 B
TypeScript

import { Actor } from "@opencode/cloud-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)
}