Download packages/app/src/components/prompt-input/contracts.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 1.56 kB
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/src/components/prompt-input/contracts.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/app/src/components/prompt-input/contracts.ts
-
curl -L -o contracts.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/src/components/prompt-input/contracts.ts
1.56 kB
| import type { useLocal } from "@/context/local" | |
| import type { Prompt, usePrompt } from "@/context/prompt" | |
| import type { PromptInputHistory } from "./history-store" | |
| import type { FollowupDraft } from "./submit" | |
| export type PromptInputState = ReturnType<typeof usePrompt> | |
| export type PromptInputSubmission = { | |
| abort: () => Promise<void> | void | |
| handleSubmit: (event: Event) => Promise<void> | void | |
| } | |
| export type PromptInputControls = { | |
| agents: { | |
| available: { name: string; hidden?: boolean; mode: string }[] | |
| options: string[] | |
| current: string | |
| loading: boolean | |
| visible: boolean | |
| select: (name: string | undefined) => void | |
| } | |
| model: { | |
| selection: ReturnType<typeof useLocal>["model"] | |
| paid: boolean | |
| loading: boolean | |
| } | |
| session: { | |
| id?: string | |
| tabs: { | |
| active: () => string | undefined | |
| all: () => string[] | |
| open: (tab: string) => void | Promise<void> | |
| setActive: (tab: string) => void | |
| } | |
| reviewPanel: { | |
| opened: () => boolean | |
| open: () => void | |
| } | |
| } | |
| } | |
| export interface PromptInputProps { | |
| class?: string | |
| state?: PromptInputState | |
| history?: PromptInputHistory | |
| submission?: PromptInputSubmission | |
| controls: PromptInputControls | |
| ref?: (el: HTMLDivElement) => void | |
| newSessionWorktree?: string | |
| onNewSessionWorktreeReset?: () => void | |
| edit?: { id: string; prompt: Prompt; context: FollowupDraft["context"] } | |
| onEditLoaded?: () => void | |
| shouldQueue?: () => boolean | |
| onQueue?: (draft: FollowupDraft) => void | |
| onAbort?: () => void | |
| onSubmit?: () => void | |
| } | |