mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-04 18:59:08 +01:00
0e46b79c22
This brings over a simplified version of the open ai feature from the previous app but in widget form. It still needs some work to reach parity with that version, but this includes all of the basic building blocks to get that working.
521 lines
11 KiB
TypeScript
521 lines
11 KiB
TypeScript
// Copyright 2024, Command Line Inc.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// generated by cmd/generate/main-generate.go
|
|
|
|
declare global {
|
|
|
|
// wconfig.AutoUpdateOpts
|
|
type AutoUpdateOpts = {
|
|
enabled: boolean;
|
|
intervalms: number;
|
|
};
|
|
|
|
// wstore.Block
|
|
type Block = WaveObj & {
|
|
blockdef: BlockDef;
|
|
controller: string;
|
|
view: string;
|
|
runtimeopts?: RuntimeOpts;
|
|
stickers?: StickerType[];
|
|
meta: MetaType;
|
|
};
|
|
|
|
// blockcontroller.BlockControllerRuntimeStatus
|
|
type BlockControllerRuntimeStatus = {
|
|
blockid: string;
|
|
status: string;
|
|
shellprocstatus?: string;
|
|
};
|
|
|
|
// wstore.BlockDef
|
|
type BlockDef = {
|
|
controller?: string;
|
|
view?: string;
|
|
files?: {[key: string]: FileDef};
|
|
meta?: MetaType;
|
|
};
|
|
|
|
// wconfig.BlockHeaderOpts
|
|
type BlockHeaderOpts = {
|
|
showblockids: boolean;
|
|
};
|
|
|
|
// webcmd.BlockInputWSCommand
|
|
type BlockInputWSCommand = {
|
|
wscommand: "blockinput";
|
|
blockid: string;
|
|
inputdata64: string;
|
|
};
|
|
|
|
// wstore.Client
|
|
type Client = WaveObj & {
|
|
mainwindowid: string;
|
|
windowids: string[];
|
|
meta: MetaType;
|
|
};
|
|
|
|
// wshrpc.CommandAppendIJsonData
|
|
type CommandAppendIJsonData = {
|
|
zoneid: string;
|
|
filename: string;
|
|
data: MetaType;
|
|
};
|
|
|
|
// wshrpc.CommandBlockInputData
|
|
type CommandBlockInputData = {
|
|
blockid: string;
|
|
inputdata64?: string;
|
|
signame?: string;
|
|
termsize?: TermSize;
|
|
};
|
|
|
|
// wshrpc.CommandBlockRestartData
|
|
type CommandBlockRestartData = {
|
|
blockid: string;
|
|
};
|
|
|
|
// wshrpc.CommandBlockSetViewData
|
|
type CommandBlockSetViewData = {
|
|
blockid: string;
|
|
view: string;
|
|
};
|
|
|
|
// wshrpc.CommandCreateBlockData
|
|
type CommandCreateBlockData = {
|
|
tabid: string;
|
|
blockdef: BlockDef;
|
|
rtopts: RuntimeOpts;
|
|
};
|
|
|
|
// wshrpc.CommandDeleteBlockData
|
|
type CommandDeleteBlockData = {
|
|
blockid: string;
|
|
};
|
|
|
|
// wshrpc.CommandFileData
|
|
type CommandFileData = {
|
|
zoneid: string;
|
|
filename: string;
|
|
data64?: string;
|
|
};
|
|
|
|
// wshrpc.CommandGetMetaData
|
|
type CommandGetMetaData = {
|
|
oref: ORef;
|
|
};
|
|
|
|
// wshrpc.CommandMessageData
|
|
type CommandMessageData = {
|
|
oref: ORef;
|
|
message: string;
|
|
};
|
|
|
|
// wshrpc.CommandResolveIdsData
|
|
type CommandResolveIdsData = {
|
|
ids: string[];
|
|
};
|
|
|
|
// wshrpc.CommandResolveIdsRtnData
|
|
type CommandResolveIdsRtnData = {
|
|
resolvedids: {[key: string]: ORef};
|
|
};
|
|
|
|
// wshrpc.CommandSetMetaData
|
|
type CommandSetMetaData = {
|
|
oref: ORef;
|
|
meta: MetaType;
|
|
};
|
|
|
|
// wstore.FileDef
|
|
type FileDef = {
|
|
filetype?: string;
|
|
path?: string;
|
|
url?: string;
|
|
content?: string;
|
|
meta?: MetaType;
|
|
};
|
|
|
|
// fileservice.FileInfo
|
|
type FileInfo = {
|
|
path: string;
|
|
name: string;
|
|
notfound?: boolean;
|
|
size: number;
|
|
mode: number;
|
|
modestr: string;
|
|
modtime: number;
|
|
isdir?: boolean;
|
|
mimetype?: string;
|
|
};
|
|
|
|
// filestore.FileOptsType
|
|
type FileOptsType = {
|
|
maxsize?: number;
|
|
circular?: boolean;
|
|
ijson?: boolean;
|
|
ijsonbudget?: number;
|
|
};
|
|
|
|
// fileservice.FullFile
|
|
type FullFile = {
|
|
info: FileInfo;
|
|
data64: string;
|
|
};
|
|
|
|
// wstore.LayoutNode
|
|
type LayoutNode = WaveObj & {
|
|
node?: any;
|
|
meta?: MetaType;
|
|
};
|
|
|
|
type MetaType = {[key: string]: any}
|
|
|
|
// tsgenmeta.MethodMeta
|
|
type MethodMeta = {
|
|
Desc: string;
|
|
ArgNames: string[];
|
|
ReturnDesc: string;
|
|
};
|
|
|
|
// wconfig.MimeTypeConfigType
|
|
type MimeTypeConfigType = {
|
|
icon: string;
|
|
color: string;
|
|
};
|
|
|
|
// waveobj.ORef
|
|
type ORef = string;
|
|
|
|
// waveai.OpenAIOptsType
|
|
type OpenAIOptsType = {
|
|
model: string;
|
|
apitoken: string;
|
|
baseurl?: string;
|
|
maxtokens?: number;
|
|
maxchoices?: number;
|
|
timeout?: number;
|
|
};
|
|
|
|
// waveai.OpenAIPacketType
|
|
type OpenAIPacketType = {
|
|
type: string;
|
|
model?: string;
|
|
created?: number;
|
|
finish_reason?: string;
|
|
usage?: OpenAIUsageType;
|
|
index?: number;
|
|
text?: string;
|
|
error?: string;
|
|
};
|
|
|
|
// waveai.OpenAIPromptMessageType
|
|
type OpenAIPromptMessageType = {
|
|
role: string;
|
|
content: string;
|
|
name?: string;
|
|
};
|
|
|
|
// waveai.OpenAIUsageType
|
|
type OpenAIUsageType = {
|
|
prompt_tokens?: number;
|
|
completion_tokens?: number;
|
|
total_tokens?: number;
|
|
};
|
|
|
|
// waveai.OpenAiStreamRequest
|
|
type OpenAiStreamRequest = {
|
|
clientid?: string;
|
|
opts: OpenAIOptsType;
|
|
prompt: OpenAIPromptMessageType[];
|
|
};
|
|
|
|
// wstore.Point
|
|
type Point = {
|
|
x: number;
|
|
y: number;
|
|
};
|
|
|
|
// wshutil.RpcMessage
|
|
type RpcMessage = {
|
|
command?: string;
|
|
reqid?: string;
|
|
resid?: string;
|
|
timeout?: number;
|
|
cont?: boolean;
|
|
cancel?: boolean;
|
|
error?: string;
|
|
datatype?: string;
|
|
data?: any;
|
|
};
|
|
|
|
// wstore.RuntimeOpts
|
|
type RuntimeOpts = {
|
|
termsize?: TermSize;
|
|
winsize?: WinSize;
|
|
};
|
|
|
|
// webcmd.SetBlockTermSizeWSCommand
|
|
type SetBlockTermSizeWSCommand = {
|
|
wscommand: "setblocktermsize";
|
|
blockid: string;
|
|
termsize: TermSize;
|
|
};
|
|
|
|
// wconfig.SettingsConfigType
|
|
type SettingsConfigType = {
|
|
mimetypes: {[key: string]: MimeTypeConfigType};
|
|
term: TerminalConfigType;
|
|
widgets: WidgetsConfigType[];
|
|
blockheader: BlockHeaderOpts;
|
|
autoupdate: AutoUpdateOpts;
|
|
termthemes: {[key: string]: TermThemeType};
|
|
};
|
|
|
|
// wstore.StickerClickOptsType
|
|
type StickerClickOptsType = {
|
|
sendinput?: string;
|
|
createblock?: BlockDef;
|
|
};
|
|
|
|
// wstore.StickerDisplayOptsType
|
|
type StickerDisplayOptsType = {
|
|
icon: string;
|
|
imgsrc: string;
|
|
svgblob?: string;
|
|
};
|
|
|
|
// wstore.StickerType
|
|
type StickerType = {
|
|
stickertype: string;
|
|
style: MetaType;
|
|
clickopts?: StickerClickOptsType;
|
|
display: StickerDisplayOptsType;
|
|
};
|
|
|
|
// wstore.Tab
|
|
type Tab = WaveObj & {
|
|
name: string;
|
|
layoutNode: string;
|
|
blockids: string[];
|
|
meta: MetaType;
|
|
};
|
|
|
|
// shellexec.TermSize
|
|
type TermSize = {
|
|
rows: number;
|
|
cols: number;
|
|
};
|
|
|
|
// wconfig.TermThemeType
|
|
type TermThemeType = {
|
|
black: string;
|
|
red: string;
|
|
green: string;
|
|
yellow: string;
|
|
blue: string;
|
|
magenta: string;
|
|
cyan: string;
|
|
white: string;
|
|
brightBlack: string;
|
|
brightRed: string;
|
|
brightGreen: string;
|
|
brightYellow: string;
|
|
brightBlue: string;
|
|
brightMagenta: string;
|
|
brightCyan: string;
|
|
brightWhite: string;
|
|
gray: string;
|
|
cmdtext: string;
|
|
foreground: string;
|
|
selectionBackground: string;
|
|
background: string;
|
|
cursorAccent: string;
|
|
};
|
|
|
|
// wconfig.TerminalConfigType
|
|
type TerminalConfigType = {
|
|
fontsize?: number;
|
|
fontfamily?: string;
|
|
};
|
|
|
|
// wstore.UIContext
|
|
type UIContext = {
|
|
windowid: string;
|
|
activetabid: string;
|
|
};
|
|
|
|
// userinput.UserInputRequest
|
|
type UserInputRequest = {
|
|
requestid: string;
|
|
querytext: string;
|
|
responsetype: string;
|
|
title: string;
|
|
markdown: boolean;
|
|
timeoutms: number;
|
|
checkboxmsg: string;
|
|
publictext: boolean;
|
|
};
|
|
|
|
// userinput.UserInputResponse
|
|
type UserInputResponse = {
|
|
type: string;
|
|
requestid: string;
|
|
text?: string;
|
|
confirm?: boolean;
|
|
errormsg?: string;
|
|
checkboxstat?: boolean;
|
|
};
|
|
|
|
// vdom.Elem
|
|
type VDomElem = {
|
|
id?: string;
|
|
tag: string;
|
|
props?: MetaType;
|
|
children?: VDomElem[];
|
|
text?: string;
|
|
};
|
|
|
|
// vdom.VDomFuncType
|
|
type VDomFuncType = {
|
|
#func: string;
|
|
#stopPropagation?: boolean;
|
|
#preventDefault?: boolean;
|
|
#keys?: string[];
|
|
};
|
|
|
|
// vdom.VDomRefType
|
|
type VDomRefType = {
|
|
#ref: string;
|
|
current: any;
|
|
};
|
|
|
|
type WSCommandType = {
|
|
wscommand: string;
|
|
} & ( SetBlockTermSizeWSCommand | BlockInputWSCommand | WSRpcCommand );
|
|
|
|
// eventbus.WSEventType
|
|
type WSEventType = {
|
|
eventtype: string;
|
|
oref?: string;
|
|
data: any;
|
|
};
|
|
|
|
// eventbus.WSFileEventData
|
|
type WSFileEventData = {
|
|
zoneid: string;
|
|
filename: string;
|
|
fileop: string;
|
|
data64: string;
|
|
};
|
|
|
|
// eventbus.WSLayoutActionData
|
|
type WSLayoutActionData = {
|
|
tabid: string;
|
|
actiontype: string;
|
|
blockid: string;
|
|
};
|
|
|
|
// webcmd.WSRpcCommand
|
|
type WSRpcCommand = {
|
|
wscommand: "rpc";
|
|
message: RpcMessage;
|
|
};
|
|
|
|
// wconfig.WatcherUpdate
|
|
type WatcherUpdate = {
|
|
settings: SettingsConfigType;
|
|
error: string;
|
|
};
|
|
|
|
// filestore.WaveFile
|
|
type WaveFile = {
|
|
zoneid: string;
|
|
name: string;
|
|
opts: FileOptsType;
|
|
createdts: number;
|
|
size: number;
|
|
modts: number;
|
|
meta: MetaType;
|
|
};
|
|
|
|
// waveobj.WaveObj
|
|
type WaveObj = {
|
|
otype: string;
|
|
oid: string;
|
|
version: number;
|
|
};
|
|
|
|
// wstore.WaveObjUpdate
|
|
type WaveObjUpdate = {
|
|
updatetype: string;
|
|
otype: string;
|
|
oid: string;
|
|
obj?: WaveObj;
|
|
};
|
|
|
|
// wstore.Window
|
|
type WaveWindow = WaveObj & {
|
|
workspaceid: string;
|
|
activetabid: string;
|
|
activeblockid?: string;
|
|
activeblockmap: {[key: string]: string};
|
|
pos: Point;
|
|
winsize: WinSize;
|
|
lastfocusts: number;
|
|
meta: MetaType;
|
|
};
|
|
|
|
// service.WebCallType
|
|
type WebCallType = {
|
|
service: string;
|
|
method: string;
|
|
uicontext?: UIContext;
|
|
args: any[];
|
|
};
|
|
|
|
// service.WebReturnType
|
|
type WebReturnType = {
|
|
success?: boolean;
|
|
error?: string;
|
|
data?: any;
|
|
updates?: WaveObjUpdate[];
|
|
};
|
|
|
|
// wconfig.WidgetsConfigType
|
|
type WidgetsConfigType = {
|
|
icon: string;
|
|
color?: string;
|
|
label?: string;
|
|
description?: string;
|
|
blockdef: BlockDef;
|
|
};
|
|
|
|
// wstore.WinSize
|
|
type WinSize = {
|
|
width: number;
|
|
height: number;
|
|
};
|
|
|
|
// wstore.Workspace
|
|
type Workspace = WaveObj & {
|
|
name: string;
|
|
tabids: string[];
|
|
meta: MetaType;
|
|
};
|
|
|
|
// wshrpc.WshRpcCommandOpts
|
|
type WshRpcCommandOpts = {
|
|
timeout: number;
|
|
noresponse: boolean;
|
|
};
|
|
|
|
// wshrpc.WshServerCommandMeta
|
|
type WshServerCommandMeta = {
|
|
commandtype: string;
|
|
};
|
|
|
|
}
|
|
|
|
export {}
|