Skip to content

Commit a08c2d7

Browse files
authored
remove old waveai backend code (#3195)
frontend was removed in the last release. cleaning up the backend code. remove wsapi host (cloud service is also getting removed)
1 parent 263eda4 commit a08c2d7

File tree

14 files changed

+0
-1209
lines changed

14 files changed

+0
-1209
lines changed

frontend/app/store/services.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ export class BlockServiceType {
3434
SaveTerminalState(blockId: string, state: string, stateType: string, ptyOffset: number, termSize: TermSize): Promise<void> {
3535
return callBackendService(this?.waveEnv, "block", "SaveTerminalState", Array.from(arguments))
3636
}
37-
SaveWaveAiData(arg2: string, arg3: WaveAIPromptMessageType[]): Promise<void> {
38-
return callBackendService(this?.waveEnv, "block", "SaveWaveAiData", Array.from(arguments))
39-
}
4037
}
4138

4239
export const BlockService = new BlockServiceType();

frontend/app/store/wshclientapi.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -924,12 +924,6 @@ export class RpcApiType {
924924
return client.wshRpcStream("streamtest", null, opts);
925925
}
926926

927-
// command "streamwaveai" [responsestream]
928-
StreamWaveAiCommand(client: WshClient, data: WaveAIStreamRequest, opts?: RpcOpts): AsyncGenerator<WaveAIPacketType, void, boolean> {
929-
if (this.mockClient) return this.mockClient.mockWshRpcStream(client, "streamwaveai", data, opts);
930-
return client.wshRpcStream("streamwaveai", data, opts);
931-
}
932-
933927
// command "termgetscrollbacklines" [call]
934928
TermGetScrollbackLinesCommand(client: WshClient, data: CommandTermGetScrollbackLinesData, opts?: RpcOpts): Promise<CommandTermGetScrollbackLinesRtnData> {
935929
if (this.mockClient) return this.mockClient.mockWshRpcCall(client, "termgetscrollbacklines", data, opts);

frontend/types/gotypes.d.ts

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,53 +2011,6 @@ declare global {
20112011
fullconfig: FullConfigType;
20122012
};
20132013

2014-
// wshrpc.WaveAIOptsType
2015-
type WaveAIOptsType = {
2016-
model: string;
2017-
apitype?: string;
2018-
apitoken: string;
2019-
orgid?: string;
2020-
apiversion?: string;
2021-
baseurl?: string;
2022-
proxyurl?: string;
2023-
maxtokens?: number;
2024-
maxchoices?: number;
2025-
timeoutms?: number;
2026-
};
2027-
2028-
// wshrpc.WaveAIPacketType
2029-
type WaveAIPacketType = {
2030-
type: string;
2031-
model?: string;
2032-
created?: number;
2033-
finish_reason?: string;
2034-
usage?: WaveAIUsageType;
2035-
index?: number;
2036-
text?: string;
2037-
error?: string;
2038-
};
2039-
2040-
// wshrpc.WaveAIPromptMessageType
2041-
type WaveAIPromptMessageType = {
2042-
role: string;
2043-
content: string;
2044-
name?: string;
2045-
};
2046-
2047-
// wshrpc.WaveAIStreamRequest
2048-
type WaveAIStreamRequest = {
2049-
clientid?: string;
2050-
opts: WaveAIOptsType;
2051-
prompt: WaveAIPromptMessageType[];
2052-
};
2053-
2054-
// wshrpc.WaveAIUsageType
2055-
type WaveAIUsageType = {
2056-
prompt_tokens?: number;
2057-
completion_tokens?: number;
2058-
total_tokens?: number;
2059-
};
2060-
20612014

20622015
// filestore.WaveFile
20632016
type WaveFile = {

pkg/service/blockservice/blockservice.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package blockservice
55

66
import (
77
"context"
8-
"encoding/json"
98
"fmt"
109
"time"
1110

@@ -68,28 +67,6 @@ func (bs *BlockService) SaveTerminalState(ctx context.Context, blockId string, s
6867
return nil
6968
}
7069

71-
func (bs *BlockService) SaveWaveAiData(ctx context.Context, blockId string, history []wshrpc.WaveAIPromptMessageType) error {
72-
block, err := wstore.DBMustGet[*waveobj.Block](ctx, blockId)
73-
if err != nil {
74-
return err
75-
}
76-
viewName := block.Meta.GetString(waveobj.MetaKey_View, "")
77-
if viewName != "waveai" {
78-
return fmt.Errorf("invalid view type: %s", viewName)
79-
}
80-
historyBytes, err := json.Marshal(history)
81-
if err != nil {
82-
return fmt.Errorf("unable to serialize ai history: %v", err)
83-
}
84-
// ignore MakeFile error (already exists is ok)
85-
filestore.WFS.MakeFile(ctx, blockId, "aidata", nil, wshrpc.FileOpts{})
86-
err = filestore.WFS.WriteFile(ctx, blockId, "aidata", historyBytes)
87-
if err != nil {
88-
return fmt.Errorf("cannot save terminal state: %w", err)
89-
}
90-
return nil
91-
}
92-
9370
func (*BlockService) CleanupOrphanedBlocks_Meta() tsgenmeta.MethodMeta {
9471
return tsgenmeta.MethodMeta{
9572
Desc: "queue a layout action to cleanup orphaned blocks in the tab",

0 commit comments

Comments
 (0)