MCPcopy
hub / github.com/wavetermdev/waveterm / WriteAppFileCommand

Method WriteAppFileCommand

pkg/wshrpc/wshserver/wshserver.go:1024–1033  ·  view source on GitHub ↗
(ctx context.Context, data wshrpc.CommandWriteAppFileData)

Source from the content-addressed store, hash-verified

1022}
1023
1024func (ws *WshServer) WriteAppFileCommand(ctx context.Context, data wshrpc.CommandWriteAppFileData) error {
1025 if data.AppId == "" {
1026 return fmt.Errorf("must provide an appId to WriteAppFileCommand")
1027 }
1028 contents, err := base64.StdEncoding.DecodeString(data.Data64)
1029 if err != nil {
1030 return fmt.Errorf("failed to decode data64: %w", err)
1031 }
1032 return waveappstore.WriteAppFile(data.AppId, data.FileName, contents)
1033}
1034
1035func (ws *WshServer) WaveFileReadStreamCommand(ctx context.Context, data wshrpc.CommandWaveFileReadStreamData) (*wshrpc.WaveFileInfo, error) {
1036 const maxStreamFileSize = 5 * 1024 * 1024

Callers

nothing calls this directly

Calls 1

WriteAppFileFunction · 0.92

Tested by

no test coverage detected