mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
Share REST and RPC response types
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
export type CommandResponse = {
|
||||
success: boolean
|
||||
stdout?: string
|
||||
stderr?: string
|
||||
exitCode?: number
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type GitCommandResponse = CommandResponse
|
||||
|
||||
export type FileReadResponse = {
|
||||
success: boolean
|
||||
content?: string
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type GeneratedImageResponse = {
|
||||
success: boolean
|
||||
content?: string
|
||||
mimeType?: string
|
||||
fileName?: string
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type UploadFileResponse = {
|
||||
success: boolean
|
||||
path?: string
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type DeleteUploadResponse = {
|
||||
success: boolean
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type DirectoryEntry = {
|
||||
name: string
|
||||
type: 'file' | 'directory' | 'other'
|
||||
size?: number
|
||||
modified?: number
|
||||
}
|
||||
|
||||
export type ListDirectoryResponse = {
|
||||
success: boolean
|
||||
entries?: DirectoryEntry[]
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type RpcListDirectoryResponse = ListDirectoryResponse
|
||||
|
||||
export type MachineDirectoryEntry = DirectoryEntry & {
|
||||
isGitRepo?: boolean
|
||||
}
|
||||
|
||||
export type MachineListDirectoryResponse = {
|
||||
success: boolean
|
||||
entries?: MachineDirectoryEntry[]
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type PathExistsResponse = {
|
||||
exists: Record<string, boolean>
|
||||
}
|
||||
|
||||
export type MachinePathsExistsResponse = PathExistsResponse
|
||||
|
||||
export type CodexModelSummary = {
|
||||
id: string
|
||||
displayName: string
|
||||
isDefault: boolean
|
||||
defaultReasoningEffort?: string | null
|
||||
supportedReasoningEfforts?: string[]
|
||||
}
|
||||
|
||||
export type CodexModelsResponse = {
|
||||
success: boolean
|
||||
models?: CodexModelSummary[]
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type ListCodexModelsResponse = CodexModelsResponse
|
||||
|
||||
export type OpencodeModelSummary = {
|
||||
modelId: string
|
||||
name?: string
|
||||
}
|
||||
|
||||
export type OpencodeModelsResponse = {
|
||||
success: boolean
|
||||
availableModels?: OpencodeModelSummary[]
|
||||
currentModelId?: string | null
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type ListOpencodeModelsResponse = OpencodeModelsResponse
|
||||
Reference in New Issue
Block a user