(ctx context.Context, raw json.RawMessage)
| 972 | } |
| 973 | |
| 974 | func (h *HostAPIHandler) handleSessionsStop(ctx context.Context, raw json.RawMessage) (any, error) { |
| 975 | var params hostAPISessionTargetParams |
| 976 | if err := decodeHostAPIParams(raw, ¶ms); err != nil { |
| 977 | return nil, err |
| 978 | } |
| 979 | if h.sessions == nil { |
| 980 | return nil, errors.New("extension: session manager is not configured") |
| 981 | } |
| 982 | if strings.TrimSpace(params.SessionID) == "" { |
| 983 | return nil, invalidParamsRPCError(errors.New("session_id is required")) |
| 984 | } |
| 985 | if _, err := h.requireHostAPISessionWorkspace(ctx, params.WorkspaceID, params.SessionID); err != nil { |
| 986 | return nil, err |
| 987 | } |
| 988 | if err := h.sessions.Stop(ctx, params.SessionID); err != nil { |
| 989 | return nil, err |
| 990 | } |
| 991 | return struct{}{}, nil |
| 992 | } |
| 993 | |
| 994 | func (h *HostAPIHandler) handleSessionsStatus(ctx context.Context, raw json.RawMessage) (any, error) { |
| 995 | var params hostAPISessionTargetParams |
nothing calls this directly
no test coverage detected