Download packages/console/app/src/context/auth.withActor.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 265 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/console/app/src/context/auth.withActor.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/console/app/src/context/auth.withActor.ts
-
curl -L -o auth.withActor.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/console/app/src/context/auth.withActor.ts
265 Bytes
| 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) | |
| } | |