Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/ec2 v1.316.1
github.com/aws/aws-sdk-go-v2/service/ecr v1.27.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.75.3
github.com/beam-cloud/clip v0.0.0-20260907023706-9420edd6f9ec
github.com/beam-cloud/clip v0.0.0-20260923215631-1c772eb678a5
github.com/beam-cloud/go-runc v0.0.0-20250911154456-bb45084abfe1
github.com/beam-cloud/goproc v0.1.12
github.com/beam-cloud/redislock v0.0.0-20250201162619-1b534b3be324
Expand Down Expand Up @@ -59,6 +59,7 @@ require (
github.com/redis/go-redis/v9 v9.5.1
github.com/rs/zerolog v1.34.0
github.com/s2-streamstore/s2-sdk-go v0.18.0
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2
github.com/sashabaranov/go-openai v1.35.7
github.com/shirou/gopsutil/v4 v4.26.5
github.com/sirupsen/logrus v1.9.4
Expand Down Expand Up @@ -152,7 +153,6 @@ require (
github.com/pires/go-proxyproto v0.8.1 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/prometheus-community/pro-bing v0.4.0 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ github.com/aws/smithy-go v1.27.3/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqx
github.com/axiomhq/hyperloglog v0.0.0-20240319100328-84253e514e02 h1:bXAPYSbdYbS5VTy92NIUbeDI1qyggi+JYh5op9IFlcQ=
github.com/axiomhq/hyperloglog v0.0.0-20240319100328-84253e514e02/go.mod h1:k08r+Yj1PRAmuayFiRK6MYuR5Ve4IuZtTfxErMIh0+c=
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
github.com/beam-cloud/clip v0.0.0-20260907023706-9420edd6f9ec h1:zcr7+ud507kcRJBHotXr4hcUzEoqfPEgjtcMW6eCZwo=
github.com/beam-cloud/clip v0.0.0-20260907023706-9420edd6f9ec/go.mod h1:uymwDNMk1qoxElmDSlPzwYqZDriHDnW5VVyfK3YNuz8=
github.com/beam-cloud/clip v0.0.0-20260923215631-1c772eb678a5 h1:OCIWtQpT3F+1PHcC5KOaOb+QEw2SkUo9Sh1lygsPPpM=
github.com/beam-cloud/clip v0.0.0-20260923215631-1c772eb678a5/go.mod h1:uymwDNMk1qoxElmDSlPzwYqZDriHDnW5VVyfK3YNuz8=
github.com/beam-cloud/geesefs v0.0.0-20260908033220-4484605feb60 h1:fX/Z5XOjVKYsWJO/FIOyCdWgg038BNHEpvp6lsiH49g=
github.com/beam-cloud/geesefs v0.0.0-20260908033220-4484605feb60/go.mod h1:q0qGsu0wiOzf/5m9JGLqZ7WteYDaaLGgBwNmstb3og0=
github.com/beam-cloud/geesefs/s3ext v0.0.0-20250606164905-2f3593d03f4f h1:XzHOu+erxeBO6D3fKVbd5DAlipl+PYZ3u+Ywb8m7Ovk=
Expand Down
8 changes: 7 additions & 1 deletion pkg/api/v1/mcp_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"encoding/json"
"errors"
"fmt"
"net/http"
"regexp"
"sort"
"strings"
Expand Down Expand Up @@ -212,9 +213,14 @@ func (g *MCPGroup) deleteApp(ctx context.Context, a *auth.AuthInfo, args toolArg
if err != nil {
return nil, err
}
if err := g.backendRepo.DeleteApp(ctx, app.ExternalId); err != nil {
// The REST handler stops deployments and containers before removing the record.
res, err := g.serve(ctx, http.MethodDelete, g.config.GatewayService.HTTP.GetExternalURL()+HttpServerBaseRoute+"/app/"+a.Workspace.ExternalId+"/"+app.ExternalId, nil, nil)
if err != nil {
return nil, err
}
if status := res.(map[string]any)["status"].(int); status >= 300 {
return nil, fmt.Errorf("delete app: HTTP %d", status)
}
return map[string]any{"deleted": app.Name, "app_id": app.ExternalId}, nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/gateway/services/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func (gws *GatewayService) recycleDependents(ctx context.Context, workspace *typ
return nil
}

// DeleteDatabaseService removes the deployment and its secrets; the disk is kept.
// DeleteDatabaseService removes the deployments, secrets and app record; the disk is kept.
func (gws *GatewayService) DeleteDatabaseService(ctx context.Context, authInfo *auth.AuthInfo, name string) error {
deployments, product, err := gws.databaseDeployments(ctx, authInfo.Workspace, name)
if err != nil {
Expand All @@ -396,7 +396,7 @@ func (gws *GatewayService) DeleteDatabaseService(ctx context.Context, authInfo *
return fmt.Errorf("delete secret %s: %w", secret, err)
}
}
return nil
return gws.backendRepo.DeleteApp(ctx, deployments[0].App.ExternalId)
}

// ListDatabaseServices returns the newest version of each database service.
Expand Down
7 changes: 6 additions & 1 deletion pkg/runtime/runsc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,12 @@ case "$cmd" in
cp "$RUNSC_FAKE_BUNDLE/config.json" "$RUNSC_FAKE_MOUNTS"
;;
state)
printf '{"id":"container-1","pid":4321,"status":"running"}'
# No pid until restore has run: Restore returns on the first pid it sees.
if [ -f "$RUNSC_FAKE_MOUNTS" ]; then
printf '{"id":"container-1","pid":4321,"status":"running"}'
else
printf '{"id":"container-1","pid":0,"status":"created"}'
fi
;;
wait|delete) ;;
*)
Expand Down
9 changes: 8 additions & 1 deletion sdk/src/beta9/cli/mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import click

from .. import terminal
from ..channel import ServiceClient
from ..config import get_config_context, get_settings
from . import extraclick
from .extraclick import ClickCommonGroup
Expand All @@ -34,13 +35,19 @@ def mcp():


def _server(context: Optional[str]) -> Dict[str, str]:
"""The MCP URL on the gateway's HTTP host, as the gateway reports it, plus the context token."""
cfg = get_config_context(context or extraclick.selected_context())
if not cfg.token:
terminal.error(
f"No token for this context; run `{terminal.cli_name()} configure` first.",
code="NOT_AUTHENTICATED",
)
return {"url": f"{cfg.http_url}/api/v1/mcp", "authorization": f"Bearer {cfg.token}"}
client = ServiceClient(cfg)
try:
base_url = client.http.base_url
finally:
client.close()
return {"url": f"{base_url}/api/v1/mcp", "authorization": f"Bearer {cfg.token}"}


def _entry(client: str, server: Dict[str, str]) -> Dict[str, Any]:
Expand Down
Loading