mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
d5b410d7e3
* feat(mcp): workspace container with bridge architecture
Migrate MCP containers to use UDS-based bridge communication instead of
TCP gRPC. Containers now mount runtime binaries and Unix domain sockets
from the host, eliminating the need for a dedicated MCP Docker image.
- Remove Dockerfile.mcp and entrypoint.sh in favor of standard base images
- Add toolkit Dockerfile for building MCP binary separately
- Containers use bind mounts for /opt/memoh (runtime) and /run/memoh (UDS)
- Update all config files with new runtime_path and socket_dir settings
- Support custom base images per bot (debian, alpine, ubuntu, etc.)
- Legacy container detection and TCP fallback for pre-bridge containers
- Frontend: add base image selector in container creation UI
* feat(container): SSE progress bar for container creation
Add real-time progress feedback during container image pull and creation
using Server-Sent Events, without breaking the existing synchronous JSON
API (content negotiation via Accept header).
Backend:
- Add PullProgress/LayerStatus types and OnProgress callback to
PullImageOptions (containerd service layer)
- DefaultService.PullImage polls ContentStore.ListStatuses every 500ms
when OnProgress is set; AppleService ignores it
- CreateContainer handler checks Accept: text/event-stream and switches
to SSE branch: pulling → pull_progress → creating → complete/error
Frontend:
- handleCreateContainer/handleRecreateContainer use fetch + SSE instead
of the SDK's synchronous postBotsByBotIdContainer
- Progress bar shows layer-level pull progress (offset/total) during
pulling phase and indeterminate animation during creating phase
- i18n keys added for pullingImage and creatingContainer (en/zh)
* fix(container): clear stale legacy route and type create SSE
* fix(ci): resolve lint errors and arm64 musl node.js download
- Fix unused-receiver lint: rename `s` to `_` on stub methods in
manager_legacy_test.go
- Fix sloglint: use slog.DiscardHandler instead of
slog.NewTextHandler(io.Discard, nil)
- Handle missing arm64 musl Node.js builds: unofficial-builds.nodejs.org
does not provide arm64 musl binaries, fall back to glibc build
* fix(lint): address errcheck, staticcheck, and gosec findings
- Discard os.Setenv/os.Remove return values explicitly with _
- Use omitted receiver name instead of _ (staticcheck ST1006)
- Tighten directory permissions from 0o755 to 0o750 (gosec G301)
* fix(lint): sanitize socket path to satisfy gosec G703
filepath.Clean the env-sourced socket path before os.Remove
to avoid path-traversal taint warning.
* fix(lint): use nolint directive for gosec G703 on socket path
filepath.Clean does not satisfy gosec's taint analysis. The socket
path comes from MCP_SOCKET_PATH env (operator-configured) or a
compiled-in default, not from end-user input.
* refactor: rename MCP container/bridge to workspace/bridge
Split internal/mcp/ to separate container lifecycle management from
Model Context Protocol connections, eliminating naming confusion:
- internal/mcp/ (container mgmt) → internal/workspace/
- internal/mcp/mcpclient/ → internal/workspace/bridge/
- internal/mcp/mcpcontainer/ → internal/workspace/bridgepb/
- cmd/mcp/ → cmd/bridge/
- config: MCPConfig → WorkspaceConfig, [mcp] → [workspace]
- container prefix: mcp-{id} → workspace-{id}
- labels: mcp.bot_id → memoh.bot_id, add memoh.workspace=v1
- socket: mcp.sock → bridge.sock, env BRIDGE_SOCKET_PATH
- runtime: /opt/memoh/runtime/mcp → /opt/memoh/runtime/bridge
- devenv: mcp-build.sh → bridge-build.sh
Legacy containers (mcp- prefix) detected by container name prefix
and handled via existing fallback path.
* fix(container): use memoh.workspace=v3 label value
* refactor(container): drop LegacyBotLabelKey, infer bot ID from container name
Legacy containers use mcp-{botID} naming, so bot ID can be derived
via TrimPrefix instead of looking up the mcp.bot_id label.
* fix(workspace): resolve containers via manager and drop gateway container ID
* docs: fix stale mcp references in AGENTS.md and DEPLOYMENT.md
* refactor(workspace): move container lifecycle ownership into manager
* dev: isolate local devenv from prod config
* toolkit: support musl node runtime
* containerd: fix fallback resolv.conf permissions
* web: preserve container create progress on completion
* web: add bot creation wait hint
* fix(workspace): preserve image selection across recreate
* feat(web): shorten default docker hub image refs
* fix(container): address code review findings
- Remove synchronous CreateContainer path (SSE-only now)
- Move flusher check before WriteHeader to avoid committed 200 on error
- Fix legacy container IP not cached via ensureContainerAndTask path
- Add atomic guard to prevent stale pull_progress after PullImage returns
- Defensive copy for tzEnv slice to avoid mutating shared backing array
- Restore network failure severity in restartContainer (return + Error)
- Extract duplicate progress bar into ContainerCreateProgress component
- Fix codesync comments to use repo-relative paths
- Add SaaS image validation note and kernel version comment on reaper
* refactor(devenv): extract toolkit install into shared script
Unify the Node.js + uv download logic into docker/toolkit/install.sh,
used by the production Dockerfile and runnable locally for dev.
Dev environment no longer bakes toolkit into the Docker image — it is
volume-mounted from .toolkit/ instead, so wrapper script changes take
effect immediately without rebuilding. The entrypoint checks for the
toolkit directory and prints a clear error if missing.
* fix(ci): address go ci failures
* chore(docker): remove unused containerd image
* refactor(config): rename workspace image key
* fix(workspace): fix legacy container data loss on migration and stop swallowing errors
Three root causes were identified and fixed:
1. Delete() used hardcoded "workspace-" prefix to look up legacy "mcp-"
containers, causing GetContainer to return NotFound. CleanupBotContainer
then silently skipped the error and deleted the DB record without ever
calling PreserveData. Fix: resolve the actual container ID via
ContainerID() (DB → label → scan) before operating.
2. Multiple restore error paths were silently swallowed (logged as Warn
but not returned), so the user saw HTTP 200/204 with no data and no
error. Fix: all errors in the preserve/restore chain now block the
workflow and propagate to the caller.
3. tarGzDir used cached DirEntry.Info() for tar header size, which on
overlayfs can differ from the actual file size, causing "archive/tar:
write too long". Fix: open the file first, Fstat the fd for a
race-free size, and use LimitReader as a safeguard.
Also adds a "restoring" SSE phase so the frontend shows a progress
indicator ("Restoring data, this may take a while...") during data
migration on container recreation.
* refactor(workspace): single-point container ID resolution
Replace the `containerID func(string) string` field with a single
`resolveContainerID(ctx, botID)` method that resolves the actual
container ID via DB → label → scan → fallback. All ~16 lookup
callsites across manager.go, dataio.go, versioning.go, and
manager_lifecycle.go now go through this single resolver, which
correctly handles both legacy "mcp-" and new "workspace-" containers.
Only `ensureBotWithImage` inlines `ContainerPrefix + botID` for
creating brand-new containers — every other path resolves dynamically.
* fix(web): show progress during data backup phase of container recreate
The recreate flow (delete with preserve_data + create with restore_data)
blocked on the DELETE call while backing up /data with no progress
indication. Add a 'preserving' phase to the progress component so
users see "正在备份数据..." instead of an unexplained hang.
* chore: remove [MYDEBUG] debug logging
Clean up all 112 temporary debug log statements added during the
legacy container migration investigation. Kept only meaningful
warn-level logs for non-fatal errors (network teardown, rename
failures).
456 lines
19 KiB
Go
456 lines
19 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.1
|
|
// - protoc v7.34.0
|
|
// source: internal/workspace/bridgepb/bridge.proto
|
|
|
|
package bridgepb
|
|
|
|
import (
|
|
context "context"
|
|
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
ContainerService_ReadFile_FullMethodName = "/mcpcontainer.ContainerService/ReadFile"
|
|
ContainerService_WriteFile_FullMethodName = "/mcpcontainer.ContainerService/WriteFile"
|
|
ContainerService_ListDir_FullMethodName = "/mcpcontainer.ContainerService/ListDir"
|
|
ContainerService_Stat_FullMethodName = "/mcpcontainer.ContainerService/Stat"
|
|
ContainerService_Mkdir_FullMethodName = "/mcpcontainer.ContainerService/Mkdir"
|
|
ContainerService_Rename_FullMethodName = "/mcpcontainer.ContainerService/Rename"
|
|
ContainerService_Exec_FullMethodName = "/mcpcontainer.ContainerService/Exec"
|
|
ContainerService_ReadRaw_FullMethodName = "/mcpcontainer.ContainerService/ReadRaw"
|
|
ContainerService_WriteRaw_FullMethodName = "/mcpcontainer.ContainerService/WriteRaw"
|
|
ContainerService_DeleteFile_FullMethodName = "/mcpcontainer.ContainerService/DeleteFile"
|
|
)
|
|
|
|
// ContainerServiceClient is the client API for ContainerService service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
type ContainerServiceClient interface {
|
|
ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error)
|
|
WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error)
|
|
ListDir(ctx context.Context, in *ListDirRequest, opts ...grpc.CallOption) (*ListDirResponse, error)
|
|
Stat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error)
|
|
Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error)
|
|
Rename(ctx context.Context, in *RenameRequest, opts ...grpc.CallOption) (*RenameResponse, error)
|
|
Exec(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ExecInput, ExecOutput], error)
|
|
ReadRaw(ctx context.Context, in *ReadRawRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DataChunk], error)
|
|
WriteRaw(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[WriteRawChunk, WriteRawResponse], error)
|
|
DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*DeleteFileResponse, error)
|
|
}
|
|
|
|
type containerServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewContainerServiceClient(cc grpc.ClientConnInterface) ContainerServiceClient {
|
|
return &containerServiceClient{cc}
|
|
}
|
|
|
|
func (c *containerServiceClient) ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ReadFileResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_ReadFile_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(WriteFileResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_WriteFile_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) ListDir(ctx context.Context, in *ListDirRequest, opts ...grpc.CallOption) (*ListDirResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListDirResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_ListDir_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) Stat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(StatResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_Stat_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) Mkdir(ctx context.Context, in *MkdirRequest, opts ...grpc.CallOption) (*MkdirResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(MkdirResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_Mkdir_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) Rename(ctx context.Context, in *RenameRequest, opts ...grpc.CallOption) (*RenameResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(RenameResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_Rename_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *containerServiceClient) Exec(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ExecInput, ExecOutput], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[0], ContainerService_Exec_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[ExecInput, ExecOutput]{ClientStream: stream}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ContainerService_ExecClient = grpc.BidiStreamingClient[ExecInput, ExecOutput]
|
|
|
|
func (c *containerServiceClient) ReadRaw(ctx context.Context, in *ReadRawRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DataChunk], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[1], ContainerService_ReadRaw_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[ReadRawRequest, DataChunk]{ClientStream: stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ContainerService_ReadRawClient = grpc.ServerStreamingClient[DataChunk]
|
|
|
|
func (c *containerServiceClient) WriteRaw(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[WriteRawChunk, WriteRawResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[2], ContainerService_WriteRaw_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[WriteRawChunk, WriteRawResponse]{ClientStream: stream}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ContainerService_WriteRawClient = grpc.ClientStreamingClient[WriteRawChunk, WriteRawResponse]
|
|
|
|
func (c *containerServiceClient) DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*DeleteFileResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DeleteFileResponse)
|
|
err := c.cc.Invoke(ctx, ContainerService_DeleteFile_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// ContainerServiceServer is the server API for ContainerService service.
|
|
// All implementations must embed UnimplementedContainerServiceServer
|
|
// for forward compatibility.
|
|
type ContainerServiceServer interface {
|
|
ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error)
|
|
WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error)
|
|
ListDir(context.Context, *ListDirRequest) (*ListDirResponse, error)
|
|
Stat(context.Context, *StatRequest) (*StatResponse, error)
|
|
Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error)
|
|
Rename(context.Context, *RenameRequest) (*RenameResponse, error)
|
|
Exec(grpc.BidiStreamingServer[ExecInput, ExecOutput]) error
|
|
ReadRaw(*ReadRawRequest, grpc.ServerStreamingServer[DataChunk]) error
|
|
WriteRaw(grpc.ClientStreamingServer[WriteRawChunk, WriteRawResponse]) error
|
|
DeleteFile(context.Context, *DeleteFileRequest) (*DeleteFileResponse, error)
|
|
mustEmbedUnimplementedContainerServiceServer()
|
|
}
|
|
|
|
// UnimplementedContainerServiceServer must be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedContainerServiceServer struct{}
|
|
|
|
func (UnimplementedContainerServiceServer) ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ReadFile not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method WriteFile not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) ListDir(context.Context, *ListDirRequest) (*ListDirResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ListDir not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) Stat(context.Context, *StatRequest) (*StatResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method Stat not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) Mkdir(context.Context, *MkdirRequest) (*MkdirResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method Mkdir not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) Rename(context.Context, *RenameRequest) (*RenameResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method Rename not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) Exec(grpc.BidiStreamingServer[ExecInput, ExecOutput]) error {
|
|
return status.Error(codes.Unimplemented, "method Exec not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) ReadRaw(*ReadRawRequest, grpc.ServerStreamingServer[DataChunk]) error {
|
|
return status.Error(codes.Unimplemented, "method ReadRaw not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) WriteRaw(grpc.ClientStreamingServer[WriteRawChunk, WriteRawResponse]) error {
|
|
return status.Error(codes.Unimplemented, "method WriteRaw not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) DeleteFile(context.Context, *DeleteFileRequest) (*DeleteFileResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method DeleteFile not implemented")
|
|
}
|
|
func (UnimplementedContainerServiceServer) mustEmbedUnimplementedContainerServiceServer() {}
|
|
func (UnimplementedContainerServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeContainerServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ContainerServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeContainerServiceServer interface {
|
|
mustEmbedUnimplementedContainerServiceServer()
|
|
}
|
|
|
|
func RegisterContainerServiceServer(s grpc.ServiceRegistrar, srv ContainerServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedContainerServiceServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&ContainerService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _ContainerService_ReadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ReadFileRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).ReadFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_ReadFile_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).ReadFile(ctx, req.(*ReadFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_WriteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(WriteFileRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).WriteFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_WriteFile_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).WriteFile(ctx, req.(*WriteFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_ListDir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListDirRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).ListDir(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_ListDir_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).ListDir(ctx, req.(*ListDirRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(StatRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).Stat(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_Stat_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).Stat(ctx, req.(*StatRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_Mkdir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(MkdirRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).Mkdir(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_Mkdir_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).Mkdir(ctx, req.(*MkdirRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_Rename_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RenameRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).Rename(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_Rename_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).Rename(ctx, req.(*RenameRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ContainerService_Exec_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(ContainerServiceServer).Exec(&grpc.GenericServerStream[ExecInput, ExecOutput]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ContainerService_ExecServer = grpc.BidiStreamingServer[ExecInput, ExecOutput]
|
|
|
|
func _ContainerService_ReadRaw_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(ReadRawRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(ContainerServiceServer).ReadRaw(m, &grpc.GenericServerStream[ReadRawRequest, DataChunk]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ContainerService_ReadRawServer = grpc.ServerStreamingServer[DataChunk]
|
|
|
|
func _ContainerService_WriteRaw_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(ContainerServiceServer).WriteRaw(&grpc.GenericServerStream[WriteRawChunk, WriteRawResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type ContainerService_WriteRawServer = grpc.ClientStreamingServer[WriteRawChunk, WriteRawResponse]
|
|
|
|
func _ContainerService_DeleteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteFileRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ContainerServiceServer).DeleteFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ContainerService_DeleteFile_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ContainerServiceServer).DeleteFile(ctx, req.(*DeleteFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var ContainerService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "mcpcontainer.ContainerService",
|
|
HandlerType: (*ContainerServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ReadFile",
|
|
Handler: _ContainerService_ReadFile_Handler,
|
|
},
|
|
{
|
|
MethodName: "WriteFile",
|
|
Handler: _ContainerService_WriteFile_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListDir",
|
|
Handler: _ContainerService_ListDir_Handler,
|
|
},
|
|
{
|
|
MethodName: "Stat",
|
|
Handler: _ContainerService_Stat_Handler,
|
|
},
|
|
{
|
|
MethodName: "Mkdir",
|
|
Handler: _ContainerService_Mkdir_Handler,
|
|
},
|
|
{
|
|
MethodName: "Rename",
|
|
Handler: _ContainerService_Rename_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteFile",
|
|
Handler: _ContainerService_DeleteFile_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Exec",
|
|
Handler: _ContainerService_Exec_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
{
|
|
StreamName: "ReadRaw",
|
|
Handler: _ContainerService_ReadRaw_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
{
|
|
StreamName: "WriteRaw",
|
|
Handler: _ContainerService_WriteRaw_Handler,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "internal/workspace/bridgepb/bridge.proto",
|
|
}
|