Download packages/coding-agent/src/experimental/services/agent-controller.ts from SaylorTwift/pi: direct link, hf CLI and curl.
- Browser
- Download file 1.9 kB
-
https://huggingface.co/SaylorTwift/pi/resolve/main/packages/coding-agent/src/experimental/services/agent-controller.ts
- Command line
-
hf download hf://SaylorTwift/pi/packages/coding-agent/src/experimental/services/agent-controller.ts
-
curl -L -o agent-controller.ts https://huggingface.co/SaylorTwift/pi/resolve/main/packages/coding-agent/src/experimental/services/agent-controller.ts
1.9 kB
| import { type Context, defineService } from "@earendil-works/chord"; | |
| export interface AgentPromptImage { | |
| type: "image"; | |
| data: string; | |
| mimeType: string; | |
| } | |
| export interface AgentPromptRequest { | |
| message: string; | |
| images: AgentPromptImage[] | null; | |
| } | |
| export interface AgentOperationError { | |
| code: string; | |
| message: string; | |
| } | |
| export type AgentOperationResponse = | |
| | { accepted: true; operationId: string; error: AgentOperationError | null } | |
| | { accepted: false; operationId: string | null; error: AgentOperationError }; | |
| export type AgentQueueResponse = | |
| | { accepted: true; entryId: string; error: null } | |
| | { accepted: false; entryId: null; error: AgentOperationError }; | |
| export interface AgentCompactionRequest { | |
| customInstructions: string | null; | |
| } | |
| export interface AgentNavigationRequest { | |
| targetId: string | null; | |
| summarize: boolean; | |
| label: string | null; | |
| customInstructions: string | null; | |
| } | |
| /** Presentation-safe command facade over the worker-owned main AgentLane. */ | |
| export interface AgentController { | |
| prompt(request: AgentPromptRequest, context: Context): Promise<AgentOperationResponse>; | |
| requestAbort(operationId: string, context: Context): Promise<void>; | |
| steer(request: AgentPromptRequest, context: Context): Promise<AgentQueueResponse>; | |
| followUp(request: AgentPromptRequest, context: Context): Promise<AgentQueueResponse>; | |
| nextRun(request: AgentPromptRequest, context: Context): Promise<AgentQueueResponse>; | |
| cancelQueued( | |
| entryId: string, | |
| context: Context, | |
| ): Promise<{ outcome: "cancelled" | "already_consumed" | "not_found" }>; | |
| resume(context: Context): Promise<AgentOperationResponse>; | |
| compact(request: AgentCompactionRequest, context: Context): Promise<AgentOperationResponse>; | |
| navigate(request: AgentNavigationRequest, context: Context): Promise<AgentOperationResponse>; | |
| } | |
| export const AgentController = defineService<AgentController>("pi.agent-controller"); | |