cloudaxe-opencode/packages/console/app/src/context/auth.withActor.ts

8 lines
265 B
TypeScript
Raw Permalink Normal View History

2025-10-05 01:33:39 +00:00
import { Actor } from "@opencode-ai/console-core/actor.js"
2025-08-29 15:58:17 +00:00
import { getActor } from "./auth"
2025-09-03 17:10:57 +00:00
export async function withActor<T>(fn: () => T, workspace?: string) {
const actor = await getActor(workspace)
2025-08-29 15:58:17 +00:00
return Actor.provide(actor.type, actor.properties, fn)
}