Download packages/server/src/handlers/agent.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 449 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/server/src/handlers/agent.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/server/src/handlers/agent.ts
-
curl -L -o agent.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/server/src/handlers/agent.ts
449 Bytes
| import { AgentV2 } from "@opencode-ai/core/agent" | |
| import { Effect } from "effect" | |
| import { HttpApiBuilder } from "effect/unstable/httpapi" | |
| import { Api } from "../api" | |
| import { response } from "../location" | |
| export const AgentHandler = HttpApiBuilder.group(Api, "server.agent", (handlers) => | |
| handlers.handle("agent.list", () => | |
| Effect.gen(function* () { | |
| return yield* response(AgentV2.Service.use((agent) => agent.all())) | |
| }), | |
| ), | |
| ) | |